cardDetail.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view>
  3. <view class="card-box clearfix" v-if="!loading">
  4. <image class="card-bottom" src="/static/images/card_bottom.png" mode="widthFix"></image>
  5. <view class="hearder">
  6. <image :src="cardInfo.avatar" style="border-radius: 100%;"></image>
  7. </view>
  8. <view class="user-name">{{ cardInfo.realName }}</view>
  9. <view class="user-tag ddflex">
  10. <view class="user-tag-item">{{ cardInfo.jobName }}</view>
  11. <view class="user-tag-item">入司{{cardInfo.inDate?getAge(cardInfo.inDate):1}}年</view>
  12. </view>
  13. <view class="pf">
  14. <view class="pf-title">综合评分</view>
  15. <uni-rate style="justify-content: center;" class="ddflex" color="#999999" active-color="#FF4600" :readonly="true" size="18" allow-half :value="evaluateInfo.evaluateDTO.serveScore/2" />
  16. </view>
  17. <view class="user-data ddflex">
  18. <view>
  19. <view class="user-data-num">{{cardInfo.cntCust?cardInfo.cntCust:0}}</view>
  20. <view class="user-data-label ddflex">
  21. <image src="/static/pages/images/fw_hui.png"></image>
  22. <view>服务客户</view>
  23. </view>
  24. </view>
  25. <view style="margin-left: 109rpx;">
  26. <view class="user-data-num">{{cardInfo.cntCntr?cardInfo.cntCntr:0}}</view>
  27. <view class="user-data-label ddflex">
  28. <image src="/static/pages/images/cy_hui.png"></image>
  29. <view>保单件数</view>
  30. </view>
  31. </view>
  32. <view style="margin-left: 109rpx;">
  33. <view class="user-data-num">{{cardInfo.thumbs?cardInfo.thumbs:0}}</view>
  34. <view class="user-data-label ddflex">
  35. <image src="/static/pages/images/dz_hui.png"></image>
  36. <view>点赞量</view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="user-des">
  41. <rich-text :nodes="cardInfo.brief ? cardInfo.brief : ''"></rich-text>
  42. </view>
  43. <image class="user-code" :src="code?code:'/static/images/lj_img.png'"></image>
  44. <view class="user-btn" @click="submit">
  45. 选TA做专属顾问
  46. </view>
  47. <view class="user-btn-text" @click="jumpUrl('/card/cardFound/cardFound')">
  48. 更多专属顾问>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. const app = getApp();
  55. const req = require("../../utils/request.js");
  56. import util from '../../utils/util.js';
  57. export default {
  58. components: {},
  59. props: {},
  60. data() {
  61. return {
  62. systems: {},
  63. isTop:0,
  64. id:null,
  65. cardInfo:{},
  66. evaluateInfo:{},
  67. code:'',
  68. loading:true
  69. }
  70. },
  71. onLoad(options) {
  72. this.id = options.id
  73. uni.showLoading({
  74. title:'加载中'
  75. })
  76. this.getCardInfo()
  77. },
  78. onShow() {
  79. },
  80. methods: {
  81. jumpUrl(url){
  82. uni.navigateTo({
  83. url:url
  84. })
  85. },
  86. getCardInfo() {
  87. var url = '';
  88. var dataP = {
  89. id:this.id
  90. };
  91. url = '/api/visiting/card/info';
  92. req.getRequest(url, dataP, data => {
  93. this.cardInfo = data;
  94. uni.hideLoading()
  95. this.loading = false
  96. this.getEvaluate()
  97. this.getCodeUrl()
  98. });
  99. },
  100. // 获取评论
  101. getEvaluate(){
  102. req.getRequest('/api/evaluate/cardInfo',{bindId:this.id,type:2},res=>{
  103. this.evaluateInfo = res
  104. })
  105. },
  106. getCodeUrl() {
  107. let that = this; //获取小程序码
  108. const params = {
  109. page: 'card/index/index',
  110. scene: this.cardInfo.id
  111. };
  112. return new Promise((resolve, reject) => {
  113. req.getRequest('/api/other/program/code', params, url => {
  114. // console.log(url);
  115. this.code = url
  116. resolve();
  117. });
  118. });
  119. },
  120. getAge(date) {
  121. return util.getAge(date)
  122. },
  123. submit(){
  124. req.postRequest('/api/visiting/card/bindManageSaleNo',{manageSaleNo:this.cardInfo.jobNumber},res=>{
  125. req.msg('已切换专属顾问')
  126. setTimeout(()=>{
  127. uni.switchTab({
  128. url:'/pages/index/index'
  129. })
  130. },1000)
  131. })
  132. }
  133. },
  134. mounted() {
  135. const systemInfo = uni.getSystemInfoSync();
  136. // px转换到rpx的比例
  137. let pxToRpxScale = 750 / systemInfo.windowWidth;
  138. let systems = {
  139. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  140. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  141. };
  142. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  143. this.systems = systems;
  144. },
  145. onPageScroll: function(e) {
  146. if (e.scrollTop > this.systems.barHeight) {
  147. this.isTop = 1;
  148. } else {
  149. this.isTop = 0;
  150. }
  151. }
  152. }
  153. </script>
  154. <style>
  155. @import "./cardDetail.css";
  156. </style>