Browse Source

修改样式

lex-xin 4 months ago
parent
commit
427addf5b8

+ 3 - 3
miniprogram/components/apply-refound/apply-refound.wxml

@@ -1,8 +1,8 @@
 <!--components/apply-refound/apply-refound.wxml-->
 <view class="useRefound-pop" wx:if="{{ refoundStatus }}">
-    <view class="useRefound-mask"></view>
+    <view class="useRefound-mask" bind:tap="onRefoundClose"></view>
     <view class="useRefound-container">
-      <image bind:tap="onRefoundClose" class="icon-close" src="./images/icon-close.png"></image>
+      <image catch:tap="onRefoundClose" class="icon-close" src="./images/icon-close.png"></image>
       <view class="use-title">申请退款</view>
       <view class="use-form__input">
         <view class="title"><text class="red">*</text>退款原因</view>
@@ -16,7 +16,7 @@
         <input placeholder="请输入手机号码" type="number" maxlength="11" bindinput="phoneInput" value="{{ refoundPhone }}"></input>
       </view>
       <view class="btnSection">
-        <button type="primary" bind:tap="onRefound">提交申请</button>
+        <button type="primary" catch:tap="onRefound">提交申请</button>
       </view>
     </view>
   </view>

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


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

@@ -31,17 +31,17 @@
     left: 50%;
     text-align: center;
     .iconImg {
-      width: 578rpx;
-      height: 686rpx;
+      width: 630rpx;
+      height: 972rpx;
     }
 
     .iconClose {
       position: absolute;
       z-index: 1;
       top: 34rpx;
-      right: 16rpx;
-      width: 44rpx;
-      height: 44rpx;
+      right: 36rpx;
+      width: 38rpx;
+      height: 38rpx;
     }
   }
 }

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

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

+ 3 - 3
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="https://oss.dayaedu.com/ktyq/1732603212303.png" data-src="https://oss.dayaedu.com/ktyq/1732603212303.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 - 2
miniprogram/pages/index/index.ts

@@ -166,7 +166,6 @@ Page({
       let info = JSON.stringify({
         ...that.data.selected
       });
-      console.log(that.data.selected, "that.data.selected")
       info = encodeURIComponent(info);
       wx.navigateTo({
         url: `../orders/order-detail?orderInfo=${info}`,
@@ -174,7 +173,7 @@ Page({
       that.setData({
         popupShow: false
       })
-    }, 500)()
+    }, 300)()
   },
   onPreivewBannerImg(e: { currentTarget: { dataset: any } }) {
     wx.previewImage({

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

@@ -42,6 +42,7 @@ page {
       font-size: 26rpx;
       color: rgba(255,255,255,0.7);
       line-height: 34rpx;
+      height: 34rpx;
       border-radius: 24rpx;
       border: 1rpx solid rgba(255,255,255,0.7);
       padding: 4rpx 12rpx;
@@ -164,6 +165,8 @@ page {
   padding-top: 60rpx;
   padding-bottom: 32rpx;
   text-align: center;
+  display: flex;
+  flex-direction: column;
   .qrcode-wrap {
     position: relative;
     margin: 0 auto;

+ 6 - 4
miniprogram/pages/orders/order-result.ts

@@ -12,7 +12,7 @@ Page({
     statusList: {
       WAIT_PAY: {
         logo: './images/ing.png',
-        title: '待付款',
+        title: '待付款',
         content: '为了确保您的订单顺利进行,请尽快完成支付'
       },
       PAID: {
@@ -37,13 +37,14 @@ Page({
       },
       REFUNDED: {
         logo: './images/refounded.png',
-        title: '退款',
+        title: '退款成功',
         content: '您的订单已成功退款,感谢您的耐心等待'
       }
     },
     timerCount: 0,
     timer: null as any,
     goodsInfo: {} as any,
+    tabIdx: 0, // 当前是从哪个tab来的
     orderNo: "" as string,
     showCanvas: false, // 是否显示二维码
     canvasImg: "" as string,
@@ -56,7 +57,8 @@ Page({
   onLoad(options: any) {
     if (options.orderNo) {
       this.setData({
-        orderNo: options.orderNo
+        orderNo: options.orderNo,
+        tabIdx: options.tabIdx,
       }, () => {
         this.getDetail(this.onTimeout)
       });
@@ -215,7 +217,7 @@ Page({
       const {data} = await api_userPaymentCancelRefund(this.data.goodsInfo.refundOrderId)
       // console.log(data, 'data')
       if(data.code == 200) {
-        wx.showToast({ title: '取消退款成功', icon: 'none' })
+        wx.showToast({ title: '你已成功取消退款', icon: 'none' })
         // setTimeout(() => {
         //   wx.navigateBack({
         //     delta: 1

+ 7 - 5
miniprogram/pages/orders/order-result.wxml

@@ -8,7 +8,7 @@
         <view class="status">
           <!-- <image src="{{ statusList[status].logo }}"></image> -->
           <text>{{ statusList[status].title }}</text>
-          <view class="btn-refound" bind:tap="useRefound"  wx:if="{{ goodsInfo.wechatStatus == 'WAIT_USE' }}">申请退款</view>
+          <view class="btn-refound" bind:tap="useRefound"  wx:if="{{ goodsInfo.wechatStatus == 'WAIT_USE' && tabIdx == 5 }}">申请退款</view>
         </view>
         <view class="tips" wx:if="{{ statusList[status].content }}">{{ statusList[status].content }}</view>
       </view>
@@ -35,8 +35,10 @@
             <image src="{{canvasImg}}" mode="scaleToFill" class='my_draw_canvas' style="opacity: {{ goodsInfo.wechatStatus == 'PAID' ? 0.4 : 1 }};" show-menu-by-longpress="true"></image>
             <view class="loader" wx:if="{{!canvasImg}}"></view>
           </view>
-          <view class="qrcode-text" wx:if="{{goodsInfo.wechatStatus == 'WAIT_USE'}}">请扫描二维码激活使用</view>
-          <view class="qrcode-text used" wx:else>二维码已使用</view>
+          <view>
+            <view class="qrcode-text" wx:if="{{goodsInfo.wechatStatus == 'WAIT_USE'}}">请扫描二维码激活使用</view>
+            <view class="qrcode-text used" wx:else>二维码已使用</view>
+          </view>
         </view>
       </view>
 
@@ -49,7 +51,7 @@
             <view class="copy" bind:tap="onCopy" data-orderno="{{goodsInfo.orderNo}}">复制</view></view>
         </view>
         <view class="order-item">
-          <view class="title">下单时间</view>
+          <view class="title">创建时间</view>
           <view class="value">{{ goodsInfo.createTime }}</view>
         </view>
       </view>
@@ -63,7 +65,7 @@
           <view class="title">退款金额</view>
           <view class="value red">¥{{ goodsInfo.refundAmount }}</view>
         </view>
-        <view class="order-item" wx:if="{{goodsInfo.wechatStatus == 'REFUNDING'}}">
+        <view class="order-item" wx:if="{{goodsInfo.wechatStatus == 'REFUNDED'}}">
           <view class="title">退款路径</view>
           <view class="value">{{ goodsInfo.refundStyleStr }}</view>
         </view>

+ 32 - 20
miniprogram/pages/orders/orders.ts

@@ -43,6 +43,7 @@ Page({
     recordList: [],
     maxPage: 1, // 总分页数
     refoundStatus: false,
+    cancelRefoundStatus: true,
     goodsInfo: {}, // 选中的数据
   },
 
@@ -129,12 +130,12 @@ Page({
   formatOrderStatus(status: string) {
     // 订单状态 WAIT_PAY:待付款,  WAIT_USE:待使用, SUCCESS:已完成, CLOSE:已取消
     const template: any = {
-      WAIT_PAY: '待付款',
-      WAIT_USE: '待使用',
-      PAID: '交易完成',
-      CLOSED: '交易取消',
-      REFUNDING: '售后中',
-      REFUNDED: '售后成功'
+      WAIT_PAY: '待付款',
+      WAIT_USE: '待使用',
+      PAID: '完成',
+      CLOSED: '取消',
+      REFUNDING: '退款中',
+      REFUNDED: '退款成功'
     }
     return template[status]
   },
@@ -205,7 +206,7 @@ Page({
       this.onSubmit({orderNo: dataset.orderno})
     } else {
       wx.navigateTo({
-        url: '../orders/order-result?orderNo=' + dataset.orderno
+        url: `../orders/order-result?orderNo=${dataset.orderno}&tabIdx=${this.data.tabIdx}`
       })
     }
   },
@@ -311,17 +312,25 @@ Page({
     }
 
     if(item.wechatStatus === "REFUNDING") {
-      try {
-        const refundOrderId = item.refundOrderId
-        const {data} = await api_userPaymentCancelRefund(refundOrderId)
-        console.log(data, 'data')
-        if(data.code == 200) {
-          wx.showToast({ title: '取消退款成功', icon: 'none' })
-          this.onRefoundComfirm()
-        } else {
-          wx.showToast({ title: data.message, icon: 'none' })
-        }
-      } catch {}
+      this.setData({
+        cancelRefoundStatus: true
+      }, async () => {
+        try {
+          const refundOrderId = item.refundOrderId
+          const {data} = await api_userPaymentCancelRefund(refundOrderId)
+          console.log(data, 'data')
+          if(data.code == 200) {
+            wx.showToast({ title: '你已成功取消退款', icon: 'none' })
+            this.onRefoundComfirm()
+          } else {
+            wx.showToast({ title: data.message, icon: 'none' })
+            this.setData({
+              cancelRefoundStatus: false
+            })
+          }
+        } catch {}
+      })
+      
     } else {
       const { orderNo, studentPaymentOrderDetails } = item
       const goodsInfo: any = {
@@ -339,25 +348,28 @@ Page({
       }
       this.setData({
         goodsInfo,
+        cancelRefoundStatus: true,
         refoundStatus: true
       })
     }
   },
   changeRefoundStatus(e: {detail: any}) {
     this.setData({
-      refoundStatus: e.detail
+      refoundStatus: e.detail,
+      cancelRefoundStatus: false,
     })
   },
   onRefoundComfirm() {
     const that = this
     this.setData({
-      refoundStatus: false
+      refoundStatus: false,
     })
     setTimeout(() => {
       that.setData({
         page: 1,
         maxPage: 1,
         recordList: [],
+        cancelRefoundStatus: false,
       }, () => {
         this.getList()
       })

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

@@ -13,7 +13,7 @@
         <view class="list-item-group">
           <view class="list-item" wx:for="{{recordList}}" wx:key="index" data-orderno="{{item.orderNo}}" data-wechatstatus="{{item.wechatStatus}}" bind:tap="onDetail">
             <view class="item-top">
-              <view class="item-mid">订单号:{{ item.orderNo }}</view>
+              <view class="item-mid">订单号:{{ item.orderNo }}</view>
               <text class="{{ item.wechatStatus == 'WAIT_PAY' || item.wechatStatus == 'WAIT_USE' ? 'red' : '' }}">{{ item.statusName }}</text>
             </view>
             <view class="item-content" wx:for="{{item.studentPaymentOrderDetails}}" wx:key="studentIndex">
@@ -37,8 +37,8 @@
                 <!-- 订单金额:<text class="price-first">¥ </text><text class="price">{{item.amount}}</text> -->
               </view>
               <block wx:if="{{ item.wechatStatus == 'REFUNDING' || (item.wechatStatus == 'WAIT_USE' && tabIdx == 5) }}" wx:key="block">
-                <button wx:if="{{ item.wechatStatus == 'REFUNDING' }}" type="primary" wx:if="{{ item.wechatStatus == 'REFUNDING' }}"  catch:tap="onRefounded" data-id="{{item.id}}">取消退款</button>
-                <button wx:else type="primary" catch:tap="onRefounded" data-id="{{item.id}}">申请退款</button>
+                <button wx:if="{{ item.wechatStatus == 'REFUNDING' }}" type="primary" wx:if="{{ item.wechatStatus == 'REFUNDING' }}"  catch:tap="onRefounded" data-id="{{item.id}}" disabled="{{ cancelRefoundStatus }}">取消退款</button>
+                <button wx:else type="primary" catch:tap="onRefounded" data-id="{{item.id}}" disabled="{{ cancelRefoundStatus }}">申请退款</button>
               </block>
               <block wx:else wx:key="block">
                 <button class="sure" type="primary" wx:if="{{ item.wechatStatus == 'WAIT_PAY' }}"  catch:tap="onPay" data-id="{{item.id}}">继续支付</button>