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

229 lines
4.6 KiB

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