Browse Source

添加客服功能

lex-wxl 3 weeks ago
parent
commit
23c5115801

BIN
miniprogram/components/service/images/icon-close.png


BIN
miniprogram/components/service/images/icon-service.png


+ 9 - 8
miniprogram/components/service/service.less

@@ -3,8 +3,8 @@
   position: fixed;
   // bottom: 198rpx;
   // right: 8rpx;
-  width: 112rpx;
-  height: 119rpx;
+  width: 84rpx;
+  height: 103rpx;
   z-index: 2998;
 }
 .service-container {
@@ -31,17 +31,18 @@
     left: 50%;
     text-align: center;
     .iconImg {
-      width: 578rpx;
-      height: 686rpx;
+      width: 590rpx;
+      height: 848rpx;
     }
 
     .iconClose {
       position: absolute;
       z-index: 1;
-      top: 34rpx;
-      right: 16rpx;
-      width: 44rpx;
-      height: 44rpx;
+      bottom: -100rpx;
+      transform: translate(-50%, -50%);
+      left: 50%;
+      width: 60rpx;
+      height: 60rpx;
     }
   }
 }

+ 4 - 1
miniprogram/components/service/service.ts

@@ -1,4 +1,7 @@
 // components/service/service.ts
+
+import { ColorGradient } from "XrFrame/components/particle/gradient";
+
 // 获取应用实例
 const app = getApp<IAppOption>()
 Component({
@@ -27,7 +30,7 @@ Component({
       this.setData({
         maxTop: barHeight + systemInfo.safeArea.top,
         windowWidth: systemInfo.windowWidth,
-        windowHeight: systemInfo.windowHeight,
+        windowHeight: systemInfo.windowHeight - (systemInfo.windowHeight  - systemInfo.safeArea.bottom) - 46,
         top: globalTop
       });
     }

+ 1 - 1
miniprogram/components/service/service.wxml

@@ -3,7 +3,7 @@
   <view class="service-container" wx:if="{{ popShow }}">
     <view class="service-mask" bind:tap="onClose"></view>
     <view class="service-section" bind:tap="onClose">
-      <image src="https://oss.dayaedu.com/ktyq/1732518474110.png" data-src="https://oss.dayaedu.com/ktyq/1732518474110.png" mode="aspectFill" catch:tap="onOpen" show-menu-by-longpress="true" catch:longtap="onPerview" class="iconImg"></image>
+      <image src="https://oss.dayaedu.com/ktyq/12/1766069067202.png" data-src="https://oss.dayaedu.com/ktyq/12/1766069067202.png" mode="aspectFill" catch:tap="onOpen" show-menu-by-longpress="true" catch:longtap="onPerview" class="iconImg"></image>
 
       <image src="./images/icon-close.png" catch:tap="onClose" class="iconClose"></image>
     </view>

+ 2 - 0
miniprogram/pages/index/index.less

@@ -361,6 +361,8 @@ page {
   }
 
   .images {
+    font-size: 0;
+    line-height: 0;
     image {
       display: block;
       width: 100%;

+ 11 - 13
miniprogram/pages/orders/order-detail.ts

@@ -38,7 +38,8 @@ Page({
     isExpanded: false,
     paymentType: null as any, // 支付类型
     paymentChannel: null as any,
-    showService: false,
+
+    serviceShow: true,
 
     showArea: false,
     areaList: [] as any,
@@ -354,18 +355,6 @@ Page({
       }
     })
   },
-  /** 客服 */
-  onService() {
-    console.log("showService")
-    this.setData({
-      showService: true
-    })
-  },
-  changePop(event: { detail: any }) {
-    this.setData({
-      showService: event.detail
-    })
-  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
@@ -386,6 +375,15 @@ Page({
       })
     }
     this.getAddress()
+
+    this.setData({
+      serviceShow: true,
+    })
+  },
+  onHide() {
+    this.setData({
+      serviceShow: false
+    })
   },
   /** 地址列表 */
   async getAddress() {

+ 2 - 1
miniprogram/pages/orders/order-detail.wxml

@@ -180,7 +180,8 @@
   <van-popup round="{{true}}" lock-scroll="{{true}}" z-index="{{103}}" show="{{showArea}}" position="bottom" safe-area-inset-bottom="{{false}}" bind:close="onCloseAreaList">
     <van-area id='area1' areaList="{{areaList}}" visible-item-count="9" item-height="46" value="{{ regionCode }}" bind:cancel="onCloseAreaList" bind:confirm="submitArea" />
   </van-popup>
-  <!-- <service popShow="{{ showService }}" bind:changePop="changePop"></service> -->
+  <!-- 客服功能 -->
+<service wx:if="{{serviceShow}}"></service>
 </view>
 
 

+ 12 - 1
miniprogram/pages/orders/order-result.ts

@@ -45,7 +45,9 @@ Page({
     timer: null as any,
     goodsInfo: {} as any,
     orderNo: "" as string,
-    isExpanded: false // 是否展开
+    isExpanded: false, // 是否展开
+
+    serviceShow: true,
   },
 
   /**
@@ -62,6 +64,15 @@ Page({
     if(this.data.orderNo) {
       this.getDetail(this.onTimeout)
     }
+
+    this.setData({
+      serviceShow: true
+    })
+  },
+  onHide() {
+    this.setData({
+      serviceShow: false
+    })
   },
   async getDetail(callback?: any) {
     try {

+ 3 - 0
miniprogram/pages/orders/order-result.wxml

@@ -97,6 +97,9 @@
   <!-- <view class="order-btn" wx:if="{{ goodsInfo.wechatStatus != 'WAIT_PAY' }}">
     <button type="primary" bind:tap="onSubmit">再来一单</button>
   </view> -->
+
+  <!-- 客服功能 -->
+  <service wx:if="{{serviceShow}}"></service>
 </view>
 
 <template name="address">

+ 2 - 1
miniprogram/pages/orders/orders.json

@@ -1,6 +1,7 @@
 {
   "usingComponents": {
     "navigation-bar": "/components/navigation-bar/navigation-bar",
-    "apply-refound": "/components/apply-refound/apply-refound"
+    "apply-refound": "/components/apply-refound/apply-refound",
+    "service": "/components/service/service"
   }
 }

+ 8 - 0
miniprogram/pages/orders/orders.ts

@@ -47,6 +47,8 @@ Page({
     cancelRefoundStatus: false,
     paymentChannel: '',
     goodsInfo: {}, // 选中的数据
+
+    serviceShow: true,
   },
 
   /**
@@ -62,10 +64,16 @@ Page({
       page: 1,
       maxPage: 1,
       recordList: [],
+      serviceShow: true
     }, () => {
       this.getList()
     })
   },
+  onHide() {
+    this.setData({
+      serviceShow: false
+    })
+  },
   /** 切换分类 */
   switchTab(e: { currentTarget: { dataset: { idx: any } } }) {
     const idx = e.currentTarget.dataset.idx;

+ 3 - 0
miniprogram/pages/orders/orders.wxml

@@ -65,4 +65,7 @@
   </view>
   <!-- 申请退款 -->
   <!-- <apply-refound refoundStatus="{{ refoundStatus }}" goodsInfo="{{goodsInfo}}" bind:changeRefoundStatus="changeRefoundStatus" bind:onConfirm="onRefoundComfirm"></apply-refound> -->
+
+  <!-- 客服功能 -->
+  <service wx:if="{{serviceShow}}"></service>
 </view>