index.vue 37 KB

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