lex-xin il y a 4 mois
Parent
commit
fe4e13e3a0

+ 2 - 1
miniprogram/app.json

@@ -6,7 +6,8 @@
     "pages/login/login",
     "pages/orders/order-detail",
     "pages/orders/order-result",
-    "pages/protocol/register"
+    "pages/protocol/register",
+    "pages/service/service"
   ],
   "window": {
     "navigationBarTextStyle": "black",

+ 1 - 0
miniprogram/app.ts

@@ -2,6 +2,7 @@
 import { api_login, api_queryUserInfo } from './api/login';
 const config = require("./config");
 
+
 App<IAppOption>({
   globalData: {
     // 在客服页面使用

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


+ 2 - 2
miniprogram/components/service/service.less

@@ -3,8 +3,8 @@
   position: fixed;
   // bottom: 198rpx;
   // right: 8rpx;
-  width: 112rpx;
-  height: 119rpx;
+  width: 100rpx;
+  height: 100rpx;
   z-index: 998;
 }
 .service-container {

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

@@ -46,9 +46,7 @@ Component({
       // 
     },
     onShow() {
-      this.setData({
-        popShow: true
-      })
+      this.triggerEvent('openService')
     },
     onTouchStart(e: any) {
       // 记录触摸起始点的 Y 坐标

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

@@ -1,12 +1,12 @@
 <!--components/service/service.wxml-->
 <view>
-  <view class="service-container" wx:if="{{ popShow }}">
+  <!-- <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="./images/icon-close.png" catch:tap="onClose" class="iconClose"></image>
     </view>
-  </view>
+  </view> -->
   <image wx:if="{{ btnShow }}" src="./images/icon-service.png" catch:tap="onShow" style="top: {{top}}px; right: 4px;" bind:touchstart="onTouchStart" catch:touchmove="onTouchMove" bind:touchend="onTouchEnd" class="iconSerivce"></image>
 </view>

+ 1 - 1
miniprogram/config.ts

@@ -2,7 +2,7 @@ const environmentVariable = "test";
 const apiUrlInfo = {
   dev: "https://dev.kt.colexiu.com",
   test: "https://test.kt.colexiu.com",
-  online: "https://online.kt.colexiu.com",
+  online: "https://kt.colexiu.com",
 };
 const baseUrl = apiUrlInfo[environmentVariable];
 module.exports = {

+ 5 - 12
miniprogram/pages/index/index.ts

@@ -33,7 +33,6 @@ Page({
     list: [] as any,
     isOverSaled: false, // 是否所有商品都没有库存
     selected: {} as any,
-    showService: false,
   },
 
   /**
@@ -143,17 +142,6 @@ Page({
       url: '../orders/orders',
     })
   },
-  /** 客服 */
-  onService() {
-    this.setData({
-      showService: true
-    })
-  },
-  changePop(event: { detail: any }) {
-    this.setData({
-      showService: event.detail
-    })
-  },
   onBuyShop() {
     // 判断是否登录
     if(!this.isLogin()) {
@@ -212,4 +200,9 @@ Page({
   onShow() {
     this.onInit()
   },
+  openService() {
+    wx.navigateTo({
+      url: '../service/service'
+    })
+  }
 })

+ 1 - 1
miniprogram/pages/index/index.wxml

@@ -104,5 +104,5 @@
   </view>
 
   <!-- 客服 -->
-  <service></service>
+  <service bind:openService="openService"></service>
 </scroll-view>

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

@@ -19,7 +19,6 @@ Page({
     goodsInfo: {} as any,
     paymentType: null as any, // 支付类型
     paymentChannel: null as any,
-    showService: false,
   },
 
   /**
@@ -170,16 +169,9 @@ Page({
       }
     })
   },
-  /** 客服 */
-  onService() {
-    console.log("showService")
-    this.setData({
-      showService: true
-    })
-  },
-  changePop(event: { detail: any }) {
-    this.setData({
-      showService: event.detail
+  openService() {
+    wx.navigateTo({
+      url: '../service/service'
     })
   },
   /**

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

@@ -54,6 +54,6 @@
       </view>
       <button type="primary" bind:tap="onSubmit">{{ goodsInfo.orderNo ? '继续支付' : '立即支付' }}</button>
   </view>
-
-  <service popShow="{{ showService }}" bind:changePop="changePop"></service>
+    <!-- 客服 -->
+    <service bind:openService="openService"></service>
 </view>

+ 3 - 10
miniprogram/pages/orders/order-result.ts

@@ -47,7 +47,6 @@ Page({
     orderNo: "" as string,
     showCanvas: false, // 是否显示二维码
     canvasImg: "" as string,
-    showService: false,
     refoundStatus: false
   },
 
@@ -205,15 +204,9 @@ Page({
       clearTimeout(timer)
     }
   },
-  /** 客服 */
-  onService() {
-    this.setData({
-      showService: true
-    })
-  },
-  changePop(event: { detail: any }) {
-    this.setData({
-      showService: event.detail
+  openService() {
+    wx.navigateTo({
+      url: '../service/service'
     })
   },
   /** 申请退款 */

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

@@ -75,11 +75,12 @@
     <!-- <button type="primary" bind:tap="useRefound" wx:if="{{ goodsInfo.wechatStatus == 'WAIT_USE' }}">申请退款</button>
     <block wx:else> -->
       <button type="primary" bind:tap="cancelRefound" wx:if="{{ goodsInfo.wechatStatus == 'REFUNDING' }}">取消退款</button>
-      <button type="primary" wx:else bind:tap="onSubmit">再来一单</button>
+      <button type="primary" wx:else bind:tap="onSubmit">再次购买</button>
     <!-- </block> -->
   </view>
 
-  <service popShow="{{ showService }}" bind:changePop="changePop"></service>
+   <!-- 客服 -->
+   <service bind:openService="openService"></service>
 
   <!-- 退费 -->
   <apply-refound refoundStatus="{{ refoundStatus }}" goodsInfo="{{goodsInfo}}" bind:changeRefoundStatus="changeRefoundStatus" bind:onConfirm="onRefoundComfirm"></apply-refound>

+ 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"
   }
 }

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

@@ -363,4 +363,9 @@ Page({
       })
     }, 1500);
   },
+  openService() {
+    wx.navigateTo({
+      url: '../service/service'
+    })
+  },
 })

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

@@ -56,6 +56,8 @@
       </block>
     </scroll-view>
   </view>
+  <!-- 客服 -->
+  <service bind:openService="openService"></service>
   <!-- 申请退款 -->
   <apply-refound refoundStatus="{{ refoundStatus }}" goodsInfo="{{goodsInfo}}" bind:changeRefoundStatus="changeRefoundStatus" bind:onConfirm="onRefoundComfirm"></apply-refound>
 </view>

BIN
miniprogram/pages/service/images/icon-logo.png


BIN
miniprogram/pages/service/images/icon-qrcode.png


+ 5 - 0
miniprogram/pages/service/service.json

@@ -0,0 +1,5 @@
+{
+  "usingComponents": {
+    "navigation-bar": "/components/navigation-bar/navigation-bar"
+  }
+}

+ 74 - 0
miniprogram/pages/service/service.less

@@ -0,0 +1,74 @@
+/* pages/service/service.wxss */
+.container {
+  position: relative;
+  background: url('https://oss.dayaedu.com/ktyq/1732533582478.png') no-repeat center;
+  background-size: cover;
+  min-height: 100vh;
+
+  .weui-navigation-bar__btn_goback {
+    background-color: #fff;
+  }
+}
+
+.content {
+  margin: 120rpx 40rpx 0;
+  background: rgba(255,255,255,0.5);
+  border-radius: 40rpx;
+  padding: 20rpx;
+  // overflow: hidden;
+  .content-section {
+    min-height: 70vh;
+    background: #FFFFFF;
+    box-shadow: 0rpx 2rpx 20rpx 0rpx rgba(208,75,10,0.13);
+    border-radius: 32rpx;
+    .serivce_logo {
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      position: relative;
+      top: -70rpx;
+      left: 50%;
+      transform: translateX(-50%);
+      .logo_img {
+        width: 140rpx;
+        height: 140rpx;
+      }
+      text {
+        padding-top: 16rpx;
+        font-weight: 600;
+        font-size: 34rpx;
+        color: #131415;
+        line-height: 48rpx;
+      }
+    }
+  }
+
+  .qrcode-section {
+    text-align: center;
+    .qrcode_img {
+      width: 400rpx;
+      height: 400rpx;
+    }
+    .tips {
+      padding-top: 40rpx;
+      font-weight: 600;
+      font-size: 30rpx;
+      color: #777777;
+      line-height: 42rpx;
+      text-align: center;
+      font-style: normal;
+      background: linear-gradient(to right, #FE8B00, #FF4B00);
+      -webkit-background-clip: text;
+      background-clip: text;
+      color: transparent;
+    }
+  }
+}
+
+.bottom_img {
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  width: 100%;
+}

+ 66 - 0
miniprogram/pages/service/service.ts

@@ -0,0 +1,66 @@
+// pages/service/service.ts
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 19 - 0
miniprogram/pages/service/service.wxml

@@ -0,0 +1,19 @@
+<!--pages/service/service.wxml-->
+<view class="container">
+  <navigation-bar color="#fff" title="联系客服"></navigation-bar>
+  <view class="content">
+    <view class="content-section">
+      <view class="serivce_logo">
+        <image class="logo_img" src="./images/icon-logo.png"></image>
+        <text>客服小音</text>
+      </view>
+
+      <view class="qrcode-section">
+        <image src="./images/icon-qrcode.png" show-menu-by-longpress="true"  class="qrcode_img"></image>
+
+        <view class="tips">长按识别二维码添加您的专属客服</view>
+      </view>
+    </view>
+  </view>
+  <image class="bottom_img" src="https://oss.dayaedu.com/ktyq/1732533650138.png"></image>
+</view>

+ 22 - 0
miniprogram/utils/event-bus.ts

@@ -0,0 +1,22 @@
+// event-bus.js
+const EventBus = {
+  events: {} as any,
+  // 重新定义的 on 方法,用于注册事件监听器,现在同一个 eventName 只会保留最后注册的那个监听器
+  on: function (eventName: string, callback: Function) {
+      this.events[eventName] = callback;
+  },
+  // 用于触发事件,通知注册的监听器执行相应逻辑
+  emit: function (eventName: string, data: any) {
+      if (this.events[eventName]) {
+          this.events[eventName](data);
+      }
+  },
+  // 新增的关闭事件方法,用于移除指定事件的监听器
+  off: function (eventName: string) {
+      if (this.events[eventName]) {
+          delete this.events[eventName];
+      }
+  }
+};
+
+export default EventBus;