index.vue 39 KB

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