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

298 lines
5.9 KiB

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