Browse Source

添加购买

lex-xin 5 months ago
parent
commit
7e298c1717

+ 1 - 1
miniprogram/config.ts

@@ -1,4 +1,4 @@
-const environmentVariable = "test";
+const environmentVariable = "dev";
 const apiUrlInfo = {
   dev: "https://dev.kt.colexiu.com",
   test: "https://test.kt.colexiu.com",

+ 44 - 36
miniprogram/pages/address/index.ts

@@ -33,7 +33,13 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad() {
+  onLoad(options: any) {
+    if (options.receiveAddress) {
+      this.setData({
+        id: options.receiveAddress
+      })
+    }
+
     this.getAddress()
     this.getAreas()
   },
@@ -157,7 +163,16 @@ Page({
   },
   onAddressAfterLeave() {
     this.setData({
-      addressAfterLeave: false
+      addressAfterLeave: true,
+      name: '',
+      phoneNumber: '',
+      detailAddress: '',
+      cityCode: 0,
+      cityName: "",
+      provinceCode: 0,
+      provinceName: "",
+      regionCode: '',
+      regionName: "",
     })
   },
 
@@ -196,30 +211,11 @@ Page({
   /** 选择地址 */
   onSelectAddress(e: any) {
     const id = e.currentTarget.dataset.id
-    const addressInfo = this.data.addressList.find((item: any) => item.id === id)
-
-    // this.setData({
-    // receiveAddress: addressInfo.id,
-    // 'receiveAddressInfo.addressDetail': addressInfo.provinceName + addressInfo.cityName + addressInfo.regionName + addressInfo.detailAddress,
-    // 'receiveAddressInfo.name': addressInfo.name,
-    // 'receiveAddressInfo.phoneNumber': addressInfo.phoneNumber,
-    // addressListShow: false
-    // })
-
-    const pages = getCurrentPages();
-    const prevPage = pages[pages.length - 2]; // 获取上一个页面实例
-    prevPage?.setData({
-      backParams: {
-        receiveAddress: addressInfo.id,
-        receiveAddressInfo: {
-          addressDetail: addressInfo.provinceName + addressInfo.cityName + addressInfo.regionName + addressInfo.detailAddress,
-          name: addressInfo.name,
-          phoneNumber: addressInfo.phoneNumber
-        }
-      }
-    });
-
-    wx.navigateBack()
+    this.setData({
+      id
+    }, () => {
+      wx.navigateBack()
+    })
   },
   /** Dialog 确定 */
   async onDialogConfirm() {
@@ -230,20 +226,32 @@ Page({
 
       this.getAddress()
       // 如果删除的是已经选中的地址,则需要重置数据
-      // if (this.data.selectAddressId === this.data.receiveAddress) {
-      //   this.setData({
-      //     selectAddressId: '',
-      //     receiveAddress: '',
-      //     'receiveAddressInfo.name': '',
-      //     'receiveAddressInfo.phoneNumber': '',
-      //     'receiveAddressInfo.addressDetail': ''
-      //   })
-      // }
+      if (this.data.selectAddressId === this.data.id) {
+        this.setData({
+          id: ''
+        })
+      }
       this.onDialogClose()
     } catch {
-
     }
   },
+  onUnload() {
+    console.log('onUnload')
+    const id = this.data.id
+    const addressInfo = this.data.addressList.find((item: any) => item.id === id)
+    const pages = getCurrentPages();
+    const prevPage = pages[pages.length - 2]; // 获取上一个页面实例
+    prevPage?.setData({
+      backParams: {
+        receiveAddress: addressInfo?.id || '',
+        receiveAddressInfo: {
+          addressDetail: addressInfo?.id ? addressInfo.provinceName + addressInfo.cityName + addressInfo.regionName + addressInfo.detailAddress : '',
+          name: addressInfo?.name,
+          phoneNumber: addressInfo?.phoneNumber
+        }
+      }
+    });
+  },
   /** 创建/修改收货地址 */
   async onOperationAddress() {
     const addressForm = this.data

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

@@ -8,7 +8,7 @@
         <view class="empty-text">暂无收货地址</view>
       </view>
       <view wx:for="{{ addressList }}" wx:key="index">
-        <view class="address-item {{ item.id === receiveAddress ? 'active' : '' }}" bind:tap="onSelectAddress" data-id="{{ item.id }}">
+        <view class="address-item {{ item.id === id ? 'active' : '' }}" bind:tap="onSelectAddress" data-id="{{ item.id }}">
           <view class="item-title">
             {{ item.provinceName }}{{ item.cityName }}{{ item.regionName }}
           </view>

+ 15 - 2
miniprogram/pages/index/index.ts

@@ -213,7 +213,14 @@ Page({
         selected,
         smallGoods,
         selectInstrumentId: '',
-        selectedInstrument: {}
+        selectedInstrument: {},
+
+        userBeneficiaryId: '',
+        userBeneficiaryInfo: {
+          name: '',
+          phoneNumber: '',
+          schoolInfo: ''
+        }
       }, () => {
         this.onFormatGoods()
       })
@@ -373,7 +380,13 @@ Page({
   },
   onClose() {
     this.setData({
-      popupShow: false
+      popupShow: false,
+      userBeneficiaryId: '',
+      userBeneficiaryInfo: {
+        name: '',
+        phoneNumber: '',
+        schoolInfo: ''
+      }
     })
   },
   onSubmit() {

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

@@ -160,7 +160,6 @@
               </view>
             </view>
           </van-popup>
-
         </view>
 
         <!-- <service popShow="{{ showService }}" bind:changePop="changePop"></service> -->

BIN
miniprogram/pages/orders/images/icon-close1.png


BIN
miniprogram/pages/orders/images/icon-home.png


BIN
miniprogram/pages/orders/images/icon-order-active.png


+ 5 - 0
miniprogram/pages/orders/order-detail.json

@@ -1,6 +1,11 @@
 {
   "usingComponents": {
     "navigation-bar": "/components/navigation-bar/navigation-bar",
+    "van-popup": "@vant/weapp/popup/index",
+    "van-area": "@vant/weapp/area/index",
+    "van-cell": "@vant/weapp/cell/index",
+    "van-cell-group": "@vant/weapp/cell-group/index",
+    "van-field": "@vant/weapp/field/index",
     "service": "/components/service/service"
   }
 }

+ 105 - 0
miniprogram/pages/orders/order-detail.less

@@ -151,6 +151,7 @@ page {
 
     .goods-current-price {
       font-weight: bold;
+      font-family: DINAlternate, DINAlternate;
       font-size: 28rpx;
       color: #131415;
       line-height: 48rpx;
@@ -487,4 +488,108 @@ page {
     color: #FFFFFF;
     flex-shrink: 0;
   }
+}
+
+
+.van-picker__toolbar,
+.toolbar-top {
+  margin: 0 40rpx !important;
+  padding: 0 14rpx !important;
+  border-bottom: 2rpx solid #F2F2F2;
+  height: auto !important;
+  line-height: normal !important;
+}
+
+.van-picker__cancel,
+.van-picker__confirm,
+.toolbar-cancel,
+toolbar-confirm {
+  font-size: 32rpx !important;
+  padding: 28rpx 0 !important;
+  color: #777777 !important;
+}
+
+.van-picker__confirm,
+.toolbar-confirm {
+  color: #FE2451 !important;
+}
+
+.toolbar-top {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+
+.addressContainer {
+  background: linear-gradient(180deg, #FFDEE7 0%, #FFFFFF 12%, #FFFFFF 100%);
+  border-radius: 32rpx 32rpx 0rpx 0rpx;
+  height: 928rpx;
+  display: flex;
+  flex-direction: column;
+
+  .icon-close {
+    position: absolute;
+    z-index: 2;
+    top: 28rpx;
+    right: 12rpx;
+    padding: 20rpx;
+    width: 30rpx;
+    height: 30rpx;
+  }
+
+  .pop-address-title {
+    position: relative;
+    z-index: 1;
+    text-align: center;
+    padding-top: 36rpx;
+    padding-bottom: 20rpx;
+    font-weight: 600;
+    font-size: 36rpx;
+    color: #131415;
+    line-height: 50rpx;
+  }
+
+  .cell-group {
+    flex: 1 auto;
+
+    .van-cell {
+      padding: 36rpx 40rpx;
+      font-size: 30rpx;
+    }
+
+    .van-field__label {
+      color: #666666;
+    }
+
+    .van-icon-arrow {
+      color: #BFBFBF;
+    }
+
+    .textarea {
+      max-height: 72rpx;
+    }
+  }
+
+  .van-picker-column__item--selected {
+    font-weight: 600;
+    font-size: 32rpx;
+    color: #6D4718 !important;
+  }
+
+  .pop-btn-group {
+    padding: 32rpx 32rpx 58rpx;
+  }
+
+  .submit-btn {
+    width: 100% !important;
+    margin: 0 !important;
+    padding: 0 !important;
+    line-height: 88rpx;
+    background: linear-gradient(270deg, #FF204B 0%, #FE5B71 100%);
+    border-radius: 88rpx;
+    font-weight: 500;
+    font-size: 32rpx;
+    color: #fff;
+  }
 }

+ 238 - 5
miniprogram/pages/orders/order-detail.ts

@@ -1,5 +1,6 @@
 // pages/orders/order-detail.ts
 import { api_executeOrder, api_executePayment, api_queryByParamName, api_userPaymentOrderUnpaid } from "../../api/login";
+import { api_sysAreaQueryAllProvince, api_userReceiveAddressPage, api_userReceiveAddressSave } from "../../api/new";
 import { formatPrice } from "../../utils/util";
 
 // 获取应用实例
@@ -18,6 +19,7 @@ Page({
       },
     },
     backParams: null,
+    addressList: [] as any,
     goodsInfo: {} as any,
     hasInstrument: false, // 是否有乐器
     receiveAddress: '', // 选择的地址信息
@@ -30,6 +32,24 @@ Page({
     paymentType: null as any, // 支付类型
     paymentChannel: null as any,
     showService: false,
+
+    showArea: false,
+    areaList: [] as any,
+    currentValues: [] as any,
+    addressShow: false,
+    addressAfterLeave: false,
+
+    // 添加地址表单信息
+    id: "",
+    name: '',
+    phoneNumber: '',
+    detailAddress: '',
+    cityCode: 0,
+    cityName: "",
+    provinceCode: 0,
+    provinceName: "",
+    regionCode: '',
+    regionName: "",
   },
 
   /**
@@ -96,7 +116,7 @@ Page({
   },
   // 格式化类型
   formatPeriod(num: number, type: string) {
-    if(!type) return ''
+    if (!type) return ''
     const template: any = {
       DAY: "天",
       MONTH: "个月",
@@ -127,9 +147,14 @@ Page({
   },
   /** 添加收货地址 */
   onSelectAddress() {
-    wx.navigateTo({
-      url: `../address/index?receiveAddress=${this.data.receiveAddress}`,
-    })
+    console.log(this.data.addressList.length > 0, this.data.receiveAddress)
+    if (this.data.addressList.length > 0 || this.data.receiveAddress) {
+      wx.navigateTo({
+        url: `../address/index?receiveAddress=${this.data.receiveAddress}`,
+      })
+    } else {
+      this.onShowAddress()
+    }
   },
   onPayError(message?: string) {
     wx.hideLoading()
@@ -197,7 +222,7 @@ Page({
             title: data.message,
             icon: 'none'
           })
-        }  else if([5435, 5436, 5437, 5439, 5442, 5443, 5408, 5427, 5432].includes(data.code)) {
+        } else if ([5435, 5436, 5437, 5439, 5442, 5443, 5408, 5427, 5432].includes(data.code)) {
           wx.hideLoading()
           wx.showToast({
             title: data.message,
@@ -231,6 +256,15 @@ Page({
         wx.hideLoading()
         if (res.data.code === 200) {
           this.onPay(paymentType, res.data.data.reqParams, orderNo)
+        } else if ([5435, 5436, 5437, 5439, 5442, 5443, 5408, 5427, 5432].includes(res.data.code)) {
+          wx.hideLoading()
+          wx.showToast({
+            title: res.data.message,
+            icon: 'none'
+          })
+          setTimeout(() => {
+            wx.navigateBack()
+          }, 1000);
         } else {
           this.onPayError(res.data.message)
         }
@@ -301,6 +335,7 @@ Page({
         backParams: null // 清空参数
       })
     }
+    this.getAddress()
   },
 
   /**
@@ -331,6 +366,204 @@ Page({
 
   },
 
+  /** 地址列表 */
+  async getAddress() {
+    try {
+      const { data } = await api_userReceiveAddressPage({ page: 1, rows: -1 })
+      this.setData({
+        addressList: data.data.rows || []
+      }, () => {
+        if (this.data.addressList.length <= 0) {
+          this.getAreas()
+        }
+      })
+    } catch {
+      // 
+    }
+  },
+  /** 获取省市区 */
+  async getAreas() {
+    try {
+      const { data } = await api_sysAreaQueryAllProvince({})
+      const areaList: any = this.formateArea(data.data)
+      const currentValues = []
+      if (areaList?.province_list) {
+        // 获取第一个键值对
+        const firstKey = Object.keys(areaList?.province_list)[0];
+        // 通过键获取值
+        const firstValue = areaList?.province_list[firstKey];
+        currentValues.push({
+          code: firstKey,
+          name: firstValue
+        })
+      }
+      if (areaList?.city_list) {
+        // 获取第一个键值对
+        const firstKey = Object.keys(areaList?.city_list)[0];
+        // 通过键获取值
+        const firstValue = areaList?.city_list[firstKey];
+        currentValues.push({
+          code: firstKey,
+          name: firstValue
+        })
+      }
+      if (areaList?.county_list) {
+        // 获取第一个键值对
+        const firstKey = Object.keys(areaList?.county_list)[0];
+        // 通过键获取值
+        const firstValue = areaList?.county_list[firstKey];
+        currentValues.push({
+          code: firstKey,
+          name: firstValue
+        })
+      }
+      console.log(areaList,
+        currentValues)
+      this.setData({
+        areaList,
+        currentValues
+      })
+    } catch {
+      // 
+    }
+  },
+  formateArea(area: any[]) {
+    const province_list: { [_: string]: string } = {};
+    const city_list: { [_: string]: string } = {};
+    const county_list: { [_: string]: string } = {};
+    area.forEach((item: any) => {
+      province_list[item.code] = item.name;
+    });
+    area.forEach((item: any) => {
+      item.areas && item.areas.forEach((city: any) => {
+        city_list[city.code] = city.name;
+      });
+    });
+    area.forEach((item: any) => {
+      item.areas && item.areas.forEach((city: any) => {
+        city.areas && city.areas.forEach((county: any) => {
+          county_list[county.code] = county.name;
+        });
+      });
+    });
+    return {
+      province_list,
+      city_list,
+      county_list
+    };
+  },
+  /** 显示选择地区 */
+  async onShowAreaList() {
+    this.setData({
+      showArea: true
+    })
+  },
+  /** 关闭选择地区 */
+  onCloseAreaList() {
+    this.setData({
+      showArea: false
+    })
+  },
+  /** 确定选择地区 */
+  submitArea(e: any) {
+    const selectedOptions: any = e.detail.values
+    this.setData({
+      provinceCode: selectedOptions[0].code,
+      cityCode: selectedOptions[1].code,
+      regionCode: selectedOptions[2].code,
+      provinceName: selectedOptions[0].name,
+      cityName: selectedOptions[1].name,
+      regionName: selectedOptions[2].name,
+      showArea: false,
+    })
+  },
+  onShowAddress() {
+    this.setData({
+      addressAfterLeave: false,
+      addressShow: true
+    })
+  },
+  onCloseAddress() {
+    this.setData({
+      addressShow: false
+    })
+  },
+  onAddressAfterLeave() {
+    this.setData({
+      addressAfterLeave: true,
+      name: '',
+      phoneNumber: '',
+      detailAddress: '',
+      cityCode: 0,
+      cityName: "",
+      provinceCode: 0,
+      provinceName: "",
+      regionCode: '',
+      regionName: "",
+    })
+  },
+  /** 创建/修改收货地址 */
+  async onOperationAddress() {
+    const addressForm = this.data
+    try {
+      if (!addressForm.name) {
+        wx.showToast({
+          title: '请输入收货人姓名',
+          icon: "none"
+        })
+        return
+      }
+      if (!addressForm.phoneNumber || !/^1[3456789]\d{9}$/.test(addressForm.phoneNumber)) {
+        wx.showToast({
+          title: '请输入正确的手机号码',
+          icon: "none"
+        })
+        return
+      }
+      if (!addressForm.provinceCode || !addressForm.cityCode || !addressForm.regionCode) {
+        wx.showToast({
+          title: '请选择地区',
+          icon: "none"
+        })
+        return
+      }
+      if (!addressForm.detailAddress) {
+        wx.showToast({
+          title: '请输入详细地址',
+          icon: "none"
+        })
+        return
+      }
+      const params = {
+        name: addressForm.name,
+        phoneNumber: addressForm.phoneNumber,
+        province: addressForm.provinceCode,
+        city: addressForm.cityCode,
+        region: addressForm.regionCode,
+        detailAddress: addressForm.detailAddress
+      }
+      const { data } = await api_userReceiveAddressSave({
+        ...params
+      })
+      wx.showToast({
+        title: '添加成功',
+        icon: 'none'
+      })
+      this.setData({
+        receiveAddress: data.data, // 选择的地址信息
+        receiveAddressInfo: {
+          addressDetail: addressForm.provinceName + addressForm.cityName + addressForm.regionName + addressForm.detailAddress,
+          name: addressForm.name,
+          phoneNumber: addressForm.phoneNumber
+        }
+      })
+      this.onCloseAddress()
+    } catch (e) {
+      // 
+      console.log(e, '1212')
+    }
+  },
+
   /**
    * 用户点击右上角分享
    */

+ 25 - 0
miniprogram/pages/orders/order-detail.wxml

@@ -128,5 +128,30 @@
     </view>
   </view>
 
+
+  <van-popup show="{{ addressShow }}" safe-area-inset-bottom="{{false}}" lock-scroll="{{true}}" bind:close="onCloseAddress" position="bottom" round z-index="101" bind:after-leave="onAddressAfterLeave">
+    <view class="addressContainer" wx:if="{{ !addressAfterLeave }}">
+      <image src="./images/icon-close1.png" class="icon-close" bind:tap="onCloseAddress" />
+      <view class="pop-address-title">
+        {{ id ? '修改收货地址' : '新建收货地址' }}
+      </view>
+
+      <van-cell-group border="{{ false }}" class="cell-group">
+        <van-field model:value="{{ name }}" label="收货人" placeholder="请填写收货人姓名" placeholder-style="color: #bbb" />
+        <van-field model:value="{{ phoneNumber }}" label="电话号码" type="number" placeholder-style="color: #bbb" placeholder="请输入手机号码" maxlength="11" />
+        <van-field value="{{ provinceName ? provinceName + '/' + cityName + '/' + regionName : '' }}" label="选择地区" placeholder-style="color: #bbb" placeholder="请选择省/市/区" readonly is-link bind:tap="onShowAreaList" />
+        <van-field model:value="{{ detailAddress }}" label="详细地址" type="textarea" placeholder-style="color: #bbb" placeholder="请填写小区/楼号/单元/门牌号" input-class="textarea" autosize />
+      </van-cell-group>
+
+      <view class="pop-btn-group">
+        <button class="submit-btn" bind:tap="onOperationAddress">确认</button>
+      </view>
+    </view>
+  </van-popup>
+
+  <!-- 地区 -->
+  <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> -->
 </view>

+ 130 - 5
miniprogram/pages/orders/order-result.less

@@ -61,6 +61,9 @@ page {
 .item-content {
   display: flex;
   width: 100%;
+  &+.item-content {
+    padding-top: 40rpx;
+  }
   .goods-icon {
     width: 160rpx;
     height: 160rpx;
@@ -86,18 +89,22 @@ page {
       overflow: hidden;
       font-weight: 600;
       font-size: 30rpx;
+      color: #131415;
+      line-height: 50rpx;
       text-overflow: ellipsis;
-      max-width: 310rpx;
+      max-width: 280rpx;
     }
+
     .goods-price {
       flex-shrink: 0;
       font-family: DINAlternate, DINAlternate;
       font-weight: bold;
-      font-size: 30rpx;
+      font-size: 28rpx;
       color: #131415;
       line-height: 48rpx;
-      text {
-        padding-right: 4rpx;
+       text {
+        font-size: 32rpx;
+        padding-left: 4rpx;
       }
     }
   }
@@ -116,13 +123,131 @@ page {
       padding: 0 12rpx;
     }
     .goods-num {
-      font-size: 28rpx;
+      font-size: 26rpx;
       color: #777777;
       line-height: 36rpx;
     }
   }
 }
 
+
+.goodsInfos {
+  margin-top: 30rpx;
+  // border-top: 2rpx solid #F2F2F2;
+
+  .qrcode-line {
+    position: relative;
+    // background: linear-gradient(to right, transparent 50%, rgba(219, 219, 219, 1) 50%) repeat-x; // 设置水平方向的线性渐变,透明与半透明色交替,模拟虚线线段
+    // background-size: 10px 1px; // 设置背景大小,控制虚线的线段长度和粗细,这里线段长度为10px,粗细为1px
+    background-color: #F2F2F2;
+    height: 2rpx; // 元素高度,可根据实际需求调整,用于展示虚线效果的高度范围
+    margin: 24rpx 0 28rpx;
+
+    // &::before,
+    // &::after {
+    //   content: '';
+    //   position: absolute;
+    //   top: -20rpx;
+    //   display: block;
+    //   width: 40rpx;
+    //   height: 40rpx;
+    //   background-color: #F4F4F4;
+    //   border-radius: 50%;
+    // }
+
+    // &::before {
+    //   left: -50rpx;
+    // }
+
+    // &::after {
+    //   right: -50rpx;
+    // }
+  }
+}
+
+.goodsInfo-item {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding-top: 28rpx;
+
+  &:first-child {
+    padding-top: 0;
+    .title {
+      color: #777;
+    }
+  }
+
+  .title {
+    font-weight: 400;
+    font-size: 28rpx;
+    color: #FE2451;
+    line-height: 40rpx;
+  }
+
+  .goods-price {
+    flex-shrink: 0;
+    font-family: DINAlternate, DINAlternate;
+    font-weight: bold;
+    color: #131415;
+    line-height: 48rpx;
+
+    .stuff {
+      font-size: 28rpx;
+      padding-right: 4rpx;
+    }
+
+    .priceZ {
+      font-size: 32rpx;
+    }
+
+    .priceF {
+      font-size: 24rpx;
+    }
+  }
+
+  .calc-price {
+    // font-weight: bold;
+    // font-size: 28rpx;
+    color: #FF0047;
+    // line-height: 32rpx;
+  }
+}
+
+.goodsInfo-count {
+  display: flex;
+  justify-content: flex-end;
+
+  .goods-price {
+    flex-shrink: 0;
+    font-family: DINAlternate, DINAlternate;
+    font-weight: bold;
+    color: #131415;
+    line-height: 48rpx;
+
+    .before {
+      font-weight: 400;
+      font-size: 24rpx;
+      color: #777777;
+      vertical-align: middle;
+    }
+
+    .stuff {
+      font-size: 38rpx;
+      padding-right: 4rpx;
+    }
+
+    .priceZ {
+      font-size: 40rpx;
+      line-height: 1;
+    }
+
+    .priceF {
+      font-size: 24rpx;
+    }
+  }
+}
+
 /* HTML: <div class="loader"></div> */
 .loader {
   position: absolute;

+ 15 - 82
miniprogram/pages/orders/order-result.ts

@@ -1,6 +1,7 @@
 // pages/orders/order-detail.ts
 import drawQrcode from "../../utils/weapp.qrcode.esm";
 import { api_userPaymentCancelRefund, api_userPaymentOrderDetail, api_userPaymentOrderRefundPayment } from "../../api/login";
+import { formatPrice } from "../../utils/util";
 
 // 获取应用实例
 Page({
@@ -79,29 +80,20 @@ Page({
         goodsInfos.forEach((item: any) => {
           tempGoods.push({
             ...item,
-            shortUrl: item.activationCodeInfo.shortUrl,
-            code: item.activationCodeInfo.activationCode,
-            originalPrice: this.formatPrice(item.paymentCashAmount, 'ALL'),
-            typeName: this.formatPeriod(item.activationCodeInfo?.times || 1, item.activationCodeInfo.type)
+            // shortUrl: item.activationCodeInfo.shortUrl,
+            // code: item.activationCodeInfo.activationCode,
+            originalPrice: formatPrice(item.paymentCashAmount, 'ALL'),
+            // typeName: this.formatPeriod(item.activationCodeInfo?.times || 1, item.activationCodeInfo.type)
           })
         })
-        let refundStyleStr = ''
-        if(result.refundStyle === 'TURN_BACK') {
-          refundStyleStr = '原路返回'
-        } else if(result.refundStyle === 'OFFLINE') {
-          refundStyleStr = '线下'
-        }
+        
         const firstGoods = tempGoods[0]
         const goodsInfo = {
           orderNo: result.orderNo,
           createTime: result.createTime,
           wechatStatus: result.wechatStatus,
           goods: tempGoods,
-          code: firstGoods.code || '',
-          refundOrderId: result.refundOrderId,
-          refundTime: result.refundTime,
-          refundAmount: this.formatPrice(result.refundAmount || 0, 'ALL'),
-          refundStyleStr
+          code: firstGoods.code || ''
         }
         this.setData({
           goodsInfo,
@@ -109,42 +101,23 @@ Page({
         }, () => {
           callback && typeof callback === 'function' && callback()
         })
-        if(result.wechatStatus != 'CLOSED' || result.wechatStatus != 'WAIT_PAY') {
-          const firstGoods = tempGoods[0]
-          if(firstGoods?.shortUrl) {
-            this.setData({
-              showCanvas: true
-            }, () => {
-              this.createQrCode(firstGoods?.shortUrl, 'canvasCode')
-            })
-          }
-        }
       }
     } catch (error) {
       console.log(error, "error");
     }
   },
-  // 格式化价格
-  formatPrice(price: number, type?: string) {
-    const amountStr = price.toFixed(2)
-    const [integerPart, decimalPart] = amountStr.split('.');
-    if(type === 'ALL') {
-      return amountStr
-    }
-    return {
-      integerPart,
-      decimalPart
-    }
-  },
   // 格式化类型
   formatPeriod(num: number, type: string) {
+    if (!num || !type) {
+      return ''
+    }
     const template: any = {
-      DAY: "天卡",
-      MONTH: "月卡",
-      YEAR: "年"
+      DAY: "天",
+      MONTH: "个月",
+      YEAR: "年"
     }
-    if(type === "YEAR" && num >= 99) {
-      return '永久'
+    if (type === "YEAR" && num >= 99) {
+      return '永久'
     }
     return num + template[type]
   },
@@ -153,46 +126,6 @@ Page({
       url: '../index/index'
     })
   },
-  setCanvasSize: function () {
-    var size = {} as any;
-    try {
-      const res = wx.getWindowInfo()
-      var scale = 750 / 262; //不同屏幕下canvas的适配比例;设计稿是750宽
-      var width = res.windowWidth / scale;
-      var height = width; //canvas画布为正方形
-      size.w = width;
-      size.h = height;
-    } catch (e) {
-      // Do something when catch error
-      console.log("获取设备信息失败" + e);
-    }
-    return size;
-  },
-  createQrCode(content: any, canvasId: any) {
-    const size = this.setCanvasSize();
-    drawQrcode({
-      width: size.w,
-      height: size.h,
-      canvasId: canvasId,
-      text: content,
-      callback: () => {
-        // 安卓机上不准确,生成的二维码无法扫描,加延时解决
-        setTimeout(() => {
-          wx.canvasToTempFilePath(
-            {
-              canvasId: canvasId,
-              success: (res) => {
-                this.setData({
-                  canvasImg: res.tempFilePath,
-                });
-              },
-            },
-            this
-          );
-        }, 0);
-      },
-    });
-  },
   onTimeout() {
     // 轮询10次查询订单状态
     const goodsInfo = this.data.goodsInfo

+ 35 - 16
miniprogram/pages/orders/order-result.wxml

@@ -18,7 +18,7 @@
           <view class="goods-desc">
             <view class="goodsInfo">
               <view class="goods-name">{{ item.goodsName }}</view>
-              <view class="goods-price"><text>¥</text>{{ item.originalPrice }}</view>
+              <view class="goods-price">¥<text>{{item.originalPrice}}</text></view>
             </view>
             <view class="goods-type">
               <view class="goods-card">{{ item.typeName }}</view>
@@ -26,30 +26,49 @@
             </view>
           </view>
         </view>
-        <view class="qrcode-section" wx:if="{{ (goodsInfo.wechatStatus == 'PAID' || goodsInfo.wechatStatus == 'WAIT_USE') && showCanvas }}">
-          <view class="qrcode-wrap">
-            <!-- <canvas class='my_draw_canvas' data-type="image" canvas-id='canvasCode' id="canvasCode"></canvas> -->
-            <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="goodsInfos">
+          <view class="goodsInfo-item">
+            <text class="title">商品总额</text>
 
-            <view class="loader" wx:if="{{!canvasImg}}"></view>
+            <view class="goods-price">
+              <text class="stuff">¥</text>
+              <text class="priceZ">{{ goodsInfo.integerPart }}</text>
+              <text class="priceF">.{{ goodsInfo.decimalPart }}</text>
+            </view>
+          </view>
+
+          <view class="goodsInfo-item" wx:if="{{ goodsInfo.allOriginPrice > goodsInfo.allSalePrice }}">
+            <text class="title">惊喜优惠</text>
+
+            <!-- <view class="calc-price">-¥ {{ goodsInfo.allDiscountPrice }}</view> -->
+            <view class="goods-price calc-price">
+              <text class="stuff">¥</text>
+              <text class="priceZ">{{ goodsInfo.discountIntegerPart }}</text>
+              <text class="priceF">.{{ goodsInfo.discountDecimalPart }}</text>
+            </view>
           </view>
-          <view class="qrcode-text" wx:if="{{goodsInfo.wechatStatus == 'WAIT_USE'}}">扫描二维码或点击激活按钮使用</view>
-          <view class="qrcode-text used" wx:else>二维码已使用</view>
 
-          <view class="qrcode-btn--section" wx:if="{{goodsInfo.wechatStatus == 'WAIT_USE'}}">
-            <button class="download" disabled="{{ !canvasImg ? true : false }}" bind:tap="onDownload">下载二维码</button>
-            <button class="submit" disabled="{{ !canvasImg ? true : false }}"  bind:tap="onActivation" data-code="{{ goodsInfo.code }}">立即激活</button>
+          <view class="qrcode-line"></view>
+
+          <view class="goodsInfo-count">
+            <view class="goods-price">
+              <text class="before">共{{ goodsInfo.goodsList.length }}件:</text>
+              <text class="stuff">¥</text>
+              <text class="priceZ">{{ goodsInfo.integerPart }}</text>
+              <text class="priceF">.{{ goodsInfo.decimalPart }}</text>
+            </view>
           </view>
         </view>
       </view>
 
-      <canvas class='my_draw_canvas only_canvas' data-type="image" canvas-id='canvasCode' id="canvasCode"></canvas>
+      <!-- <canvas class='my_draw_canvas only_canvas' data-type="image" canvas-id='canvasCode' id="canvasCode"></canvas> -->
 
       <view class="order-time">
         <view class="order-item">
           <view class="title">订单号</view>
           <view class="value">{{ goodsInfo.orderNo }}
-            <view class="copy" bind:tap="onCopy" data-orderno="{{goodsInfo.orderNo}}">复制</view></view>
+            <view class="copy" bind:tap="onCopy" data-orderno="{{goodsInfo.orderNo}}">复制</view>
+          </view>
         </view>
         <view class="order-item">
           <view class="title">下单时间</view>
@@ -72,7 +91,7 @@
         </view>
       </view>
 
-      <view class="btn-refound" bind:tap="useRefound"  wx:if="{{ goodsInfo.wechatStatus == 'WAIT_USE' && tabIdx == 5 }}">申请退款</view>
+      <view class="btn-refound" bind:tap="useRefound" wx:if="{{ goodsInfo.wechatStatus == 'WAIT_USE' && tabIdx == 5 }}">申请退款</view>
     </view>
   </scroll-view>
 
@@ -83,8 +102,8 @@
     </view>
     <!-- <button type="primary" bind:tap="useRefound" wx:if="{{ goodsInfo.wechatStatus == 'WAIT_USE' }}">申请退款</button>
     <block wx:else> -->
-      <button type="primary" bind:tap="cancelRefound" disabled="{{cancelRefoundStatus}}" wx:if="{{ goodsInfo.wechatStatus == 'REFUNDING' }}">取消退款</button>
-      <button type="primary" wx:else bind:tap="onSubmit">再来一单</button>
+    <button type="primary" bind:tap="cancelRefound" disabled="{{cancelRefoundStatus}}" wx:if="{{ goodsInfo.wechatStatus == 'REFUNDING' }}">取消退款</button>
+    <button type="primary" wx:else bind:tap="onSubmit">再来一单</button>
     <!-- </block> -->
   </view>
 

+ 142 - 22
miniprogram/pages/orders/orders.less

@@ -1,5 +1,5 @@
 /* pages/orders/orders.wxss */
-page {
+.container {
   height: 100vh;
   display: flex;
   flex-direction: column;
@@ -23,13 +23,14 @@ page {
   display: flex;
   align-items: center;
   justify-content: space-between;
-  padding: 28rpx 30rpx 16rpx;
+  padding: 28rpx 24rpx 16rpx;
 
   >view {
       font-size: 32rpx;
       font-family: PingFangSC-Regular, PingFang SC;
       font-weight: 500;
       color: rgba(0, 0, 0, 0.4);
+      padding: 0 34rpx;
 
       &.active {
           font-size: 32rpx;
@@ -62,7 +63,7 @@ page {
 }
 
 .list-item-group {
-  padding-bottom: 88rpx;
+  padding-bottom: 24rpx;
 }
 
 .list-item {
@@ -93,6 +94,10 @@ page {
 
   .item-content {
     display: flex;
+    &+.item-content {
+      padding-top: 40rpx;
+    }
+  
 
     .goods-icon {
       width: 160rpx;
@@ -118,10 +123,13 @@ page {
         white-space: nowrap;
         overflow: hidden;
         font-weight: 600;
-        font-size: 28rpx;
+        font-size: 30rpx;
+        color: #131415;
+        line-height: 50rpx;
         text-overflow: ellipsis;
-        max-width: 310rpx;
+        max-width: 280rpx;
       }
+  
       .goods-price {
         flex-shrink: 0;
         font-family: DINAlternate, DINAlternate;
@@ -129,6 +137,10 @@ page {
         font-size: 28rpx;
         color: #131415;
         line-height: 48rpx;
+         text {
+          font-size: 32rpx;
+          padding-left: 4rpx;
+        }
       }
     }
 
@@ -146,7 +158,7 @@ page {
         padding: 0 12rpx;
       }
       .goods-num {
-        font-size: 28rpx;
+        font-size: 26rpx;
         color: #777777;
         line-height: 36rpx;
       }
@@ -161,23 +173,68 @@ page {
     align-items: center;
 
     .order-price {
-      font-weight: 600;
-      font-size: 28rpx;
-      color: #131415;
-      line-height: 48rpx;
+      // font-weight: 600;
+      // font-size: 28rpx;
+      // color: #131415;
+      // line-height: 48rpx;
 
-      .price-first {
-        font-weight: bold;
-        color: #FE2451;
-        font-size: 28rpx;
-      }
-      .price {
-        font-family: DINAlternate, DINAlternate;
-        font-weight: bold;
-        font-size: 36rpx;
-        color: #FE2451;
-        line-height: 48rpx;
-      }
+      // .price-first {
+      //   font-weight: bold;
+      //   color: #FE2451;
+      //   font-size: 28rpx;
+      // }
+      // .price {
+      //   font-family: DINAlternate, DINAlternate;
+      //   font-weight: bold;
+      //   font-size: 36rpx;
+      //   color: #FE2451;
+      //   line-height: 48rpx;
+      // }
+      
+        display: flex;
+        align-items: flex-end;
+    
+        .desc {
+          font-size: 24rpx;
+          color: #999;
+          line-height: 40rpx;
+          flex-shrink: 0;
+        }
+    
+        .currentPrice {
+          font-weight: bold;
+          color: #FE2451;
+          font-family: DINAlternate, DINAlternate;
+          display: flex;
+          // align-items: flex-end;
+    
+          .stuff {
+            font-size: 28rpx;
+            padding: 2rpx 4rpx 0;
+          }
+    
+          .priceZ {
+            font-size: 40rpx;
+            line-height: 1;
+          }
+    
+          .priceF {
+            font-size: 32rpx;
+          }
+        }
+    
+        .line {
+          margin: 0 12rpx 8rpx;
+          background-color: #D2D2D2;
+          width: 2rpx;
+          height: 20rpx;
+        }
+    
+        .discountPrice {
+          padding-bottom: 2rpx;
+          font-size: 24rpx;
+          color: #FE2451;
+        }
     }
 
     button {
@@ -200,6 +257,69 @@ page {
   }
 }
 
+
+.bottom-section {
+  // position: fixed;
+  // bottom: 0;
+  // left: 0;
+  width: 100%;
+  background-color: #FFFFFF;
+  box-shadow: inset 0rpx 2rpx 0rpx 0rpx #F0F0F0;
+  padding: 20rpx 32rpx 58rpx 32rpx;
+  display: flex;
+  align-items: center;
+  box-sizing: border-box;
+  justify-content: space-around;
+
+  .orders {
+    display: flex;
+    align-items: center;
+    margin-right: 40rpx;
+    padding: 8rpx 0 16rpx;
+
+    &.active {
+      text {
+        color: #131415;
+      }
+    }
+
+    image {
+      width: 44rpx;
+      height: 44rpx;
+    }
+
+    text {
+      padding-left: 16rpx;
+      font-weight: 500;
+      font-size: 28rpx;
+      color: #AAAAAA;
+      line-height: 44rpx;
+      text-align: center;
+    }
+  }
+
+  .btnSection {
+    flex: 1 auto;
+
+    button {
+      width: 100%;
+      line-height: 88rpx;
+      background: linear-gradient(270deg, #FF204B 0%, #FE5B71 100%);
+      border-radius: 44rpx;
+      font-weight: 500;
+      font-size: 32rpx;
+      color: #FFFFFF;
+      padding-top: 0;
+      padding-bottom: 0;
+
+      &[disabled][type=primary] {
+        opacity: 0.7;
+      }
+    }
+  }
+}
+
+
 .empty-box {
   position: absolute;
   left: 50%;

+ 61 - 47
miniprogram/pages/orders/orders.ts

@@ -1,4 +1,5 @@
 import { api_executePayment, api_queryByParamName, api_studentOrderPage, api_userPaymentCancelRefund, api_userPaymentOrderUnpaid } from "../../api/login";
+import { formatPrice } from "../../utils/util";
 // 获取应用实例
 const app = getApp<IAppOption>()
 Page({
@@ -16,10 +17,10 @@ Page({
         id: 1,
         label: "待付款",
       },
-      {
-        id: 2,
-        label: "待使用",
-      },
+      // {
+      //   id: 2,
+      //   label: "待使用",
+      // },
       {
         id: 3,
         label: "已完成",
@@ -28,10 +29,10 @@ Page({
         id: 4,
         label: "已取消",
       },
-      {
-        id: 5,
-        label: "售后",
-      },
+      // {
+      //   id: 5,
+      //   label: "售后",
+      // },
       // {
       //   id: 6,
       //   label: "已退款",
@@ -44,6 +45,7 @@ Page({
     maxPage: 1, // 总分页数
     refoundStatus: false,
     cancelRefoundStatus: false,
+    paymentChannel: '',
     goodsInfo: {}, // 选中的数据
   },
 
@@ -89,6 +91,7 @@ Page({
     try {
       // @ApiModelProperty("订单状态 WAIT_PAY:待付款,WAIT_USE:待使用,SUCCESS:已完成,CLOSE:已取消")
       const { data } = await api_studentOrderPage({
+        version: 'V2',
         openId: app.globalData.userInfo?.liteOpenid,
         page: currentPage,
         rows: this.data.rows,
@@ -96,17 +99,31 @@ Page({
       })
       if (data.code == 200) {
         const { rows, total } = data.data;
+
         rows.forEach((item: any) => {
-          item.amount = this.formatPrice(item.paymentCashAmount, 'ALL')
+          item.amount = formatPrice(item.paymentCashAmount, 'ALL')
           item.statusName = this.formatOrderStatus(item.wechatStatus)
+          let originalPrice = 0
           const studentPaymentOrderDetails = item.studentPaymentOrderDetails || [];
           studentPaymentOrderDetails.forEach((student: any) => {
-            student.originalPrice = this.formatPrice(student.paymentCashAmount, 'ALL');
+            student.originalPrice = formatPrice(student.originalPrice, 'ALL');
             student.typeName = this.formatPeriod(student.activationCodeInfo?.times || 1, student.activationCodeInfo?.type);
+
+            // 总的日常价
+            originalPrice += Number(student.originalPrice || 0)
           })
+
+          item.originalPrice = originalPrice
+          item.discountPrice = formatPrice(
+            originalPrice - item.paymentCashAmount,
+            "ALL"
+          )
+          const prices: any = formatPrice(item.paymentCashAmount)
+          item.integerPart = prices.integerPart
+          item.decimalPart = prices.decimalPart
           item.studentPaymentOrderDetails = studentPaymentOrderDetails
         });
-        
+
         const newList = this.data.recordList.concat(rows);
         this.setData(
           {
@@ -118,7 +135,7 @@ Page({
       } else {
         wx.hideLoading();
       }
-    } catch(e) {
+    } catch (e) {
       console.log(e, 'e')
       wx.hideLoading()
     }
@@ -136,30 +153,18 @@ Page({
     }
     return template[status]
   },
-  // 格式化价格
-  formatPrice(price: number, type?: string) {
-    const amountStr = price.toFixed(2)
-    const [integerPart, decimalPart] = amountStr.split('.');
-    if(type === 'ALL') {
-      return amountStr
-    }
-    return {
-      integerPart,
-      decimalPart
-    }
-  },
   // 格式化类型
   formatPeriod(num: number, type: string) {
-    if(!num || !type) {
+    if (!num || !type) {
       return ''
     }
     const template: any = {
-      DAY: "天",
-      MONTH: "月",
-      YEAR: "年"
+      DAY: "天",
+      MONTH: "个月",
+      YEAR: "年"
     }
-    if(type === "YEAR" && num >= 99) {
-      return '永久'
+    if (type === "YEAR" && num >= 99) {
+      return '永久'
     }
     return num + template[type]
   },
@@ -186,7 +191,7 @@ Page({
   onPay(e: any) {
     const { dataset } = e.currentTarget
     const item: any = this.data.recordList.find((item: any) => item.id === dataset.id)
-    if(item) {
+    if (item) {
       this.onSubmit({
         orderNo: item.orderNo
       })
@@ -199,13 +204,13 @@ Page({
   },
   onDetail(e: any) {
     const { dataset } = e.currentTarget
-    if(dataset.wechatstatus === "WAIT_PAY") {
-      this.onSubmit({orderNo: dataset.orderno})
-    } else {
+    // if (dataset.wechatstatus === "WAIT_PAY") {
+    //   this.onSubmit({ orderNo: dataset.orderno })
+    // } else {
       wx.navigateTo({
         url: `../orders/order-result?orderNo=${dataset.orderno}&tabIdx=${this.data.tabIdx}`
       })
-    }
+    // }
   },
   // 购买
   async onSubmit(goodsInfo: any) {
@@ -215,7 +220,7 @@ Page({
     });
     try {
       const { orderNo } = goodsInfo
-      const {data} = await api_userPaymentOrderUnpaid({
+      const { data } = await api_userPaymentOrderUnpaid({
         orderNo: orderNo,
         paymentType: 'WECHAT_MINI'
       })
@@ -229,21 +234,30 @@ Page({
       wx.hideLoading()
     }
   },
-  async onExecutePay( paymentConfig: any, paymentType: string, orderNo: string) {
+  async onExecutePay(paymentConfig: any, paymentType: string, orderNo: string) {
     wx.login({
       success: async (wxres: any) => {
         const res = await api_executePayment({
           merOrderNo: paymentConfig.merOrderNo,
-          paymentChannel: this.data.paymentChannel || 'wx_lite', 
+          paymentChannel: this.data.paymentChannel || 'wx_lite',
           paymentType,
           userId: app.globalData.userInfo?.id,
           code: wxres.code,
           wxMiniAppId: app.globalData.appId
         })
         wx.hideLoading()
-        if(res.data.code === 200) {
+        if (res.data.code === 200) {
           this.onPaying(paymentType, res.data.data.reqParams, orderNo)
-        } else {
+        }  else if ([5435, 5436, 5437, 5439, 5442, 5443, 5408, 5427, 5432].includes(res.data.code)) {
+          wx.hideLoading()
+          wx.showToast({
+            title: res.data.message,
+            icon: 'none'
+          })
+          setTimeout(() => {
+            this.getList()
+          }, 1000);
+        }  else {
           this.onPayError(res.data.message)
         }
       },
@@ -304,19 +318,19 @@ Page({
     const { dataset } = e.currentTarget
     const item: any = this.data.recordList.find((item: any) => item.id === dataset.id)
     console.log(dataset, item, 'item')
-    if(!item) {
+    if (!item) {
       return
     }
 
-    if(item.wechatStatus === "REFUNDING") {
+    if (item.wechatStatus === "REFUNDING") {
       this.setData({
         cancelRefoundStatus: true
       }, async () => {
         try {
           const refundOrderId = item.refundOrderId
-          const {data} = await api_userPaymentCancelRefund(refundOrderId)
+          const { data } = await api_userPaymentCancelRefund(refundOrderId)
           wx.hideLoading()
-          if(data.code == 200) {
+          if (data.code == 200) {
             wx.showToast({ title: '取消退款成功', icon: 'none' })
             this.onRefoundComfirm()
           } else {
@@ -325,14 +339,14 @@ Page({
         } catch {
         }
       })
-     
+
     } else {
       const { orderNo, studentPaymentOrderDetails } = item
       const goodsInfo: any = {
         orderNo,
         goods: []
       }
-      if(Array.isArray(studentPaymentOrderDetails)) {
+      if (Array.isArray(studentPaymentOrderDetails)) {
         studentPaymentOrderDetails.forEach((item: any) => {
           goodsInfo.goods.push({
             ...item,
@@ -348,7 +362,7 @@ Page({
       })
     }
   },
-  changeRefoundStatus(e: {detail: any}) {
+  changeRefoundStatus(e: { detail: any }) {
     this.setData({
       refoundStatus: e.detail,
       cancelRefoundStatus: false,

+ 29 - 12
miniprogram/pages/orders/orders.wxml

@@ -21,26 +21,31 @@
               <view class="goods-desc">
                 <view class="goodsInfo">
                   <view class="goods-name">{{item.goodsName}}</view>
-                  <view class="goods-price">¥ {{(item.originalPrice)}}</view>
+                  <view class="goods-price">¥<text>{{item.originalPrice}}</text></view>
                 </view>
                 <view class="goods-type">
-                  <view class="goods-card" wx:if="{{ item.typeName }}">{{item.typeName}}</view>
+                  <view>
+                    <view class="goods-card" wx:if="{{ item.typeName }}">{{item.typeName}}</view>
+                  </view>
                   <view class="goods-num">x1</view>
                 </view>
               </view>
             </view>
             <view class="item-footer">
               <view class="order-price">
-                订单金额:<text class="price-first">¥ </text><text class="price">{{item.amount}}</text>
+                <!-- 共计<text class="price-first">¥ </text><text class="price">{{item.amount}}</text> -->
+                <view class="desc">共计</view>
+                <view class="currentPrice">
+                  <text class="stuff">¥</text>
+                  <text class="priceZ">{{ item.integerPart }}</text>
+                  <text class="priceF">.{{ item.decimalPart }}</text>
+                </view>
+                <text class="line"></text>
+                <text class="discountPrice">优惠 ¥{{ item.discountPrice }}</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' }}" disabled="{{ cancelRefoundStatus }}" catch:tap="onRefounded" data-id="{{item.id}}">取消退款</button>
-                <button wx:else type="primary" disabled="{{ cancelRefoundStatus }}" catch:tap="onRefounded" data-id="{{item.id}}">申请退款</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>
-                <button type="primary" wx:else catch:tap="onOne" data-id="{{item.id}}">再来一单</button>
-              </block>
+
+              <button class="sure" type="primary" wx:if="{{ item.wechatStatus == 'WAIT_PAY' }}" catch:tap="onPay" data-id="{{item.id}}">继续支付</button>
+              <button type="primary" wx:else catch:tap="onDetail" data-wechatstatus="{{item.wechatStatus}}" data-id="{{item.id}}" data-orderno="{{item.orderNo}}">查看订单</button>
             </view>
           </view>
         </view>
@@ -52,7 +57,19 @@
         </view>
       </block>
     </scroll-view>
+
+    <view class="bottom-section">
+      <view class="orders" bind:tap="onOne">
+        <image src="./images/icon-home.png" />
+        <text>首页</text>
+      </view>
+      <view class="orders active">
+        <image src="./images/icon-order-active.png" />
+        <text>订单</text>
+      </view>
+    </view>
+
   </view>
   <!-- 申请退款 -->
-  <apply-refound refoundStatus="{{ refoundStatus }}" goodsInfo="{{goodsInfo}}" bind:changeRefoundStatus="changeRefoundStatus" bind:onConfirm="onRefoundComfirm"></apply-refound>
+  <!-- <apply-refound refoundStatus="{{ refoundStatus }}" goodsInfo="{{goodsInfo}}" bind:changeRefoundStatus="changeRefoundStatus" bind:onConfirm="onRefoundComfirm"></apply-refound> -->
 </view>