3 Commits 0071164ef6 ... eb85999cdd

Author SHA1 Message Date
  anxiaoxia eb85999cdd Merge branch 'master' of http://39.106.8.246:3003/sagacloud/sagacloud-sagacare-weChat 1 year ago
  anxiaoxia a46573f80d delete 无效组件 1 year ago
  anxiaoxia 8b1f18ec77 feat 页面底部客服 1 year ago

+ 25 - 0
src/api/common.js

@@ -0,0 +1,25 @@
+import $http from '@/common/request.js'
+import config from '@/config'
+import store from '@/store/index.js'
+function getProjectId() {
+  const userInfo = store.state.user.userInfo
+  return userInfo
+}
+//  客服
+function customerservice() {
+  let params = {
+    'criteria': {
+      'projectId': getProjectId().projectId,
+      'state': 1
+    }
+  }
+  return $http({
+    serverSp: config.brsgServer.duoduoUrl,
+    url: `/server/duoduoenv/customerservice/query`,
+    method: 'POST',
+    isNotShowErrorToast: true,
+    errorSave: true,
+    data: JSON.stringify(params)
+  })
+}
+export { customerservice }

src/packagesEnv/pages/personalCenter/component/custome-service-panel.wpy → src/components/coustome/custome-service-panel.wpy


+ 5 - 1
src/packagesEnv/pages/personalCenter/footer.wpy

@@ -76,7 +76,7 @@
 
 import wepy from '@wepy/core'
 import config from '@/config'
-import { customerservice } from '../../api/personalCenter.js'
+import { customerservice } from '../../api/common.js'
 wepy.component({
   name: 'Footer',
   props: {
@@ -100,8 +100,12 @@ wepy.component({
         let phone = null
         if (res.count) {
           phone = res.content[0].phone
+          this.IsShowPhone = true
+        } else {
+          this.IsShowPhone = false
         }
         this.phone = phone
+        this.$emit('custome-phone-show', phone)
       })
     }
   }

+ 8 - 3
src/packagesEnv/pages/personalCenter/index.wpy

@@ -193,7 +193,7 @@ page {
 
             </div>
         </div>
-        <footer @callPhone="openPhonePanel"></footer>
+        <footer v-show="hasCustomePhone" @callPhone="openPhonePanel" @custome-phone-show="customePhoneShow"></footer>
         <custome-service-panel
             :show="visiblePhone"
             :phone="phone"
@@ -216,6 +216,7 @@ wepy.page({
   components: {},
   props: {},
   data: {
+    hasCustomePhone: null,
     visiblePhone: false,
     phone: '',
     userInfo: null,
@@ -234,6 +235,10 @@ wepy.page({
 
   computed: {},
   methods: {
+    // 是否有客服
+    customePhoneShow(val) {
+      this.hasCustomePhone = val
+    },
     getUserInfo() {
       queryUserById().then(res => {
         this.userInfo = res.data
@@ -273,8 +278,8 @@ wepy.page({
     usingComponents: {
         'page-top-bar': '~@/components/common/page-top-bar', 
         'add-miniprogram-to-desk-panel': './component/add-miniprogram-to-desk-panel', 
-        'custome-service-panel': './component/custome-service-panel', 
-        'footer':'./footer'     
+        'custome-service-panel': '~@/components/coustome/custome-service-panel', 
+        'footer':'~@/components/coustome/footer'     
     },
     "componentPlaceholder": {
         "add-miniprogram-to-desk-panel": "view",