Selaa lähdekoodia

新增练琴订单详情页面

zhangshuling 3 vuotta sitten
vanhempi
commit
9c9f03a54e

+ 2 - 1
app.json

@@ -36,7 +36,8 @@
     "pages/showVideoList/showVideoList",
     "pages/leaveDetail/leaveDetail",
     "pages/uploadShow/uploadShow",
-    "pages/pianoDetailCode/pianoDetail"
+    "pages/pianoDetailCode/pianoDetail",
+    "pages/pianoOrderDetail/pianoOrderDetail"
   ],
   "window": {
     "backgroundTextStyle": "dark",

+ 13 - 4
pages/classOrder/classOrder.js

@@ -19,9 +19,18 @@ Page({
   getDetail: function (e) {
     let id = e.currentTarget.dataset.id
     let cid = e.currentTarget.dataset.cid
-    wx.navigateTo({
-      url: '/pages/orderClassDetail/orderClassDetail?id='+id+'&cid='+cid,
-    })
+    let type = e.currentTarget.dataset.type
+ 
+    if (type == 2) {
+      let item = this.data.list.filter(o=>o.id == id)[0]
+      wx.navigateTo({
+        url: '/pages/pianoOrderDetail/pianoOrderDetail?str=' + JSON.stringify(item)
+      })
+    } else {
+      wx.navigateTo({
+        url: '/pages/orderClassDetail/orderClassDetail?id=' + id + '&cid=' + cid,
+      })
+    }
   },
 
   /**
@@ -95,7 +104,7 @@ Page({
           if (o.payDate) {
             o.payDate = o.payDate.replace('T', ' ').substring(0, 16)
           }
-          if (o.refundDate ) {
+          if (o.refundDate) {
             o.refundDate = o.refundDate.replace('T', ' ').substring(0, 16)
           }
         })

+ 1 - 1
pages/classOrder/classOrder.wxml

@@ -1,7 +1,7 @@
 <view class="container">
   <view class="order-view">
     <view class="order-list">
-      <view class="order-box" wx:for="{{list}}" wx:key="index" bindtap="getDetail" data-id="{{item.id}}" data-cid="{{item.orderClassesId}}">
+      <view class="order-box" wx:for="{{list}}" wx:key="index" bindtap="getDetail" data-id="{{item.id}}" data-cid="{{item.orderClassesId}}" data-type="{{item.orderType}}">
         <view class="order-type">{{item.orderType == 2 ? '练琴卡' : (item.kindId == 1 ?'1v1' : '集体')}}</view>
         <view class="order-name">{{item.classesName}}
                 <block wx:if="{{item.refundStatus == 4}}">[已退款]</block>

+ 3 - 3
pages/orderClassDetail/orderClassDetail.js

@@ -46,9 +46,9 @@ Page({
     }
     util.apiPost(urls.get_order, params).then(rs => {
       if (rs != null) {
-        rs[0].payDate = this.renderTime(rs[0].payDate)
-        this.setData({ items: rs, order: rs[0] })
-        this.queryContract()
+        // rs[0].payDate = this.renderTime(rs[0].payDate)
+        // this.setData({ items: rs, order: rs[0] })
+        // this.queryContract()
       }
     })
   },

+ 67 - 0
pages/pianoOrderDetail/pianoOrderDetail.js

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

+ 3 - 0
pages/pianoOrderDetail/pianoOrderDetail.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 23 - 0
pages/pianoOrderDetail/pianoOrderDetail.wxml

@@ -0,0 +1,23 @@
+<view class="container">
+  <view class="detail-title">
+    <view class="order-name">{{order.classesName}}</view>
+    <view class="order-money">¥ {{order.classesActualAmount}}</view>
+  </view>
+  <view class="class-detail">
+    <view class="class-title">有效天数:</view>
+    <view class="class-nums detail">{{order.nums}}(天)</view>
+    <view class="class-title">课程有效期:</view>
+    <view class="class-valid detail">{{order.beginDate}} 至 {{order.endDate}}</view>
+  </view>
+  <view class="order-detail">
+    <view class="order-title">订单号:</view>
+    <view class="order-num detail">{{order.orderNum}}</view>
+    <view class="order-title">下单时间:</view>
+    <view class="order-payTime detail">{{order.payDate}}</view>
+  </view>
+  <view class="order-detail">
+    <view class="order-title">实付金额</view>
+    <view class="money-price-other">¥ {{order.actualAmount}}</view>
+  </view>
+ 
+</view>

+ 65 - 0
pages/pianoOrderDetail/pianoOrderDetail.wxss

@@ -0,0 +1,65 @@
+/* pages/pianoOrderDetail.wxss */
+.container{
+  padding: 0;
+  margin: 0;
+  font-size: 28rpx;
+}
+.detail-title{
+  display: flex;
+    height: 100rpx;
+    line-height: 100rpx;
+    justify-content: space-between;
+    font-size: 32rpx;
+    border-top: 1px solid #CCC;
+    border-bottom: 1px solid #CCC;
+    width: 700rpx;
+    padding: 0 25rpx;
+}
+.class-detail,.money-detail,.order-detail{
+  width: 700rpx;
+  padding: 25rpx 25rpx 0;
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: space-between;
+}
+.class-title,.order-title,.money-title{
+  max-width: 200rpx;
+  font-size: 28rpx;
+  height: 60rpx;
+  line-height: 60rpx;
+  color: #999;
+}
+.detail{
+  margin-right: auto;
+  width: 500rpx;
+  font-size: 28rpx;
+  height: 60rpx;
+  line-height: 60rpx;
+}
+.order-contract{
+  color: #cc6031;
+}
+.money-detail .detail{
+  margin-right: 0;
+  margin-left: auto;
+  text-align: right;
+}
+.money-title-other{
+  color: #999;
+  margin-left: auto;
+  height: 60rpx;
+  line-height: 60rpx;
+}
+.money-price-other{
+  font-size: 32rpx;
+  color: #cc6031;
+  height: 60rpx;
+  line-height: 60rpx;
+}
+
+.order-num,.order-payTime,.class-valid,.class-nums{
+  font-weight: 600;
+}
+.class-detail,.order-detail{
+  border-bottom: 20rpx solid #eee;
+}