时空网前端
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.

170 lines
5.6 KiB

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