anxiaoxia 1 year ago
parent
commit
2ef4af3285
2 changed files with 32 additions and 8 deletions
  1. 5 1
      src/components/coustome/footer.wpy
  2. 27 7
      src/packagesEnv/pages/portrait/home.wpy

+ 5 - 1
src/components/coustome/footer.wpy

@@ -51,7 +51,7 @@
     <div class="footer">
         <div
             class="btn-box"
-            v-if="IsShowPhone"
+            v-if="IsShowPhone && !justText"
             @click="callPhone"
         >
             <image
@@ -80,6 +80,10 @@ import { customerservice } from '../../api/common.js'
 wepy.component({
   name: 'Footer',
   props: {
+    justText: {
+      type: Boolean,
+      default: false
+    }
   },
   data: {
     h5StaticPath: config.h5StaticPath + '/page-personalCenter',

+ 27 - 7
src/packagesEnv/pages/portrait/home.wpy

@@ -181,6 +181,13 @@ page {
             class="logo-text"
             src="{{h5StaticPath}}/page-home/tenatslink.svg"
         ></image> -->
+        <footer v-show="hasCustomePhone" @callPhone="openPhonePanel" @custome-phone-show="customePhoneShow"></footer>
+        <custome-service-panel
+            :show="visiblePhone"
+            :phone="phone"
+            @custome-service-close="closePhonePanel"
+        >
+        </custome-service-panel>
 
     </div>
 </template>
@@ -201,6 +208,9 @@ import { carbonCredit } from '../common.js'
 wepy.page({
   store,
   data: {
+    phone: null,
+    visiblePhone: false,
+    hasCustomePhone: false,
     carbonCreditText: '',
     pageTopBarTop: 0,
     h5StaticPath: config.h5StaticPath + '/page-portrait',
@@ -232,13 +242,18 @@ wepy.page({
       this.getAir()
       this.getLamp()
       this.queryPortraitModule()
-            //   this.getUsersFace()
     },
-        // getUsersFace() { // 用户信息
-        //   getCompmayUsers().then(res => {
-        //     store.commit('setUserData', res.data || {})
-        //   })
-        // },
+     // 是否有客服
+    customePhoneShow(val) {
+      this.hasCustomePhone = val
+    },
+    openPhonePanel(val) {
+      this.phone = val
+      this.visiblePhone = true
+    },
+    closePhonePanel(val) {
+      this.visiblePhone = val
+    },
     showEnergyPage(page, pointType, pointName) { // 跳转到排行
       wx.uma.trackEvent(`portrait_home_${pointType}`, { key: pointName })
             //   if (page === 'total') {
@@ -319,7 +334,12 @@ wepy.page({
     navigationStyle:"custom",
     backgroundColor: '#EBF5FA',
     usingComponents: {
-        'page-top-bar': '~@/components/common/page-top-bar',      
+        'page-top-bar': '~@/components/common/page-top-bar', 
+        'custome-service-panel': '~@/components/coustome/custome-service-panel', 
+        'footer':'~@/components/coustome/footer'        
     },
+    "componentPlaceholder": {
+        "add-miniprogram-to-desk-panel": "view",
+    }
 }
 </config>