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

253 lines
5.0 KiB

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