青蛙卖大米小程序2024-11-24
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.

267 lines
5.1 KiB

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