index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787
  1. <template>
  2. <ay-container v-show="store.user.isLogined">
  3. <div class="chunk">
  4. <div class="center justify-between top">
  5. <div class="center" @click="methods.goPerson">
  6. <image class="personal" :src="store.user.userInfo.head_url" mode="scaleToFill" />
  7. <div>
  8. <div>{{ store.user.userInfo.user_name }}</div>
  9. <div class="mobile">{{ store.user.userInfo.mobileDes }}</div>
  10. </div>
  11. </div>
  12. <div class="text-center" @click="methods.scanCode">
  13. <image src="@img/icons/scan_icon.png" mode="scaleToFill" class="scan mt-spacd4" />
  14. <div class="p-color s-fz mt-spacd2">扫一扫</div>
  15. </div>
  16. <!-- <uni-icons
  17. type="scan"
  18. color=""
  19. class="p-color"
  20. size="40"
  21. @click="methods.scanCode"
  22. ></uni-icons> -->
  23. </div>
  24. <div class="center">
  25. <ay-flowLine
  26. class="mt-spac mb-spac"
  27. :lineWidth="4"
  28. :loading="store.webapi.strategy.get_user_qrcode.ing"
  29. >
  30. <div class="qrcode">
  31. <image
  32. src="@img/qr@3x.png"
  33. class="image"
  34. mode="aspectFit"
  35. v-if="data.hasnopayfordriver || data.qrcode.expire"
  36. @click="methods.getQrcode"
  37. />
  38. <image :src="data.qrcode.img" class="image" mode="aspectFit" v-else />
  39. </div>
  40. </ay-flowLine>
  41. </div>
  42. <div class="center qrcode-text">
  43. <template v-if="!data.firstUnload">
  44. <template v-if="data.hasnopayfordriver">存在未支付完成订单</template>
  45. <template v-else-if="data.qrcode.expire">
  46. 二维码已失效
  47. <ay-refresh
  48. :iconSize="36"
  49. :loading="store.webapi.strategy.get_user_qrcode.ing"
  50. @refresh="methods.getQrcode"
  51. ></ay-refresh>
  52. </template>
  53. <template v-else>
  54. 有效时间:
  55. <ay-countdown :seconds="data.qrcode.seconds" @ender="data.qrcode.expire = true" />
  56. </template>
  57. </template>
  58. </div>
  59. </div>
  60. <div class="flex">
  61. <ay-flowLine class="flex-1 mr-spac" :loading="store.webapi.strategy.get_driver_balance.ing">
  62. <div class="chunk m0 h-100% s-fz money-bg" @click="methods.goAccount">
  63. <div class="mb-spacd4">
  64. 可用余额
  65. <div class="inline yellow-color ss-fz ml-spacd4" v-if="data.accountInfo.flag === 0">
  66. [余额不足]
  67. </div>
  68. </div>
  69. <ay-numer :value="data.accountInfo.showBalance" :unit="data.accountInfo.unit" />
  70. </div>
  71. </ay-flowLine>
  72. <ay-flowLine class="flex-1" :loading="store.webapi.strategy.get_truck_info.ing">
  73. <div class="chunk m0 h-100% s-fz cars" @click="methods.truckManage">
  74. <div>
  75. <div class="mb-spacd4" v-show="showcm">车辆管理</div>
  76. <div v-show="store.webapi.strategy.get_truck_info.firstSuccess">
  77. <div class="p-color mt-spac" v-if="data.truckInfo.length === 0">添加车辆</div>
  78. <div v-else>
  79. <span class="font-bold b-fz">{{ data.truckInfo.length }}</span>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </ay-flowLine>
  85. </div>
  86. <div class="center justify-around mt-spacm2">
  87. <div
  88. class="text-center menu"
  89. v-for="(m, i) in data.menus"
  90. :key="i"
  91. @click="methods.goPage(m)"
  92. >
  93. <img class="icon" :src="m.icon" />
  94. <div>{{ m.name }}</div>
  95. </div>
  96. </div>
  97. <div class="chuck list-app">
  98. <ay-sticky :top="topHeightPX" relativeTo="#stations" targetSelector="#stationTop">
  99. <div
  100. class="center justify-between sticky"
  101. id="stationTop"
  102. :class="{ stickyed: data.station.stickyed }"
  103. @click="methods.hiddenDoora"
  104. >
  105. <div class="title" @click.stop="methods.hiddenDoorb">附近加气站</div>
  106. <div v-if="data.userLocation" @click="methods.drawerOpen">
  107. {{ data.station.curCity }}
  108. <uni-icons type="down" size="12" />
  109. </div>
  110. </div>
  111. </ay-sticky>
  112. <div v-show="data.userLocation" id="stations">
  113. <ay-flowLine :minLoadTime="400" :loading="store.webapi.strategy.list_mini.ing">
  114. <div style="height: 2rpx"></div>
  115. </ay-flowLine>
  116. <ayb-station
  117. v-for="(la, i) in data.station.listApp"
  118. :key="i"
  119. :stationInfo="la"
  120. ></ayb-station>
  121. <!-- <div v-if="store.webapi.strategy.list_mini.fail" class="center">
  122. 加载失败
  123. <ay-refresh
  124. :iconSize="36"
  125. :loading="store.webapi.strategy.list_mini.ing"
  126. text="重试"
  127. @refresh="methods.getListApp"
  128. ></ay-refresh>
  129. </div> -->
  130. </div>
  131. <div
  132. class="center p-color"
  133. v-show="!data.firstUnload && !data.userLocation"
  134. @click="methods.getListApp({ activation: true })"
  135. >
  136. 查看附近加气站
  137. </div>
  138. </div>
  139. <uni-popup ref="inputDialog" type="dialog">
  140. <uni-popup-dialog
  141. mode="input"
  142. title="邀请通知"
  143. confirmText="加入"
  144. cancelText="拒绝"
  145. :beforeClose="true"
  146. @confirm="methods.agree"
  147. @close="methods.disagree"
  148. >
  149. <div class="text-center w-100%">
  150. <div class="mb-spacd2 text-center">
  151. 【{{ data.invite?.org?.orgName }}】邀请您加入成为其司机
  152. <span class="p-color" @click="methods.phone(data.invite?.org?.mobile)">
  153. <uni-icons type="phone" color="" class="mr-spacd4" size="none"></uni-icons>
  154. <span>{{ data.invite?.org?.mobile }}</span>
  155. </span>
  156. </div>
  157. </div>
  158. </uni-popup-dialog>
  159. </uni-popup>
  160. <ay-drawer
  161. ref="drawer"
  162. mode="right"
  163. :maskClick="true"
  164. :width="320"
  165. :top="topHeightPX"
  166. @change="methods.drawerChange"
  167. >
  168. <uni-indexed-list
  169. :options="data.station.cityList"
  170. :show-select="false"
  171. @click="methods.changeCity"
  172. ref="indexedList"
  173. v-if="data.station.indexedListShow"
  174. />
  175. </ay-drawer>
  176. <ayb-carNumber ref="carNumber" />
  177. </ay-container>
  178. </template>
  179. <script lang="ts" setup>
  180. import stompSocket from '@/utils/api/socket/stomp'
  181. import perpay from '@img/icons/perpay.png'
  182. import payhistory from '@img/icons/payhistory.png'
  183. import firm from '@img/icons/firm.png'
  184. import card from '@img/icons/card.png'
  185. const drawer = ref()
  186. const indexedList = ref()
  187. const carNumber = ref()
  188. const inputDialog = ref()
  189. const staticData = {
  190. /** 选择的城市 缓存key名 */
  191. cctkn: 'chooseCity',
  192. /** 默认选择城市 */
  193. defCity: '全部',
  194. /** websocket 实例 */
  195. client: null,
  196. // entranceArgs: null as AyContainerEntryArgs,
  197. /** 临时记录位置信息 */
  198. location: { longitude: '', latitude: '' } as any,
  199. indexedListShowed: false,
  200. /** 索引组件数据监听器 */
  201. indexedListWatcher: null,
  202. /** 页面滚动距离 */
  203. scrollTop: 0,
  204. }
  205. const data = ay.initData({
  206. loading: false,
  207. /** 未load */
  208. firstUnload: true,
  209. /** 存在未支付完成订单 */
  210. hasnopayfordriver: true,
  211. invite: {} as 预添加司机详情,
  212. truckInfo: [] as PersonDriver对象[],
  213. accountInfo: {} as IAccountInfo,
  214. /** 用户已授权定位 */
  215. userLocation: false,
  216. /** 二维码相关 */
  217. qrcode: {
  218. /** 有效时长 m */
  219. seconds: 300,
  220. /** 二维码 */
  221. img: null,
  222. /** 已过期 */
  223. expire: true,
  224. },
  225. /** 菜单列表 */
  226. menus: [
  227. {
  228. id: 0,
  229. icon: perpay,
  230. name: '待支付订单',
  231. },
  232. {
  233. id: 1,
  234. name: '加气订单',
  235. icon: payhistory,
  236. },
  237. {
  238. id: 2,
  239. name: '所属物流',
  240. icon: firm,
  241. },
  242. {
  243. id: 3,
  244. name: '优惠卡/券',
  245. icon: card,
  246. },
  247. ],
  248. station: {
  249. /** 头部已吸顶 */
  250. stickyed: false,
  251. cityList: [] /** 附近加气站列表 */,
  252. curCity: staticData.defCity,
  253. listApp: [],
  254. indexedListShow: false,
  255. },
  256. hiddenDoor: [],
  257. })
  258. const topHeight = computed(() => config.common.safeAreaTopHeight)
  259. const topHeightPX = computed(() => `${topHeight.value}px`)
  260. const showcm = computed(() => {
  261. return (
  262. !store.webapi.strategy.get_truck_info.firstSuccess ||
  263. (store.webapi.strategy.get_truck_info.firstSuccess && data.truckInfo.length)
  264. )
  265. })
  266. const methods = ay.initMethods(
  267. {
  268. hiddenDoorb() {
  269. data.hiddenDoor[data.hiddenDoor.length - 1]++
  270. },
  271. hiddenDoora() {
  272. if (
  273. data.hiddenDoor[0] === 3 &&
  274. data.hiddenDoor[1] === 1 &&
  275. data.hiddenDoor[2] === 2 &&
  276. data.hiddenDoor[3] === 4
  277. ) {
  278. data.hiddenDoor = []
  279. uni.setClipboardData({
  280. data: JSON.stringify({ userInfo: store.user.userInfo }),
  281. })
  282. } else {
  283. data.hiddenDoor.push(0)
  284. }
  285. },
  286. phone(num) {
  287. uni.makePhoneCall({
  288. phoneNumber: num,
  289. })
  290. },
  291. getTruckInfo() {
  292. webapi.strategy.get_truck_info({}).then((res) => {
  293. data.truckInfo = aop.request.AR.truckInfo(res)
  294. })
  295. },
  296. truckManage() {
  297. if (store.common.data.mockScenes === config.common.mockScenes.examine) {
  298. return
  299. }
  300. if (data.truckInfo.length) {
  301. ay.goPage(config.pages.truckInfo_index)
  302. } else {
  303. carNumber.value.open().then((cn) => {
  304. if (store.webapi.strategy.bind_person_truck.ing) {
  305. return
  306. }
  307. webapi.strategy
  308. .bind_person_truck<{ userId: string }>({
  309. userId: store.user.userInfo.user_id,
  310. newCarNumber: cn,
  311. })
  312. .then((res) => {
  313. if (res) {
  314. func.native.showToast('添加成功')
  315. methods.getTruckInfo()
  316. }
  317. })
  318. })
  319. }
  320. },
  321. goPerson() {
  322. if (store.common.data.mockScenes === config.common.mockScenes.examine) {
  323. return
  324. }
  325. ay.goPage(config.pages.personCenter_index)
  326. },
  327. goPage(menu) {
  328. const maps = {
  329. 0() {
  330. methods.checkNopayfordriver(1)
  331. },
  332. 1() {
  333. ay.goPage(config.pages.order_index)
  334. },
  335. 2() {
  336. ay.goPage(config.pages.org_index)
  337. },
  338. 3() {
  339. ay.goPage(config.pages.cards_index)
  340. },
  341. }
  342. maps[menu.id]()
  343. },
  344. drawerOpen() {
  345. methods.getCityList()
  346. drawer.value.open()
  347. data.station.indexedListShow = true
  348. // 解决uni-indexed-list 组件滑动失效问题
  349. // 问题原因: 因为嵌套于uni-drawer内,造成uni-indexed-list的winOffsetY值获取有误
  350. // 解决方法:通过阅读组件源码发现uni-indexed-list在初始化时会设置winOffsetY,再给他设置正确的值。
  351. // 小程序于h5环境设置时机不同;
  352. // 组件内部:小程序仅首次渲染完毕会设置winOffsetY,h5环境每次打开组件都会重新设置winOffsetY
  353. // 通过监听$data.loaded的变化,重新设置winOffsetY为页面滚动距离,以及小程序环境-每次呈现组件后重新设置winOffsetY
  354. nextTick(() => {
  355. // 小程序环境-每次呈现组件后重新设置winOffsetY
  356. // #ifdef MP
  357. if (indexedList.value) {
  358. indexedList.value.$data.winOffsetY = staticData.scrollTop + topHeight.value
  359. }
  360. // #endif
  361. if (!staticData.indexedListWatcher) {
  362. staticData.indexedListWatcher = watch(
  363. () => indexedList.value?.$data.loaded,
  364. (nv) => {
  365. // 小程序环境仅首次呈现监听到, h5环境每次呈现都会监听到
  366. if (indexedList.value) {
  367. indexedList.value.$data.winOffsetY = staticData.scrollTop + topHeight.value
  368. }
  369. },
  370. {
  371. // deep: true,
  372. },
  373. )
  374. // 调用可释放监听
  375. // staticData.indexedListWatcher()
  376. }
  377. })
  378. },
  379. drawerChange(isopen) {},
  380. changeCity(args) {
  381. drawer.value.close()
  382. data.station.curCity = args.item.name
  383. uni.setStorageSync(staticData.cctkn, args.item.name)
  384. methods.getListApp()
  385. },
  386. goAccount() {
  387. ay.goPage(config.pages.account_index)
  388. },
  389. /** 初始化ws */
  390. initWS() {
  391. stompSocket
  392. .init(
  393. ay.getWebsocketUrl('websocket/sockjs'),
  394. // 传参
  395. {
  396. access_token: store.user.userInfo.token,
  397. identifier: store.user.userInfo.Identifier,
  398. },
  399. // ws断开回调
  400. () => {
  401. methods.initWS()
  402. },
  403. )
  404. .then((client) => {
  405. staticData.client = client
  406. // 订阅
  407. const subscription = client.subscribe(
  408. // 路径
  409. '/user/' + store.user.userInfo.user_id + '/msg',
  410. // 接收到的数据
  411. (res) => {
  412. const body = JSON.parse(res.body)
  413. if (body.type === 1) {
  414. ay.goPage(config.pages.order_prePay, { params: JSON.parse(body.content) })
  415. } else if (body.type === 0) {
  416. const content = JSON.parse(body.content)
  417. uni
  418. .showModal({
  419. title: content.data,
  420. message: content.message,
  421. })
  422. .then(() => {})
  423. }
  424. },
  425. )
  426. })
  427. },
  428. // 直接调用发送即可
  429. send() {
  430. staticData.client.send(
  431. // 路径
  432. '/user/' + store.user.userInfo.user_id + '/msg',
  433. {},
  434. // 发送文本
  435. JSON.stringify({ content: '1212' }),
  436. )
  437. },
  438. /** 检查未支付
  439. * type 0:仅检查 1:点击待支付订单 2:点击扫码
  440. * */
  441. async checkNopayfordriver(type: 0 | 1 | 2 = 0) {
  442. const nopayfordriver = await webapi.pay.find_unpayfordriver()
  443. // 存在 未支付(待支付、支付中、支付异常)
  444. if (nopayfordriver) {
  445. if (type === 1) {
  446. if (nopayfordriver.settleStatus === 1) {
  447. // 跳未支付
  448. ay.goPage(config.pages.order_prePay, { params: { orderId: nopayfordriver.orderId } })
  449. }
  450. }
  451. if (type === 2) {
  452. func.native
  453. .showModal({
  454. title: '温馨提示',
  455. content: '存在未支付完成订单',
  456. showCancel: true,
  457. })
  458. .then((res) => {
  459. if (res.confirm) {
  460. if (nopayfordriver.settleStatus === 1) {
  461. ay.goPage(config.pages.order_prePay, {
  462. params: { orderId: nopayfordriver.orderId },
  463. })
  464. } else {
  465. ay.goPage(config.pages.order_orderDetail, {
  466. params: { orderId: nopayfordriver.orderId },
  467. })
  468. }
  469. }
  470. })
  471. }
  472. return true
  473. } else {
  474. if (type === 1) {
  475. func.native.showToast('暂无待支付订单!')
  476. }
  477. return false
  478. }
  479. },
  480. async scanCode() {
  481. if (await methods.checkNopayfordriver(2)) {
  482. return
  483. }
  484. const ret: { gasstationId?: string; cashierId?: string } = await func.native.scan()
  485. if (!(ret.gasstationId && ret.cashierId)) {
  486. func.native.showToast('二维码无效')
  487. return
  488. }
  489. const user = await webapi.user.find_6({ userId: ret.cashierId })
  490. if (ret.gasstationId === user.user.orgId) {
  491. const price = await webapi.strategy.find_price({
  492. gasstationId: ret.gasstationId,
  493. driverId: user.user.userId,
  494. })
  495. if (
  496. ((price.qrcode === 0 || price.qrcode === 1) && ret.gasstationId !== ret.cashierId) || // 设置的加气站收款码
  497. (price.qrcode === 2 && ret.gasstationId === ret.cashierId) // 设置的收银员
  498. ) {
  499. func.native.showModal({
  500. title: '温馨提示',
  501. content:
  502. price.qrcode === 2
  503. ? '加气站收款码已禁用,请选择收银员收款码扫码。'
  504. : '收银员收款码已禁用,请选择加气站收款码扫码。',
  505. })
  506. } else {
  507. const gasJudge = await webapi.strategy.driver_gas_judge({
  508. driverId: user.user.userId,
  509. gasstationId: ret.gasstationId,
  510. })
  511. if (gasJudge === 1) {
  512. // 创建订单
  513. ay.goPage(config.pages.order_createOrder, { params: ret })
  514. } else if (gasJudge === 2) {
  515. func.native.showModal({
  516. title: '温馨提示',
  517. content: `该加气站未及时补充平台气源,已无法通过大象平台为您提供优质气源,给您带来的不便深感其歉意,如有疑问可以与加气站沟通,亦可拨打大象加气平台客服电话:"${store.common.data.phone}"`,
  518. })
  519. }
  520. }
  521. } else {
  522. func.native.showModal({
  523. title: '温馨提示',
  524. content: '当前收银员所属企业和二维码对应的企业不一致,请联系加气站管理员。',
  525. })
  526. }
  527. },
  528. /** 同意加入 */
  529. agree() {
  530. webapi.user.agree({ id: data.invite.driverWhiteList.id }).then((res) => {
  531. if (res) {
  532. func.native.showToast('加入成功,请重新登录').then(() => {})
  533. inputDialog.value.close()
  534. }
  535. })
  536. },
  537. /** 拒绝加入 */
  538. disagree() {
  539. webapi.user.disagree({ id: data.invite.driverWhiteList.id }).then((res) => {
  540. if (res) {
  541. func.native.showToast('已拒绝')
  542. inputDialog.value.close()
  543. }
  544. })
  545. },
  546. /** 获取邀请信息 */
  547. getInvite() {
  548. webapi.user
  549. .find_by_driver_mobile({ driverMobile: store.user.userInfo.mobile })
  550. .then((res) => {
  551. if (res.driverWhiteList && res.org) {
  552. data.invite = res
  553. inputDialog.value.open()
  554. }
  555. })
  556. },
  557. getCityList() {
  558. return webapi.strategy.city_list().then((res) => {
  559. res.unshift({ text: staticData.defCity, children: [{ text: staticData.defCity }] })
  560. data.station.cityList = res.map((m) => {
  561. return {
  562. letter: m.text,
  563. data: m.children.map((cm) => cm.text),
  564. }
  565. })
  566. })
  567. },
  568. async getListApp({
  569. cras = store.curPage.getDefAyContainerRefreshArgs(),
  570. activation = false,
  571. // checkScope = false,
  572. } = {}) {
  573. // 非激活 && 未授权
  574. if (!activation && !data.userLocation) {
  575. // 取消加载中效果
  576. ay.containerLoaded({
  577. reqState: enums.ReqState.cancel,
  578. })
  579. return
  580. }
  581. let location = staticData.location
  582. // 上拉不重新获取位置
  583. if (!cras.isAdd) {
  584. location = await func.native.getLocation(false)
  585. if (!location) return
  586. staticData.location = location
  587. }
  588. data.userLocation = true
  589. webapi.strategy
  590. .list_mini(
  591. {
  592. page: cras.page,
  593. size: cras.size,
  594. param: {
  595. city: data.station.curCity === staticData.defCity ? '' : data.station.curCity,
  596. longitude: location.longitude.toString(),
  597. latitude: location.latitude.toString(),
  598. },
  599. },
  600. // { showLoading: activation }, // || !cras.isAdd },
  601. )
  602. .then((res) => {
  603. if (cras.isAdd) {
  604. data.station.listApp.push(...res.records)
  605. } else {
  606. data.station.listApp = res.records
  607. }
  608. })
  609. },
  610. getQrcode() {
  611. if (data.hasnopayfordriver || store.webapi.strategy.get_user_qrcode.ing) {
  612. return
  613. }
  614. return webapi.strategy.get_user_qrcode({}, { minRTime: 1e3 }).then(async (res) => {
  615. data.qrcode.img = res
  616. data.qrcode.expire = false
  617. })
  618. },
  619. },
  620. {
  621. scanCode: { showLoading: true },
  622. },
  623. )
  624. ay.entrance(
  625. async (args) => {
  626. // staticData.entranceArgs = args
  627. const init = async () => {
  628. webapi.strategy.get_driver_balance({}).then((res) => {
  629. data.accountInfo = {
  630. ...res,
  631. ...aop.request.AR.getAccountInfo(res),
  632. }
  633. })
  634. data.hasnopayfordriver = await methods.checkNopayfordriver()
  635. methods.getTruckInfo()
  636. }
  637. if (args.loadType === enums.LoadType.onLoad) {
  638. // data.title = store.curPage?.pageConfig?.title
  639. // #ifdef MP
  640. // 用户是否授权了获取地理位置
  641. await uni
  642. .getSetting()
  643. .then((res) => {
  644. if (res.authSetting['scope.userLocation']) {
  645. data.userLocation = true
  646. }
  647. })
  648. .catch()
  649. // #endif
  650. methods.initWS()
  651. methods.getCityList()
  652. data.station.curCity = uni.getStorageSync(staticData.cctkn) || staticData.defCity
  653. methods.getListApp({ cras: args.cras })
  654. await init()
  655. // 无未支付订单
  656. if (!data.hasnopayfordriver) {
  657. await methods.getQrcode()
  658. }
  659. data.firstUnload = false
  660. // 小程序环境:时机过早会inputDialog.value为null
  661. // h5环境:当页面data内的值改变时,弹框会消失
  662. // 所有先放这里吧
  663. methods.getInvite()
  664. }
  665. if (args.loadType === enums.LoadType.refresh) {
  666. methods.getListApp({ cras: args.cras })
  667. // if (!args.cras.isAdd) {
  668. // init()
  669. // }
  670. }
  671. if (args.loadType === enums.LoadType.onShow) {
  672. init()
  673. }
  674. },
  675. {
  676. addLoadTypes: [enums.LoadType.onShow],
  677. },
  678. )
  679. onPageScroll((res) => {
  680. staticData.scrollTop = res.scrollTop
  681. })
  682. </script>
  683. <style lang="scss" scoped>
  684. .center-item {
  685. min-height: 136rpx;
  686. }
  687. .top {
  688. padding-bottom: $p-spac;
  689. border-bottom: 1px dashed;
  690. .personal {
  691. width: 100rpx;
  692. height: 100rpx;
  693. margin-right: $p-spac;
  694. border-radius: $p-spac;
  695. }
  696. .mobile {
  697. margin-top: $p-spacd2;
  698. font-size: $s-fz;
  699. }
  700. }
  701. .qrcode {
  702. width: 400rpx;
  703. height: 400rpx;
  704. overflow: hidden;
  705. border-radius: $p-spacd2;
  706. .image {
  707. width: 480rpx;
  708. height: 480rpx;
  709. margin: -40rpx;
  710. }
  711. }
  712. .qrcode-text {
  713. height: $p-fz;
  714. }
  715. .truck {
  716. width: 152rpx;
  717. height: 116rpx;
  718. }
  719. #stationTop {
  720. padding: $p-spac 0;
  721. }
  722. .unit {
  723. margin: 0 $p-spacd2;
  724. }
  725. $bgc: rgba($p-color, 0.4);
  726. .cars {
  727. position: relative;
  728. overflow: hidden;
  729. &::after {
  730. position: absolute;
  731. top: 0;
  732. left: 0;
  733. width: 100%;
  734. height: 100%;
  735. content: '';
  736. background-image: linear-gradient($bgc, $bgc), url('@img/truck.svg');
  737. background-repeat: no-repeat;
  738. background-position: right;
  739. background-size: contain;
  740. opacity: 0.2;
  741. }
  742. }
  743. .menu {
  744. font-size: $s-fz;
  745. .icon {
  746. width: 80rpx;
  747. height: 80rpx;
  748. margin-bottom: $p-spacd2;
  749. border-radius: 50%;
  750. }
  751. }
  752. .list-app {
  753. margin-top: $p-spac;
  754. .title {
  755. font-size: $p-fz * 1.2;
  756. font-weight: bold;
  757. }
  758. }
  759. // 为了让左侧索引中文竖排
  760. ::v-deep .uni-indexed-list__menu-item {
  761. width: 20px;
  762. }
  763. ::v-deep .uni-popup__info {
  764. @apply: font-bold;
  765. font-size: $bs-fz;
  766. color: unset;
  767. }
  768. .scan {
  769. width: 50rpx;
  770. height: 50rpx;
  771. }
  772. </style>