1
0

index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. <template>
  2. <view class="page">
  3. <uni-nav-bar :fixed="true" background-color="#FFE05C" :border="false" :statusBar="true" title="首页" />
  4. <view class="flex-row tuni ">
  5. <image class="profile" :src="userInfo.avatarUrl || '/static/ud4.png'"></image>
  6. <view class="tuniMsg">
  7. <view class="name ">
  8. <text>{{userInfo.name}}</text>
  9. </view>
  10. <view>
  11. <text class="biaoqian ">{{userInfo.post}}</text>
  12. </view>
  13. </view>
  14. <view class="flex-row justify-around tuni-right ">
  15. <view class="flex-col">
  16. <view class="flex-row justify-center dakaIcon ">
  17. <text>{{userInfo.subNumber}}</text>
  18. </view>
  19. <view class="flex-row justify-center dakaText ">
  20. <text>今日预约</text>
  21. </view>
  22. </view>
  23. <view class="flex-col" @click="promotion">
  24. <view class="flex-row justify-center dakaIcon ">
  25. <u-icon name="/static/index/erweima.png" size="35"></u-icon>
  26. </view>
  27. <!-- <view class="flex-row justify-center dakaText " >-->
  28. <!-- <text>拓客码</text>-->
  29. <!-- </view>-->
  30. </view>
  31. <view class="flex-col " @click="userScanCode">
  32. <view class="flex-row justify-center dakaIcon ">
  33. <u-icon name="/static/index/saoma.png" size="25"></u-icon>
  34. </view>
  35. <view class="flex-row justify-center dakaText ">
  36. <text>报到打卡</text>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="flex-row justify-around buttons">
  42. <!-- <view class="buttonItem" @click="call" v-if="currService && currService.callState == '2'">-->
  43. <!-- <text>叫号</text>-->
  44. <!-- </view>-->
  45. <view class="buttonItem" :class="{buttonState:buttonState[0]}" @click="next">
  46. <text>下一位</text>
  47. </view>
  48. <view class="buttonItem" :class="{buttonState:buttonState[1]}" @click="takePlace">
  49. <text>已就位</text>
  50. </view>
  51. <view class="buttonItem" :class="{buttonState:buttonState[2]}" @click="settle">
  52. <text>结算</text>
  53. </view>
  54. <view class="buttonItem" :class="{buttonState:buttonState[3]}" @click="addService">
  55. <text>添加服务</text>
  56. </view>
  57. </view>
  58. <view class="flex-row justify-center ">
  59. <view class="serviceMsg " v-if="currService">
  60. <view class="flex-row serviceInfo ">
  61. <image class="serviceProfile" :src="currService.avatar || '/static/ud4.png'" @click="avatarOpen">
  62. </image>
  63. <view class="flex-col justify-end serviceInfo-rigth ">
  64. <view class="flex-row justify-between ">
  65. <view class="">
  66. <view class="flex-row">
  67. <text class="servicename">{{currService.serviceObjectName}}</text>
  68. <text v-if="currService.isVip" class="biaoqian">会员客户</text>
  69. <text v-else class="biaoqian">现金客户</text>
  70. </view>
  71. <view class="">
  72. <text class="servicename">{{currService.no}}</text>
  73. </view>
  74. </view>
  75. <view class="flex-col justify-center ">
  76. <view class="flex-row justify-center tag" @click="openSelectServiceObjectPopup">
  77. <text>切换</text>
  78. <u-icon name="/static/index/qiehuan.png" size="18"></u-icon>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <view :style="{'height':'120rpx'}"></view>
  85. <view class="flex-row justify-center" v-if="!currService.balanceFlag">
  86. <view class="flex-row justify-center hintView">
  87. <view class="hint">
  88. <text>!</text>
  89. </view>
  90. <view class="hintCentent">
  91. <text>娇宝余额不足哟~</text>
  92. </view>
  93. </view>
  94. </view>
  95. <view class="flex-row justify-center" v-if="currService.balanceFlag && currService.balance *1 <= 200">
  96. <view class="flex-row justify-center hintView" :class="{hintViewBgColor2: currService.balance *1 <= 100,
  97. hintViewBgColor3: currService.balance *1 > 100 && currService.balance *1 <= 200}">
  98. <view class="hint">
  99. <text>!</text>
  100. </view>
  101. <view class="hintCentent">
  102. <text>娇宝余额充足~</text>
  103. </view>
  104. </view>
  105. </view>
  106. <view class="flex-col orderMsg">
  107. <view class="flex-row justify-between">
  108. <view class="flex-row">
  109. <u-icon name="/static/index/quhao.png" size="20"></u-icon>
  110. <text class="key">排号:</text>
  111. <text class="value">{{currService.planNumber}}</text>
  112. </view>
  113. <view class="flex-col justify-center stateStr">
  114. <text>{{currService.statusDesc}}</text>
  115. </view>
  116. </view>
  117. <view class="flex-row">
  118. <u-icon name="/static/index/orderNo1.png" size="20"></u-icon>
  119. <text class="key">订单编号:</text>
  120. <text class="value">{{currService.orderNo}}</text>
  121. </view>
  122. <view class="flex-row">
  123. <u-icon name="/static/index/jiandao.png" size="20"></u-icon>
  124. <text class="key">服务项目:</text>
  125. <text class="value">{{currService.serviceProject}}</text>
  126. </view>
  127. <view class="flex-row">
  128. <u-icon name="/static/index/tel.png" size="20"></u-icon>
  129. <text class="key">手机尾号:</text>
  130. <text class="value">{{currService.phone.substring(7,11)}}</text>
  131. </view>
  132. </view>
  133. <view class="flex-row justify-center">
  134. <view class="imgs">
  135. <view class="mmImgView" :class="{floatRight: (index+1) % 2==0,marginTop:index>1}"
  136. v-for="(i,index) in 0" :key="index">
  137. <image class="mmImg" mode="widthFix" src="/static/mn1.webp"></image>
  138. </view>
  139. </view>
  140. </view>
  141. <view class="flex-row justify-center" v-if="currService.status!==12">
  142. <view class="like">
  143. <text>{{currService.preference || '暂无'}}</text>
  144. </view>
  145. </view>
  146. </view>
  147. <view class="flex-col" :style="{'height':sysHeight}" v-else>
  148. <view class="flex-row justify-center">
  149. <image class="dataNull" src="/static/index/dataNull.png"></image>
  150. </view>
  151. <view class="flex-row justify-center dataNullText">
  152. <text>暂无服务项目,请点击下一位刷新页面</text>
  153. </view>
  154. </view>
  155. </view>
  156. <uni-popup ref="avatarPopup" type="center">
  157. <view class="avatarView " v-if="currService">
  158. <view class="flex-row justify-center">
  159. <image class="avatarOpen" mode="widthFix" :src="currService.avatar || '/static/ud4.png'"></image>
  160. </view>
  161. <view class="flex-row justify-center" :style="{'marginTop':'20rpx'}">
  162. <text>服务对象:{{currService.serviceObjectName}}</text>
  163. </view>
  164. </view>
  165. </uni-popup>
  166. <uni-popup ref="reminderPopup" type="center">
  167. <view class="reminderView ">
  168. <view class="reminderTitle">
  169. <text>保存用户喜好</text>
  170. </view>
  171. <view class="textareaView flex-row justify-center ">
  172. <textarea class="textarea" v-model="content" placeholder-style="color:#999999;fontSize:28rpx"
  173. placeholder="请输入用户喜好" />
  174. </view>
  175. <view class="flex-row justify-around" :style="{'marginTop':'20rpx'}">
  176. <view class="cancelButton " @click="closeReminderPopup">
  177. <text>取消</text>
  178. </view>
  179. <view class="confirmButton " @click="preference">
  180. <text>确定</text>
  181. </view>
  182. </view>
  183. </view>
  184. </uni-popup>
  185. <uni-popup ref="addServicePopup" @change="popupChange" type="bottom">
  186. <view class="addService">
  187. <scroll-view class="scrollY1 " scroll-y>
  188. <view class="flex-col">
  189. <view class="popupTitle">
  190. <text>选择服务项目</text>
  191. </view>
  192. <view class="flex-row justify-center">
  193. <view class="serviceItems ">
  194. <view class="serviceItem "
  195. :class="{vBackGround: serviceProjectListIndex === index,marginLeft16: (index+3) % 3!==0,marginTop24:index>2}"
  196. v-for="(item,index) in serviceProjectList" :key="index"
  197. @click="selectProject(item,index)">
  198. <text>{{item.serviceName}}</text>
  199. </view>
  200. </view>
  201. </view>
  202. <view class="popupTitle marginTop24">
  203. <text>选择服务技师</text>
  204. </view>
  205. <view class="flex-row justify-center">
  206. <view class="serviceItems ">
  207. <view class="flex-col serviceTeach "
  208. :class="{marginLeft28: (index+4) % 4!==0,marginTop24:index>3}"
  209. v-for="(item,index) in servicePersonList" :key="index"
  210. @click="servicePersonListIndex = index">
  211. <image class="serviceTeachImg" :src="item.facePhotoUrl ||'/static/ud4.png'"
  212. :class="{vBackGround: servicePersonListIndex === index}"></image>
  213. <view class="serviceTeachName">
  214. <text>{{item.personName}}</text>
  215. </view>
  216. <image v-if="servicePersonListIndex === index" class="vImage"
  217. src="/static/index/xuanzhong.png"></image>
  218. </view>
  219. </view>
  220. </view>
  221. </view>
  222. </scroll-view>
  223. <view class="flex-row justify-around">
  224. <view class="cancelButton " @click="closeAddServicePopup">
  225. <text>取消</text>
  226. </view>
  227. <view class="confirmButton" @click="addServiceProject">
  228. <text>确定</text>
  229. </view>
  230. </view>
  231. </view>
  232. </uni-popup>
  233. <uni-popup ref="selectServiceObjectPopup" @change="popupChange" type="bottom">
  234. <view class="addService">
  235. <view class="popupTitle">
  236. <text>切换服务对象</text>
  237. </view>
  238. <scroll-view class="scrollY" scroll-y>
  239. <view class="flex-row objectItem" :class="{'vBackGround': selectServiceObjectIndex === index}"
  240. v-for="(item,index) in selectServiceObjectList" :key="index"
  241. @click="selectServiceObjectIndex = index">
  242. <image class="objectImage" :src="item.facePhotoUrl || '/static/ud4.png'"></image>
  243. <view class="flex-col objectName ">
  244. <text>{{item.nickName}}</text>
  245. </view>
  246. <image v-if="selectServiceObjectIndex === index" class="vImage"
  247. src="/static/index/xuanzhong.png"></image>
  248. </view>
  249. </scroll-view>
  250. <view class="flex-row justify-around">
  251. <view class="cancelButton" @click="closeSelectServiceObjectPopup">
  252. <text>取消</text>
  253. </view>
  254. <view class="confirmButton" @click="switchServiceObject">
  255. <text>确定</text>
  256. </view>
  257. </view>
  258. </view>
  259. </uni-popup>
  260. <uni-popup ref="promotionPopup" type="center">
  261. <view class="promotionView">
  262. <view class="flex-row justify-center qrcodeView">
  263. <uv-qrcode ref="qrcode" size="400rpx" :value="qrcodeUrl" :options="options"></uv-qrcode>
  264. </view>
  265. <view class="flex-row justify-center">
  266. <text>娇骄儿造型</text>
  267. </view>
  268. </view>
  269. </uni-popup>
  270. </view>
  271. </template>
  272. <script>
  273. import MescrollItem from "./module/mescrollUni-item.vue";
  274. import QQMapWX from '../../common/js/qqmap/myqqmap-sdk.js'
  275. export default {
  276. components: {
  277. MescrollItem
  278. },
  279. data() {
  280. return {
  281. buttonState: [0, 0, 0, 0], //0:不禁用按钮,1:禁用按钮。
  282. previousServiceOrderId: '',
  283. content: '',
  284. selectServiceObjectList: [],
  285. selectServiceObjectIndex: -1,
  286. servicePersonList: [],
  287. servicePersonListIndex: 0,
  288. serviceProjectList: [],
  289. serviceProjectListIndex: 0,
  290. tabIndex: 0,
  291. sysHeight: '',
  292. readerHeight: '',
  293. readerWidth: '',
  294. userInfo: {},
  295. storeId: '',
  296. storeName: '',
  297. currService: null,
  298. qqMap: new QQMapWX({
  299. key: 'ZIABZ-543WB-747UM-JL5Y7-NDS4E-HWB4M',
  300. vm: this
  301. }),
  302. qrcodeUrl: 'https://jje.admin.xinyuekj.com.cn/recharge/recharge?storeId={promotionStoreId}&techNo={techNo}',
  303. options: {
  304. // 指定二维码前景,一般可在中间放logo
  305. foregroundImagePadding: 2,
  306. foregroundImageBorderRadius: 5,
  307. foregroundImageSrc: '/static/logo.png'
  308. }
  309. }
  310. },
  311. onLoad() {
  312. let sysInfo = uni.getSystemInfoSync()
  313. this.sysHeight = sysInfo.windowHeight - (sysInfo.windowWidth / 750) * 400 + 'px'
  314. this.readerHeight = sysInfo.windowHeight + 'px'
  315. this.readerWidth = sysInfo.windowWidth + 'px'
  316. },
  317. onShow() {
  318. this.getUserInfo()
  319. // this.userInfo = uni.getStorageSync('userInfo')
  320. // if (this.userInfo.signIn){
  321. // this.currServiceInfo()
  322. // }
  323. },
  324. methods: {
  325. avatarOpen() {
  326. this.$refs.avatarPopup.open()
  327. },
  328. promotion() {
  329. let data = {
  330. promotionStoreId: this.userInfo.workStoreId || '',
  331. techNo: this.userInfo.techNo || ''
  332. };
  333. for (let key in data) {
  334. let regexp = new RegExp("{" + key + "}"); // 构造正则表达式
  335. this.qrcodeUrl = this.qrcodeUrl.replace(regexp, data[key]); // 执行替换操作
  336. }
  337. console.log('++++qrcodeUrl+++++', this.qrcodeUrl)
  338. this.$refs.promotionPopup.open()
  339. },
  340. closeReminderPopup() {
  341. this.previousServiceOrderId = ''
  342. this.$refs.reminderPopup.close()
  343. },
  344. openSelectServiceObjectPopup() {
  345. this.$api.service.getServiceObjectList({
  346. orderServiceId: this.currService.orderServiceId,
  347. }).then(res => {
  348. this.selectServiceObjectList = res.data.data
  349. this.getServiceObjectUrl(this.selectServiceObjectList)
  350. uni.hideTabBar()
  351. this.$refs.selectServiceObjectPopup.open()
  352. })
  353. },
  354. // 获取图片
  355. getServiceObjectUrl(items) {
  356. for (let i = 0; i < items.length; i++) {
  357. let ptoto = items[i].facePhoto || items[i].personPhoto
  358. if (ptoto) {
  359. this.$api.service.getImgUrlByOssId({
  360. ossId: ptoto
  361. }).then(res => {
  362. items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  363. this.$forceUpdate()
  364. })
  365. }
  366. }
  367. },
  368. closeSelectServiceObjectPopup() {
  369. this.serviceProjectListIndex = -1
  370. this.$refs.selectServiceObjectPopup.close()
  371. },
  372. switchServiceObject() {
  373. if (this.selectServiceObjectIndex === -1) {
  374. uni.showToast({
  375. icon: 'none',
  376. duration: 2000,
  377. title: '请选择服务对象'
  378. });
  379. return
  380. }
  381. this.$api.service.switchServiceObject({
  382. orderServiceId: this.currService.orderServiceId,
  383. serviceObjectId: this.selectServiceObjectList[this.selectServiceObjectIndex].id
  384. }).then(res => {
  385. this.currServiceInfo()
  386. this.closeSelectServiceObjectPopup()
  387. })
  388. },
  389. addService() {
  390. if (!this.currService) {
  391. uni.showToast({
  392. icon: 'error',
  393. duration: 2000,
  394. title: '没有服务对象'
  395. });
  396. return
  397. }
  398. this.serviceProjectListIndex = 0
  399. this.$api.service.serviceProjectList().then(res => {
  400. this.serviceProjectList = res.data.data
  401. this.serviceUserList(res.data.data[0])
  402. uni.hideTabBar()
  403. this.$refs.addServicePopup.open()
  404. })
  405. },
  406. selectProject(item, index) {
  407. this.serviceProjectListIndex = index
  408. this.serviceUserList(item)
  409. },
  410. serviceUserList(item) {
  411. this.$api.service.serviceUserList({
  412. serviceProjectId: item.id,
  413. storeId: this.storeId
  414. }).then(res => {
  415. this.servicePersonListIndex = 0
  416. this.servicePersonList = res.data.data
  417. this.getServiceObjectUrl(this.servicePersonList)
  418. })
  419. },
  420. closeAddServicePopup() {
  421. this.serviceProjectListIndex = 0
  422. this.$refs.addServicePopup.close()
  423. },
  424. addServiceProject() {
  425. this.previousServiceOrderId = this.currService.serviceObjectId
  426. this.$api.service.addServiceProject({
  427. orderServiceId: this.currService.orderServiceId,
  428. serviceProjectId: this.serviceProjectList[this.serviceProjectListIndex].id,
  429. serviceUserId: this.servicePersonList[this.servicePersonListIndex].personId
  430. }).then(res => {
  431. this.closeAddServicePopup()
  432. this.currServiceInfo()
  433. this.$refs.reminderPopup.open()
  434. })
  435. },
  436. popupChange(e) {
  437. if (!e.show) {
  438. uni.showTabBar()
  439. }
  440. },
  441. takePlace() {
  442. if (!this.currService) {
  443. uni.showToast({
  444. icon: 'error',
  445. duration: 2000,
  446. title: '没有服务对象'
  447. });
  448. return
  449. }
  450. this.$api.service.takePlace({
  451. orderServiceId: this.currService.orderServiceId
  452. }).then(res => {
  453. uni.showToast({
  454. icon: 'success',
  455. duration: 2000,
  456. title: '操作成功'
  457. });
  458. this.currServiceInfo()
  459. })
  460. },
  461. preference() {
  462. this.$refs.reminderPopup.close()
  463. this.$api.service.preference({
  464. serviceObjectId: this.previousServiceOrderId,
  465. preference: this.content
  466. }).then(res => {
  467. if (this.currService) {
  468. if (this.currService.serviceObjectId == this.previousServiceOrderId) {
  469. this.currService.preference = this.content
  470. }
  471. }
  472. this.previousServiceOrderId = ''
  473. this.content = ''
  474. uni.showToast({
  475. icon: 'success',
  476. duration: 2000,
  477. title: '保存成功'
  478. });
  479. })
  480. },
  481. settle() {
  482. let that = this
  483. if (!that.currService) {
  484. uni.showToast({
  485. icon: 'error',
  486. duration: 2000,
  487. title: '没有服务对象'
  488. });
  489. return
  490. }
  491. uni.showModal({
  492. title: '温馨提示',
  493. content: '是否确定结算',
  494. editable: false,
  495. success: (e) => {
  496. console.log(e)
  497. if (e.confirm) {
  498. that.previousServiceOrderId = that.currService.serviceObjectId
  499. uni.showLoading({
  500. title: '结算中...'
  501. });
  502. that.$api.service.settle({
  503. orderServiceId: that.currService.orderServiceId
  504. }).then(res => {
  505. uni.hideLoading();
  506. that.currServiceInfo()
  507. that.$refs.reminderPopup.open()
  508. }).catch(err => {
  509. uni.hideLoading();
  510. })
  511. }
  512. }
  513. })
  514. },
  515. start() {
  516. this.$api.service.start({
  517. orderServiceId: this.currService.orderServiceId
  518. }).then(res => {
  519. this.currServiceInfo()
  520. })
  521. },
  522. end() {
  523. this.$api.service.end({
  524. orderServiceId: this.currService.orderServiceId
  525. }).then(res => {
  526. this.currServiceInfo()
  527. })
  528. },
  529. call() {
  530. this.$api.service.call({
  531. orderServiceId: this.currService.orderServiceId
  532. }).then(res => {
  533. this.currServiceInfo()
  534. })
  535. },
  536. next() {
  537. if (!this.userInfo.signIn) {
  538. uni.showToast({
  539. icon: 'error',
  540. duration: 2000,
  541. title: '请先扫码签到'
  542. });
  543. return
  544. }
  545. uni.showModal({
  546. title: '温馨提示',
  547. content: '是否确定下一位',
  548. editable: false,
  549. success: (e) => {
  550. if (e.confirm) {
  551. console.log(e.confirm)
  552. uni.showLoading({
  553. title: '叫号中...'
  554. });
  555. this.$api.service.next({
  556. orderServiceId: this.currService ? this.currService.orderServiceId :
  557. null,
  558. storeId: this.storeId
  559. }).then(res => {
  560. this.currServiceInfo(true)
  561. }).catch(err => {
  562. uni.hideLoading();
  563. })
  564. }
  565. }
  566. })
  567. },
  568. currServiceInfo(e) {
  569. if (!this.userInfo.signIn) {
  570. uni.showToast({
  571. icon: 'error',
  572. duration: 2000,
  573. title: '请先扫码签到'
  574. });
  575. return
  576. }
  577. uni.showLoading({
  578. title: '叫号中...'
  579. });
  580. this.$api.service.currServiceInfo({
  581. storeId: this.userInfo.workStoreId
  582. }).then(res => {
  583. if (e) {
  584. console.log(res.data.data)
  585. if (res.data.data === null) {
  586. uni.showModal({
  587. title: '温馨提示',
  588. content: '暂无需要服务的客户',
  589. editable: false,
  590. showCancel: false,
  591. success: (e) => {
  592. if (e.confirm) {
  593. }
  594. }
  595. })
  596. }
  597. }
  598. uni.hideLoading();
  599. this.currService = res.data.data
  600. this.setButtomState(this.currService)
  601. this.currService.avatar = this.currService.avatar.replace(/^http:/, "https:")
  602. }).catch(err => {
  603. uni.hideLoading();
  604. console.log("出错了+++++++++++出错了+++++++", err)
  605. })
  606. },
  607. setButtomState(currService) {
  608. if (currService) {
  609. if (currService.status == 12) {
  610. //叫号中
  611. this.buttonState = [0, 0, 1, 1]
  612. } else if (currService.status == 8 || currService.status == 1) {
  613. //服务中
  614. this.buttonState = [1, 1, 0, 0]
  615. }
  616. } else {
  617. this.buttonState = [0, 1, 1, 1]
  618. }
  619. },
  620. getUserInfo() {
  621. this.$api.user.getUserInfo().then(res => {
  622. this.userInfo = res.data.data
  623. this.storeId = res.data.data.workStoreId
  624. uni.setStorageSync('userInfo', this.userInfo)
  625. if (this.userInfo.avatar) {
  626. this.getImgUrlByOssId(this.userInfo.avatar)
  627. }
  628. if (this.userInfo.signIn) {
  629. this.buttonState = [0, 1, 1, 1]
  630. this.currServiceInfo()
  631. }
  632. this.$forceUpdate()
  633. })
  634. },
  635. getImgUrlByOssId(ossId) {
  636. this.$api.service.getImgUrlByOssId({
  637. ossId: ossId
  638. }).then(res => {
  639. this.$set(this.userInfo, 'avatarUrl', res.data.data[0].url.replace(/^http:/, "https:"))
  640. uni.setStorageSync('userInfo', this.userInfo)
  641. })
  642. },
  643. userScanCode() {
  644. let that = this
  645. uni.navigateTo({
  646. url: '/pages/scanCode/scanCode',
  647. events: {
  648. getScancode: function(data) {
  649. let param = {
  650. storeId: JSON.parse(data).storeId,
  651. timestamp: JSON.parse(data).timestamp
  652. }
  653. that.$api.service.clockIn(param).then(res => {
  654. uni.showToast({
  655. icon: 'success',
  656. duration: 2000,
  657. title: '签到成功'
  658. });
  659. uni.setStorageSync('userInfo', that.userInfo)
  660. that.getUserInfo()
  661. })
  662. },
  663. }
  664. })
  665. },
  666. clickTab(e) {
  667. this.tabIndex = e
  668. if (e === 0) {
  669. this.currServiceInfo()
  670. }
  671. },
  672. }
  673. }
  674. </script>
  675. <style lang="scss" scoped>
  676. @import './index.rpx.css';
  677. </style>