| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- <template>
- <view>
- <view class="card-box clearfix" v-if="!loading">
- <image class="card-bottom" src="/static/images/card_bottom.png" mode="widthFix"></image>
- <view class="hearder">
- <image :src="cardInfo.avatar" style="border-radius: 100%;"></image>
- </view>
- <view class="user-name">{{ cardInfo.realName }}</view>
- <view class="user-tag ddflex">
- <view class="user-tag-item">{{ cardInfo.jobName }}</view>
- <view class="user-tag-item">入司{{cardInfo.inDate?getAge(cardInfo.inDate):1}}年</view>
- </view>
- <view class="pf">
- <view class="pf-title">综合评分</view>
- <uni-rate style="justify-content: center;" class="ddflex" color="#999999" active-color="#FF4600" :readonly="true" size="18" allow-half :value="evaluateInfo.info.avage/2" />
- </view>
- <view class="user-data ddflex">
- <view>
- <view class="user-data-num">{{cardInfo.cntCust?cardInfo.cntCust:0}}</view>
- <view class="user-data-label ddflex">
- <image src="/static/pages/images/fw_hui.png"></image>
- <view>服务客户</view>
- </view>
- </view>
- <view style="margin-left: 109rpx;">
- <view class="user-data-num">{{cardInfo.cntCntr?cardInfo.cntCntr:0}}</view>
- <view class="user-data-label ddflex">
- <image src="/static/pages/images/cy_hui.png"></image>
- <view>保单件数</view>
- </view>
- </view>
- <view style="margin-left: 109rpx;">
- <view class="user-data-num">{{cardInfo.thumbs?cardInfo.thumbs:0}}</view>
- <view class="user-data-label ddflex">
- <image src="/static/pages/images/dz_hui.png"></image>
- <view>点赞量</view>
- </view>
- </view>
- </view>
- <view class="user-des">
- <rich-text :nodes="cardInfo.brief ? cardInfo.brief : ''"></rich-text>
- </view>
- <image class="user-code" :src="code?code:'/static/images/lj_img.png'"></image>
- <view class="user-btn" @click="submit">
- 选TA做专属顾问
- </view>
- <view class="user-btn-text" @click="jumpUrl('/card/cardList/cardList')">
- 更多专属顾问>
- </view>
- </view>
- </view>
- </template>
- <script>
- const app = getApp();
- const req = require("../../utils/request.js");
- import util from '../../utils/util.js';
- export default {
- components: {},
- props: {},
- data() {
- return {
- systems: {},
- isTop:0,
- id:null,
- cardInfo:{},
- evaluateInfo:{},
- code:'',
- loading:true
- }
- },
- onLoad(options) {
- this.id = options.id
- uni.showLoading({
- title:'加载中'
- })
- this.getCardInfo()
- },
- onShow() {
-
- },
- methods: {
- jumpUrl(url){
- uni.navigateTo({
- url:url
- })
- },
- getCardInfo() {
- var url = '';
- var dataP = {
- id:this.id
- };
- url = '/api/visiting/card/info';
- req.getRequest(url, dataP, data => {
- this.cardInfo = data;
- uni.hideLoading()
- this.loading = false
- this.getEvaluate()
- this.getCodeUrl()
- });
- },
- // 获取评论
- getEvaluate(){
- req.getRequest('/api/evaluate/cardInfo',{bindId:this.id,type:2},res=>{
- this.evaluateInfo = res
- })
- },
- getCodeUrl() {
- let that = this; //获取小程序码
- const params = {
- page: 'card/index/index',
- scene: this.cardInfo.id
- };
- return new Promise((resolve, reject) => {
- req.getRequest('/api/other/program/code', params, url => {
- // console.log(url);
- this.code = url
- resolve();
- });
- });
- },
- getAge(date) {
- return util.getAge(date)
- },
- submit(){
- req.postRequest('/api/visiting/card/bindManageSaleNo',{manageSaleNo:this.cardInfo.jobNumber},res=>{
- req.msg('已切换专属顾问')
- let userInfo = req.getStorage('userInfo')
- userInfo.manageSaleNo = this.cardInfo.jobNumber
- req.setStorage('userInfo',userInfo)
- setTimeout(()=>{
- uni.switchTab({
- url:'/pages/index/index'
- })
- },1000)
- })
- }
- },
- mounted() {
- const systemInfo = uni.getSystemInfoSync();
- // px转换到rpx的比例
- let pxToRpxScale = 750 / systemInfo.windowWidth;
- let systems = {
- ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
- navigationHeight: 44 * pxToRpxScale // 导航栏的高度
- };
- systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
- this.systems = systems;
- },
- onPageScroll: function(e) {
- if (e.scrollTop > this.systems.barHeight) {
- this.isTop = 1;
- } else {
- this.isTop = 0;
- }
- }
- }
- </script>
- <style>
- @import "./cardDetail.css";
- </style>
|