青蛙卖大米小程序2024-11-24
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.

234 lines
4.2 KiB

5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
4 months ago
5 months ago
4 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
4 months ago
5 months ago
4 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
  1. <template>
  2. <view class="page">
  3. <navbar
  4. title="订单中心"
  5. leftClick
  6. @leftClick="$utils.navigateBack"
  7. />
  8. <uv-tabs :list="tabs"
  9. :activeStyle="{color : '#A3D250', fontWeight : 600}"
  10. lineColor="#A3D250"
  11. lineHeight="8rpx"
  12. lineWidth="50rpx"
  13. :current="current"
  14. :scrollable="false"
  15. @click="clickTabs"></uv-tabs>
  16. <view class="list">
  17. <view class="item"
  18. v-for="(item, index) in list"
  19. @click="toOrderDetail(item.id)"
  20. :key="index">
  21. <view class="top">
  22. <view class="service">
  23. <!-- <text>{{item.projectId_dictText}}</text>
  24. <text>{{item.type_dictText}}</text> -->
  25. </view>
  26. <view class="status">
  27. <text> {{ tabs[Number(item.state) + 1].name }}</text>
  28. </view>
  29. </view>
  30. <view class="content"
  31. :key="index"
  32. v-for="(good, index) in item.commonOrderSkuList">
  33. <view class="left">
  34. <image mode="aspectFill"
  35. :src="good.image && good.image.split(',')[0]"></image>
  36. </view>
  37. <view class="right">
  38. <view class="text-hidden-1">
  39. 商品{{good.title}}
  40. </view>
  41. <view class="text-hidden-1">
  42. 规格{{good.sku}}
  43. </view>
  44. <view class="text-hidden-1">
  45. 数量{{good.num}}
  46. </view>
  47. <!-- <view class="text-hidden-1">
  48. 总计时间{{item.useTime}}分钟
  49. </view> -->
  50. </view>
  51. </view>
  52. <view class="bottom">
  53. <view class="price">
  54. 实付款<text class="num">{{item.price}}</text>
  55. </view>
  56. <!-- <view class="b1">
  57. 查看物流
  58. </view> -->
  59. <view @click.stop="toPayOrder(item)" class="b2"
  60. v-if="item.state == 0">
  61. 立即付款
  62. </view>
  63. <view class="b2"
  64. @click.stop="confirmOrder(item)"
  65. v-if="item.state == 2">
  66. 确认收货
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. import { mapGetters } from 'vuex'
  75. import mixinsList from '@/mixins/list.js'
  76. import mixinsOrder from '@/mixins/order.js'
  77. export default {
  78. mixins : [mixinsList, mixinsOrder],
  79. components : {
  80. },
  81. computed : {
  82. },
  83. data() {
  84. return {
  85. tabs: [{
  86. name: '全部'
  87. },
  88. {
  89. name: '待付款'
  90. },
  91. {
  92. name: '待发货'
  93. },
  94. {
  95. name: '待收货'
  96. },
  97. {
  98. name: '已完成'
  99. }
  100. ],
  101. current : 0,
  102. mixinsListApi : 'getOrderPageList',
  103. }
  104. },
  105. onLoad(args) {
  106. this.current = args.type || 0
  107. this.clickTabs({index : this.current})
  108. },
  109. onShow() {
  110. },
  111. methods: {
  112. //点击tab栏
  113. clickTabs({index}) {
  114. console.log(index);
  115. if (index == 0) {
  116. delete this.queryParams.state
  117. } else {
  118. this.queryParams.state = index - 1
  119. }
  120. this.getData()
  121. },
  122. //跳转订单详情页面
  123. toOrderDetail(id) {
  124. uni.navigateTo({
  125. url: '/pages_order/order/orderDetail?id=' + id
  126. })
  127. },
  128. }
  129. }
  130. </script>
  131. <style scoped lang="scss">
  132. .page{
  133. }
  134. .list {
  135. .item {
  136. width: calc(100% - 40rpx);
  137. background-color: #fff;
  138. margin: 20rpx;
  139. box-sizing: border-box;
  140. border-radius: 16rpx;
  141. padding: 30rpx;
  142. .top {
  143. display: flex;
  144. justify-content: space-between;
  145. align-items: center;
  146. font-size: 30rpx;
  147. .service {}
  148. .status {
  149. font-size: 26rpx;
  150. font-weight: 600;
  151. }
  152. }
  153. .content {
  154. display: flex;
  155. margin: 10rpx 0;
  156. .left {
  157. width: 150rpx;
  158. height: 150rpx;
  159. border-radius: 10rpx;
  160. image {
  161. width: 150rpx;
  162. height: 150rpx;
  163. border-radius: 10rpx;
  164. }
  165. }
  166. .right {
  167. width: calc(100% - 160rpx);
  168. color: #777;
  169. font-size: 24rpx;
  170. padding-left: 20rpx;
  171. line-height: 40rpx;
  172. background-color: #F8F8F8;
  173. }
  174. }
  175. .bottom {
  176. display: flex;
  177. justify-content: space-between;
  178. font-size: 25rpx;
  179. .price {
  180. font-weight: 900;
  181. text {
  182. color: #ff780099;
  183. font-size: 30rpx;
  184. }
  185. }
  186. .b1 {
  187. border: 1px solid #777;
  188. color: #777;
  189. box-sizing: border-box;
  190. }
  191. .b2 {
  192. background: $uni-color;
  193. color: #fff;
  194. display: flex;
  195. align-items: center;
  196. justify-content: center;
  197. }
  198. view {
  199. margin: 12rpx;
  200. border-radius: 28rpx;
  201. padding: 16rpx 48rpx;
  202. margin-bottom: 0;
  203. }
  204. }
  205. }
  206. }
  207. </style>