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

242 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. </view>
  59. </template>
  60. <script>
  61. import orderMixin from '@/mixins/order.js'
  62. export default {
  63. mixins: [orderMixin],
  64. components: {
  65. },
  66. computed: {
  67. },
  68. data() {
  69. return {
  70. tabs: [
  71. {
  72. name: '全部'
  73. },
  74. {
  75. name: '待付款'
  76. },
  77. {
  78. name: '配送中'
  79. },
  80. {
  81. name: '已完成'
  82. },
  83. {
  84. name: '已取消'
  85. }
  86. ],
  87. queryParams: {
  88. pageNo: 1,
  89. pageSize: 10
  90. },
  91. orderList: {
  92. records: [],
  93. total: 0,
  94. },
  95. state: -1,
  96. }
  97. },
  98. onShow() {
  99. this.getData()
  100. },
  101. //滚动到屏幕底部
  102. onReachBottom() {
  103. if (this.queryParams.pageSize < this.orderList.total) {
  104. this.queryParams.pageSize += 10
  105. this.getData()
  106. }
  107. },
  108. onPullDownRefresh() {
  109. this.getData()
  110. },
  111. methods: {
  112. getData() {
  113. let queryParams = {
  114. ...this.queryParams,
  115. }
  116. if (this.state != -1) {
  117. queryParams.state = this.state
  118. }
  119. this.$api('getOrderPageBean', queryParams, res => {
  120. uni.stopPullDownRefresh()
  121. if (res.code == 200) {
  122. this.orderList = res.result
  123. }
  124. })
  125. },
  126. //点击tab栏
  127. clickTabs({ index }) {
  128. if (index == 0) {
  129. this.state = -1;
  130. } else {
  131. this.state = index - 1;
  132. }
  133. this.queryParams.pageSize = 10
  134. this.getData()
  135. },
  136. //跳转订单详情页面
  137. toOrderDetail(id) {
  138. uni.navigateTo({
  139. url: '/pages_order/order/orderDetail?id=' + id
  140. })
  141. },
  142. }
  143. }
  144. </script>
  145. <style scoped lang="scss">
  146. .page {}
  147. .list {
  148. .item {
  149. width: calc(100% - 40rpx);
  150. background-color: #fff;
  151. margin: 20rpx;
  152. box-sizing: border-box;
  153. border-radius: 16rpx;
  154. padding: 30rpx;
  155. .top {
  156. display: flex;
  157. justify-content: space-between;
  158. align-items: center;
  159. font-size: 30rpx;
  160. .service {}
  161. .status {
  162. font-size: 26rpx;
  163. font-weight: 600;
  164. color: $uni-color;
  165. }
  166. }
  167. .content {
  168. display: flex;
  169. margin: 10rpx 0;
  170. .left {
  171. width: 150rpx;
  172. height: 150rpx;
  173. border-radius: 10rpx;
  174. image {
  175. width: 150rpx;
  176. height: 150rpx;
  177. border-radius: 10rpx;
  178. }
  179. }
  180. .right {
  181. width: calc(100% - 160rpx);
  182. color: #777;
  183. font-size: 24rpx;
  184. padding-left: 20rpx;
  185. line-height: 40rpx;
  186. background-color: #F8F8F8;
  187. }
  188. }
  189. .bottom {
  190. display: flex;
  191. justify-content: space-between;
  192. font-size: 25rpx;
  193. .price {
  194. color: #787777;
  195. font-weight: 900;
  196. text {
  197. color: #fd7d41;
  198. font-size: 26rpx;
  199. }
  200. }
  201. .b1 {
  202. border: 1px solid #777;
  203. color: #777;
  204. box-sizing: border-box;
  205. }
  206. .b2 {
  207. background: linear-gradient(178deg, $uni-color, #d34f4f);
  208. color: #fff;
  209. }
  210. view {
  211. margin: 12rpx;
  212. border-radius: 28rpx;
  213. padding: 8rpx 28rpx;
  214. margin-bottom: 0;
  215. }
  216. }
  217. }
  218. }
  219. </style>