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

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