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

249 lines
4.9 KiB

5 months ago
5 months ago
4 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"
  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. }
  165. }
  166. .main {
  167. display: flex;
  168. margin: 20rpx 0rpx;
  169. .left {
  170. display: flex;
  171. align-items: center;
  172. justify-content: center;
  173. width: 180rpx;
  174. height: 180rpx;
  175. image {
  176. width: 95%;
  177. height: 95%;
  178. border-radius: 10rpx;
  179. }
  180. }
  181. .right {
  182. display: flex;
  183. flex-direction: column;
  184. justify-content: space-between;
  185. width: calc(100% - 200rpx);
  186. color: #777;
  187. font-size: 26rpx;
  188. padding: 30rpx 20rpx;
  189. box-sizing: border-box;
  190. margin-left: 20rpx;
  191. border-radius: 10rpx;
  192. background-color: #F8F8F8;
  193. }
  194. }
  195. }
  196. .bottom {
  197. display: flex;
  198. justify-content: space-between;
  199. font-size: 25rpx;
  200. .price {
  201. .total-title {}
  202. .num {
  203. font-size: 36rpx;
  204. }
  205. .num,
  206. .unit,
  207. .c-unit {
  208. color: $uni-color;
  209. }
  210. }
  211. .btn {
  212. border: 1px solid #C7C7C7;
  213. padding: 10rpx 20rpx;
  214. border-radius: 40rpx;
  215. color: #575757;
  216. }
  217. }
  218. }
  219. }
  220. </style>