index.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063
  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;">
  68. <view class="ddflex fflex" style="background: #F8F8F8;border-radius: 10rpx;padding: 20rpx;font-size: 26rpx;margin-right: 30rpx;">
  69. <image style="width: 32rpx;height: 32rpx;margin-right: 10rpx;" src="/card/static/images/phone.png"></image>
  70. {{cardInfo.phone?cardInfo.phone:'暂无手机号'}}
  71. </view>
  72. <view class="ddflex fflex" style="background: #F8F8F8;border-radius: 10rpx;padding: 20rpx;font-size: 26rpx;">
  73. <image style="width: 32rpx;height: 32rpx;margin-right: 10rpx;" src="/card/static/images/wx.png"></image>
  74. {{cardInfo.wechat?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="!(cardInfo.wechat||cardInfo.wechatCode)?'background: #999':'background: linear-gradient(80deg, #7EBFF1 0%, #458EEE 100%);'"
  82. @click="cardInfo.wechat||cardInfo.wechatCode?isShowCodePop=true:''">
  83. <image src="../../static/pages/images/wx.png"></image>微信联系</view>
  84. <view class="share-ta ddflex fflex" :style="!cardInfo.phone?'background: #999':'background: linear-gradient(84deg, #6FE5BC 0%, #27D699 100%);'"
  85. @click="cardInfo.phone?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="cardInfo.auditState!=1?'':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="cardInfo.auditState!=1?'':jumpUrl('/card/poster/poster?id='+cardInfo.id)">
  97. <image src="/card/static/images/wdmp.png"></image>我的名片码</view>
  98. <button :open-type="cardInfo.auditState!=1?'':'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" v-if="cardInfo.wechat" @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. this.cardId = this.scene
  460. // await this.loadCodeParams();
  461. }
  462. await req.silenceLogin(this.options.userId ? this.options.userId : '', '')
  463. this.userInfo = req.getStorage('userInfo')
  464. this.getCardInfo();
  465. },
  466. onReachBottom() {
  467. this.form.page++;
  468. this.getOfficeList();
  469. },
  470. onShareAppMessage(res) {
  471. if (res.from == 'button') {
  472. let userInfo = req.getStorage('userInfo');
  473. this.userBehavior(6)
  474. return {
  475. title: this.cardInfo.realName,
  476. path: '/card/index/index?cardId=' + this.cardInfo.id + '&userId=' + userInfo.id + (userInfo.userType==1?('&shareId=' + userInfo.saleNo):''),
  477. imageUrl: this.cardInfo.avatar, // 分享图
  478. };
  479. }
  480. },
  481. onShareTimeline(res) {
  482. if (res.from == 'button') {
  483. let userInfo = req.getStorage('userInfo');
  484. this.userBehavior(6)
  485. return {
  486. title: this.cardInfo.realName,
  487. path: '/card/index/index?cardId=' + this.cardInfo.id + '&userId=' + userInfo.id,
  488. imageUrl: this.cardInfo.avatar, // 分享图
  489. };
  490. }
  491. },
  492. methods: {
  493. toBack(){
  494. let page = getCurrentPages()
  495. let pages = page[page.length-2]
  496. if(pages){
  497. uni.navigateBack()
  498. }else{
  499. uni.switchTab({
  500. url:'/pages/index/index'
  501. })
  502. }
  503. },
  504. getConfig() {
  505. var _this = this;
  506. return new Promise((res, rej) => {
  507. req.g(
  508. '/api/other/config',
  509. data => {
  510. req.setStorage('configRes', JSON.stringify(data));
  511. this.config = data;
  512. res(data);
  513. },
  514. true
  515. );
  516. });
  517. },
  518. getImgList(url) {
  519. var list = [];
  520. if (url) {
  521. list = url.split(',');
  522. }
  523. return list;
  524. },
  525. jumpUrl(url) {
  526. uni.navigateTo({
  527. url: url
  528. });
  529. },
  530. getCardInfo() {
  531. var url = '';
  532. var dataP = {
  533. id:this.cardId
  534. };
  535. if (this.cardId) {
  536. url = '/api/visiting/card/info';
  537. dataP.id = this.cardId;
  538. } else {
  539. url = '/api/visiting/card/userInfo';
  540. dataP = {};
  541. }
  542. req.getRequest(url, dataP, data => {
  543. this.cardInfo = data;
  544. this.userId = this.cardInfo.userId
  545. if(this.pageList.length==0){
  546. this.getOfficeList();
  547. }
  548. console.log('isFirst')
  549. if (this.cardId && this.cardInfo.userId == req.getStorage('userInfo').id) {
  550. this.cardId = null
  551. this.getCardInfo()
  552. } else {
  553. if (this.cardInfo.userId == req.getStorage('userInfo').id) {
  554. } else {
  555. // 用户浏览
  556. if (this.isFirst) {
  557. this.userBehavior(4)
  558. }
  559. }
  560. this.isFirst = false
  561. uni.hideLoading()
  562. this.loading = false
  563. }
  564. this.getEvaluate()
  565. if(this.cardInfo.auditState!=1) {
  566. uni.hideShareMenu()
  567. }
  568. });
  569. },
  570. // 用户行为
  571. userBehavior(type) {
  572. var dataP = {};
  573. dataP.type =
  574. 23 //、产品 2、活动 3、未知 4、内容 5、课程 6、老师 7、素材 8、题目 9、资料领取 10、招聘职位 12、用户须知 13、素材 15、医院科室 16、海报 20、医生 21 新闻 23名片
  575. dataP.behavior = type; //1、关注 2、收藏 3、点赞 4、浏览 5、确认 6、分享
  576. dataP.bindId = this.cardInfo.id;
  577. req.postRequestLoding('/api/v3/behavior/save', dataP, data => {
  578. if (type == 3) {
  579. this.cardInfo.isThumbs = !this.cardInfo.isThumbs
  580. }
  581. if (type == 1) {
  582. this.cardInfo.follow = !this.cardInfo.follow
  583. }
  584. });
  585. },
  586. // 存入名片夹
  587. saveToFolder() {
  588. let form = {
  589. visitingCardId: this.cardInfo.id,
  590. userId: req.getStorage('userInfo').id
  591. }
  592. req.postRequest('/api/v3/visiting/card/folder/saveOrUpdate', form, res => {
  593. req.msg('已存入名片夹')
  594. this.cardInfo.isSave = true
  595. })
  596. },
  597. // 存入通讯录
  598. saveToPhone() {
  599. console.log('saveToPhone')
  600. uni.addPhoneContact({
  601. nickName: this.cardInfo.realName,
  602. firstName: this.cardInfo.realName,
  603. mobilePhoneNumber: this.cardInfo.phone,
  604. success: (res) => {
  605. console.log(res)
  606. uni.showModal({
  607. title: '提示',
  608. content: '已存入通讯录,请前往手机通讯录查看',
  609. showCancel: false,
  610. })
  611. },
  612. fail: (err) => {
  613. console.log(err)
  614. req.msg('存入失败')
  615. }
  616. })
  617. },
  618. goPhone() {
  619. uni.makePhoneCall({
  620. phoneNumber: this.cardInfo.phone
  621. }); // 传参带入号码即可
  622. },
  623. copy(valueText, type) {
  624. let that = this
  625. uni.setClipboardData({
  626. data: valueText,
  627. success:(res)=> {
  628. if (type == 1) {
  629. that.isShowCodePop = false
  630. req.msg('微信号复制成功');
  631. } else if (type == 2) {
  632. req.msg('邮箱复制成功');
  633. }
  634. }
  635. });
  636. },
  637. getPlayInfo(videoId) {
  638. req.getRequest('/api/v3/vod/playInfo', {
  639. videoId: videoId
  640. }, data => {
  641. this.videoInfo = data
  642. })
  643. },
  644. createUploader() {
  645. let self = this;
  646. return new VODUpload({
  647. timeout: 60000,
  648. partSize: 1048576,
  649. parallel: 5,
  650. retryCount: 3,
  651. retryDuration: 2,
  652. region: this.regionId,
  653. userId: this.accountId,
  654. // 开始上传
  655. onUploadstarted: function(uploadInfo) {
  656. uni.showLoading({
  657. title: '视频上传中'
  658. })
  659. console.log('uploadInfo==', uploadInfo)
  660. if (!uploadInfo.videoId) {
  661. req.getRequest('/api/v3/vod/uploadAuth?fileName=' + self.fileName, {}, res => {
  662. var data = res;
  663. self.uploader.setUploadAuthAndAddress(uploadInfo, data.uploadAuth, data
  664. .uploadAddress, data.videoId)
  665. })
  666. self.isStart = true;
  667. } else {
  668. req.getRequest('/api/v3/vod/refreshUploadAuth?videoId=' + uploadInfo.videoId, {},
  669. res => {
  670. var data = res;
  671. self.uploader.setUploadAuthAndAddress(uploadInfo, data.uploadAuth, data
  672. .uploadAddress, data.videoId)
  673. })
  674. }
  675. },
  676. // 文件上传成功
  677. onUploadSucceed: function(uploadInfo) {
  678. // req.msg("视频上传成功");
  679. let dataP = {
  680. id: self.cardInfo.id,
  681. videoId: uploadInfo.videoId,
  682. videoInfo: JSON.stringify(uploadInfo)
  683. }
  684. req.postRequest('/api/v3/visiting/card/saveOrUpdate', dataP, res => {
  685. self.getPlayInfo(uploadInfo.videoId);
  686. setTimeout(() => {
  687. self.isStart = false;
  688. }, 1000);
  689. uni.hideLoading()
  690. })
  691. },
  692. // 文件上传失败
  693. onUploadFailed: function(uploadInfo, code, message) {
  694. req.msg("文件上传失败");
  695. },
  696. // 取消文件上传
  697. onUploadCanceled: function(uploadInfo, code, message) {
  698. req.msg("文件已暂停上传");
  699. },
  700. // 文件上传进度,单位:字节, 可以在这个函数中拿到上传进度并显示在页面上
  701. onUploadProgress: function(uploadInfo, totalSize, progress) {
  702. var progressPercent = Math.ceil(progress * 100);
  703. // self.$set(self.uploader, 'authProgress', progressPercent);
  704. },
  705. // 上传凭证超时
  706. onUploadTokenExpired: function(uploadInfo) {
  707. req.getRequest('/api/v3/vod/refreshUploadAuth?videoId=' + uploadInfo.videoId, {},
  708. res => {
  709. var data = res;
  710. self.uploader.resumeUploadWithAuth(data.uploadAuth)
  711. })
  712. }
  713. })
  714. },
  715. uploadVodChangeHandle: function(e) {
  716. let self = this;
  717. uni.chooseVideo({
  718. count: 1, //上传视频的个数
  719. mediaType: ['video'], //限制上传的类型为video
  720. sourceType: ['album', 'camera'], //视频选择来源
  721. maxDuration: 58, //拍摄限制时间
  722. camera: 'back', //采用后置摄像头
  723. success: function(res) {
  724. //获取临时存放的视频资源
  725. // let tempFilePath=res.tempFiles[0]
  726. console.log('视频文件==', res)
  727. var file = {
  728. url: res.tempFilePath,
  729. coverUrl: res.thumbTempFilePath
  730. };
  731. self.fileName = res.tempFilePath.substring(res.tempFilePath.lastIndexOf('/') + 1)
  732. // if (self.uploader) {
  733. // self.uploader.stopUpload();
  734. // self.authProgress = 0;
  735. // }
  736. var userData = '{"Vod":{}}';
  737. self.uploader = self.createUploader();
  738. self.uploader.addFile(file, null, null, null, userData);
  739. self.uploader.startUpload();
  740. },
  741. })
  742. },
  743. uploadImg() {
  744. let that = this;
  745. uni.chooseImage({
  746. count: 1,
  747. sizeType: ['original', 'compressed'],
  748. sourceType: ['album', 'camera'],
  749. success: function({
  750. tempFilePaths
  751. }) {
  752. var promise = Promise.all(
  753. tempFilePaths.map(tempFilePath => {
  754. return new Promise(function(resolve, reject) {
  755. req.uploadFile(api.upload, tempFilePath, res => {
  756. that.imageMap = res.src;
  757. //上传完成,则更新保存
  758. that.updateCard(3, that.imageMap);
  759. });
  760. });
  761. })
  762. );
  763. promise
  764. .then(function(results) {
  765. console.log(results);
  766. })
  767. .catch(function(err) {
  768. console.log(err);
  769. });
  770. }
  771. });
  772. },
  773. uploadImgs() {
  774. let that = this;
  775. uni.chooseImage({
  776. count: 9,
  777. sizeType: ['original', 'compressed'],
  778. sourceType: ['album', 'camera'],
  779. success: function({
  780. tempFilePaths
  781. }) {
  782. var promise = Promise.all(
  783. tempFilePaths.map(tempFilePath => {
  784. return new Promise(function(resolve, reject) {
  785. req.uploadFile(api.upload, tempFilePath, res => {
  786. let picUrls = that.zhiPicUrls;
  787. that.zhiPicUrls = picUrls.concat(res.src);
  788. if (tempFilePaths.length == that.zhiPicUrls
  789. .length) {
  790. //上传完成,则更新保存
  791. that.updateCard(1, that.zhiPicUrls.join(
  792. ','));
  793. }
  794. });
  795. });
  796. })
  797. );
  798. promise
  799. .then(function(results) {
  800. console.log(results);
  801. })
  802. .catch(function(err) {
  803. console.log(err);
  804. });
  805. }
  806. });
  807. },
  808. //预览图片
  809. previewImg(picUrls, index) {
  810. //预览合同图片
  811. var src = picUrls[index];
  812. let imgs = picUrls;
  813. uni.previewImage({
  814. current: src, // 当前显示图片的http链接
  815. urls: imgs
  816. });
  817. },
  818. cleanimages(index) {
  819. // 删除图片
  820. let arr = this.zhiPicUrls;
  821. arr.splice(index, 1);
  822. this.zhiPicUrls = arr;
  823. },
  824. /**
  825. * @param {Object} type 1图片 2、视频
  826. * @param {Object} url 资源地址
  827. */
  828. updateCard(type, url) {
  829. var dataP = {};
  830. dataP.id = this.cardInfo.id;
  831. if (type == 1) {
  832. dataP.pictures = url;
  833. } else if (type == 2) {
  834. dataP.video = url;
  835. } else if (type == 3) {
  836. dataP.imageMap = url;
  837. }
  838. req.postRequest(api.api_addressList_update, dataP, json => {
  839. if (type == 1) {
  840. this.cardInfo.pictures = url;
  841. } else if (type == 2) {
  842. this.cardInfo.video = url;
  843. } else if (type == 3) {
  844. this.cardInfo.imageMap = url;
  845. }
  846. });
  847. },
  848. monthDayDiff(date){
  849. return util.monthDayDiff(date)
  850. },
  851. // 获取评论
  852. getEvaluate(){
  853. req.getRequest('/api/evaluate/cardInfo',{bindId:this.cardInfo.id,type:2},res=>{
  854. this.evaluateInfo = res
  855. })
  856. },
  857. tabChange(type){
  858. if(type==this.tabType) return false
  859. this.tabType = type
  860. },
  861. getOfficeList() {
  862. let that = this;
  863. var pramData = this.form;
  864. // pramData.type = this.type;
  865. pramData.orderType = 2;
  866. pramData.userId = this.userId;
  867. if (!this.isLoad) return false;
  868. this.isLoad = false;
  869. req.getRequest('/api/v3/moments/page', pramData, data => {
  870. if(data.list&&data.list.length > 0){
  871. this.total = data.total
  872. data.list.map(it=>{
  873. if(it.qyPoll && it.qyPoll.isEnd){
  874. it.qyPoll.voteCount = that.sum(JSON.parse(it.qyPoll.optionJson))
  875. }
  876. if(it.url){
  877. let h = it.url.substring(it.url.lastIndexOf('.') + 1)
  878. if(h.indexOf('mp4')<0&&h.indexOf('MP4')<0){
  879. it.url = it.url.split(',');
  880. }else{
  881. it.isHaveVideo = true
  882. it.isControls = false
  883. it.isShowPlayBtn = true
  884. }
  885. }
  886. 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>'
  887. return it;
  888. })
  889. }
  890. if (data.list && data.list.length >= this.form.limit) {
  891. this.isLoad = true;
  892. }
  893. if (this.form.page > 1) {
  894. data.list = this.pageList.concat(data.list);
  895. }
  896. this.pageList = data.list;
  897. this.isShowView = true;
  898. });
  899. },
  900. sum(arr) {
  901. var s = 0;
  902. for (var i=arr.length-1; i>=0; i--) {
  903. if(arr[i].count){
  904. s += Number(arr[i].count);
  905. }
  906. }
  907. return s;
  908. },
  909. //提交点赞、取消点赞;收藏、取消收藏
  910. submitFabulous(type, id, index) {
  911. if (!req.isLogins(true)) {
  912. return;
  913. }
  914. var dataP = {};
  915. dataP.type = type; //1,观看 ,2点赞,3评论,4分享,5收藏
  916. dataP.momentsId = id;
  917. req.postRequestLoding('/api/v3/fabulous/save', dataP, data => {
  918. if (type == 2) {
  919. //动态点赞
  920. if (this.pageList[index].isPraise == 1) {
  921. //已赞
  922. this.pageList[index].isPraise = 0;
  923. this.pageList[index].count.fabulousCount--;
  924. } else {
  925. this.pageList[index].isPraise = 1;
  926. this.pageList[index].count.fabulousCount++;
  927. }
  928. }
  929. });
  930. },
  931. //提交投票
  932. submitPoll(item, pIndex, pollIndex) {
  933. if(item.qyPoll.isEnd) return false;
  934. var dataP = {};
  935. // dataP.id = item.id;
  936. dataP.pollId = item.qyPoll.id;
  937. var pollObjList = JSON.parse(item.qyPoll.optionJson);
  938. dataP.pollOptionCode = pollObjList[pollIndex].code;
  939. req.postRequest('/api/v3/poll/saveDetails', dataP, data => {
  940. req.msg('投票成功');
  941. //图片完之后要将该投票的对象返回,便于做渲染%
  942. this.pageList[pIndex].qyPoll = data;
  943. });
  944. },
  945. videoPlay(index){
  946. var that = this;
  947. var curIdx = index;
  948. this.pageList[index].isControls = true
  949. this.pageList[index].isShowPlayBtn = false
  950. // 有播放时先将prev暂停,再播放当前点击的current
  951. if (that.videoCurrent != null) {
  952. var videoContextPrev = uni.createVideoContext('myVideo' + that.videoCurrent)
  953. if (that.videoCurrent != curIdx) {
  954. this.pageList[that.videoCurrent].isControls = false
  955. this.pageList[that.videoCurrent].isShowPlayBtn = true
  956. videoContextPrev.stop()
  957. }
  958. that.videoCurrent = curIdx
  959. var videoContextCurrent = uni.createVideoContext('myVideo' + curIdx)
  960. videoContextCurrent.play()
  961. } else {
  962. // 没有播放时播放视频
  963. that.videoCurrent = curIdx
  964. var videoContext = uni.createVideoContext('myVideo' + curIdx) // 对应的视频id
  965. videoContext.play()
  966. }
  967. },
  968. videoPause(index){
  969. this.pageList[index].isControls = false
  970. this.pageList[index].isShowPlayBtn = true
  971. },
  972. videoEnded(index){
  973. this.pageList[index].isControls = false
  974. this.pageList[index].isShowPlayBtn = true
  975. },
  976. jumpUrlDetail(item) {
  977. this.jumpUrl('/office/detail/detail?contentId=' + item.id);
  978. },
  979. toUserHomePage(userId) {
  980. this.jumpUrl('/topics/home/home?userId=' + userId);
  981. },
  982. bindSale(){
  983. uni.showModal({
  984. title:'提示',
  985. content:'是否绑定该顾问?',
  986. success: (con) => {
  987. if(con.confirm){
  988. req.postRequest('/api/visiting/card/bindManageSaleNo',{manageSaleNo:this.cardInfo.jobNumber},res=>{
  989. req.msg('已绑定专属顾问')
  990. let userInfo = req.getStorage('userInfo')
  991. userInfo.manageSaleNo = this.cardInfo.jobNumber
  992. req.setStorage('userInfo',userInfo)
  993. this.userInfo = req.getStorage('userInfo')
  994. })
  995. }
  996. }
  997. })
  998. }
  999. },
  1000. mounted() {
  1001. const systemInfo = uni.getSystemInfoSync();
  1002. // px转换到rpx的比例
  1003. let pxToRpxScale = 750 / systemInfo.windowWidth;
  1004. let systems = {
  1005. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  1006. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  1007. };
  1008. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  1009. this.systems = systems;
  1010. },
  1011. onPageScroll: function(e) {
  1012. if (e.scrollTop > this.systems.barHeight) {
  1013. this.isTop = 1;
  1014. } else {
  1015. this.isTop = 0;
  1016. }
  1017. }
  1018. };
  1019. </script>
  1020. <style>
  1021. @import './index.css';
  1022. </style>