敢为人鲜小程序前端代码仓库
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.

251 lines
5.0 KiB

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