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

264 lines
5.1 KiB

7 months ago
6 months ago
7 months ago
  1. <template>
  2. <view class="page">
  3. <navbar
  4. title="订单中心"
  5. bgColor="#DC2828"
  6. color="#fff"
  7. leftClick
  8. @leftClick="$utils.navigateBack"
  9. />
  10. <uv-tabs :list="tabs"
  11. :activeStyle="{color : '#FD5100', fontWeight : 600}"
  12. lineColor="#FD5100"
  13. lineHeight="8rpx"
  14. lineWidth="50rpx"
  15. @click="clickTabs"></uv-tabs>
  16. <view v-if="orderList.length > 0" class="list">
  17. <view class="item"
  18. v-for="(item, index) in orderList.records"
  19. @click="toOrderDetail(item.id)"
  20. :key="index">
  21. <view class="top">
  22. <view class="service">
  23. <text>{{item.projectId_dictText}}</text>
  24. <text>{{item.type_dictText}}</text>
  25. </view>
  26. <view class="status">
  27. <text> {{item.state_dictText}}</text>
  28. </view>
  29. </view>
  30. <view class="content">
  31. <view class="left">
  32. <image mode="aspectFill" :src="item.image"></image>
  33. </view>
  34. <view class="right">
  35. <view class="text-hidden-1">
  36. 客户姓名{{item.name}}
  37. </view>
  38. <view class="text-hidden-1">
  39. 产品规格{{item.unit}}
  40. </view>
  41. <view class="text-hidden-1">
  42. 租赁地址{{item.address}}
  43. </view>
  44. <!-- <view class="text-hidden-1">
  45. 总计时间{{item.useTime}}分钟
  46. </view> -->
  47. </view>
  48. </view>
  49. <view class="bottom">
  50. <view class="price">
  51. 总价格<text class="num">{{item.money}}</text>
  52. </view>
  53. <view class="b1">
  54. 查看物流
  55. </view>
  56. <!-- <view @click.stop="toPayOrder(item)" class="b2" v-if="item.state == 0">
  57. 立即付款
  58. </view>
  59. <view class="b1" @click.stop="moreOrder(item.projectId,toPlaceorder)" v-if="item.state == 3">
  60. 再来一单
  61. </view>
  62. <view class="b2" @click.stop="toEvaluate(item.id,item.projectId,item.technicianId)" v-if="item.state == 3">
  63. 立即评价
  64. </view>
  65. <view class="b2" @click.stop="moreOrder(item.projectId,toPlaceorder)" v-if="item.state == 4">
  66. 再来一单
  67. </view> -->
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. import { mapGetters } from 'vuex'
  75. export default {
  76. components : {
  77. },
  78. computed : {
  79. ...mapGetters(['userShop']),
  80. },
  81. data() {
  82. return {
  83. tabs: [{
  84. name: '全部'
  85. },
  86. {
  87. name: '租赁押金'
  88. },
  89. {
  90. name: '水洗租赁'
  91. },
  92. {
  93. name: '破损换货'
  94. },
  95. {
  96. name: '退货退款'
  97. }
  98. ],
  99. queryParams: {
  100. pageNo: 1,
  101. pageSize: 10
  102. },
  103. // orderList: [
  104. // {
  105. // money : 99.99,
  106. // address : '广东省广州市越秀区城南故事C3栋2802',
  107. // name : '李**',
  108. // phone : '150*****091',
  109. // unit : '120*40*75【桌子尺寸】',
  110. // image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
  111. // state_dictText : '已完成',
  112. // }
  113. // ], //订单列表数据
  114. orderList : {
  115. records : [],
  116. total : 0,
  117. },
  118. state : -1,
  119. }
  120. },
  121. onShow() {
  122. this.orderPage()
  123. },
  124. //滚动到屏幕底部
  125. onReachBottom() {
  126. if(this.queryParams.pageSize < this.orderList.total){
  127. this.queryParams.pageSize += 10
  128. this.orderPage()
  129. }
  130. },
  131. methods: {
  132. orderPage(){
  133. let queryParams = {
  134. ...this.queryParams,
  135. }
  136. if(this.state != -1){
  137. queryParams.state = this.state
  138. }
  139. this.$api('orderPage', queryParams, res => {
  140. if(res.code == 200){
  141. this.orderList = res.result
  142. }
  143. })
  144. },
  145. //点击tab栏
  146. clickTabs(index) {
  147. if (index == 0) {
  148. this.state = -1;
  149. } else {
  150. this.state = index - 1;
  151. }
  152. this.queryParams.pageSize = 10
  153. this.orderPage()
  154. },
  155. //跳转订单详情页面
  156. toOrderDetail(id) {
  157. uni.navigateTo({
  158. url: '/pages_order/order/orderDetail?id=' + id
  159. })
  160. },
  161. getOrderList(){
  162. },
  163. }
  164. }
  165. </script>
  166. <style scoped lang="scss">
  167. .page{
  168. }
  169. .list {
  170. .item {
  171. width: calc(100% - 40rpx);
  172. background-color: #fff;
  173. margin: 20rpx;
  174. box-sizing: border-box;
  175. border-radius: 16rpx;
  176. padding: 30rpx;
  177. .top {
  178. display: flex;
  179. justify-content: space-between;
  180. align-items: center;
  181. font-size: 30rpx;
  182. .service {}
  183. .status {
  184. font-size: 26rpx;
  185. font-weight: 600;
  186. }
  187. }
  188. .content {
  189. display: flex;
  190. margin: 10rpx 0;
  191. .left {
  192. width: 150rpx;
  193. height: 150rpx;
  194. border-radius: 10rpx;
  195. image {
  196. width: 150rpx;
  197. height: 150rpx;
  198. border-radius: 10rpx;
  199. }
  200. }
  201. .right {
  202. width: calc(100% - 160rpx);
  203. color: #777;
  204. font-size: 24rpx;
  205. padding-left: 20rpx;
  206. line-height: 40rpx;
  207. background-color: #F8F8F8;
  208. }
  209. }
  210. .bottom {
  211. display: flex;
  212. justify-content: space-between;
  213. font-size: 25rpx;
  214. .price {
  215. font-weight: 900;
  216. text {
  217. color: #ff780099;
  218. font-size: 30rpx;
  219. }
  220. }
  221. .b1 {
  222. border: 1px solid #777;
  223. color: #777;
  224. box-sizing: border-box;
  225. }
  226. .b2 {
  227. background: linear-gradient(178deg, #4FD3BC, #60C285);
  228. color: #fff;
  229. }
  230. view {
  231. margin: 12rpx;
  232. border-radius: 28rpx;
  233. padding: 8rpx 28rpx;
  234. margin-bottom: 0;
  235. }
  236. }
  237. }
  238. }
  239. </style>