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

244 lines
4.9 KiB

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