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

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