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

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