建材商城系统20241014
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.

252 lines
6.7 KiB

7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="订单中心" bgColor="#DC2828" color="#fff" leftClick @leftClick="$utils.navigateBack" />
  4. <uv-tabs :list="tabs"
  5. :activeStyle="{ color: '#FD5100', fontWeight: 600 }"
  6. lineColor="#FD5100" lineHeight="8rpx"
  7. lineWidth="50rpx"
  8. @click="clickTabs"></uv-tabs>
  9. <view v-if="orderList.records.length > 0" class="list">
  10. <view class="item" v-for="(item, index) in orderList.records" @click="toOrderDetail(item.id)" :key="index">
  11. <!-- 顶部 -->
  12. <view class="top">
  13. <view class="service">
  14. <text>{{ item.createTime }}</text>
  15. <!-- <text>{{ item.type_dictText }}</text> -->
  16. </view>
  17. <view class="status">
  18. <text> {{ tabs[item.status - 1 + 2].name }}</text>
  19. </view>
  20. </view>
  21. <!-- -->
  22. <view class="content"
  23. v-for="(shop, i) in item.children"
  24. :key="i">
  25. <view class="left">
  26. <image mode="aspectFill" :src="shop.image && shop.image.split(',')[0]"></image>
  27. </view>
  28. <view class="right">
  29. <view class="text-hidden-1">
  30. 客户姓名{{ shop.title }}
  31. </view>
  32. <view class="text-hidden-1">
  33. 材质{{ shop.material }}
  34. </view>
  35. <view class="text-hidden-1">
  36. 数量{{ shop.num }}
  37. </view>
  38. </view>
  39. </view>
  40. <!-- -->
  41. <view class="bottom">
  42. <view class="price">
  43. 总价格<text class="num">{{ item.price }}</text>
  44. </view>
  45. <view class="b2" v-if="item.status == 0" @click.stop="toPayOrder(item)">
  46. 立即支付
  47. </view>
  48. <view class="b2" v-if="item.status == 2" @click.stop="confirmOrder(item)">
  49. 确认收货
  50. </view>
  51. <view class="b1" v-if="item.status == 0" @click.stop="cancelOrder(item)">
  52. 取消订单
  53. </view>
  54. <!-- <view class="b1" v-if="item.status != 0">
  55. 联系客服
  56. </view> -->
  57. </view>
  58. </view>
  59. </view>
  60. <kefu/>
  61. <quick-order-entry
  62. ref="quickOrderEntry"
  63. />
  64. </view>
  65. </template>
  66. <script>
  67. import orderMixin from '@/mixins/order.js'
  68. export default {
  69. mixins: [orderMixin],
  70. components: {
  71. },
  72. computed: {
  73. },
  74. data() {
  75. return {
  76. tabs: [
  77. {
  78. name: '全部'
  79. },
  80. {
  81. name: '待付款'
  82. },
  83. {
  84. name: '已付款'
  85. },
  86. {
  87. name: '配送中'
  88. },
  89. {
  90. name: '已完成'
  91. },
  92. {
  93. name: '已取消'
  94. }
  95. ],
  96. queryParams: {
  97. pageNo: 1,
  98. pageSize: 10
  99. },
  100. orderList: {
  101. records: [],
  102. total: 0,
  103. },
  104. state: -1,
  105. }
  106. },
  107. onShow() {
  108. this.getData()
  109. },
  110. //滚动到屏幕底部
  111. onReachBottom() {
  112. if (this.queryParams.pageSize < this.orderList.total) {
  113. this.queryParams.pageSize += 10
  114. this.getData()
  115. }
  116. },
  117. onPullDownRefresh() {
  118. this.getData()
  119. },
  120. methods: {
  121. getData() {
  122. let queryParams = {
  123. ...this.queryParams,
  124. }
  125. if (this.state != -1) {
  126. queryParams.state = this.state
  127. }
  128. this.$api('getOrderPageBean', queryParams, res => {
  129. uni.stopPullDownRefresh()
  130. if (res.code == 200) {
  131. this.orderList = res.result
  132. }
  133. })
  134. },
  135. //点击tab栏
  136. clickTabs({ index }) {
  137. if (index == 0) {
  138. this.state = -1;
  139. } else {
  140. this.state = index - 1;
  141. }
  142. this.queryParams.pageSize = 10
  143. this.getData()
  144. },
  145. //跳转订单详情页面
  146. toOrderDetail(id) {
  147. uni.navigateTo({
  148. url: '/pages_order/order/orderDetail?id=' + id
  149. })
  150. },
  151. }
  152. }
  153. </script>
  154. <style scoped lang="scss">
  155. .page {}
  156. .list {
  157. .item {
  158. width: calc(100% - 40rpx);
  159. background-color: #fff;
  160. margin: 20rpx;
  161. box-sizing: border-box;
  162. border-radius: 16rpx;
  163. padding: 30rpx;
  164. .top {
  165. display: flex;
  166. justify-content: space-between;
  167. align-items: center;
  168. font-size: 30rpx;
  169. .service {}
  170. .status {
  171. font-size: 26rpx;
  172. font-weight: 600;
  173. color: $uni-color;
  174. }
  175. }
  176. .content {
  177. display: flex;
  178. margin: 10rpx 0;
  179. .left {
  180. width: 150rpx;
  181. height: 150rpx;
  182. border-radius: 10rpx;
  183. image {
  184. width: 150rpx;
  185. height: 150rpx;
  186. border-radius: 10rpx;
  187. }
  188. }
  189. .right {
  190. width: calc(100% - 160rpx);
  191. color: #777;
  192. font-size: 24rpx;
  193. padding-left: 20rpx;
  194. line-height: 40rpx;
  195. background-color: #F8F8F8;
  196. }
  197. }
  198. .bottom {
  199. display: flex;
  200. justify-content: space-between;
  201. font-size: 25rpx;
  202. .price {
  203. color: #787777;
  204. font-weight: 900;
  205. text {
  206. color: #fd7d41;
  207. font-size: 26rpx;
  208. }
  209. }
  210. .b1 {
  211. border: 1px solid #777;
  212. color: #777;
  213. box-sizing: border-box;
  214. }
  215. .b2 {
  216. background: linear-gradient(178deg, $uni-color, #d34f4f);
  217. color: #fff;
  218. }
  219. view {
  220. margin: 12rpx;
  221. border-radius: 28rpx;
  222. padding: 8rpx 28rpx;
  223. margin-bottom: 0;
  224. }
  225. }
  226. }
  227. }
  228. </style>