Kaynağa Gözat

feat: 医械通增加获取客服的接口

zhangsiya 1 yıl önce
ebeveyn
işleme
40809dbc2a

+ 12 - 0
apps/bigmember_pc/src/api/modules/common.js

@@ -0,0 +1,12 @@
+import request from '@/api'
+import qs from 'qs'
+
+// 获取客服用户
+export function getCustomInfo(data) {
+  data = qs.stringify(data)
+  return request({
+    url: '/bigmember/use/getCustom',
+    method: 'POST',
+    data
+  })
+}

+ 1 - 0
apps/bigmember_pc/src/api/modules/index.js

@@ -31,3 +31,4 @@ export * from './message'
 export * from './business'
 export * from './search'
 export * from './nzj'
+export * from './common'

+ 21 - 2
apps/bigmember_pc/src/views/medical-field/Credentials.vue

@@ -26,7 +26,7 @@
               <p class="cred_desc">方式1:扫描二维码获得专属客户服务</p>
               <div class="qr_box">
                 <img
-                  src="@/assets/images/medical-field/qrcode-814.png"
+                  :src="kefuInfo.wxer"
                   alt=""
                   class="qr_img"
                 />
@@ -233,6 +233,8 @@ import {
   domainUsersave
 } from '@/api/modules/medicalField.js'
 import informationSuccess from '@/components/common/informationSuccess.vue'
+import { getCustomInfo } from '@/api/modules/'
+import qrCode from '@/assets/images/medical-field/qrcode-814.png'
 export default {
   name: 'Credentials',
   components: {
@@ -358,10 +360,14 @@ export default {
       jobData: [], // 职位数据
       branchData: [], // 部门数据
       source: 'Credentials',
-      list_choose: false
+      list_choose: false,
+      kefuInfo: {
+        wxer: qrCode
+      }
     }
   },
   created() {
+    this.getKefuInfo()
     this.getAllFunctions({ vm: this })
     this.jobData = jobJson.map((item) => {
       return {
@@ -593,6 +599,19 @@ export default {
     },
     otherFocus() {
       this.$refs.ruleForm.clearValidate(['job'])
+    },
+    // 获取客服二维码信息
+    getKefuInfo () {
+      const params = {
+        type: 'kf'
+      }
+      getCustomInfo(params).then(res => {
+        const { error_code: code, data } = res
+        if(code === 0 && data) {
+          this.kefuInfo = Object.assign(this.kefuInfo, data)
+        }
+        console.log(data)
+      })
     }
   }
 }