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.

422 lines
9.4 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="content">
  3. <view style="
  4. background-color: #fff;
  5. text-align: center;
  6. padding: 20px;
  7. font-weight: 900;
  8. ">
  9. 我的订单
  10. </view>
  11. <van-tabs v-model:active="active"
  12. color="#EF8C94"
  13. @click-tab="onClickTab">
  14. <van-tab title="全部"></van-tab>
  15. <van-tab title="待确认"></van-tab>
  16. <van-tab title="已完成"></van-tab>
  17. <van-tab title="已取消"></van-tab>
  18. </van-tabs>
  19. <view style="width: 710rpx; margin: 40rpx auto 20rpx;">
  20. <!-- <view
  21. style="width: 670rpx;height: 80rpx;background-color: #fff; border-radius: 16rpx;padding: 15rpx 20rpx;">
  22. <view class="flex-sb" style="line-height: 40rpx; font-size: 28rpx;">
  23. <view :class="{'sb-w8' : true, select : item == selectDate}" @click="onSelectDate(item)"
  24. v-for="(item, index) in dateList">
  25. <view class="">
  26. {{ item.format('dddd')[2] }}
  27. </view>
  28. <view class="">
  29. {{ index == 0 ? '今' : index == 1 ? '明' : item.format('DD') }}
  30. </view>
  31. </view>
  32. <view class="sb-w8" style="border-left: 1rpx solid #999;"><uni-icons type="list" size="34rpx"/></view>
  33. </view>
  34. </view> -->
  35. <view class="flex-sb" style="margin-top: 20rpx;">
  36. <view :class="{'status-card' : true, select : queryParams.state == 0}">
  37. <view>
  38. <view class="num">{{ completedQuantity }}</view>
  39. <view>总接单数</view>
  40. </view>
  41. </view>
  42. <view :class="{'status-card' : true, select : queryParams.state == 1}">
  43. <view>
  44. <view class="num">{{ confirmedQuantity }}</view>
  45. <view>总佣金数额</view>
  46. </view>
  47. </view>
  48. <view :class="{'status-card' : true, select : 2}">
  49. <view>
  50. <view class="num">{{ numberOfVisits }}</view>
  51. <view>今日待上门</view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="mt20">
  56. <van-list v-if="orderList.length > 0" v-model:loading="loading" :finished="finished" @load="onLoad">
  57. <view v-show="item.state" class="item" v-for="(item, index) in orderList"
  58. @click="toOrderDetail(item.id)">
  59. <view class="top">
  60. <view class="service">
  61. <text>{{item.projectId_dictText}}</text>
  62. <uni-icons type="right" size="15"></uni-icons>
  63. <text>{{item.type_dictText}}</text>
  64. </view>
  65. <view class="status">
  66. <text> {{item.tenState_dictText}}</text>
  67. </view>
  68. </view>
  69. <view class="content">
  70. <view class="left">
  71. <image mode="aspectFill" :src="item.image"></image>
  72. <view class="tag">
  73. {{item.technicianId_dictText}}
  74. </view>
  75. </view>
  76. <view class="right">
  77. <view class="text-hidden-1">
  78. 客户姓名{{item.name}}
  79. </view>
  80. <view class="text-hidden-1">
  81. 下单时间{{item.createTime}}
  82. </view>
  83. <view class="text-hidden-1">
  84. 下单地址{{item.addressId_dictText}}
  85. </view>
  86. <view class="text-hidden-1">
  87. 总计时间{{item.useTime}}分钟
  88. </view>
  89. <view class="price">
  90. 总价格<text class="num">{{item.money}}</text>
  91. </view>
  92. </view>
  93. </view>
  94. <view v-if="item.state !=4" class="bottom">
  95. <view class="b2" v-if="item.tenState == 0"
  96. @click.stop="confirmVipOrder(item, getOrderList)">
  97. 确认订单
  98. </view>
  99. <view class="b2" v-if="item.tenState == 1" @click.stop="startVipOrder(item, getOrderList)">
  100. 技师出发
  101. </view>
  102. <view class="b2" v-if="item.tenState == 2" @click.stop="arriveVipOrder(item, getOrderList)">
  103. 到达打卡
  104. </view>
  105. <view class="b2" v-if="item.tenState == 3"
  106. @click.stop="startVipService(item, getOrderList)">
  107. 开始服务
  108. </view>
  109. <view class="b2" v-if="item.tenState == 4"
  110. @click.stop="endVipService(item, toEvaluate, item.id, item.projectId)">
  111. 结束服务
  112. </view>
  113. <view class="b1" @click.stop="toEvaluate()" v-if="item.tenState == 5">
  114. 投诉举报
  115. </view>
  116. <view class="b2" @click.stop="toEvaluate(item.id,item.projectId)"
  117. v-if="item.tenState == 5 && item.evaluated == 0">
  118. 立即评价
  119. </view>
  120. </view>
  121. <view v-else class="bottom">
  122. <view @click.stop="()=>{}" class="b3">
  123. 用户取消
  124. </view>
  125. </view>
  126. </view>
  127. </van-list>
  128. <van-empty v-else image="/static/empty/order.png" image-size="400rpx" :description="getStatus()"/>
  129. </view>
  130. </view>
  131. </view>
  132. </template>
  133. <script>
  134. import orderMixins from '@/mixins/order.js'
  135. export default {
  136. mixins: [orderMixins],
  137. data() {
  138. return {
  139. dateList: [],
  140. active: 0,
  141. queryParams: {
  142. pageNo: 1,
  143. pageSize: 10
  144. },
  145. orderList: [], //订单列表数据
  146. loading: false,
  147. finished: false,
  148. tenState: 0,
  149. selectDate: null,
  150. config: [],
  151. notice: '',
  152. completedQuantity : 0,
  153. confirmedQuantity : 0,
  154. numberOfVisits : 0
  155. }
  156. },
  157. onShow() {
  158. this.getOrderList()
  159. this.getConfig()
  160. this.dateList = []
  161. let today = this.dayjs()
  162. this.selectDate = today;
  163. this.dateList.push(today)
  164. for (let i = 1; i < 7; i++) {
  165. this.dateList.push(today.add(i, 'day'))
  166. }
  167. },
  168. methods: {
  169. onClickTab(){},
  170. onLoad() {
  171. this.queryParams.pageSize += 10
  172. this.getOrderList()
  173. },
  174. //获取订单列表
  175. getOrderList(state) {
  176. let params = {
  177. ...this.queryParams,
  178. }
  179. if (this.selectDate) {
  180. params.serviceDate = this.selectDate.format('YYYY-MM-DD')
  181. }
  182. this.$api('getTenOrderPageList', params, res => {
  183. if (res.code == 200) {
  184. if (res.code == 200) {
  185. this.orderList = res.result.records;
  186. let titles = ['completedQuantity','confirmedQuantity','numberOfVisits']
  187. let current = titles[state]
  188. this[current] = this.orderList.length
  189. } else {
  190. this.finished = true
  191. }
  192. if (this.queryParams.pageSize > this.orderList.length) {
  193. this.finished = true
  194. }
  195. this.loading = false
  196. }
  197. })
  198. },
  199. selectTenState(state) {
  200. this.queryParams.pageSize = 10
  201. this.queryParams.state = state;
  202. this.getOrderList(state)
  203. },
  204. onSelectDate(selectDate) {
  205. if (this.selectDate == selectDate) {
  206. this.selectDate = null
  207. } else {
  208. this.selectDate = selectDate
  209. }
  210. this.queryParams.pageSize = 10
  211. this.queryParams.serviceTime = this.dayjs(selectDate).format('YYYY-MM-DD')
  212. this.getOrderList(this.queryParams.state)
  213. },
  214. toEvaluate(id, projectId) {
  215. uni.navigateTo({
  216. url: '/pages/order/evaluate?id=' + id + '&projectId=' + projectId
  217. })
  218. },
  219. toOrderDetail(id) {
  220. uni.navigateTo({
  221. url: '/pages/order/orderDetail?id=' + id
  222. })
  223. },
  224. getConfig() {
  225. this.vid = uni.getStorageSync("ivcode");
  226. this.$api('getConfig', {}, res => {
  227. if (res.code == 200) {
  228. res.result.forEach(n => {
  229. if (n.keyValue == 'notice') {
  230. this.notice = n.content
  231. }
  232. })
  233. this.config = res.result
  234. }
  235. })
  236. },
  237. //获取当前查询订单状态
  238. getStatus(){
  239. let titles = ['暂无已完成订单','暂无待确认订单','暂无待上门']
  240. return titles[this.queryParams.state]
  241. }
  242. }
  243. }
  244. </script>
  245. <style scoped lang="scss">
  246. body {
  247. background-color: #f3f3f3;
  248. font-family: PingFang SC;
  249. }
  250. .rr {
  251. height: 52rpx;
  252. background: #fbecdd;
  253. border-radius: 16rpx;
  254. width: calc(710rpx - 40rpx);
  255. padding: 20rpx;
  256. margin: 20rpx 0;
  257. }
  258. .xx {
  259. width: 602rpx;
  260. height: 56rpx;
  261. font-size: 20rpx;
  262. font-family: PingFang SC, PingFang SC-Regular;
  263. font-weight: 400;
  264. text-align: left;
  265. color: #323232;
  266. display: flex;
  267. align-items: center;
  268. }
  269. .status-card {
  270. width: 132rpx;
  271. height: 92rpx;
  272. background-color: #fff;
  273. border-radius: 16rpx;
  274. font-size: 26rpx;
  275. padding: 40rpx;
  276. text-align: center;
  277. color: #ccc;
  278. .num {
  279. color: #0d0d0d;
  280. font-size: 42rpx;
  281. }
  282. }
  283. .status-card.select {
  284. background-color: var(--van-primary-color);
  285. color: #eee;
  286. .num {
  287. color: #fff;
  288. }
  289. }
  290. .select {
  291. color: var(--van-primary-color);
  292. font-weight: 900;
  293. }
  294. .item {
  295. width: calc(100% - 40rpx);
  296. background-color: #fff;
  297. margin: 20rpx;
  298. box-sizing: border-box;
  299. border-radius: 16rpx;
  300. padding: 30rpx;
  301. .top {
  302. display: flex;
  303. justify-content: space-between;
  304. align-items: center;
  305. font-size: 30rpx;
  306. .service {}
  307. .status {
  308. color: var(--van-primary-color);
  309. font-size: 26rpx;
  310. font-weight: 600;
  311. }
  312. }
  313. .content {
  314. display: flex;
  315. margin: 10rpx 0;
  316. .left {
  317. width: 150rpx;
  318. height: 150rpx;
  319. overflow: hidden;
  320. border-radius: 10rpx;
  321. image {
  322. width: 150rpx;
  323. height: 150rpx;
  324. }
  325. .tag {
  326. color: var(--van-primary-color);
  327. font-size: 24rpx;
  328. text-align: center;
  329. width: 100%;
  330. background-color: #e7fdf7;
  331. border: 1px solid var(--van-primary-color);
  332. border-radius: 8rpx;
  333. padding: 2rpx 0;
  334. }
  335. }
  336. .right {
  337. width: calc(100% - 160rpx);
  338. color: #777;
  339. font-size: 24rpx;
  340. padding-left: 20rpx;
  341. line-height: 40rpx;
  342. .price {
  343. font-weight: 900;
  344. text-align: right;
  345. text {
  346. color: #ff780099;
  347. font-size: 30rpx;
  348. }
  349. }
  350. }
  351. }
  352. .bottom {
  353. display: flex;
  354. justify-content: flex-end;
  355. font-size: 25rpx;
  356. .b1,
  357. .b3 {
  358. border: 1px solid #777;
  359. color: #777;
  360. box-sizing: border-box;
  361. }
  362. .b2 {
  363. background-color: #EF8C94;
  364. color: #fff;
  365. }
  366. .b3 {
  367. background: transparent;
  368. }
  369. view {
  370. margin: 12rpx;
  371. border-radius: 28rpx;
  372. padding: 8rpx 28rpx;
  373. margin-bottom: 0;
  374. }
  375. }
  376. }
  377. </style>