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.

417 lines
9.8 KiB

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