engineerCenter.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  1. <template>
  2. <view class="center">
  3. <view class="head">
  4. <view class="left">
  5. <image :src="$globalData.publicUrl+infoData.cPortrait" mode=""></image>
  6. </view>
  7. <view class="middle">
  8. <view class="name">
  9. {{infoData.cNickName}}
  10. </view>
  11. <view class="address">
  12. {{address}}
  13. </view>
  14. </view>
  15. <!-- <view class="right" @click="getAddress">
  16. 更换位置
  17. </view> -->
  18. </view>
  19. <view class="jsdata">
  20. <view class="num">
  21. <view class="item">
  22. <text>本月订单数</text>
  23. <text class="amount"><span>{{jsData.orderNum}}</span>单</text>
  24. </view>
  25. <view class="item">
  26. <text>本月在线时长</text>
  27. <text class="amount"><span>{{onLine.toFixed(2)}}</span>时</text>
  28. </view>
  29. <view class="item">
  30. <text>本月营业额</text>
  31. <text class="amount"><span>{{jsData.turnover}}</span>元</text>
  32. </view>
  33. </view>
  34. <view class="num first">
  35. <view class="item">
  36. <text>余额</text>
  37. <text class="amount"><span>{{money.dBalance}}</span>元</text>
  38. </view>
  39. <view class="item" v-if="money.getAmount > 0">
  40. <text>可提现</text>
  41. <text class="amount"><span>{{money.getAmount}}</span>元</text>
  42. </view>
  43. <view class="item" v-else>
  44. 0.00
  45. <text>可提现</text>
  46. </view>
  47. <view class="withdraw" @click="goWithdraw">
  48. 申请提现
  49. </view>
  50. </view>
  51. </view>
  52. <view class="warn">
  53. <view class="top">
  54. <view class="work is_work" v-if="isWork">
  55. <image src="../../static/identify/work.png" mode=""></image>
  56. 在线中
  57. </view>
  58. <view class="work" v-else>
  59. <image src="../../static/identify/rest.png" mode=""></image>
  60. 休息中
  61. </view>
  62. <view class="goWork" v-if="isWork" @click="cutWork">
  63. 下线
  64. </view>
  65. <view class="goWork" v-else @click="cutWork">
  66. 上线
  67. </view>
  68. </view>
  69. <view class="bottom" @click="warn">
  70. <!-- <image src="../../static/other/warn.png" mode=""></image> -->
  71. 报警/求助
  72. </view>
  73. </view>
  74. <view class="other">
  75. <view class="title">
  76. 其他功能
  77. </view>
  78. <view class="fun_box">
  79. <view class="function" @click="goOrder">
  80. <image src="../../static/other/order.png" mode=""></image>
  81. <span class="order_num" v-if="orderNum>0">{{orderNum}}</span>
  82. 订单
  83. </view>
  84. <view class="function" @click="goFree">
  85. <image src="../../static/other/set.png" mode=""></image>
  86. 设置免车费
  87. </view>
  88. <view class="function" @click="goEdit">
  89. <image src="../../static/other/edit.png" mode=""></image>
  90. 编辑资料
  91. </view>
  92. <view class="function" @click="qrCodeShow">
  93. <image src="../../static/other/code.png" mode=""></image>
  94. 我的分销码
  95. </view>
  96. </view>
  97. </view>
  98. <view class="work">
  99. </view>
  100. <!-- 分销码弹窗 -->
  101. <view class="qr_code" @click="qrCodeShow" v-if="isQrcodeShow">
  102. <view class="img_box">
  103. <view class="logo">
  104. <image src="/static/other/code_logo.png" mode=""></image>
  105. </view>
  106. <view class="title">扫码下单 一键预约</view>
  107. <image :src="urlView" mode=""></image>
  108. <view class="foot">多名技师|在线接单</view>
  109. </view>
  110. </view>
  111. <!-- 添加银行卡提示弹窗 -->
  112. <view class="add_blankcard" v-if="isAddBlank">
  113. <view class="popup">
  114. <view class="popup_title">
  115. 申请提现
  116. </view>
  117. <view class="popup_center">
  118. 您还没有绑定银行卡,<br/>
  119. 请先去添加银行卡再进行提现
  120. </view>
  121. <view class="btn">
  122. <view class="cancel" @click="isAddBlank = false">
  123. 取消
  124. </view>
  125. <view class="add" @click="addBlank">
  126. 添加银行卡
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. </template>
  133. <script>
  134. // import { Router } from "../../../utils/common.js";
  135. import {
  136. getwxQrCode,
  137. freeFare,
  138. engineDetail,
  139. work,
  140. selectApp,
  141. alertOrder,
  142. getInfo,
  143. getJsLocation,
  144. waitOrder,
  145. } from '../../api/index.js'
  146. export default {
  147. data() {
  148. return {
  149. isWork: false,
  150. urlView: '',
  151. isQrcodeShow: false,
  152. id: '',
  153. infoData: {},
  154. jsData: {},
  155. money: {},
  156. onLine: '',
  157. address: '',
  158. latitude: '',
  159. longitude: '',
  160. name: '',
  161. isAddBlank:false,
  162. orderNum:0,
  163. cJsId:''
  164. }
  165. },
  166. methods: {
  167. //添加银行卡
  168. addBlank(){
  169. uni.navigateTo({
  170. url: './add_blank'
  171. })
  172. this.isAddBlank = false
  173. },
  174. //更换位置
  175. getAddress() {
  176. uni.chooseLocation({
  177. success: res => {
  178. this.address = res.address;
  179. this.latitude = res.latitude;
  180. this.longitude = res.longitude;
  181. this.name = res.name
  182. let data = {
  183. address: this.address,
  184. name: this.name,
  185. latitude: this.latitude,
  186. longitude: this.longitude,
  187. cOpenId: uni.getStorageSync('wx_copenid')
  188. }
  189. getJsLocation(data).then(res => {
  190. this.getIsWork()
  191. })
  192. }
  193. });
  194. },
  195. //报警
  196. warn() {
  197. let data = {}
  198. data.jsId = this.id
  199. alertOrder(data).then(res => {
  200. if (res.data.code == 200) {
  201. uni.showToast({
  202. title: '已通知地区负责人',
  203. icon: 'none'
  204. })
  205. } else {
  206. uni.showToast({
  207. title: res.data.msg,
  208. icon: 'none'
  209. })
  210. }
  211. })
  212. },
  213. getInfo() {
  214. getInfo().then(res => {
  215. this.money = res.data.data
  216. })
  217. },
  218. alertOrder() {
  219. // alertOrder
  220. },
  221. goWithdraw() {
  222. if (this.money.getAmount <= 0) {
  223. uni.showToast({
  224. title: '暂无可提现金额',
  225. icon: 'none'
  226. })
  227. }
  228. else {
  229. uni.navigateTo({
  230. url: './withdraw'
  231. })
  232. }
  233. },
  234. selectApp() {
  235. let data = {}
  236. data.openId = uni.getStorageSync('wx_copenid')
  237. selectApp(data).then(res => {
  238. this.jsData = res.data.data,
  239. this.onLine = this.jsData.onLine / 60
  240. })
  241. },
  242. cutWork() {
  243. let data = {}
  244. data.id = this.id
  245. data.nStatus2 = this.isWork ? '-1' : '0'
  246. // data.nStatus =
  247. work(data).then(res => {
  248. if (res.data.code == 200) {
  249. uni.showToast({
  250. title: '设置成功',
  251. icon: 'none'
  252. })
  253. this.getIsWork()
  254. } else {
  255. uni.showToast({
  256. title: res.data.msg,
  257. icon: 'none'
  258. })
  259. }
  260. })
  261. },
  262. getIsWork() {
  263. var openid = {
  264. cOpenId: uni.getStorageSync('wx_copenid')
  265. }
  266. engineDetail(openid).then(res => {
  267. console.log(res)
  268. this.address = res.data.data.name
  269. this.cJsId = res.data.data.id
  270. if (res.data.code == 200) {
  271. this.infoData = res.data.data
  272. this.id = res.data.data.id
  273. if (res.data.data.nStatus2 == '-1') { //未上岗
  274. this.isWork = false
  275. } else if (res.data.data.nStatus2 == '0') { //以上
  276. this.isWork = true
  277. }
  278. }
  279. let data = {
  280. cJsId:this.cJsId
  281. }
  282. waitOrder(data).then(res => {
  283. console.log(res)
  284. this.orderNum = res.data.data
  285. })
  286. })
  287. },
  288. qrCodeShow() {
  289. this.isQrcodeShow = !this.isQrcodeShow
  290. },
  291. getwxQrCode() {
  292. var openId = {
  293. openId: uni.getStorageSync('wx_copenid')
  294. }
  295. getwxQrCode(openId).then(res => {
  296. let TICKET = res.data.ticket
  297. this.urlView = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' + TICKET
  298. })
  299. },
  300. goEdit() {
  301. uni.navigateTo({
  302. url: './indent?title=编辑资料'
  303. })
  304. },
  305. goOrder() {
  306. uni.navigateTo({
  307. url: './js_order'
  308. })
  309. },
  310. goFree() {
  311. uni.navigateTo({
  312. url: './free_fare'
  313. })
  314. },
  315. getOrderNum(){
  316. console.log(this.cJsId)
  317. }
  318. },
  319. onShow() {
  320. this.getwxQrCode()
  321. this.getIsWork()
  322. this.selectApp()
  323. this.getInfo()
  324. }
  325. }
  326. </script>
  327. <style lang="scss" scoped>
  328. .center {
  329. width: 100vw;
  330. height: 100vh;
  331. padding: 30rpx 38rpx;
  332. box-sizing: border-box;
  333. background: linear-gradient(152deg, #DCFFF8 0%, #F1FEFF 100%);
  334. }
  335. .head {
  336. width: 100%;
  337. // height: 158rpx;
  338. display: flex;
  339. align-items: center;
  340. background: #FFFFFF;
  341. box-shadow: 0px 4rpx 12rpx 0px rgba(88, 209, 187, 0.1);
  342. border-radius: 24rpx;
  343. padding: 24rpx;
  344. box-sizing: border-box;
  345. .left {
  346. border-radius: 100px;
  347. overflow: hidden;
  348. width: 80rpx;
  349. height: 80rpx;
  350. margin-right: 32rpx;
  351. background-color: #ccc;
  352. // margin-bottom: 20rpx;
  353. image {
  354. width: 80rpx;
  355. height: 80rpx;
  356. }
  357. }
  358. .middle {
  359. width: 344rpx;
  360. margin-right: 28rpx;
  361. .name {
  362. font-size: 28rpx;
  363. color: #2F3437;
  364. line-height: 33rpx;
  365. }
  366. .address {
  367. font-size: 24rpx;
  368. color: #666666;
  369. line-height: 32rpx;
  370. margin-top: 8rpx;
  371. }
  372. }
  373. .right {
  374. width: 152rpx;
  375. height: 52rpx;
  376. background: linear-gradient(135deg, #1AD8CF 0%, #21C8C0 100%);
  377. border-radius: 98rpx;
  378. font-size: 26rpx;
  379. color: #FFFFFF;
  380. line-height: 52rpx;
  381. text-align: center;
  382. }
  383. }
  384. .jsdata {
  385. width: 100%;
  386. height: 264rpx;
  387. background: #FFFFFF;
  388. box-shadow: 0px 4rpx 12rpx 0px rgba(88, 209, 187, 0.1);
  389. border-radius: 20rpx;
  390. padding: 24rpx;
  391. box-sizing: border-box;
  392. margin-top: 24rpx;
  393. .num {
  394. // width: 95%;
  395. height: 50%;
  396. margin: 0 auto;
  397. border-bottom: 1px solid #EEEEEE;
  398. box-sizing: border-box;
  399. // background-color: #fff;
  400. display: flex;
  401. justify-content: space-between;
  402. // align-items: center;
  403. .item {
  404. // flex: 1;
  405. // height: 100%;
  406. display: flex;
  407. flex-direction: column;
  408. align-items: center;
  409. text {
  410. // margin-top: 5px;
  411. color: #2F3437;
  412. font-size: 26rpx;
  413. display: inline-block;
  414. }
  415. .amount {
  416. font-size: 24rpx;
  417. color: #5E686E;
  418. line-height: 30rpx;
  419. margin-top: 10rpx;
  420. span {
  421. font-size: 26rpx;
  422. color: #03C8BE;
  423. margin-right: 4rpx;
  424. }
  425. }
  426. }
  427. .address_title {
  428. width: 18%;
  429. }
  430. .address {
  431. width: 60%;
  432. font-size: 30rpx;
  433. }
  434. .update_address {
  435. // width: 25%;
  436. width: 70px;
  437. height: 50rpx;
  438. text-align: center;
  439. background: linear-gradient(to right, #35c99d, #27aea7);
  440. border-radius: 10rpx;
  441. color: #ffffff;
  442. padding: 10rpx;
  443. }
  444. }
  445. .first {
  446. // margin-top: 24rpx;
  447. border: none;
  448. align-items: center;
  449. .withdraw {
  450. width: 152rpx;
  451. height: 52rpx;
  452. background: linear-gradient(135deg, #FF8B66 0%, #EE5B2D 100%);
  453. border-radius: 98rpx;
  454. text-align: center;
  455. // margin-left: -50px;
  456. padding:0px 10rpx;
  457. box-sizing: border-box;
  458. line-height: 52rpx;
  459. color: #fff;
  460. }
  461. }
  462. .money {
  463. // width: 100%;
  464. box-sizing: border-box;
  465. display: flex;
  466. justify-content: space-between;
  467. align-items: center;
  468. .item {
  469. // flex: 1;
  470. height: 100%;
  471. display: flex;
  472. flex-direction: column;
  473. align-items: center;
  474. text {
  475. margin-top: 5px;
  476. color: #999;
  477. font-size: 26rpx;
  478. }
  479. }
  480. .withdraw {
  481. width: 70px;
  482. height: 50rpx;
  483. text-align: center;
  484. background: linear-gradient(to right, #35c99d, #27aea7);
  485. border-radius: 10rpx;
  486. // margin-left: -50px;
  487. margin-right: -30px;
  488. padding: 10rpx;
  489. color: #fff;
  490. }
  491. }
  492. }
  493. .warn {
  494. width: 100%;
  495. height: auto;
  496. margin: 10px auto 0px;
  497. border-radius: 20rpx;
  498. padding: 26rpx 24rpx;
  499. box-sizing: border-box;
  500. background-color: #fff;
  501. .top {
  502. width: 100%;
  503. display: flex;
  504. justify-content: space-between;
  505. // margin: 0 auto;
  506. padding-bottom: 22rpx;
  507. border-bottom: 1px solid #eeeeee;
  508. margin-bottom: 20rpx;
  509. text {
  510. color: #a6482c;
  511. }
  512. .goWork {
  513. width: 100rpx;
  514. height: 50rpx;
  515. background: linear-gradient(to right, #35c99d, #27aea7);
  516. color: #fff;
  517. text-align: center;
  518. line-height: 50rpx;
  519. border-radius: 98rpx;
  520. padding: 0px 32rpx;
  521. }
  522. .work {
  523. display: flex;
  524. align-items: center;
  525. font-size: 32rpx;
  526. color: #999999;
  527. line-height: 24rpx;
  528. image {
  529. width: 44rpx;
  530. height: 44rpx;
  531. margin-right: 12rpx;
  532. }
  533. }
  534. .is_work {
  535. color: #02CEC4;
  536. }
  537. }
  538. .bottom {
  539. width: 100%;
  540. height: 72rpx;
  541. background: #F24F62;
  542. color: #fff;
  543. display: flex;
  544. align-items: center;
  545. justify-content: center;
  546. border-radius: 10rpx;
  547. image {
  548. width: 50rpx;
  549. height: 50rpx;
  550. margin-right: 10rpx;
  551. }
  552. }
  553. }
  554. .other {
  555. width: 100%;
  556. height: auto;
  557. margin: 10px auto 0px;
  558. border-radius: 20rpx;
  559. padding: 26rpx 24rpx;
  560. box-sizing: border-box;
  561. background-color: #fff;
  562. .title{
  563. margin-bottom: 24rpx;
  564. font-size: 28rpx;
  565. color: #2F3437;
  566. line-height: 33rpx;
  567. font-weight: 600;
  568. }
  569. .fun_box{
  570. width: 100%;
  571. display: flex;
  572. justify-content: space-around;
  573. .function{
  574. font-size: 24rpx;
  575. color: #2F3437;
  576. line-height: 28rpx;
  577. display: flex;
  578. flex-direction: column;
  579. align-items: center;
  580. position: relative;
  581. .order_num{
  582. position: absolute;
  583. top: -10rpx;
  584. right: -20rpx;
  585. // width: 30rpx;
  586. padding: 0px 10rpx;
  587. height: 30rpx;
  588. background-color: #fa3534;
  589. border-radius: 30rpx;
  590. color: #ffffff;
  591. display: flex;
  592. // align-items: center;
  593. justify-content: center;
  594. }
  595. image{
  596. width: 64rpx;
  597. height: 64rpx;
  598. margin-bottom: 8rpx;
  599. }
  600. }
  601. }
  602. }
  603. .list {
  604. // width: calc(100% - 60rpx);
  605. width: 100%;
  606. // height: 70vh;
  607. border-top-left-radius: 30rpx;
  608. border-top-right-radius: 30rpx;
  609. // padding: 0 30rpx;
  610. margin-top: 30rpx;
  611. display: flex;
  612. justify-content: space-between;
  613. flex-wrap: wrap;
  614. .item {
  615. width: 100%;
  616. height: 80rpx;
  617. line-height: 100rpx;
  618. position: relative;
  619. text-align: center;
  620. // background-color: #c0edf6;
  621. background-color: #fff;
  622. padding: 20rpx;
  623. border-radius: 20rpx;
  624. margin-bottom: 10px;
  625. display: flex;
  626. justify-content: space-between;
  627. align-items: center;
  628. box-sizing: border-box;
  629. .left {
  630. display: flex;
  631. align-items: center;
  632. height: 100%;
  633. image {
  634. width: 50rpx;
  635. height: 50rpx;
  636. margin-right: 20rpx;
  637. }
  638. }
  639. .right {
  640. width: 40rpx;
  641. height: 40rpx;
  642. image {
  643. width: 40rpx;
  644. height: 40rpx;
  645. }
  646. }
  647. view {
  648. font-size: 30rpx;
  649. color: #333;
  650. height: 30rpx;
  651. line-height: 30rpx;
  652. }
  653. }
  654. }
  655. .qr_code {
  656. width: 100vw;
  657. height: 100vh;
  658. // background-color: rgba(0, 0, 0, 0.8);
  659. background-image: url('/static/other/code_bg.png');
  660. background-size: cover; /* 完全覆盖,可能裁剪 */
  661. background-position: center; /* 图片居中(避免裁剪关键部分) */
  662. z-index: 999999;
  663. position: absolute;
  664. top: 0;
  665. left: 0;
  666. display: flex;
  667. justify-content: center;
  668. align-items: center;
  669. .img_box {
  670. width: 598rpx;
  671. height: 724rpx;
  672. background-color: #fff;
  673. // height: 800rpx;
  674. border-radius: 16rpx;
  675. // overflow: hidden;
  676. position: relative;
  677. display: flex;
  678. flex-direction: column;
  679. justify-content: center;
  680. align-items: center;
  681. margin-top: 160rpx;
  682. .logo{
  683. position: absolute;
  684. top: 0;
  685. left: 50%;
  686. z-index: 99999;
  687. transform: translate(-50%,-50%);
  688. image{
  689. width: 144rpx;
  690. height: 144rpx;
  691. }
  692. }
  693. image {
  694. width: 400rpx;
  695. height: 400rpx;
  696. }
  697. }
  698. .title{
  699. font-size: 36rpx;
  700. margin-bottom: 32rpx;
  701. }
  702. .foot{
  703. width: 316rpx;
  704. height: 48rpx;
  705. background: #F4F5F7;
  706. border-radius: 4rpx;
  707. margin-top: 32rpx;
  708. font-size: 28rpx;
  709. color: #788096;
  710. display: flex;
  711. justify-content: center;
  712. align-items: center;
  713. }
  714. }
  715. .work {
  716. width: 100%;
  717. }
  718. .add_blankcard{
  719. width: 100vw;
  720. height: 100vh;
  721. z-index: 999999;
  722. position: absolute;
  723. top: 0;
  724. left: 0;
  725. background: rgba(0,0,0,0.4);
  726. padding: 0px 60rpx;
  727. // display: flex;
  728. // align-items: center;
  729. .popup{
  730. width: 630rpx;
  731. height: 420rpx;
  732. background: #FFFFFF;
  733. border-radius: 24rpx;
  734. margin-top: 564rpx;
  735. display: flex;
  736. flex-direction: column;
  737. .popup_title{
  738. width:100%;
  739. height: 92rpx;
  740. background: #F8EDE6;
  741. border-radius: 24rpx 24rpx 0px 0px;
  742. font-size: 32rpx;
  743. color: #000000;
  744. font-weight: 700;
  745. text-align: center;
  746. line-height: 92rpx;
  747. }
  748. .popup_center{
  749. flex: 1;
  750. background-color: #fff;
  751. font-size: 28rpx;
  752. color: #333333;
  753. line-height: 39rpx;
  754. display: flex;
  755. align-items: center;
  756. justify-content: center;
  757. text-align: center;
  758. }
  759. .btn{
  760. height: 116rpx;
  761. background: #FFFFFF;
  762. border-radius: 0px 0px 24rpx 24rpx;
  763. border-top: 2rpx solid #EEEEEE;
  764. display: flex;
  765. justify-content: space-around;
  766. align-items: center;
  767. .cancel{
  768. width: 182rpx;
  769. height: 68rpx;
  770. border-radius: 106rpx ;
  771. border: 2rpx solid #BBBBBB;
  772. font-size: 32rpx;
  773. color: #999999;
  774. text-align: center;
  775. line-height: 68rpx;
  776. }
  777. .add{
  778. width: 268rpx;
  779. height: 68rpx;
  780. background: linear-gradient( 135deg, #FF8B66 0%, #EE5B2D 100%);
  781. border-radius: 44rpx;
  782. font-size: 32rpx;
  783. line-height: 68rpx;
  784. text-align: center;
  785. color: #FFFFFF;
  786. }
  787. }
  788. }
  789. }
  790. </style>