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.

669 lines
14 KiB

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