index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view :style="[mainStyle]">
  3. <view>
  4. <view class="gw-topbox">
  5. <view class="gw-title">添加官方客服微信~</view>
  6. <view class="gw-subtitle">了解更多</view>
  7. <view class="gw-header">
  8. <image :src="advisor.headUrl?advisor.headUrl:'/other/static/images/kefu.png'"></image>
  9. </view>
  10. <view class="gw-name">{{advisor.realName}}</view>
  11. <view class="ddflex" style="justify-content: center;" v-if="advisor&&advisor.label">
  12. <view class="gw-tag" v-for="item,index in advisor.label.split(',')" :key="index">{{item}}</view>
  13. </view>
  14. <view class="gw-add" v-for="item,index in advisor.merchantTitle?advisor.merchantTitle.split(','):[]" :key="index">{{item}}</view>
  15. <view class="gw-text">{{sysConfig.contact_text?sysConfig.contact_text:''}}</view>
  16. </view>
  17. <view class="gw-line"></view>
  18. <view class="gw-bottombox">
  19. <image class="gw-wx" :src="advisor.wechatQrcode" show-menu-by-longpress="true"></image>
  20. <view class="gw-sm">1.长按扫码 2.添加微信</view>
  21. </view>
  22. </view>
  23. <view style="height: 110rpx;"></view>
  24. <view class="bot ddflex">
  25. <view class="b-btn fflex ddflex" @click="call(advisor.mobile)">
  26. <image src="../static/images/kf_icon3.png"></image>
  27. 电话咨询
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. const req = require('../../utils/request.js');
  34. const api = require('../../utils/api.js');
  35. const util = require('../../utils/util.js');
  36. const app = getApp();
  37. export default {
  38. data() {
  39. return {
  40. mainStyle: app.globalData.mainStyle,
  41. goShare: false,
  42. isLogin: false,
  43. id: '',
  44. detaile: '',
  45. sysConfig: {},
  46. advisor:''
  47. };
  48. },
  49. onLoad(options) {
  50. this.id = options.id;
  51. // this.getDetail();
  52. this.getSysConfig();
  53. this.getAdvisor()
  54. },
  55. onShow() {},
  56. methods: {
  57. getAdvisor() {
  58. return new Promise((resolve, reject) => {
  59. req.getRequest('/api/distribution/advisorInfo', {}, data => {
  60. console.log('服务顾问==', data)
  61. this.advisor = data;
  62. resolve();
  63. })
  64. })
  65. },
  66. getDetail() {
  67. let that = this;
  68. let apiUrl = '/api/v3/sysUser/info';
  69. return new Promise((resolve,reject)=>{
  70. req.getRequest(apiUrl,{ id: that.id },async res => {
  71. that.detaile = res;
  72. resolve();
  73. },true);
  74. })
  75. },
  76. getSysConfig() {
  77. req.getRequest('/api/config', {}, json => {
  78. this.sysConfig = json;
  79. });
  80. },
  81. //预览图片
  82. previewImgss(url) {
  83. //预览合同图片
  84. var src = [];
  85. src.push(url);
  86. uni.previewImage({
  87. current: 0,
  88. urls: src
  89. });
  90. },
  91. saveImge(url) {
  92. req.saveImageToPhotosAlbum(url);
  93. },
  94. copy(number) {
  95. uni.setClipboardData({
  96. data: number,
  97. success: function(res) {
  98. uni.showToast({
  99. title: '复制成功'
  100. });
  101. }
  102. });
  103. },
  104. call(mobile) {
  105. if(!mobile) return false
  106. uni.makePhoneCall({
  107. phoneNumber: mobile
  108. });
  109. }
  110. }
  111. };
  112. </script>
  113. <style>
  114. @import './index.css';
  115. </style>