lex-xin hai 4 meses
pai
achega
b9de485ea7

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


+ 4 - 0
miniprogram/components/service/service.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 36 - 0
miniprogram/components/service/service.less

@@ -0,0 +1,36 @@
+/* components/service/service.wxss */
+.service-container {
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  z-index: 99;
+
+  .service-mask {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: rgba(0, 0, 0, 0.7);
+  }
+
+  .service-section {
+    position: absolute;
+    transform: translate(-50%, -50%);
+    top: 50%;
+    left: 50%;
+    text-align: center;
+    .iconImg {
+      width: 590rpx;
+      height: 848.22rpx;
+    }
+
+    .iconClose {
+      margin-top: 40rpx;
+      width: 60rpx;
+      height: 60rpx;
+    }
+  }
+}

+ 32 - 0
miniprogram/components/service/service.ts

@@ -0,0 +1,32 @@
+// components/service/service.ts
+Component({
+
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    popShow: {
+      type: Boolean,
+      default: false
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    onClose() {
+      this.triggerEvent('changePop', false)
+    },
+    onOpen() {
+// 
+    }
+  }
+})

+ 9 - 0
miniprogram/components/service/service.wxml

@@ -0,0 +1,9 @@
+<!--components/service/service.wxml-->
+<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/1732155965679.png" data-src="https://oss.dayaedu.com/ktyq/1732155965679.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>

BIN=BIN
miniprogram/pages/index/images/icon-service.png


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

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

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

@@ -205,13 +205,14 @@ page {
   width: 100%;
   background-color: #FFFFFF;
   box-shadow: inset 0rpx 2rpx 0rpx 0rpx #F0F0F0;
-  padding: 20rpx 32rpx 58rpx 40rpx;
+  padding: 20rpx 32rpx 58rpx 32rpx;
   display: flex;
   align-items: center;
   box-sizing: border-box;
   .orders {
     display: flex;
     flex-direction: column;
+    margin-right: 40rpx;
     image {
       width: 48rpx;
       height: 48rpx;
@@ -226,7 +227,6 @@ page {
   }
   .btnSection {
     flex: 1 auto;
-    padding-left: 40rpx;
     button {
       width: 100%;
       line-height: 88rpx;

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

@@ -19,6 +19,7 @@ Page({
     list: [] as any,
     isOverSaled: false, // 是否所有商品都没有库存
     selected: {} as any,
+    showService: false,
   },
 
   /**
@@ -128,6 +129,17 @@ Page({
       url: '../orders/orders',
     })
   },
+  /** 客服 */
+  onService() {
+    this.setData({
+      showService: true
+    })
+  },
+  changePop(event: { detail: any }) {
+    this.setData({
+      showService: event.detail
+    })
+  },
   onBuyShop() {
     // 判断是否登录
     if(!this.isLogin()) {

+ 6 - 0
miniprogram/pages/index/index.wxml

@@ -71,6 +71,10 @@
     </view>
 
     <view class="bottom-section">
+      <view class="orders" bind:tap="onService">
+        <image src="./images/icon-service.png" />
+        <text>客服</text>
+      </view>
       <view class="orders" bind:tap="onOrder">
         <image src="./images/icon-order.png" />
         <text>订单</text>
@@ -110,4 +114,6 @@
       </view>
     </view>
   </view>
+
+  <service popShow="{{ showService }}" bind:changePop="changePop"></service>
 </scroll-view>

+ 3 - 0
miniprogram/pages/login/login.ts

@@ -70,6 +70,7 @@ Page({
         wx.hideLoading()
         if(users.data.code === 200) {
           app.globalData.userInfo = users.data.data
+          wx.hideLoading()
           // 登录成功先跳转到首页
           wx.navigateTo({
             url: '../index/index',
@@ -81,6 +82,8 @@ Page({
         }
       } else {
         app.globalData.isLogin = false;
+        wx.hideLoading()
+        wx.showToast({ title: data.msg, icon: "none" })
       }
     } catch(e) {
       console.log('error', e)

BIN=BIN
miniprogram/pages/orders/images/icon-service.png


BIN=BIN
miniprogram/pages/orders/images/refounded.png


BIN=BIN
miniprogram/pages/orders/images/refounding.png


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

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

+ 23 - 1
miniprogram/pages/orders/order-detail.less

@@ -141,6 +141,27 @@ page {
   justify-content: space-between;
   box-sizing: border-box;
 
+  .orders {
+    display: flex;
+    flex-direction: column;
+    margin-right: 40rpx;
+    image {
+      width: 48rpx;
+      height: 48rpx;
+    }
+    text {
+      font-weight: 500;
+      font-size: 22rpx;
+      color: #131415;
+      line-height: 32rpx;
+      text-align: center;
+    }
+  }
+
+  .more {
+    display: flex;
+  }
+
   .price {
     display: flex;
     align-items: center;
@@ -150,6 +171,7 @@ page {
       font-size: 28rpx;
       color: #131415;
       line-height: 40rpx;
+      padding-top: 20rpx;
     }
     .currentPrice {
       font-weight: bold;
@@ -168,7 +190,7 @@ page {
   }
 
   button {
-    margin: 0;
+    margin: 0 0 0 12rpx;
     width: auto;
     background: linear-gradient( 270deg, #FF204B 0%, #FE5B71 100%);
     border-radius: 78rpx;

+ 14 - 1
miniprogram/pages/orders/order-detail.ts

@@ -19,6 +19,7 @@ Page({
     goodsInfo: {} as any,
     paymentType: null as any, // 支付类型
     paymentChannel: null as any,
+    showService: false,
   },
 
   /**
@@ -40,7 +41,7 @@ Page({
     try {
       // wxlite_payment_service_provider
       const { data } = await api_queryByParamName({
-        paramName: 'wxlite_payment_service_provider'
+        paramName: app.globalData.appId
       });
       if (data.code == 200) {
         const paramValue = data.data.paramValue ? JSON.parse(data.data.paramValue) : {}
@@ -168,6 +169,18 @@ Page({
       }
     })
   },
+  /** 客服 */
+  onService() {
+    console.log("showService")
+    this.setData({
+      showService: true
+    })
+  },
+  changePop(event: { detail: any }) {
+    this.setData({
+      showService: event.detail
+    })
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 15 - 8
miniprogram/pages/orders/order-detail.wxml

@@ -40,15 +40,22 @@
   </scroll-view>
 
   <view class="order-btn">
-    <view class="price">
-      <view class="desc">订单金额:</view>
-      <view class="currentPrice">
-        <text class="stuff">¥</text>
-        <text class="priceZ">{{ goodsInfo.integerPart }}</text>
-        <text class="priceF">.{{ goodsInfo.decimalPart }}</text>
+    <view class="orders" bind:tap="onService">
+        <image src="./images/icon-service.png" />
+        <text>客服</text>
       </view>
+    <view class="more">
+      <view class="price">
+        <view class="desc">订单金额:</view>
+        <view class="currentPrice">
+          <text class="stuff">¥</text>
+          <text class="priceZ">{{ goodsInfo.integerPart }}</text>
+          <text class="priceF">.{{ goodsInfo.decimalPart }}</text>
+        </view>
+      </view>
+      <button type="primary" bind:tap="onSubmit">{{ goodsInfo.orderNo ? '继续支付' : '立即支付' }}</button>
     </view>
-
-    <button type="primary" bind:tap="onSubmit">{{ goodsInfo.orderNo ? '继续支付' : '立即支付' }}</button>
   </view>
+
+  <service popShow="{{ showService }}" bind:changePop="changePop"></service>
 </view>

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

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

+ 17 - 0
miniprogram/pages/orders/order-result.less

@@ -172,6 +172,23 @@ page {
   justify-content: space-between;
   box-sizing: border-box;
 
+  .orders {
+    display: flex;
+    flex-direction: column;
+    margin-right: 40rpx;
+    image {
+      width: 48rpx;
+      height: 48rpx;
+    }
+    text {
+      font-weight: 500;
+      font-size: 22rpx;
+      color: #131415;
+      line-height: 32rpx;
+      text-align: center;
+    }
+  }
+
   .price {
     display: flex;
     align-items: center;

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

@@ -30,8 +30,13 @@ Page({
         title: '等待使用',
         content: '请尽快扫描下方二维码进行激活'
       },
+      REFUNDING: {
+        logo: './images/refounding.png',
+        title: '退款中',
+        content: '您的退款申请正在处理,预计7个工作日内完成审核'
+      },
       REFUNDED: {
-        logo: './images/wait.png',
+        logo: './images/refounded.png',
         title: '退款成功',
         content: '您的退款已成功处理,感谢您的理解和支持'
       }
@@ -41,7 +46,8 @@ Page({
     goodsInfo: {} as any,
     orderNo: "" as string,
     showCanvas: false, // 是否显示二维码
-    canvasImg: "" as string
+    canvasImg: "" as string,
+    showService: false,
   },
 
   /**
@@ -195,5 +201,16 @@ Page({
     } else {
       clearTimeout(timer)
     }
-  }
+  },
+  /** 客服 */
+  onService() {
+    this.setData({
+      showService: true
+    })
+  },
+  changePop(event: { detail: any }) {
+    this.setData({
+      showService: event.detail
+    })
+  },
 })

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

@@ -62,6 +62,12 @@
   </scroll-view>
 
   <view class="order-btn" wx:if="{{ goodsInfo.wechatStatus != 'WAIT_PAY' }}">
+    <view class="orders" bind:tap="onService">
+      <image src="./images/icon-service.png" />
+      <text>客服</text>
+    </view>
     <button type="primary" bind:tap="onSubmit">再来一单</button>
   </view>
+
+  <service popShow="{{ showService }}" bind:changePop="changePop"></service>
 </view>

+ 1 - 1
miniprogram/pages/orders/orders.less

@@ -23,7 +23,7 @@ page {
   display: flex;
   align-items: center;
   justify-content: space-between;
-  padding: 28rpx 50rpx 16rpx;
+  padding: 28rpx 30rpx 16rpx;
 
   >view {
       font-size: 32rpx;

+ 12 - 13
miniprogram/pages/orders/orders.ts

@@ -1,7 +1,6 @@
 import { api_studentOrderPage } from "../../api/login";
 // 获取应用实例
 const app = getApp<IAppOption>()
-// pages/orders/orders.ts
 Page({
 
   /**
@@ -29,10 +28,10 @@ Page({
         id: 4,
         label: "已取消",
       },
-      // {
-      //   id: 5,
-      //   label: "退款中",
-      // },
+      {
+        id: 5,
+        label: "售后",
+      },
       // {
       //   id: 6,
       //   label: "已退款",
@@ -82,7 +81,7 @@ Page({
         openId: app.globalData.userInfo?.liteOpenid,
         page: currentPage,
         rows: this.data.rows,
-        wechatOrderStatus: tabIdx == 0 ? "" : tabIdx == 1 ? "WAIT_PAY" : tabIdx == 2 ? "WAIT_USE" : tabIdx == 3 ? "PAID" : tabIdx == 4 ? "CLOSED" : "",
+        wechatOrderStatus: tabIdx == 0 ? "" : tabIdx == 1 ? "WAIT_PAY" : tabIdx == 2 ? "WAIT_USE" : tabIdx == 3 ? "PAID" : tabIdx == 4 ? "CLOSED" : tabIdx == 5 ? 'REFUNDED' : "",
       })
       if (data.code == 200) {
         const { rows, total } = data.data;
@@ -122,7 +121,8 @@ Page({
       WAIT_USE: '等待使用',
       PAID: '交易完成',
       CLOSED: '交易取消',
-      REFUNDED: '退款成功'
+      REFUNDING: '售后中',
+      REFUNDED: '售后成功'
     }
     return template[status]
   },
@@ -157,11 +157,11 @@ Page({
   loadMore() {
     const currentPage = this.data.page;
     if (this.data.page >= this.data.maxPage) {
-      wx.showToast({
-        title: "没有更多数据了",
-        icon: "none",
-        duration: 1000,
-      });
+      // wx.showToast({
+      //   title: "没有更多数据了",
+      //   icon: "none",
+      //   duration: 1000,
+      // });
     } else {
       this.setData(
         {
@@ -213,7 +213,6 @@ Page({
   },
   onDetail(e: any) {
     const { dataset } = e.currentTarget
-    console.log(e)
     wx.navigateTo({
       url: '../orders/order-result?orderNo=' + dataset.orderno
     })