珠宝小程序前端代码
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.

237 lines
4.3 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 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. <tabber select="order" />
  72. </view>
  73. </template>
  74. <script>
  75. import { mapGetters } from 'vuex'
  76. import mixinsList from '@/mixins/list.js'
  77. import mixinsOrder from '@/mixins/order.js'
  78. import tabber from '@/components/base/tabbar.vue'
  79. export default {
  80. mixins : [mixinsList, mixinsOrder],
  81. components : {
  82. tabber,
  83. },
  84. computed : {
  85. },
  86. data() {
  87. return {
  88. tabs: [{
  89. name: '全部'
  90. },
  91. {
  92. name: '待付款'
  93. },
  94. {
  95. name: '待发货'
  96. },
  97. {
  98. name: '待收货'
  99. },
  100. {
  101. name: '已完成'
  102. }
  103. ],
  104. current : 0,
  105. mixinsListApi : 'getOrderPageList',
  106. }
  107. },
  108. onLoad(args) {
  109. this.current = args.type || 0
  110. this.clickTabs({index : this.current})
  111. },
  112. onShow() {
  113. },
  114. methods: {
  115. //点击tab栏
  116. clickTabs({index}) {
  117. console.log(index);
  118. if (index == 0) {
  119. delete this.queryParams.state
  120. } else {
  121. this.queryParams.state = index - 1
  122. }
  123. this.getData()
  124. },
  125. //跳转订单详情页面
  126. toOrderDetail(id) {
  127. uni.navigateTo({
  128. url: '/pages_order/order/orderDetail?id=' + id
  129. })
  130. },
  131. }
  132. }
  133. </script>
  134. <style scoped lang="scss">
  135. .page{
  136. }
  137. .list {
  138. .item {
  139. width: calc(100% - 40rpx);
  140. background-color: #fff;
  141. margin: 20rpx;
  142. box-sizing: border-box;
  143. border-radius: 16rpx;
  144. padding: 30rpx;
  145. .top {
  146. display: flex;
  147. justify-content: space-between;
  148. align-items: center;
  149. font-size: 30rpx;
  150. .service {}
  151. .status {
  152. font-size: 26rpx;
  153. font-weight: 600;
  154. }
  155. }
  156. .content {
  157. display: flex;
  158. margin: 10rpx 0;
  159. .left {
  160. width: 150rpx;
  161. height: 150rpx;
  162. border-radius: 10rpx;
  163. image {
  164. width: 150rpx;
  165. height: 150rpx;
  166. border-radius: 10rpx;
  167. }
  168. }
  169. .right {
  170. width: calc(100% - 160rpx);
  171. color: #777;
  172. font-size: 24rpx;
  173. padding-left: 20rpx;
  174. line-height: 40rpx;
  175. background-color: #F8F8F8;
  176. }
  177. }
  178. .bottom {
  179. display: flex;
  180. justify-content: space-between;
  181. font-size: 25rpx;
  182. .price {
  183. font-weight: 900;
  184. text {
  185. color: #ff780099;
  186. font-size: 30rpx;
  187. }
  188. }
  189. .b1 {
  190. border: 1px solid #777;
  191. color: #777;
  192. box-sizing: border-box;
  193. }
  194. .b2 {
  195. background: $uni-color;
  196. color: #fff;
  197. display: flex;
  198. align-items: center;
  199. justify-content: center;
  200. }
  201. view {
  202. margin: 12rpx;
  203. border-radius: 28rpx;
  204. padding: 16rpx 48rpx;
  205. margin-bottom: 0;
  206. }
  207. }
  208. }
  209. }
  210. </style>