index.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078
  1. <template>
  2. <view style="padding-bottom: 30rpx;" v-if="!loading">
  3. <view class="top-fixed" :style="'height: '+ systems.barHeight + 'rpx;'">
  4. <view :class="'bgcolor' + (isTop == 1 ? ' opacity' : '')" :style="'height:' + systems.barHeight + 'rpx'">
  5. </view>
  6. <view class="top-fixed-c"
  7. :style="'height: '+ systems.navigationHeight + 'rpx;margin-top:' + systems.ktxStatusHeight + 'rpx;'">
  8. <navigator @click="toBack" hover-class="none" class="back ddflex"
  9. :style="'height: '+ systems.navigationHeight + 'rpx;'">
  10. <image v-if="!pageBack" src="/static/pages/images/back_black.png"></image>
  11. <image v-else src="/static/pages/images/back_home.png" style="width: 40rpx;height:40rpx"></image>
  12. </navigator>
  13. <view :class="'top-title tover' + (isTop == 1 ? ' top-black':'')"
  14. :style="'line-height: '+ systems.navigationHeight + 'rpx;'">名片</view>
  15. </view>
  16. </view>
  17. <view :style="'height: '+ systems.barHeight + 'rpx;'"></view>
  18. <view class="bg">
  19. <image src="/static/pages/images/userBg.png"></image>
  20. </view>
  21. <view class="infos">
  22. <view class="infos-border">
  23. <view class="photo">
  24. <block v-if="cardInfo.avatar">
  25. <image :src="cardInfo.avatar" mode="aspectFill" class="poster"></image>
  26. <view class="change-option ddflex">
  27. <view v-if="cardId" class="change" style="right: 140rpx;background-color:#27D699;"
  28. @click="userBehavior(3)">
  29. <image v-if="!cardInfo.isThumbs" style="width: 35rpx;height: 32rpx;"
  30. src="/card/static/images/dz1.png" mode="aspectFit"></image>
  31. <image v-else style="width: 35rpx;height:32rpx;" src="/card/static/images/dz1_h.png" mode="aspectFit">
  32. </image>
  33. <view class="change-option-text">点赞</view>
  34. <!-- 点赞 -->
  35. </view>
  36. <view v-if="cardId&&(userInfo.manageSaleNo!=cardInfo.jobNumber)" class="change" @click="jumpUrl('/card/cardFound/cardFound')">
  37. <image src="/card/static/images/change.png" style="width: 35rpx;height: 32rpx;" mode="aspectFit"></image>
  38. <view class="change-option-text">切换</view>
  39. <!-- 更换销售员-->
  40. </view>
  41. <view v-if="cardId&&(!userInfo.manageSaleNo)" style="background-color: #FF7229;" class="change" @click="bindSale()">
  42. <image style="width: 32rpx;height: 32rpx;" src="/card/static/images/bind.png" mode="aspectFit"></image>
  43. <view class="change-option-text">绑定</view>
  44. <!-- 绑定销售员-->
  45. </view>
  46. </view>
  47. </block>
  48. </view>
  49. <view class="info dflex">
  50. <view class="flex">
  51. <view class="name">
  52. {{ cardInfo.realName }}
  53. <text class="job" v-if="cardInfo.job">{{ cardInfo.jobName }}</text>
  54. <text class="job">入司{{cardInfo.inDate?monthDayDiff(cardInfo.inDate):'1年'}}</text>
  55. </view>
  56. <view class="company ddflex" style="margin-top: 20rpx;">
  57. <image src="/card/static/images/gs.png"></image>
  58. {{ cardInfo.companyName }}
  59. </view>
  60. <view class="company ddflex">
  61. <image src="/card/static/images/area.png"></image>
  62. 服务区域 {{ cardInfo.areaCodeName?cardInfo.areaCodeName:'湖南' }}
  63. </view>
  64. <view class="company">
  65. 执业证书:{{ cardInfo.professionalCertificateNo?cardInfo.professionalCertificateNo:'暂无'}}
  66. </view>
  67. <view class="ddflex" style="margin-top: 30rpx;" v-if="cardInfo.wechat||cardInfo.wechat">
  68. <view class="ddflex fflex" style="background: #F8F8F8;border-radius: 10rpx;padding: 20rpx;font-size: 26rpx;margin-right: 30rpx;" v-if="cardInfo.phone">
  69. <image style="width: 32rpx;height: 32rpx;margin-right: 10rpx;" src="/card/static/images/phone.png"></image>
  70. {{cardInfo.phone}}
  71. </view>
  72. <view class="ddflex fflex" style="background: #F8F8F8;border-radius: 10rpx;padding: 20rpx;font-size: 26rpx;" v-if="cardInfo.wechat">
  73. <image style="width: 32rpx;height: 32rpx;margin-right: 10rpx;" src="/card/static/images/wx.png"></image>
  74. {{cardInfo.wechat}}
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="btns ddflex" v-if="cardId">
  81. <view class="share-ta ddflex fflex" style="background: linear-gradient(80deg, #7EBFF1 0%, #458EEE 100%);"
  82. @click="isShowCodePop=true">
  83. <image src="../../static/pages/images/wx.png"></image>微信联系</view>
  84. <view class="share-ta ddflex fflex" style="background: linear-gradient(84deg, #6FE5BC 0%, #27D699 100%);"
  85. @click="goPhone()">
  86. <image src="/card/static/images/phone1.png"></image>电话联系</view>
  87. <view class="share-ta ddflex fflex" style="background: linear-gradient(80deg, #FF985A 0%, #FF5700 100%);"
  88. @click="jumpUrl('/card/poster/poster?id='+cardInfo.id)">
  89. <image src="/card/static/images/fx.png"></image>分享名片</view>
  90. </view>
  91. <view class="save-text ddflex" v-if="cardId" @click="saveToPhone()">
  92. <image src="/card/static/images/save.png"></image>保存到通讯录
  93. </view>
  94. <view class="btns ddflex" v-if="!cardId" style="justify-content: center;">
  95. <view class="share-ta ddflex" style="background: linear-gradient(84deg, #6FE5BC 0%, #27D699 100%);width: 260rpx;margin-right: 30rpx;"
  96. @click="jumpUrl('/card/poster/poster?id='+cardInfo.id)">
  97. <image src="/card/static/images/wdmp.png"></image>我的名片码</view>
  98. <button open-type="share" class="share-ta ddflex" style="background: linear-gradient(80deg, #FF985A 0%, #FF5700 100%);width: 260rpx !important;"
  99. >
  100. <image src="/card/static/images/fx.png"></image>发送名片</button>
  101. </view>
  102. <view class="extend-info ddflex">
  103. <view class="extend-info-item fflex">
  104. <view class="extend-info-data">{{cardInfo.cntCust?cardInfo.cntCust:0}}</view>
  105. <view class="extend-info-label ddflex">
  106. <image src="../../static/pages/images/fw_hui.png"></image>
  107. <view>服务客户</view>
  108. </view>
  109. </view>
  110. <view class="extend-info-item fflex">
  111. <view class="extend-info-data">{{cardInfo.cntCntr?cardInfo.cntCntr:0}}</view>
  112. <view class="extend-info-label ddflex">
  113. <image src="/static/pages/images/cy_hui.png"></image>
  114. <view>保单件数</view>
  115. </view>
  116. </view>
  117. <view class="extend-info-item fflex">
  118. <view class="extend-info-data">{{cardInfo.thumbs?cardInfo.thumbs:0}}</view>
  119. <view class="extend-info-label ddflex">
  120. <image src="/static/pages/images/dz_hui.png"></image>
  121. <view>点赞量</view>
  122. </view>
  123. </view>
  124. </view>
  125. <view class="q-hud ddflex">
  126. <view class="q-hud-c ddflex">
  127. <view class="q-users ddflex">
  128. <image :src="item.avatar?item.avatar:'../../static/images/userimg.png'" mode="aspectFill" v-for="(item, index) in cardInfo.pageUser.list"
  129. v-if="index<3" :key="index"></image>
  130. </view>
  131. <view class="fflex">
  132. {{cardInfo.pageUser.total}}人看过
  133. </view>
  134. <!-- <image src="../static/images/q_rico.png" class="q-rico"></image> -->
  135. </view>
  136. <view class="q-hud-r ddflex">
  137. <view class="ddflex">
  138. <image style="width: 23rpx;height: 31rpx;margin-right: 10rpx;"
  139. src="/card/static/images/hot.png"></image>
  140. <text>{{cardInfo.share}}</text>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. <!-- 评分 -->
  146. <view class="pf-box">
  147. <view class="ddflex" style="justify-content: space-between;">
  148. <view class="pf-nav">客户评价</view>
  149. <view class="ddflex pf-more" @click="jumpUrl('/card/evaluateList/evaluateList?groupId='+cardInfo.id)" v-if="evaluateInfo.evaluateDTO">
  150. 全部评价
  151. <image style="width: 9rpx;height: 19rpx;margin-left: 10rpx;" src="/static/pages/images/more.png"></image>
  152. </view>
  153. </view>
  154. <view class="ddflex" style="justify-content: center;margin-top: 40rpx;">
  155. <view class="pf-number">
  156. {{evaluateInfo.info?evaluateInfo.info.avage:0}}<text style="font-size: 24rpx;color: #333333;font-weight: 400;margin-left: 10rpx;">分</text>
  157. </view>
  158. <uni-rate style="justify-content: center;margin-left: 30rpx;" class="ddflex" color="#999999" active-color="#FF4600" :readonly="true" size="18" allow-half :value="evaluateInfo.info.avage/2" />
  159. </view>
  160. <view class="pf-note">综合评分 {{evaluateInfo.info?evaluateInfo.info.total:0}}人评分</view>
  161. <view class="pf-data" v-if="evaluateInfo.evaluateDTO">
  162. <view class="pf-user ddflex">
  163. <view class="ddflex">
  164. <image class="pf-user-header" :src="evaluateInfo.evaluateDTO.avatar?evaluateInfo.evaluateDTO.avatar:'../../static/images/userimg.png'"></image>
  165. <view class="pf-user-name tover">{{evaluateInfo.evaluateDTO.name}}</view>
  166. <uni-rate style="justify-content: center;margin-left: 30rpx;" class="ddflex" color="#999999" active-color="#FF4600" :readonly="true" size="14" allow-half :value="evaluateInfo.evaluateDTO.serveScore/2" />
  167. <text style="font-size: 20rpx;color: #FF4600;">{{evaluateInfo.evaluateDTO.serveScore}}分</text>
  168. </view>
  169. <view class="pf-user-time">{{evaluateInfo.evaluateDTO.createDate}}</view>
  170. </view>
  171. <view class="pf-user-content">
  172. {{evaluateInfo.evaluateDTO.content}}
  173. </view>
  174. <view class="" style="margin-top: 20rpx;">
  175. <image :style="'width: 200rpx;height: 200rpx;margin-bottom: 10rpx;display: inline-block;'+((index+1)%3==0?'':'margin-right:10rpx')"
  176. v-for="item,index in evaluateInfo.evaluateDTO.evaluateImgUrls" :src="item" mode="aspectFit"
  177. @click="previewImg(evaluateInfo.evaluateDTO.evaluateImgUrls,index)"></image>
  178. </view>
  179. </view>
  180. <view class="pf-btn" v-if="cardId" @click="jumpUrl('/card/evaluate/evaluate?id='+cardInfo.id)">点击输入您的评价</view>
  181. </view>
  182. <view class="ddflex index-tab">
  183. <view :class="tabType==1?'index-tab-active':''" @click="tabChange(1)">个人主页</view>
  184. <view :class="tabType==2?'index-tab-active':''" @click="tabChange(2)">最新动态</view>
  185. </view>
  186. <block v-if="tabType==1">
  187. <view class="box brief" v-if="cardInfo.honorImg">
  188. <view class="tit ddflex">
  189. <view class="flex ddflex">
  190. <image src="/card/static/images/shry.png"></image>
  191. <view>所获荣誉</view>
  192. </view>
  193. </view>
  194. <view class="contacts" style="height: 300rpx;margin-top: 20rpx;">
  195. <scroll-view scroll-x="true" class="contact" style="height: 300rpx;">
  196. <view class=" ry-image" v-for="item,index in cardInfo.honorImg.split(',')" @click="previewImg(cardInfo.honorImg.split(','),index)">
  197. <image :src="item" mode="aspectFill"></image>
  198. </view>
  199. </scroll-view>
  200. </view>
  201. </view>
  202. <view class="box brief" v-if="cardInfo.styleImg">
  203. <view class="tit ddflex">
  204. <view class="flex ddflex">
  205. <image src="/card/static/images/grfc.png"></image>
  206. <view>个人风采</view>
  207. </view>
  208. </view>
  209. <view class="contacts" style="height: 300rpx;margin-top: 20rpx;">
  210. <scroll-view scroll-x="true" class="contact" style="height: 300rpx;">
  211. <view class=" ry-image" v-for="item,index in cardInfo.styleImg.split(',')" @click="previewImg(cardInfo.styleImg.split(','),index)">
  212. <image :src="item" mode="aspectFill"></image>
  213. </view>
  214. </scroll-view>
  215. </view>
  216. </view>
  217. <view class="box brief">
  218. <view class="tit ddflex">
  219. <view class="flex ddflex">
  220. <image src="/card/static/images/grjj.png"></image>
  221. <view>个人简介</view>
  222. </view>
  223. <!-- <image v-if="!cardId" src="../static/images/bj_ico.png" class="edit" @tap="jumpUrl('/card/editDesc/editDesc?id=' + cardInfo.id)"></image> -->
  224. </view>
  225. <view class="bri"><rich-text :nodes="cardInfo.brief ? cardInfo.brief : ''"></rich-text></view>
  226. </view>
  227. <view class="box brief">
  228. <view class="tit ddflex">
  229. <view class="flex ddflex">
  230. <image src="/card/static/images/gsjj.png"></image>
  231. <view>公司简介</view>
  232. </view>
  233. <!-- <image v-if="!cardId" src="../static/images/bj_ico.png" class="edit" @tap="jumpUrl('/card/editDesc/editDesc?id=' + cardInfo.id)"></image> -->
  234. </view>
  235. <view class="bri"><rich-text :nodes="config.CONFIG_ABOUT_COMPANY ? config.CONFIG_ABOUT_COMPANY : ''"></rich-text></view>
  236. </view>
  237. </block>
  238. <block v-if="tabType==2">
  239. <view class="list" v-if="pageList && pageList.length > 0">
  240. <view class="li" v-for="(item, index) in pageList" :key="index">
  241. <view class="user ddflex">
  242. <image :src="item.userDTO.avatar" mode="aspectFill" class="userimg" @click="toUserHomePage(item.userDTO.id)"></image>
  243. <view class="fflex">
  244. <view class="namea ddflex">
  245. <view class="name fflex ddflex" @click="toUserHomePage(item.userDTO.id)">
  246. {{ item.userDTO.nickName }}
  247. <image v-if="item.userDTO.levelGrade > 0" src="../../static/images/vip_tag.png" class="vip-tag"></image>
  248. </view>
  249. <view class="time">{{ item.time }}</view>
  250. </view>
  251. <view class="area" @click="toUserHomePage(item.userDTO.id)" v-if="item.userDTO.cityName">{{ item.userDTO.provinceName }} {{ item.userDTO.cityName }}</view>
  252. </view>
  253. </view>
  254. <!-- 分享的动态 -->
  255. <block v-if="item.source">
  256. <view class="link ddflex" @click="jumpUrlDetail(item)">
  257. <block v-if="item.url&&item.url.length>0"><image mode="aspectFill" v-if="idx == 0" v-for="(it, idx) in item.url" :src="it" :key="idx"></image></block>
  258. <view class="fflex tover"><rich-text :nodes="item.content"></rich-text></view>
  259. </view>
  260. </block>
  261. <!-- 非分享的动态 -->
  262. <block v-else>
  263. <view v-if="item.type == 2" class="des tovers" @click="jumpUrlDetail(item)">
  264. <view class="wen">提问</view>
  265. {{ removeHtml(item.content) }}
  266. </view>
  267. <view class="des" v-else @click="jumpUrlDetail(item)"><rich-text :nodes="item.content"></rich-text></view>
  268. <!-- //如果有投票,就不显示图片 -->
  269. <block v-if="!item.qyPoll">
  270. <view class="video" v-if="item.isHaveVideo && config.open_community_video == 1">
  271. <video :src="item.url" :show-center-play-btn="false" :controls="item.isControls" :autoplay="item.isControls" :id="'myVideo'+index" @pause="videoPause(index)" @ended="videoEnded(index)"></video>
  272. <view class="video-play ddflex" @click="videoPlay(index)" v-if="item.isShowPlayBtn"><image src="../../static/images/play.png"></image></view>
  273. </view>
  274. <view class="imgbox ddflex" @click="jumpUrlDetail(item)" v-if="!item.isHaveVideo"><!-- @click="previewImgss(item.url, idx)" -->
  275. <block v-if="item.url&&item.url.length>0">
  276. <image mode="aspectFill" v-for="(it, idx) in item.url" :src="it" :key="idx"></image>
  277. </block>
  278. </view>
  279. </block>
  280. <!-- 话题 -->
  281. <view class="ddflex" v-if="item.qyDialogu">
  282. <view class="topic ddflex" @click="jumpUrl('/topics/detail/detail?topicId=' + item.qyDialogu.id)">
  283. <image src="../../static/images/topic.png"></image>
  284. {{ item.qyDialogu.title }}
  285. </view>
  286. </view>
  287. <view class="loca ddflex" @click="jumpUrlPoi(item,'/office/poi/index')" v-if="item.poiName"><image :src="picUrlss+'office_images/loca.png'"></image><text v-if="item.poiDistance > 0">{{item.poiDistance ? item.poiDistance < 1000 ? item.poiDistance+'m' : (item.poiDistance/1000).toFixed(1)+'km' : ''}}</text>{{item.poiName}}</view>
  288. <!-- 投票 -->
  289. <view :class="'vote-box' + (item.qyPoll.isEnd ? ' ends' : '')" v-if="item.qyPoll">
  290. <view class="vote-tit">{{ item.qyPoll.title }}</view>
  291. <block v-if="item.qyPoll.isVote == 1">
  292. <view class="vote-list end" @click="jumpUrlDetail(item)">
  293. <view :class="'lis ddflex ' + (itpy.isVote == 1 ? 'active' : '')" v-for="(itpy, idex) in JSON.parse(item.qyPoll.optionJson)" :key="idex">
  294. <view class="percent" :style="'width:' + parseFloat(itpy.proportion) + '%;'"></view>
  295. <view class="fflex">{{ itpy.name }}</view>
  296. <view>{{ parseFloat(itpy.proportion) + '%' }}</view>
  297. </view>
  298. </view>
  299. </block>
  300. <block v-else>
  301. <view class="vote-list">
  302. <view class="lis" v-for="(itpy, idex) in JSON.parse(item.qyPoll.optionJson)" :key="idex" @click="submitPoll(item, index, idex)">
  303. {{ itpy.name }}
  304. </view>
  305. </view>
  306. </block>
  307. <view class="vote-can" v-if="item.qyPoll.isEnd"><text>{{item.qyPoll.voteCount}}人参与</text>投票已结束</view>
  308. </view>
  309. <block v-if="item.type==10||item.type==11">
  310. <view v-if="item.type==10" class="ddflex step-box" style="justify-content: space-between;" @click="jumpUrl('/exercise/record/record?userId=' + item.userId)">
  311. <view>
  312. <view class="step-date">{{item.wxRun.step}}</view>
  313. <view class="step-label">步数</view>
  314. </view>
  315. <view>
  316. <view class="step-date">{{item.wxRun.index}}</view>
  317. <view class="step-label" style="text-align: right;">名次</view>
  318. </view>
  319. </view>
  320. <view v-if="item.type==11" class="ddflex step-box" style="justify-content: space-between;" @click="jumpUrl('/match/activityDetail/activityDetail?id=' + item.matchContent.id)">
  321. <image class="step-pic" :src="item.matchContent.pic" mode="aspectFill"></image>
  322. <view class="fflex">
  323. <view class="step-title tovers">{{item.matchContent.title}}</view>
  324. <view class="ddflex" style="justify-content: space-between;margin-top: 10rpx;">
  325. <view class="step-price">{{item.matchContent.endTime}}</view>
  326. <view class="step-btn">查看</view>
  327. </view>
  328. </view>
  329. </view>
  330. </block>
  331. <view v-if="item.userGroupId" class="ddflex step-box" style="padding: 25rpx 21rpx;" @click="jumpUrl('/office/team/index?id=' + item.userGroupId)">
  332. <image style="width: 24rpx;height: 24rpx;margin-right: 13rpx;" src="../../static/images/link.png"></image>
  333. <view style="font-weight: 500;color: #999999;">Team:</view>
  334. <view>{{item.userGroupTitle}}</view>
  335. </view>
  336. <block v-else>
  337. <view class="product" v-if="item.products && item.products.length > 0">
  338. <view scroll-x="true" :class="'pro-view' + (item.products.length == 1 ? ' pro-view1' : '')">
  339. <view class="li" v-for="(it, idx) in item.products" :key="idx" @click="toProductDetail(it)">
  340. <view class="ddflex">
  341. <image :src="it.pic" mode="aspectFill" class="pro-pic"></image>
  342. <view class="fflex">
  343. <view class="title tovers">{{ it.title }}</view>
  344. <view class="opts ddflex">
  345. <view class="money">¥{{ it.salePrice }}</view>
  346. <view class="pro-btn">购买</view>
  347. </view>
  348. </view>
  349. </view>
  350. </view>
  351. </view>
  352. </view>
  353. </block>
  354. </block>
  355. <view class="opt ddflex" v-if="!item.source && type != 3">
  356. <view class="fflex" @click="jumpUrlDetail(item)">{{ item.count.browseCount }}次浏览</view>
  357. <view class="ddflex" @click="submitFabulous(2, item.id, index)">
  358. <image :src="'../../static/images/' + (item.isPraise == 1 ? 'like_h' : 'like') + '.png'"></image>
  359. {{ item.count.fabulousCount < 99 ? item.count.fabulousCount : '99+' }}
  360. </view>
  361. <view class="ddflex" @click="jumpUrlDetail(item)">
  362. <image src="../../static/images/comment.png"></image>
  363. {{ item.count.commentCount < 99 ? item.count.commentCount : '99+' }}
  364. </view>
  365. <!-- <button open-type="share" class="opt-share ddflex">
  366. <image src="../../static/images/share.png"></image>
  367. 分享
  368. </button> -->
  369. </view>
  370. </view>
  371. </view>
  372. <view class="nodata" v-else>
  373. <image :src="picUrlss + 'empty_jl.png'"></image>
  374. <text>{{ type == 1 ? '暂无动态' : type == 2 ? '暂无提问' : type == 3 ? '暂无日记' : '' }}</text>
  375. </view>
  376. </block>
  377. <view class="ceng2" v-if="isShowCodePop" @click="isShowCodePop = false" @touchmove.stop.prevent="moveHandle">
  378. </view>
  379. <view :class="'code-pop ' +(about.greyTheme==1?'grayTheme':'')" v-if="isShowCodePop">
  380. <view class="code-content" v-if="cardInfo.wechatCode">
  381. <image :src="cardInfo.wechatCode?cardInfo.wechatCode:'/static/images/wxCode.jpg'"
  382. show-menu-by-longpress="true"></image>
  383. <view style="text-align: center;font-size: 24rpx;color: #999;margin-bottom: 50rpx;">长按识别微信二维码</view>
  384. </view>
  385. <view class="code-text" v-else>
  386. <view>微信号</view>
  387. <view>{{cardInfo.wechat}}</view>
  388. </view>
  389. <view class="code-btn" @click="copy(cardInfo.wechat,1)">
  390. 复制微信号
  391. </view>
  392. </view>
  393. <serviceContact></serviceContact>
  394. </view>
  395. </template>
  396. <script>
  397. const app = getApp();
  398. const req = require('../../utils/request.js');
  399. const api = require('../../utils/api.js');
  400. import VODUpload from '@/utils/aliyun-upload-sdk-1.0.1.min.js'
  401. import serviceContact from '@/components/service-contact/index.vue'
  402. import util from '../../utils/util.js';
  403. export default {
  404. data() {
  405. return {
  406. picUrlss: req.public.picUrls,
  407. systems: {},
  408. isTop: 0,
  409. options: {},
  410. scene: null,
  411. cardId: '',
  412. cardInfo: '',
  413. cardCount: '',
  414. zhiPicUrls: [],
  415. isFirst: true, //页面加载第一次调用
  416. uploader: '',
  417. isStart: false,
  418. videoInfo: '',
  419. fileName: '', //视频名称
  420. evaluateInfo:null,//评分
  421. tabType:1,
  422. loading:true,
  423. config: {},
  424. isLoad: true,
  425. form: {
  426. page: 1,
  427. limit: 10
  428. },
  429. pageList: [],
  430. userId: '',
  431. videoCurrent: null,
  432. videoContext: '',
  433. userInfo:'',
  434. isShowCodePop: false,
  435. pageBack:false
  436. };
  437. },
  438. components:{ serviceContact },
  439. onLoad(options) {
  440. this.options = options
  441. this.cardId = options.cardId;
  442. if(options.shareId) req.setStorage('shareId',options.shareId)
  443. if (options.scene)
  444. this.scene = options.scene
  445. uni.showLoading({
  446. title:'加载中'
  447. })
  448. let page = getCurrentPages()
  449. let pages = page[page.length-2]
  450. if(pages){
  451. this.pageBack = false
  452. }else{
  453. this.pageBack = true
  454. }
  455. },
  456. async onShow() {
  457. this.getConfig()
  458. if (this.scene) {
  459. await this.loadCodeParams();
  460. }
  461. await req.silenceLogin(this.options.userId ? this.options.userId : '', '')
  462. this.userInfo = req.getStorage('userInfo')
  463. this.getCardInfo();
  464. },
  465. onReachBottom() {
  466. this.form.page++;
  467. this.getOfficeList();
  468. },
  469. onShareAppMessage(res) {
  470. if (res.from == 'button') {
  471. let userInfo = req.getStorage('userInfo');
  472. this.userBehavior(6)
  473. return {
  474. title: this.cardInfo.realName,
  475. path: '/card/index/index?cardId=' + this.cardInfo.id + '&userId=' + userInfo.id + (userInfo.userType==1?('&shareId=' + userInfo.saleNo):''),
  476. imageUrl: this.cardInfo.avatar, // 分享图
  477. };
  478. }
  479. },
  480. onShareTimeline(res) {
  481. if (res.from == 'button') {
  482. let userInfo = req.getStorage('userInfo');
  483. this.userBehavior(6)
  484. return {
  485. title: this.cardInfo.realName,
  486. path: '/card/index/index?cardId=' + this.cardInfo.id + '&userId=' + userInfo.id,
  487. imageUrl: this.cardInfo.avatar, // 分享图
  488. };
  489. }
  490. },
  491. methods: {
  492. toBack(){
  493. let page = getCurrentPages()
  494. let pages = page[page.length-2]
  495. if(pages){
  496. uni.navigateBack()
  497. }else{
  498. uni.switchTab({
  499. url:'/pages/index/index'
  500. })
  501. }
  502. },
  503. getConfig() {
  504. var _this = this;
  505. return new Promise((res, rej) => {
  506. req.g(
  507. '/api/other/config',
  508. data => {
  509. req.setStorage('configRes', JSON.stringify(data));
  510. this.config = data;
  511. res(data);
  512. },
  513. true
  514. );
  515. });
  516. },
  517. loadCodeParams() {
  518. let _ts = this;
  519. return new Promise((resolve, reject) => {
  520. if (!_ts.scene) {
  521. resolve();
  522. return false;
  523. }
  524. req.getRequest(
  525. '/api/code/params', {
  526. scene: _ts.scene
  527. },
  528. data => {
  529. this.options.userId = data.userId
  530. this.cardId = data.scene
  531. resolve();
  532. }
  533. );
  534. });
  535. },
  536. getImgList(url) {
  537. var list = [];
  538. if (url) {
  539. list = url.split(',');
  540. }
  541. return list;
  542. },
  543. jumpUrl(url) {
  544. uni.navigateTo({
  545. url: url
  546. });
  547. },
  548. getCardInfo() {
  549. var url = '';
  550. var dataP = {
  551. id:this.cardId
  552. };
  553. if (this.cardId) {
  554. url = '/api/visiting/card/info';
  555. dataP.id = this.cardId;
  556. } else {
  557. url = '/api/visiting/card/userInfo';
  558. dataP = {};
  559. }
  560. req.getRequest(url, dataP, data => {
  561. this.cardInfo = data;
  562. this.userId = this.cardInfo.userId
  563. if(this.pageList.length==0){
  564. this.getOfficeList();
  565. }
  566. console.log('isFirst')
  567. if (this.cardId && this.cardInfo.userId == req.getStorage('userInfo').id) {
  568. this.cardId = null
  569. this.getCardInfo()
  570. } else {
  571. if (this.cardInfo.userId == req.getStorage('userInfo').id) {
  572. } else {
  573. // 用户浏览
  574. if (this.isFirst) {
  575. this.userBehavior(4)
  576. }
  577. }
  578. this.isFirst = false
  579. uni.hideLoading()
  580. this.loading = false
  581. }
  582. this.getEvaluate()
  583. });
  584. },
  585. // 用户行为
  586. userBehavior(type) {
  587. var dataP = {};
  588. dataP.type =
  589. 23 //、产品 2、活动 3、未知 4、内容 5、课程 6、老师 7、素材 8、题目 9、资料领取 10、招聘职位 12、用户须知 13、素材 15、医院科室 16、海报 20、医生 21 新闻 23名片
  590. dataP.behavior = type; //1、关注 2、收藏 3、点赞 4、浏览 5、确认 6、分享
  591. dataP.bindId = this.cardInfo.id;
  592. req.postRequestLoding('/api/v3/behavior/save', dataP, data => {
  593. if (type == 3) {
  594. this.cardInfo.isThumbs = !this.cardInfo.isThumbs
  595. }
  596. if (type == 1) {
  597. this.cardInfo.follow = !this.cardInfo.follow
  598. }
  599. });
  600. },
  601. // 存入名片夹
  602. saveToFolder() {
  603. let form = {
  604. visitingCardId: this.cardInfo.id,
  605. userId: req.getStorage('userInfo').id
  606. }
  607. req.postRequest('/api/v3/visiting/card/folder/saveOrUpdate', form, res => {
  608. req.msg('已存入名片夹')
  609. this.cardInfo.isSave = true
  610. })
  611. },
  612. // 存入通讯录
  613. saveToPhone() {
  614. console.log('saveToPhone')
  615. uni.addPhoneContact({
  616. nickName: this.cardInfo.realName,
  617. firstName: this.cardInfo.realName,
  618. mobilePhoneNumber: this.cardInfo.phone,
  619. success: (res) => {
  620. console.log(res)
  621. uni.showModal({
  622. title: '提示',
  623. content: '已存入通讯录,请前往手机通讯录查看',
  624. showCancel: false,
  625. })
  626. },
  627. fail: (err) => {
  628. console.log(err)
  629. req.msg('存入失败')
  630. }
  631. })
  632. },
  633. goPhone() {
  634. uni.makePhoneCall({
  635. phoneNumber: this.cardInfo.phone
  636. }); // 传参带入号码即可
  637. },
  638. copy(valueText, type) {
  639. let that = this
  640. uni.setClipboardData({
  641. data: valueText,
  642. success:(res)=> {
  643. if (type == 1) {
  644. that.isShowCodePop = false
  645. req.msg('微信号复制成功');
  646. } else if (type == 2) {
  647. req.msg('邮箱复制成功');
  648. }
  649. }
  650. });
  651. },
  652. getPlayInfo(videoId) {
  653. req.getRequest('/api/v3/vod/playInfo', {
  654. videoId: videoId
  655. }, data => {
  656. this.videoInfo = data
  657. })
  658. },
  659. createUploader() {
  660. let self = this;
  661. return new VODUpload({
  662. timeout: 60000,
  663. partSize: 1048576,
  664. parallel: 5,
  665. retryCount: 3,
  666. retryDuration: 2,
  667. region: this.regionId,
  668. userId: this.accountId,
  669. // 开始上传
  670. onUploadstarted: function(uploadInfo) {
  671. uni.showLoading({
  672. title: '视频上传中'
  673. })
  674. console.log('uploadInfo==', uploadInfo)
  675. if (!uploadInfo.videoId) {
  676. req.getRequest('/api/v3/vod/uploadAuth?fileName=' + self.fileName, {}, res => {
  677. var data = res;
  678. self.uploader.setUploadAuthAndAddress(uploadInfo, data.uploadAuth, data
  679. .uploadAddress, data.videoId)
  680. })
  681. self.isStart = true;
  682. } else {
  683. req.getRequest('/api/v3/vod/refreshUploadAuth?videoId=' + uploadInfo.videoId, {},
  684. res => {
  685. var data = res;
  686. self.uploader.setUploadAuthAndAddress(uploadInfo, data.uploadAuth, data
  687. .uploadAddress, data.videoId)
  688. })
  689. }
  690. },
  691. // 文件上传成功
  692. onUploadSucceed: function(uploadInfo) {
  693. // req.msg("视频上传成功");
  694. let dataP = {
  695. id: self.cardInfo.id,
  696. videoId: uploadInfo.videoId,
  697. videoInfo: JSON.stringify(uploadInfo)
  698. }
  699. req.postRequest('/api/v3/visiting/card/saveOrUpdate', dataP, res => {
  700. self.getPlayInfo(uploadInfo.videoId);
  701. setTimeout(() => {
  702. self.isStart = false;
  703. }, 1000);
  704. uni.hideLoading()
  705. })
  706. },
  707. // 文件上传失败
  708. onUploadFailed: function(uploadInfo, code, message) {
  709. req.msg("文件上传失败");
  710. },
  711. // 取消文件上传
  712. onUploadCanceled: function(uploadInfo, code, message) {
  713. req.msg("文件已暂停上传");
  714. },
  715. // 文件上传进度,单位:字节, 可以在这个函数中拿到上传进度并显示在页面上
  716. onUploadProgress: function(uploadInfo, totalSize, progress) {
  717. var progressPercent = Math.ceil(progress * 100);
  718. // self.$set(self.uploader, 'authProgress', progressPercent);
  719. },
  720. // 上传凭证超时
  721. onUploadTokenExpired: function(uploadInfo) {
  722. req.getRequest('/api/v3/vod/refreshUploadAuth?videoId=' + uploadInfo.videoId, {},
  723. res => {
  724. var data = res;
  725. self.uploader.resumeUploadWithAuth(data.uploadAuth)
  726. })
  727. }
  728. })
  729. },
  730. uploadVodChangeHandle: function(e) {
  731. let self = this;
  732. uni.chooseVideo({
  733. count: 1, //上传视频的个数
  734. mediaType: ['video'], //限制上传的类型为video
  735. sourceType: ['album', 'camera'], //视频选择来源
  736. maxDuration: 58, //拍摄限制时间
  737. camera: 'back', //采用后置摄像头
  738. success: function(res) {
  739. //获取临时存放的视频资源
  740. // let tempFilePath=res.tempFiles[0]
  741. console.log('视频文件==', res)
  742. var file = {
  743. url: res.tempFilePath,
  744. coverUrl: res.thumbTempFilePath
  745. };
  746. self.fileName = res.tempFilePath.substring(res.tempFilePath.lastIndexOf('/') + 1)
  747. // if (self.uploader) {
  748. // self.uploader.stopUpload();
  749. // self.authProgress = 0;
  750. // }
  751. var userData = '{"Vod":{}}';
  752. self.uploader = self.createUploader();
  753. self.uploader.addFile(file, null, null, null, userData);
  754. self.uploader.startUpload();
  755. },
  756. })
  757. },
  758. uploadImg() {
  759. let that = this;
  760. uni.chooseImage({
  761. count: 1,
  762. sizeType: ['original', 'compressed'],
  763. sourceType: ['album', 'camera'],
  764. success: function({
  765. tempFilePaths
  766. }) {
  767. var promise = Promise.all(
  768. tempFilePaths.map(tempFilePath => {
  769. return new Promise(function(resolve, reject) {
  770. req.uploadFile(api.upload, tempFilePath, res => {
  771. that.imageMap = res.src;
  772. //上传完成,则更新保存
  773. that.updateCard(3, that.imageMap);
  774. });
  775. });
  776. })
  777. );
  778. promise
  779. .then(function(results) {
  780. console.log(results);
  781. })
  782. .catch(function(err) {
  783. console.log(err);
  784. });
  785. }
  786. });
  787. },
  788. uploadImgs() {
  789. let that = this;
  790. uni.chooseImage({
  791. count: 9,
  792. sizeType: ['original', 'compressed'],
  793. sourceType: ['album', 'camera'],
  794. success: function({
  795. tempFilePaths
  796. }) {
  797. var promise = Promise.all(
  798. tempFilePaths.map(tempFilePath => {
  799. return new Promise(function(resolve, reject) {
  800. req.uploadFile(api.upload, tempFilePath, res => {
  801. let picUrls = that.zhiPicUrls;
  802. that.zhiPicUrls = picUrls.concat(res.src);
  803. if (tempFilePaths.length == that.zhiPicUrls
  804. .length) {
  805. //上传完成,则更新保存
  806. that.updateCard(1, that.zhiPicUrls.join(
  807. ','));
  808. }
  809. });
  810. });
  811. })
  812. );
  813. promise
  814. .then(function(results) {
  815. console.log(results);
  816. })
  817. .catch(function(err) {
  818. console.log(err);
  819. });
  820. }
  821. });
  822. },
  823. //预览图片
  824. previewImg(picUrls, index) {
  825. //预览合同图片
  826. var src = picUrls[index];
  827. let imgs = picUrls;
  828. uni.previewImage({
  829. current: src, // 当前显示图片的http链接
  830. urls: imgs
  831. });
  832. },
  833. cleanimages(index) {
  834. // 删除图片
  835. let arr = this.zhiPicUrls;
  836. arr.splice(index, 1);
  837. this.zhiPicUrls = arr;
  838. },
  839. /**
  840. * @param {Object} type 1图片 2、视频
  841. * @param {Object} url 资源地址
  842. */
  843. updateCard(type, url) {
  844. var dataP = {};
  845. dataP.id = this.cardInfo.id;
  846. if (type == 1) {
  847. dataP.pictures = url;
  848. } else if (type == 2) {
  849. dataP.video = url;
  850. } else if (type == 3) {
  851. dataP.imageMap = url;
  852. }
  853. req.postRequest(api.api_addressList_update, dataP, json => {
  854. if (type == 1) {
  855. this.cardInfo.pictures = url;
  856. } else if (type == 2) {
  857. this.cardInfo.video = url;
  858. } else if (type == 3) {
  859. this.cardInfo.imageMap = url;
  860. }
  861. });
  862. },
  863. monthDayDiff(date){
  864. return util.monthDayDiff(date)
  865. },
  866. // 获取评论
  867. getEvaluate(){
  868. req.getRequest('/api/evaluate/cardInfo',{bindId:this.cardInfo.id,type:2},res=>{
  869. this.evaluateInfo = res
  870. })
  871. },
  872. tabChange(type){
  873. if(type==this.tabType) return false
  874. this.tabType = type
  875. },
  876. getOfficeList() {
  877. let that = this;
  878. var pramData = this.form;
  879. // pramData.type = this.type;
  880. pramData.orderType = 2;
  881. pramData.userId = this.userId;
  882. if (!this.isLoad) return false;
  883. this.isLoad = false;
  884. req.getRequest('/api/v3/moments/page', pramData, data => {
  885. if(data.list&&data.list.length > 0){
  886. this.total = data.total
  887. data.list.map(it=>{
  888. if(it.qyPoll && it.qyPoll.isEnd){
  889. it.qyPoll.voteCount = that.sum(JSON.parse(it.qyPoll.optionJson))
  890. }
  891. if(it.url){
  892. let h = it.url.substring(it.url.lastIndexOf('.') + 1)
  893. if(h.indexOf('mp4')<0&&h.indexOf('MP4')<0){
  894. it.url = it.url.split(',');
  895. }else{
  896. it.isHaveVideo = true
  897. it.isControls = false
  898. it.isShowPlayBtn = true
  899. }
  900. }
  901. it.content = '<div style="overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 5;-webkit-box-orient: vertical;word-break: break-all;">' + it.content + '</div>'
  902. return it;
  903. })
  904. }
  905. if (data.list && data.list.length >= this.form.limit) {
  906. this.isLoad = true;
  907. }
  908. if (this.form.page > 1) {
  909. data.list = this.pageList.concat(data.list);
  910. }
  911. this.pageList = data.list;
  912. this.isShowView = true;
  913. });
  914. },
  915. sum(arr) {
  916. var s = 0;
  917. for (var i=arr.length-1; i>=0; i--) {
  918. if(arr[i].count){
  919. s += Number(arr[i].count);
  920. }
  921. }
  922. return s;
  923. },
  924. //提交点赞、取消点赞;收藏、取消收藏
  925. submitFabulous(type, id, index) {
  926. if (!req.isLogins(true)) {
  927. return;
  928. }
  929. var dataP = {};
  930. dataP.type = type; //1,观看 ,2点赞,3评论,4分享,5收藏
  931. dataP.momentsId = id;
  932. req.postRequestLoding('/api/v3/fabulous/save', dataP, data => {
  933. if (type == 2) {
  934. //动态点赞
  935. if (this.pageList[index].isPraise == 1) {
  936. //已赞
  937. this.pageList[index].isPraise = 0;
  938. this.pageList[index].count.fabulousCount--;
  939. } else {
  940. this.pageList[index].isPraise = 1;
  941. this.pageList[index].count.fabulousCount++;
  942. }
  943. }
  944. });
  945. },
  946. //提交投票
  947. submitPoll(item, pIndex, pollIndex) {
  948. if(item.qyPoll.isEnd) return false;
  949. var dataP = {};
  950. // dataP.id = item.id;
  951. dataP.pollId = item.qyPoll.id;
  952. var pollObjList = JSON.parse(item.qyPoll.optionJson);
  953. dataP.pollOptionCode = pollObjList[pollIndex].code;
  954. req.postRequest('/api/v3/poll/saveDetails', dataP, data => {
  955. req.msg('投票成功');
  956. //图片完之后要将该投票的对象返回,便于做渲染%
  957. this.pageList[pIndex].qyPoll = data;
  958. });
  959. },
  960. videoPlay(index){
  961. var that = this;
  962. var curIdx = index;
  963. this.pageList[index].isControls = true
  964. this.pageList[index].isShowPlayBtn = false
  965. // 有播放时先将prev暂停,再播放当前点击的current
  966. if (that.videoCurrent != null) {
  967. var videoContextPrev = uni.createVideoContext('myVideo' + that.videoCurrent)
  968. if (that.videoCurrent != curIdx) {
  969. this.pageList[that.videoCurrent].isControls = false
  970. this.pageList[that.videoCurrent].isShowPlayBtn = true
  971. videoContextPrev.stop()
  972. }
  973. that.videoCurrent = curIdx
  974. var videoContextCurrent = uni.createVideoContext('myVideo' + curIdx)
  975. videoContextCurrent.play()
  976. } else {
  977. // 没有播放时播放视频
  978. that.videoCurrent = curIdx
  979. var videoContext = uni.createVideoContext('myVideo' + curIdx) // 对应的视频id
  980. videoContext.play()
  981. }
  982. },
  983. videoPause(index){
  984. this.pageList[index].isControls = false
  985. this.pageList[index].isShowPlayBtn = true
  986. },
  987. videoEnded(index){
  988. this.pageList[index].isControls = false
  989. this.pageList[index].isShowPlayBtn = true
  990. },
  991. jumpUrlDetail(item) {
  992. this.jumpUrl('/office/detail/detail?contentId=' + item.id);
  993. },
  994. toUserHomePage(userId) {
  995. this.jumpUrl('/topics/home/home?userId=' + userId);
  996. },
  997. bindSale(){
  998. uni.showModal({
  999. title:'提示',
  1000. content:'是否绑定该顾问?',
  1001. success: (con) => {
  1002. if(con.confirm){
  1003. req.postRequest('/api/visiting/card/bindManageSaleNo',{manageSaleNo:this.cardInfo.jobNumber},res=>{
  1004. req.msg('已绑定专属顾问')
  1005. let userInfo = req.getStorage('userInfo')
  1006. userInfo.manageSaleNo = this.cardInfo.jobNumber
  1007. req.setStorage('userInfo',userInfo)
  1008. this.userInfo = req.getStorage('userInfo')
  1009. })
  1010. }
  1011. }
  1012. })
  1013. }
  1014. },
  1015. mounted() {
  1016. const systemInfo = uni.getSystemInfoSync();
  1017. // px转换到rpx的比例
  1018. let pxToRpxScale = 750 / systemInfo.windowWidth;
  1019. let systems = {
  1020. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  1021. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  1022. };
  1023. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  1024. this.systems = systems;
  1025. },
  1026. onPageScroll: function(e) {
  1027. if (e.scrollTop > this.systems.barHeight) {
  1028. this.isTop = 1;
  1029. } else {
  1030. this.isTop = 0;
  1031. }
  1032. }
  1033. };
  1034. </script>
  1035. <style>
  1036. @import './index.css';
  1037. </style>