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.

670 lines
14 KiB

8 months ago
8 months ago
8 months ago
8 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="widthFix"></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. confirmText : '确认',
  199. cancelText : '取消',
  200. success: function(res) {
  201. if (res.confirm) {
  202. uni.showLoading({
  203. title: is ? '上线中...' : '下线中...'
  204. });
  205. self.$utils.getLocation(loca => {
  206. self.$api('tenOnline', {
  207. bookable: isY, //是否上线
  208. ...loca,
  209. }, res => {
  210. if (res.code == 200) {
  211. uni.hideLoading();
  212. self.getUserInfo();
  213. uni.showToast({
  214. title: is ? '已上线' : '已下线',
  215. icon: 'none'
  216. })
  217. }
  218. })
  219. })
  220. } else if (res.cancel) {
  221. }
  222. }
  223. });
  224. },
  225. clickBanner() {
  226. uni.navigateTo({
  227. url: '/pages/login/login'
  228. })
  229. },
  230. clickNotice() {
  231. uni.navigateTo({
  232. url: '/pages/index/notice'
  233. })
  234. },
  235. clickFillin() {
  236. uni.navigateTo({
  237. url: '/pages/index/fillin'
  238. })
  239. },
  240. clickSpring() {
  241. uni.navigateTo({
  242. url: '/pages/spring/vote'
  243. })
  244. },
  245. clickSpRank() {
  246. uni.navigateTo({
  247. url: '/pages/spring/rank'
  248. })
  249. },
  250. clickMore() {
  251. uni.navigateTo({
  252. url: '/pages/index/infor'
  253. })
  254. },
  255. clickStar() {
  256. uni.navigateTo({
  257. url: '/pages/star/index'
  258. })
  259. },
  260. clickVote() {
  261. uni.switchTab({
  262. url: '/pages/star/vote'
  263. })
  264. },
  265. clickRank() {
  266. uni.switchTab({
  267. url: '/pages/index/rank'
  268. })
  269. },
  270. clickInfo(id) {
  271. uni.navigateTo({
  272. url: `/pages/index/infod?id=${id}`
  273. })
  274. },
  275. refreshOnLine() { //刷新用户位置
  276. let isY = this.userInfo.bookable == 'Y' ? 'Y' : 'N'
  277. this.$utils.getLocation(loca => {
  278. this.$api('tenOnline', {
  279. bookable: isY, //是否上线
  280. ...loca,
  281. }, res => {})
  282. })
  283. },
  284. initData() { //初始化时间项目数据
  285. this.$api('initTerTime', {}, res => {})
  286. this.$api('initTerProject', {}, res => {})
  287. },
  288. //跳转订单页面
  289. toOrder() {
  290. uni.switchTab({
  291. url: '/pages/index/order'
  292. })
  293. }
  294. }
  295. }
  296. </script>
  297. <style scoped lang="scss">
  298. body {
  299. background-color: #f3f3f3;
  300. }
  301. .center {
  302. width: calc(100vw - 72rpx);
  303. height: 194rpx;
  304. display: flex;
  305. padding: 0 36rpx 0;
  306. align-items: center;
  307. background-color: #FFF;
  308. }
  309. .my-swipe {
  310. width: 100%;
  311. height: 334rpx;
  312. margin: 0px auto;
  313. border-radius: 15rpx;
  314. overflow: hidden;
  315. .banner-image {
  316. width: 100%;
  317. vertical-align: middle;
  318. }
  319. }
  320. // .center image {
  321. // width: 58rpx;
  322. // height: 58rpx;
  323. // margin-right: 20rpx;
  324. // }
  325. .font-m {
  326. line-height: 58rpx;
  327. font-family: PingFang SC, PingFang SC-Heavy;
  328. font-weight: 800;
  329. text-align: left;
  330. color: #292421;
  331. }
  332. .font-n {
  333. height: 42rpx;
  334. line-height: 42rpx;
  335. font-size: 20rpx;
  336. font-family: PingFang SC, PingFang SC-Medium;
  337. font-weight: 500;
  338. text-align: center;
  339. color: #fdfaf8;
  340. width: 168rpx;
  341. background: #4eed78;
  342. border-radius: 8px;
  343. margin-top: 5rpx;
  344. margin-left: 20rpx;
  345. }
  346. .banner-font-1 {
  347. width: 292rpx;
  348. height: 142rpx;
  349. font-size: 72rpx;
  350. line-height: 66rpx;
  351. font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  352. font-weight: 400;
  353. text-align: left;
  354. color: #ffffff;
  355. letter-spacing: -1;
  356. text-shadow: 0px 6px 6px 0px rgba(0, 165, 141, 0.70);
  357. position: absolute;
  358. left: 52rpx;
  359. top: 34rpx;
  360. }
  361. .banner-font-2 {
  362. height: 28rpx;
  363. line-height: 28rpx;
  364. font-size: 24rpx;
  365. font-family: PingFang SC, PingFang SC-Regular;
  366. font-weight: 400;
  367. text-align: left;
  368. color: #ffffff;
  369. text-shadow: 0 4rpx 6rpx 0 rgba(0, 165, 141, 0.70);
  370. position: absolute;
  371. left: 52rpx;
  372. top: 138rpx;
  373. }
  374. .banner-button {
  375. width: 240rpx;
  376. height: 56rpx;
  377. line-height: 56rpx;
  378. background: #ffdb75;
  379. border-radius: 24rpx;
  380. box-shadow: 0 6rpx 6rpx 0 rgba(17, 106, 93, 0.23);
  381. position: absolute;
  382. left: 52rpx;
  383. top: 220rpx;
  384. font-size: 24rpx;
  385. font-family: PingFang SC, PingFang SC-Bold;
  386. font-weight: 700;
  387. text-align: center;
  388. color: #26c591;
  389. }
  390. .card-1 {
  391. height: 100rpx;
  392. line-height: 100rpx;
  393. background: #ffffff;
  394. border-radius: 16rpx;
  395. font-size: 28rpx;
  396. font-family: PingFang SC, PingFang SC-Bold;
  397. font-weight: 700;
  398. text-align: left;
  399. color: #333333;
  400. padding: 0 20rpx;
  401. margin: 20rpx 0;
  402. }
  403. .button-1 {
  404. font-size: 28rpx;
  405. font-family: PingFang SC, PingFang SC-Bold;
  406. font-weight: 700;
  407. text-align: center;
  408. color: #e25851;
  409. width: 148rpx;
  410. line-height: 54rpx;
  411. height: 54rpx;
  412. background: #fdd5d3;
  413. border: 2rpx solid #e98986;
  414. border-radius: 30rpx;
  415. position: absolute;
  416. right: 20rpx;
  417. top: 23rpx;
  418. }
  419. .card-2 {
  420. height: 420rpx;
  421. background: #ffffff;
  422. border-radius: 16rpx;
  423. line-height: 80rpx;
  424. font-size: 28rpx;
  425. font-family: PingFang SC, PingFang SC-Bold;
  426. font-weight: 700;
  427. text-align: left;
  428. color: #333333;
  429. padding: 0 20rpx;
  430. }
  431. .card-item {
  432. width: 322rpx;
  433. height: 140rpx;
  434. background: linear-gradient(174deg, #f07a77 5%, #e58988 96%);
  435. border-radius: 12rpx;
  436. margin-bottom: 20rpx;
  437. }
  438. .font-n0 {
  439. height: 80rpx;
  440. line-height: 80rpx;
  441. font-size: 44rpx;
  442. font-family: PingFang SC, PingFang SC-Bold;
  443. font-weight: 700;
  444. text-align: center;
  445. color: #ffffff;
  446. }
  447. .font-n1 {
  448. height: 34rpx;
  449. line-height: 34rpx;
  450. font-size: 24rpx;
  451. font-family: PingFang SC, PingFang SC-Regular;
  452. font-weight: 400;
  453. text-align: center;
  454. color: #ffffff;
  455. }
  456. .item-a {
  457. background: linear-gradient(174deg, #f07a77 5%, #e58988 96%);
  458. }
  459. .item-b {
  460. background: linear-gradient(174deg, #fc8048 5%, #ed9555 96%);
  461. }
  462. .item-c {
  463. background: linear-gradient(174deg, #4fd3bc 5%, #74e5d1 96%);
  464. }
  465. .item-d {
  466. background: linear-gradient(174deg, #68d9eb 5%, #78c9e6 96%);
  467. }
  468. .rr {
  469. height: 52rpx;
  470. background: #fbecdd;
  471. border-radius: 16rpx;
  472. width: calc(710rpx - 40rpx);
  473. padding: 20rpx;
  474. margin: 20rpx 0;
  475. }
  476. .xx {
  477. width: 602rpx;
  478. height: 56rpx;
  479. font-size: 20rpx;
  480. font-family: PingFang SC, PingFang SC-Regular;
  481. font-weight: 400;
  482. text-align: left;
  483. color: #323232;
  484. display: flex;
  485. align-items: center;
  486. }
  487. .tt {
  488. line-height: 48rpx;
  489. font-size: 28rpx;
  490. font-family: PingFang SC, PingFang SC-Bold;
  491. font-weight: 700;
  492. text-align: left;
  493. color: #333333;
  494. padding-left: 14rpx;
  495. }
  496. .item {
  497. width: 630rpx;
  498. height: 452rpx;
  499. background: #ffffff;
  500. border-radius: 16rpx;
  501. padding: 40rpx;
  502. margin-bottom: 20rpx;
  503. }
  504. .item-time {
  505. font-size: 32rpx;
  506. font-family: PingFang SC, PingFang SC-Bold;
  507. font-weight: 700;
  508. text-align: left;
  509. color: #fe8a3b;
  510. }
  511. .item-price {
  512. font-size: 32rpx;
  513. font-family: PingFang SC, PingFang SC-Bold;
  514. font-weight: 700;
  515. text-align: right;
  516. color: #f32713;
  517. }
  518. .item-button {
  519. width: 100%;
  520. height: 72rpx;
  521. line-height: 72rpx;
  522. border: 2rpx solid #c7c7c7;
  523. border-radius: 8rpx;
  524. font-size: 24rpx;
  525. font-family: PingFang SC, PingFang SC-Bold;
  526. font-weight: 700;
  527. text-align: center;
  528. color: #333333;
  529. margin: 0 auto;
  530. }
  531. .item-font1 {
  532. line-height: 44rpx;
  533. font-size: 32rpx;
  534. font-family: PingFang SC, PingFang SC-Bold;
  535. font-weight: 700;
  536. text-align: left;
  537. margin-bottom: 12rpx;
  538. }
  539. .item-font2 {
  540. font-size: 20rpx;
  541. font-family: PingFang SC, PingFang SC-Regular;
  542. font-weight: 400;
  543. text-align: left;
  544. color: #717171;
  545. }
  546. .item-font3 {
  547. font-size: 24rpx;
  548. font-family: PingFang SC, PingFang SC-Bold;
  549. font-weight: 700;
  550. text-align: left;
  551. color: #333333;
  552. line-height: 44rpx;
  553. }
  554. .item-font4 {
  555. font-size: 28rpx;
  556. font-family: PingFang SC, PingFang SC-Bold;
  557. font-weight: 700;
  558. text-align: left;
  559. color: #333333;
  560. }
  561. .Top-line {
  562. height: 60rpx;
  563. line-height: 60rpx;
  564. font-size: 20rpx;
  565. font-family: PingFang SC, PingFang SC-Medium;
  566. font-weight: 500;
  567. text-align: center;
  568. border-radius: 8px;
  569. padding: 0 20rpx;
  570. position: absolute;
  571. right: 30rpx;
  572. color: #fdfaf8;
  573. background-color: #292421;
  574. }
  575. .Top-line.online {
  576. color: #fdfaf8;
  577. background: #4eed78;
  578. }
  579. .name,
  580. .address {
  581. font-size: 28rpx;
  582. font-weight: normal;
  583. }
  584. .address {
  585. display: -webkit-box;
  586. -webkit-box-orient: vertical;
  587. -webkit-line-clamp: 2;
  588. overflow: hidden;
  589. }
  590. </style>