12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <!--pages/orders/orders.wxml-->
- <view class="container">
- <navigation-bar title="订单"></navigation-bar>
- <view class="record-content">
- <view class="record-tab">
- <view wx:for="{{tabList}}" wx:key="id" class="{{item.id == tabIdx ? 'active' : ''}}" catch:tap="switchTab" data-idx="{{item.id}}">
- {{item.label}}
- </view>
- </view>
- <scroll-view class="record-list" type="list" scroll-y bindscrolltolower="loadMore">
- <block wx:if="{{ recordList.length }}">
- <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>
- <text class="{{ item.wechatStatus == 'WAIT_PAY' || item.wechatStatus == 'WAIT_USE' || item.wechatStatus == 'REFUNDING' ? 'red' : item.wechatStatus === 'CLOSED' ? 'closed' : '' }}">{{ item.statusName }}</text>
- </view>
- <view class="item-content">
- <view class="imgCon">
- <image class='goods-icon' wx:for="{{item.studentPaymentOrderDetails}}" wx:key="studentIndex" src="{{item.goodsUrl}}" mode="" />
- <view class="goodsDes" wx:if="{{item.studentPaymentOrderDetails.length===1}}">
- <view>{{item.studentPaymentOrderDetails[0].goodsName}}</view>
- <view>{{item.studentPaymentOrderDetails[0].typeName}}</view>
- </view>
- </view>
- <view class="goods-desc">
- <view class="goodsInfo">
- <view class="goods-price">
- <text class="stuff">¥ </text>
- <numberDisplay number="{{ my.sumArray(item.studentPaymentOrderDetails, 'paymentCashAmount') }}" />
- </view>
- </view>
- <view class="goods-type">
- <view class="goods-num">共 {{ item.studentPaymentOrderDetails.length }} 件</view>
- </view>
- </view>
- </view>
- <view class="item-footer">
- <view wx:if="{{ (my.sumArray(item.studentPaymentOrderDetails, 'originalPrice') - my.sumArray(item.studentPaymentOrderDetails, 'paymentCashAmount'))>0 }}" class="order-price">
- {{
- "已优惠 ¥ " + my.formatValue(my.sumArray(item.studentPaymentOrderDetails, 'originalPrice') - my.sumArray(item.studentPaymentOrderDetails, 'paymentCashAmount'))
- }}
- </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}}" 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 wx:if="{{ item.wechatStatus == 'WAIT_PAY' }}" class="sure" type="primary" catch:tap="onPay" data-id="{{item.id}}">继续支付</button>
- <button wx:else class="sure lookDetails" type="primary">查看详情</button>
- <!-- <button type="primary" wx:else catch:tap="onOne" data-id="{{item.id}}">再次购买</button> -->
- <!-- </block> -->
- </view>
- </view>
- </view>
- </block>
- <block wx:else>
- <view class="empty-box">
- <image src="https://oss.dayaedu.com/ktyq/1739875042508.png"></image>
- <view class="empty-text">当前暂无订单</view>
- </view>
- </block>
- </scroll-view>
- </view>
- <!-- 客服 -->
- <!-- <service wx:if="{{serviceShow}}"></service> -->
- <!-- 申请退款 -->
- <!-- <apply-refound refoundStatus="{{ refoundStatus }}" goodsInfo="{{goodsInfo}}" bind:changeRefoundStatus="changeRefoundStatus" bind:onConfirm="onRefoundComfirm"></apply-refound> -->
- </view>
- <wxs module="my">
- var sumArray = function (value, key) {
- return value.reduce(function (num, item) {
- return item[key] + num
- }, 0)
- }
- var formatValue = function (value) {
- return parseFloat(value).toFixed(2);
- }
- module.exports = {
- sumArray: sumArray,
- formatValue: formatValue
- }
- </wxs>
|