orders.wxml 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!--pages/orders/orders.wxml-->
  2. <view class="container">
  3. <navigation-bar title="订单"></navigation-bar>
  4. <view class="record-content">
  5. <view class="record-tab">
  6. <view wx:for="{{tabList}}" wx:key="id" class="{{item.id == tabIdx ? 'active' : ''}}" catch:tap="switchTab" data-idx="{{item.id}}">
  7. {{item.label}}
  8. </view>
  9. </view>
  10. <scroll-view class="record-list" type="list" scroll-y bindscrolltolower="loadMore">
  11. <block wx:if="{{ recordList.length }}">
  12. <view class="list-item-group">
  13. <view class="list-item" wx:for="{{recordList}}" wx:key="index" data-orderno="{{item.orderNo}}" data-wechatstatus="{{item.wechatStatus}}" bind:tap="onDetail">
  14. <view class="item-top">
  15. <view class="item-mid">{{ "订单编号: " + item.orderNo }}</view>
  16. <text class="{{ item.wechatStatus == 'WAIT_PAY' || item.wechatStatus == 'WAIT_USE' || item.wechatStatus == 'REFUNDING' ? 'red' : item.wechatStatus === 'CLOSED' ? 'closed' : '' }}">{{ item.statusName }}</text>
  17. </view>
  18. <view class="item-content">
  19. <view class="imgCon">
  20. <image class='goods-icon' wx:for="{{item.studentPaymentOrderDetails}}" wx:key="studentIndex" src="{{item.goodsUrl}}" mode="" />
  21. <view class="goodsDes" wx:if="{{item.studentPaymentOrderDetails.length===1}}">
  22. <view>{{item.studentPaymentOrderDetails[0].goodsName}}</view>
  23. <view>{{item.studentPaymentOrderDetails[0].typeName}}</view>
  24. </view>
  25. </view>
  26. <view class="goods-desc">
  27. <view class="goodsInfo">
  28. <view class="goods-price">
  29. <text class="stuff">¥ </text>
  30. <numberDisplay number="{{ my.sumArray(item.studentPaymentOrderDetails, 'paymentCashAmount') }}" />
  31. </view>
  32. </view>
  33. <view class="goods-type">
  34. <view class="goods-num">共 {{ item.studentPaymentOrderDetails.length }} 件</view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="item-footer">
  39. <view wx:if="{{ (my.sumArray(item.studentPaymentOrderDetails, 'originalPrice') - my.sumArray(item.studentPaymentOrderDetails, 'paymentCashAmount'))>0 }}" class="order-price">
  40. {{
  41. "已优惠 ¥ " + my.formatValue(my.sumArray(item.studentPaymentOrderDetails, 'originalPrice') - my.sumArray(item.studentPaymentOrderDetails, 'paymentCashAmount'))
  42. }}
  43. </view>
  44. <!-- <block wx:if="{{ item.wechatStatus == 'REFUNDING' || (item.wechatStatus == 'WAIT_USE' && tabIdx == 5) }}" wx:key="block">
  45. <button wx:if="{{ item.wechatStatus == 'REFUNDING' }}" type="primary" wx:if="{{ item.wechatStatus == 'REFUNDING' }}" catch:tap="onRefounded" data-id="{{item.id}}" disabled="{{ cancelRefoundStatus }}">取消退款</button>
  46. <button wx:else type="primary" catch:tap="onRefounded" data-id="{{item.id}}" disabled="{{ cancelRefoundStatus }}">申请退款</button>
  47. </block> -->
  48. <!-- <block wx:else wx:key="block"> -->
  49. <button wx:if="{{ item.wechatStatus == 'WAIT_PAY' }}" class="sure" type="primary" catch:tap="onPay" data-id="{{item.id}}">继续支付</button>
  50. <button wx:else class="sure lookDetails" type="primary">查看详情</button>
  51. <!-- <button type="primary" wx:else catch:tap="onOne" data-id="{{item.id}}">再次购买</button> -->
  52. <!-- </block> -->
  53. </view>
  54. </view>
  55. </view>
  56. </block>
  57. <block wx:else>
  58. <view class="empty-box">
  59. <image src="https://oss.dayaedu.com/ktyq/1739875042508.png"></image>
  60. <view class="empty-text">当前暂无订单</view>
  61. </view>
  62. </block>
  63. </scroll-view>
  64. </view>
  65. <!-- 客服 -->
  66. <!-- <service wx:if="{{serviceShow}}"></service> -->
  67. <!-- 申请退款 -->
  68. <!-- <apply-refound refoundStatus="{{ refoundStatus }}" goodsInfo="{{goodsInfo}}" bind:changeRefoundStatus="changeRefoundStatus" bind:onConfirm="onRefoundComfirm"></apply-refound> -->
  69. </view>
  70. <wxs module="my">
  71. var sumArray = function (value, key) {
  72. return value.reduce(function (num, item) {
  73. return item[key] + num
  74. }, 0)
  75. }
  76. var formatValue = function (value) {
  77. return parseFloat(value).toFixed(2);
  78. }
  79. module.exports = {
  80. sumArray: sumArray,
  81. formatValue: formatValue
  82. }
  83. </wxs>