时空网前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

162 lines
5.3 KiB

5 years ago
  1. <template>
  2. <view>
  3. <mescroll-uni ref="mescrollRef" @init="mescrollInit" height="100%" top="0" :down="downOption" @down="downCallback"
  4. :up="upOption" @up="upCallback">
  5. <!-- 数据列表 -->
  6. <view class="padding-bottom-xl">
  7. <block v-for="(item, index) in assetsFlow" :key="index">
  8. <view class="margin-top bg-white">
  9. <view class="flex justify-between align-start solid-bottom padding-tb-sm padding-lr">
  10. <image src="@/static/tu.png" mode="aspectFill" style="width: 150rpx; height: 150rpx;"></image>
  11. <view class="flex-sub padding-left-sm">
  12. <view class="bref-box margin-top-xs">
  13. 网红辣椒棒 魔鬼辣椒挑战全网第一辣 网红优惠季
  14. </view>
  15. <text class="block margin-top-sm text-gray text-sm">网红辣椒棒 500g <text class="margin-left text-gray">x1</text></text>
  16. <view class="flex justify-between margin-top-sm">
  17. <view class="text-red text-price text-lg">
  18. <amount :value="Number(19.90 || 0)" :is-round-up="false" :precision="2" :duration="800" transition></amount>
  19. </view>
  20. <view>
  21. <button v-if="i==1" class="cu-btn line-gray round margin-left-sm" @tap="orderClick(item,'modalShowCancel')">取消订单</button>
  22. <button v-if="i==2" class="cu-btn line-red round margin-left-sm" @tap="$routerGo('/pages/shop/returngoods?id=1')">我要退货</button>
  23. <button v-if="i==2" class="cu-btn line-black round margin-left-sm" @tap="orderClick(item,'modalShowConfirm')">确认收货</button>
  24. <button v-if="i !=1 && i != 2" class="cu-btn line-orange round margin-left-sm" @tap="orderClick(item,'modalShowDel')">立即付款</button>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="padding-lr padding-tb-sm order-bottom">
  30. <text class="cuIcon-fold bg-white order-ico"></text>
  31. <view class="flex justify-between align-center">
  32. <view style="color: #777777;">2021-6-17 12:37:54</view>
  33. <view class="flex align-center justify-end">
  34. 实付
  35. <view class="text-price text-red text-xl">
  36. <amount :value="Number(19.90 || 0)" :is-round-up="false" :precision="2" :duration="800" transition></amount>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </block>
  43. </view>
  44. </mescroll-uni>
  45. <!-- 取消订单 -->
  46. <my-uni-modal title="取消订单" content="您确定要取消该订单吗?" btnText="取消订单" :modalShow="modalShowCancel" @determine="cancelDetermine"
  47. @hideModal="modalShowCancel=false" />
  48. <!-- 删除订单 -->
  49. <my-uni-modal title="删除订单" content="您确定要删除该订单吗?" btnText="删除订单" :modalShow="modalShowDel" @determine="delDetermine"
  50. @hideModal="modalShowDel=false" />
  51. <!-- 确认收货 -->
  52. <my-uni-modal title="确认收货" content="请确认您已经收到商品在点击确认收货,以免造成损失." btnText="确认收货" :modalShow="modalShowConfirm"
  53. @determine="confirmDetermine" @hideModal="modalShowConfirm=false" />
  54. </view>
  55. </template>
  56. <script>
  57. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  58. import MescrollMoreItemMixin from "@/components/mescroll-uni/mixins/mescroll-more-item.js";
  59. export default {
  60. mixins: [MescrollMixin, MescrollMoreItemMixin], // 注意此处还需使用MescrollMoreItemMixin (必须写在MescrollMixin后面)
  61. data() {
  62. return {
  63. modalShowCancel: false, //取消订单
  64. modalShowDel: false, //删除订单
  65. modalShowConfirm: false, //确认收货
  66. orderItem: {},
  67. downOption: {
  68. auto: false
  69. },
  70. upOption: {
  71. auto: false
  72. },
  73. assetsFlow: 10
  74. }
  75. },
  76. props: {
  77. i: Number, // 每个tab页的专属下标 (除了支付宝小程序必须在这里定义, 其他平台都可不用写, 因为已在MescrollMoreItemMixin定义)
  78. index: { // 当前tab的下标 (除了支付宝小程序必须在这里定义, 其他平台都可不用写, 因为已在MescrollMoreItemMixin定义)
  79. type: Number,
  80. default () {
  81. return 0
  82. }
  83. },
  84. tabs: { // 为了请求数据,演示用,可根据自己的项目判断是否要传
  85. type: Array,
  86. default () {
  87. return []
  88. }
  89. }
  90. },
  91. methods: {
  92. orderClick(item, type) {
  93. this.orderItem = item
  94. this[type] = true
  95. },
  96. //取消订单
  97. cancelDetermine() {
  98. },
  99. //删除订单
  100. delDetermine() {
  101. },
  102. //确认收货
  103. confirmDetermine() {
  104. this.$toast('已成功收货')
  105. },
  106. //资产流水
  107. getAssetsFlow(pageNum) {
  108. setTimeout(() => {
  109. this.mescroll.endBySize(10, 10);
  110. }, 1000)
  111. },
  112. /*下拉刷新的回调 */
  113. downCallback() {
  114. // 下拉刷新的回调,默认重置上拉加载列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
  115. this.mescroll.resetUpScroll()
  116. },
  117. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  118. upCallback(page) {
  119. this.getAssetsFlow(page.num);
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. .bref-box {
  126. text-overflow: -o-ellipsis-lastline;
  127. overflow: hidden;
  128. text-overflow: ellipsis;
  129. display: -webkit-box;
  130. -webkit-line-clamp: 2;
  131. -webkit-box-orient: vertical;
  132. }
  133. .order-bottom {
  134. position: relative;
  135. .order-ico {
  136. position: absolute;
  137. right: 50rpx;
  138. top: -19rpx;
  139. color: rgba(0, 0, 0, 0.1)
  140. }
  141. }
  142. </style>