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.

667 lines
14 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
  1. <template>
  2. <view class="content">
  3. <view class="b-relative center">
  4. <view style="width: 118rpx;height: 118rpx;overflow: hidden;border-radius: 50%;">
  5. <image style="width: 118rpx;" :src="userInfo.image" mode="widthFix"></image>
  6. </view>
  7. <view>
  8. <view class="font-m">{{ userInfo.title }}欢迎您</view>
  9. <view class="font-n" v-if="userInfo.realOk == 'Y'">已完成实名认证</view>
  10. </view>
  11. <view :class="{'Top-line' : true, online : userInfo.bookable == 'Y'}"
  12. @click="clickTopLine(userInfo.bookable == 'Y' ? 'N' : 'Y')">
  13. {{ userInfo.bookable == 'Y' ? '在线' : '离线' }}
  14. </view>
  15. </view>
  16. <view style="width: 710rpx; margin: 40rpx auto 20rpx;">
  17. <view class="b-relative">
  18. <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
  19. <van-swipe-item v-for="item in bannerList" :key="item.id">
  20. <image class="banner-image" :src="item.image" mode="aspectFill"></image>
  21. </van-swipe-item>
  22. </van-swipe>
  23. </view>
  24. <view class="flex rr" style="align-items: center;">
  25. <uni-icons type="sound" size="50rpx" color="#FBA54F"></uni-icons>
  26. <view class="xx" v-html="notice">
  27. </view>
  28. <!-- 长沙市刘师傅在服务过程中客户投诉服务过程中有不文明的行为,扣信用分5分罚款500元公布三日望引以为戒 -->
  29. </view>
  30. <van-tabs v-model:active="active"
  31. color="#EF8C94"
  32. @click-tab="onClickTab">
  33. <van-tab title="客户指定"></van-tab>
  34. <van-tab title="平台派单"></van-tab>
  35. <van-tab title="订单统计"></van-tab>
  36. </van-tabs>
  37. <view v-if="active === 2">
  38. <!-- <view class="card-1 b-relative">
  39. <span>订单待处理事项</span>
  40. <span> {{ total }}</span>
  41. <view class="button-1" @click="step=2">去处理</view>
  42. </view> -->
  43. <view class="card-2 b-relative ">
  44. <view>本月订单统计</view>
  45. <view class="flex-wrap">
  46. <view @click="toOrder" :class="{'card-item' : true, [cardColor[item.status || 0]] : true}"
  47. v-for="(item, index) in statistics">
  48. <view class="font-n0">{{ item.size }}</view>
  49. <view class="font-n1">{{ item.name }}</view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view v-if="active != 2">
  55. <!-- <view class="flex" style="position: relative;">
  56. <view class="button-1" style="top : 0;" @click="step=1">查看统计</view>
  57. </view> -->
  58. <!-- <view class="flex"
  59. style="padding: 10rpx;">
  60. <view style="width: 8rpx;height: 34rpx;
  61. background: #60bda2;border-radius: 4rpx;
  62. margin: 8rpx 0;" />
  63. <view class="tt">待确认订单</view>
  64. </view> -->
  65. <view v-if="orderList.length > 0" class="mt20">
  66. <view class="item" v-for="(item, index) in orderList">
  67. <view class="flex-sb">
  68. <view class="item-time">30分钟内到达</view>
  69. <view class="item-price">¥ {{ item.money }}</view>
  70. </view>
  71. <view class="flex item-font1" style="margin: 24rpx 0 12rpx;border-radius: 10rpx;">
  72. <image :src="item.image"
  73. style="width: 134rpx;height: 134rpx;background: #ccc;margin-right: 20rpx;border-radius: 10rpx;"
  74. mode="aspectFill"></image>
  75. <view style="width: 452rpx;padding: 10rpx;background: #f8f8f8;border-radius: 8px;">
  76. <view class="item-font4">{{ '韵享推拿' }}</view>
  77. <view class="item-font3 flex-sb">
  78. <view>¥ {{ item.money }}</view>
  79. </view>
  80. <view class="flex-sb item-font2">
  81. <view>总计时间{{ item.useTime }}</view>
  82. <view>{{ item.createTime }}</view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="flex-sb item-font1 name">
  87. <view>客户姓名{{ item.name }}</view>
  88. <view>{{ item.phone }}</view>
  89. </view>
  90. <view class="item-font1 address">
  91. <span>下单地址{{item.addressId_dictText}}</span>
  92. </view>
  93. <view class="flex">
  94. <!-- <view class="item-button">拒绝32s</view> -->
  95. <view class="item-button" @click.stop="confirmVipOrder(item, getOrderList)">确认</view>
  96. </view>
  97. </view>
  98. </view>
  99. <van-empty v-else image="/static/empty/order.png" image-size="400rpx" description="暂无待确认订单"/>
  100. </view>
  101. </view>
  102. </view>
  103. </template>
  104. <script>
  105. import orderMixins from '@/mixins/order.js'
  106. export default {
  107. mixins: [orderMixins],
  108. data() {
  109. return {
  110. step: 1,
  111. queryParams: {
  112. pageNo: 1,
  113. pageSize: 10
  114. },
  115. total: 0,
  116. orderList: [],
  117. userInfo: {},
  118. bannerList: [],
  119. statistics: [],
  120. cardColor: ['item-a', 'item-b', 'item-c', 'item-d'],
  121. config: [],
  122. notice: '',
  123. active : 0,
  124. }
  125. },
  126. onShow() {
  127. this.getOrderList()
  128. this.getUserInfo()
  129. this.getBanner()
  130. this.getTenOrderStatistics()
  131. this.getConfig()
  132. this.initData()
  133. },
  134. methods: {
  135. onClickTab(){
  136. },
  137. getUserInfo() {
  138. this.$api('giveTenInfo', {}, res => {
  139. if (res.code == 200) {
  140. this.userInfo = res.result.msgTen;
  141. this.refreshOnLine()
  142. }
  143. })
  144. },
  145. //获取订单列表
  146. getOrderList(state) {
  147. this.$api('getTenOrderList', this.queryParams, res => {
  148. if (res.code == 200) {
  149. if (res.code == 200) {
  150. this.orderList = res.result.records;
  151. this.total = res.result.total
  152. } else {
  153. this.finished = true
  154. }
  155. if (this.queryParams.pageSize > this.orderList.length) {
  156. this.finished = true
  157. }
  158. this.loading = false
  159. }
  160. })
  161. },
  162. getConfig() {
  163. this.vid = uni.getStorageSync("ivcode");
  164. this.$api('getConfig', {}, res => {
  165. if (res.code == 200) {
  166. res.result.forEach(n => {
  167. if (n.keyValue == 'notice') {
  168. this.notice = n.content
  169. }
  170. })
  171. this.config = res.result
  172. }
  173. })
  174. },
  175. //获取banner
  176. getBanner() {
  177. this.$api('getBanner', {}, res => {
  178. this.bannerList = res.result;
  179. })
  180. },
  181. getTenOrderStatistics() {
  182. this.$api('getTenOrderStatistics', {}, res => {
  183. if (res.code == 200) {
  184. this.statistics = res.result
  185. }
  186. })
  187. },
  188. clickTopLine(isY) {
  189. let self = this;
  190. let is = isY == 'Y'
  191. uni.showModal({
  192. content: is ? '确认上线吗?你将开始接单!' : '确认下线吗?',
  193. success: function(res) {
  194. if (res.confirm) {
  195. uni.showLoading({
  196. title: is ? '上线中...' : '下线中...'
  197. });
  198. self.$utils.getLocation(loca => {
  199. self.$api('tenOnline', {
  200. bookable: isY, //是否上线
  201. ...loca,
  202. }, res => {
  203. if (res.code == 200) {
  204. uni.hideLoading();
  205. self.getUserInfo();
  206. uni.showToast({
  207. title: is ? '已上线' : '已下线',
  208. icon: 'none'
  209. })
  210. }
  211. })
  212. })
  213. } else if (res.cancel) {
  214. }
  215. }
  216. });
  217. },
  218. clickBanner() {
  219. uni.navigateTo({
  220. url: '/pages/login/login'
  221. })
  222. },
  223. clickNotice() {
  224. uni.navigateTo({
  225. url: '/pages/index/notice'
  226. })
  227. },
  228. clickFillin() {
  229. uni.navigateTo({
  230. url: '/pages/index/fillin'
  231. })
  232. },
  233. clickSpring() {
  234. uni.navigateTo({
  235. url: '/pages/spring/vote'
  236. })
  237. },
  238. clickSpRank() {
  239. uni.navigateTo({
  240. url: '/pages/spring/rank'
  241. })
  242. },
  243. clickMore() {
  244. uni.navigateTo({
  245. url: '/pages/index/infor'
  246. })
  247. },
  248. clickStar() {
  249. uni.navigateTo({
  250. url: '/pages/star/index'
  251. })
  252. },
  253. clickVote() {
  254. uni.switchTab({
  255. url: '/pages/star/vote'
  256. })
  257. },
  258. clickRank() {
  259. uni.switchTab({
  260. url: '/pages/index/rank'
  261. })
  262. },
  263. clickInfo(id) {
  264. uni.navigateTo({
  265. url: `/pages/index/infod?id=${id}`
  266. })
  267. },
  268. refreshOnLine() { //刷新用户位置
  269. let isY = this.userInfo.bookable == 'Y' ? 'Y' : 'N'
  270. this.$utils.getLocation(loca => {
  271. this.$api('tenOnline', {
  272. bookable: isY, //是否上线
  273. ...loca,
  274. }, res => {})
  275. })
  276. },
  277. initData() { //初始化时间项目数据
  278. this.$api('initTerTime', {}, res => {})
  279. this.$api('initTerProject', {}, res => {})
  280. },
  281. //跳转订单页面
  282. toOrder() {
  283. uni.switchTab({
  284. url: '/pages/index/order'
  285. })
  286. }
  287. }
  288. }
  289. </script>
  290. <style scoped lang="scss">
  291. body {
  292. background-color: #f3f3f3;
  293. }
  294. .center {
  295. width: calc(100vw - 72rpx);
  296. height: 194rpx;
  297. display: flex;
  298. padding: 0 36rpx 0;
  299. align-items: center;
  300. background-color: #FFF;
  301. }
  302. .my-swipe {
  303. width: 100%;
  304. height: 500rpx;
  305. margin: 0px auto;
  306. border-radius: 15rpx;
  307. overflow: hidden;
  308. .banner-image {
  309. width: 100%;
  310. height: 100%;
  311. vertical-align: middle;
  312. }
  313. }
  314. // .center image {
  315. // width: 58rpx;
  316. // height: 58rpx;
  317. // margin-right: 20rpx;
  318. // }
  319. .font-m {
  320. line-height: 58rpx;
  321. font-family: PingFang SC, PingFang SC-Heavy;
  322. font-weight: 800;
  323. text-align: left;
  324. color: #292421;
  325. }
  326. .font-n {
  327. height: 42rpx;
  328. line-height: 42rpx;
  329. font-size: 20rpx;
  330. font-family: PingFang SC, PingFang SC-Medium;
  331. font-weight: 500;
  332. text-align: center;
  333. color: #fdfaf8;
  334. width: 168rpx;
  335. background: #4eed78;
  336. border-radius: 8px;
  337. margin-top: 5rpx;
  338. margin-left: 20rpx;
  339. }
  340. .banner-font-1 {
  341. width: 292rpx;
  342. height: 142rpx;
  343. font-size: 72rpx;
  344. line-height: 66rpx;
  345. font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  346. font-weight: 400;
  347. text-align: left;
  348. color: #ffffff;
  349. letter-spacing: -1;
  350. text-shadow: 0px 6px 6px 0px rgba(0, 165, 141, 0.70);
  351. position: absolute;
  352. left: 52rpx;
  353. top: 34rpx;
  354. }
  355. .banner-font-2 {
  356. height: 28rpx;
  357. line-height: 28rpx;
  358. font-size: 24rpx;
  359. font-family: PingFang SC, PingFang SC-Regular;
  360. font-weight: 400;
  361. text-align: left;
  362. color: #ffffff;
  363. text-shadow: 0 4rpx 6rpx 0 rgba(0, 165, 141, 0.70);
  364. position: absolute;
  365. left: 52rpx;
  366. top: 138rpx;
  367. }
  368. .banner-button {
  369. width: 240rpx;
  370. height: 56rpx;
  371. line-height: 56rpx;
  372. background: #ffdb75;
  373. border-radius: 24rpx;
  374. box-shadow: 0 6rpx 6rpx 0 rgba(17, 106, 93, 0.23);
  375. position: absolute;
  376. left: 52rpx;
  377. top: 220rpx;
  378. font-size: 24rpx;
  379. font-family: PingFang SC, PingFang SC-Bold;
  380. font-weight: 700;
  381. text-align: center;
  382. color: #26c591;
  383. }
  384. .card-1 {
  385. height: 100rpx;
  386. line-height: 100rpx;
  387. background: #ffffff;
  388. border-radius: 16rpx;
  389. font-size: 28rpx;
  390. font-family: PingFang SC, PingFang SC-Bold;
  391. font-weight: 700;
  392. text-align: left;
  393. color: #333333;
  394. padding: 0 20rpx;
  395. margin: 20rpx 0;
  396. }
  397. .button-1 {
  398. font-size: 28rpx;
  399. font-family: PingFang SC, PingFang SC-Bold;
  400. font-weight: 700;
  401. text-align: center;
  402. color: #e25851;
  403. width: 148rpx;
  404. line-height: 54rpx;
  405. height: 54rpx;
  406. background: #fdd5d3;
  407. border: 2rpx solid #e98986;
  408. border-radius: 30rpx;
  409. position: absolute;
  410. right: 20rpx;
  411. top: 23rpx;
  412. }
  413. .card-2 {
  414. height: 420rpx;
  415. background: #ffffff;
  416. border-radius: 16rpx;
  417. line-height: 80rpx;
  418. font-size: 28rpx;
  419. font-family: PingFang SC, PingFang SC-Bold;
  420. font-weight: 700;
  421. text-align: left;
  422. color: #333333;
  423. padding: 0 20rpx;
  424. }
  425. .card-item {
  426. width: 322rpx;
  427. height: 140rpx;
  428. background: linear-gradient(174deg, #f07a77 5%, #e58988 96%);
  429. border-radius: 12rpx;
  430. margin-bottom: 20rpx;
  431. }
  432. .font-n0 {
  433. height: 80rpx;
  434. line-height: 80rpx;
  435. font-size: 44rpx;
  436. font-family: PingFang SC, PingFang SC-Bold;
  437. font-weight: 700;
  438. text-align: center;
  439. color: #ffffff;
  440. }
  441. .font-n1 {
  442. height: 34rpx;
  443. line-height: 34rpx;
  444. font-size: 24rpx;
  445. font-family: PingFang SC, PingFang SC-Regular;
  446. font-weight: 400;
  447. text-align: center;
  448. color: #ffffff;
  449. }
  450. .item-a {
  451. background: linear-gradient(174deg, #f07a77 5%, #e58988 96%);
  452. }
  453. .item-b {
  454. background: linear-gradient(174deg, #fc8048 5%, #ed9555 96%);
  455. }
  456. .item-c {
  457. background: linear-gradient(174deg, #4fd3bc 5%, #74e5d1 96%);
  458. }
  459. .item-d {
  460. background: linear-gradient(174deg, #68d9eb 5%, #78c9e6 96%);
  461. }
  462. .rr {
  463. height: 52rpx;
  464. background: #fbecdd;
  465. border-radius: 16rpx;
  466. width: calc(710rpx - 40rpx);
  467. padding: 20rpx;
  468. margin: 20rpx 0;
  469. }
  470. .xx {
  471. width: 602rpx;
  472. height: 56rpx;
  473. font-size: 20rpx;
  474. font-family: PingFang SC, PingFang SC-Regular;
  475. font-weight: 400;
  476. text-align: left;
  477. color: #323232;
  478. display: flex;
  479. align-items: center;
  480. }
  481. .tt {
  482. line-height: 48rpx;
  483. font-size: 28rpx;
  484. font-family: PingFang SC, PingFang SC-Bold;
  485. font-weight: 700;
  486. text-align: left;
  487. color: #333333;
  488. padding-left: 14rpx;
  489. }
  490. .item {
  491. width: 630rpx;
  492. height: 452rpx;
  493. background: #ffffff;
  494. border-radius: 16rpx;
  495. padding: 40rpx;
  496. margin-bottom: 20rpx;
  497. }
  498. .item-time {
  499. font-size: 32rpx;
  500. font-family: PingFang SC, PingFang SC-Bold;
  501. font-weight: 700;
  502. text-align: left;
  503. color: #fe8a3b;
  504. }
  505. .item-price {
  506. font-size: 32rpx;
  507. font-family: PingFang SC, PingFang SC-Bold;
  508. font-weight: 700;
  509. text-align: right;
  510. color: #f32713;
  511. }
  512. .item-button {
  513. width: 100%;
  514. height: 72rpx;
  515. line-height: 72rpx;
  516. border: 2rpx solid #c7c7c7;
  517. border-radius: 8rpx;
  518. font-size: 24rpx;
  519. font-family: PingFang SC, PingFang SC-Bold;
  520. font-weight: 700;
  521. text-align: center;
  522. color: #333333;
  523. margin: 0 auto;
  524. }
  525. .item-font1 {
  526. line-height: 44rpx;
  527. font-size: 32rpx;
  528. font-family: PingFang SC, PingFang SC-Bold;
  529. font-weight: 700;
  530. text-align: left;
  531. margin-bottom: 12rpx;
  532. }
  533. .item-font2 {
  534. font-size: 20rpx;
  535. font-family: PingFang SC, PingFang SC-Regular;
  536. font-weight: 400;
  537. text-align: left;
  538. color: #717171;
  539. }
  540. .item-font3 {
  541. font-size: 24rpx;
  542. font-family: PingFang SC, PingFang SC-Bold;
  543. font-weight: 700;
  544. text-align: left;
  545. color: #333333;
  546. line-height: 44rpx;
  547. }
  548. .item-font4 {
  549. font-size: 28rpx;
  550. font-family: PingFang SC, PingFang SC-Bold;
  551. font-weight: 700;
  552. text-align: left;
  553. color: #333333;
  554. }
  555. .Top-line {
  556. height: 60rpx;
  557. line-height: 60rpx;
  558. font-size: 20rpx;
  559. font-family: PingFang SC, PingFang SC-Medium;
  560. font-weight: 500;
  561. text-align: center;
  562. border-radius: 8px;
  563. padding: 0 20rpx;
  564. position: absolute;
  565. right: 30rpx;
  566. color: #fdfaf8;
  567. background-color: #292421;
  568. }
  569. .Top-line.online {
  570. color: #fdfaf8;
  571. background: #4eed78;
  572. }
  573. .name,
  574. .address {
  575. font-size: 28rpx;
  576. font-weight: normal;
  577. }
  578. .address {
  579. display: -webkit-box;
  580. -webkit-box-orient: vertical;
  581. -webkit-line-clamp: 2;
  582. overflow: hidden;
  583. }
  584. </style>