index.vue 36 KB

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