陶杰
2025-01-19 87a56274d598af9842b593ec972f517161f60707
sub_pages/supplier/customer_service/customer_service.vue
@@ -1,10 +1,39 @@
<template>
   <view class="main-container user-container">
   <view class="main-container user-container bg-white">
      
      <view class="user-utils m-20">
         <u-cell-group v-for="(item,index) in list" :key="index"  >
            <u-cell
                title="单元格"
                value="内容"
                label="标签"
                center
            >
            <view  slot="title" class="title" >{{ item.name }}</view>
            <view  slot="label"  >
               <button open-type="contact" class="component-button-contact"  @handleContact="handleContact " v-if="item.type==='have' ">
                  {{ item.description }}
                  <image class="icon-clock m-r-6 m-t-2" :src="item.iconUrl" style="margin-left: 10px;"></image>
                  <span class="topic-gray" @click.stop="callTel(item.contact)">{{ item.contact }}</span>
               </button>
               <button open-type="contact" class="component-button-contact" @handleContact="handleContact" v-else>
                  {{ item.description }}
               </button>
            </view>
            <view  slot="value"  style="width:60px;">
               <button open-type="contact" class="component-button-contact"  style="display: flex; justify-content: center;"   @handleContact="handleContact">
                  <image class="icon-clock m-r-6 m-t-2" :src="item.iconUrl"></image>
               </button>
               <button open-type="contact" class="component-button-contact" style="display: flex; justify-content: center;"    @handleContact="handleContact">
                  {{ item.iconContent }}
               </button>
            </view>
            </u-cell>
         </u-cell-group>
         <u-cell-group>
         <!-- <u-cell-group>
            <u-cell
                title="单元格"
                value="内容"
@@ -14,7 +43,8 @@
            <view  slot="title" class="title" >我的客服</view>
            <view  slot="label">
               <button open-type="contact" class="component-button-contact"  @handleContact="handleContact"> 
                  客服电话:<span class="topic-gray">{{ tel }}</span>
                  客服电话:<image class="icon-clock m-r-6 m-t-2" src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/26/269f62d09013429596acc9be4be8a1bcicon-call.png"></image>
                  <span class="topic-gray" @click.stop="callTel">{{ tel }}</span>
               </button>   
            </view>
            <view  slot="value" >
@@ -102,7 +132,7 @@
               </button>
            </view>
            </u-cell>
         </u-cell-group>
         </u-cell-group> -->
         
      </view>
@@ -125,7 +155,7 @@
            tcode: '',
            inviterName: '',
            // StatusBar:0,
            tel: '15974805814',
            tel: '19288780072',
            tj: {},
            tj_order: {},
            cacheUserId: '',
@@ -136,8 +166,9 @@
      },
      onShow() {
         this.cacheUserId = ''
         this.getHotLineConfig()
      },
      onLoad(options) {
      async onLoad(options) {
         // const url = options.q ? decodeURIComponent(options.q) : '';
         // const urlcode = options.url && decodeURIComponent(options.url) || ''
         // #ifdef PUB_CUSTOMER
@@ -145,6 +176,10 @@
            this.bindPartnerUser(options.partnerUserId, options.partnerUserName)
         }
         // #endif
         this.listApi="/api/configCustomer/list"
         await this.getList()
         console.log(this.list)
      },
@@ -157,6 +192,28 @@
         uni.stopPullDownRefresh()
      },
      methods: {
         async getHotLineConfig() {
            this.$message.showLoading()
            const {
               code,
               data
            } = await this.$http.request('get', `/v2/config-param/base/getBaseString`, {
               params: {
                  paramGroup: "servicehotline",
                  paramKey: "hotline_tel"
               }
            })
            this.$message.hideLoading()
            if (code === 0) {
               // 电话
               console.log(data)
               this.tel =data
            }
         },
         async bindPartnerUser(userId, name) {
            // await this.$message.confirm(`确定要绑定${name}合伙人吗?`)
            //调用接口绑定
@@ -177,11 +234,17 @@
         },
         async callTel() {
         async callTel(tel) {
            await this.$message.confirm('是否拨打客服电话')
            uni.makePhoneCall({
               phoneNumber: this.tel //仅为示例
            });
            if(tel){
               uni.makePhoneCall({
                  phoneNumber: tel //仅为示例
               });
            }
            // uni.makePhoneCall({
            //    phoneNumber: this.tel //仅为示例
            // });
         },
      }
   }