|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <ay-container>
|
|
|
|
|
|
|
+ <ay-container v-show="store.user.isLogined">
|
|
|
<div class="chunk">
|
|
<div class="chunk">
|
|
|
<div class="center justify-between top">
|
|
<div class="center justify-between top">
|
|
|
<div class="center" @click="methods.goPerson">
|
|
<div class="center" @click="methods.goPerson">
|
|
@@ -46,16 +46,19 @@
|
|
|
<div class="center">
|
|
<div class="center">
|
|
|
<template v-if="data.qrcode.expire">
|
|
<template v-if="data.qrcode.expire">
|
|
|
二维码已失效
|
|
二维码已失效
|
|
|
- <div class="center p-color" @click="methods.getQrcode">
|
|
|
|
|
|
|
+ <div class="center p-color" @click="methods.getQrcode(true)">
|
|
|
<uni-icons type="refresh" color="" size="24"></uni-icons>
|
|
<uni-icons type="refresh" color="" size="24"></uni-icons>
|
|
|
刷新
|
|
刷新
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-else>有效时间:{{ data.qrcode.countdown }}</template>
|
|
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ 有效时间:
|
|
|
|
|
+ <ay-countdown :seconds="300" @ender="data.qrcode.expire = true" />
|
|
|
|
|
+ </template>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="flex">
|
|
<div class="flex">
|
|
|
- <div class="chunk flex-1 s-fz mr-spac account" @click="methods.goAccount">
|
|
|
|
|
|
|
+ <div class="chunk flex-1 s-fz mr-spac money-bg" @click="methods.goAccount">
|
|
|
<div class="mb-spacd4">可用余额</div>
|
|
<div class="mb-spacd4">可用余额</div>
|
|
|
<div class="">
|
|
<div class="">
|
|
|
<span class="font-bold b-fz">{{ data.accountInfo.showBalance.balance }}</span>
|
|
<span class="font-bold b-fz">{{ data.accountInfo.showBalance.balance }}</span>
|
|
@@ -64,12 +67,12 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div class="chunk flex-1 center justify-start s-fz cars" @click="">
|
|
|
|
|
- <div class="p-color" v-if="false">添加车辆</div>
|
|
|
|
|
|
|
+ <div class="chunk flex-1 center justify-start s-fz cars" @click="methods.truckManage">
|
|
|
|
|
+ <div class="p-color" v-if="data.truckInfo.length === 0">添加车辆</div>
|
|
|
<div v-else>
|
|
<div v-else>
|
|
|
<div class="mb-spacd4">车辆管理</div>
|
|
<div class="mb-spacd4">车辆管理</div>
|
|
|
<div>
|
|
<div>
|
|
|
- <span class="font-bold b-fz">1</span>
|
|
|
|
|
|
|
+ <span class="font-bold b-fz">{{ data.truckInfo.length }}</span>
|
|
|
辆
|
|
辆
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -87,33 +90,49 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="chuck list-app">
|
|
<div class="chuck list-app">
|
|
|
- <div class="center justify-between mb-spac">
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="center justify-between sticky"
|
|
|
|
|
+ id="stationTop"
|
|
|
|
|
+ :class="{ stickyed: data.station.stickyed }"
|
|
|
|
|
+ >
|
|
|
<div class="title">附近加气站</div>
|
|
<div class="title">附近加气站</div>
|
|
|
<div v-if="data.userLocation" @click="methods.drawerOpen">
|
|
<div v-if="data.userLocation" @click="methods.drawerOpen">
|
|
|
{{ data.station.curCity }}
|
|
{{ data.station.curCity }}
|
|
|
<uni-icons type="down" size="12" />
|
|
<uni-icons type="down" size="12" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <template v-if="data.userLocation">
|
|
|
|
|
|
|
+ <div v-show="data.userLocation" id="stations">
|
|
|
<ayb-station
|
|
<ayb-station
|
|
|
v-for="(la, i) in data.station.listApp"
|
|
v-for="(la, i) in data.station.listApp"
|
|
|
:key="i"
|
|
:key="i"
|
|
|
:stationInfo="la"
|
|
:stationInfo="la"
|
|
|
></ayb-station>
|
|
></ayb-station>
|
|
|
- </template>
|
|
|
|
|
- <div class="center p-color" v-else @click="methods.getListApp({ first: true })">
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="center p-color"
|
|
|
|
|
+ v-show="!data.userLocation"
|
|
|
|
|
+ @click="methods.getListApp({ first: true })"
|
|
|
|
|
+ >
|
|
|
查看附近加气站
|
|
查看附近加气站
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <uni-drawer ref="drawer" mode="right" :maskClick="true" :width="320">
|
|
|
|
|
|
|
+ <uni-drawer
|
|
|
|
|
+ ref="drawer"
|
|
|
|
|
+ mode="right"
|
|
|
|
|
+ :maskClick="true"
|
|
|
|
|
+ :width="320"
|
|
|
|
|
+ @change="methods.drawerChange"
|
|
|
|
|
+ >
|
|
|
<uni-indexed-list
|
|
<uni-indexed-list
|
|
|
:options="data.station.cityList"
|
|
:options="data.station.cityList"
|
|
|
:show-select="false"
|
|
:show-select="false"
|
|
|
- @click="methods.bindClick"
|
|
|
|
|
- v-if="data.station.showIndexedList"
|
|
|
|
|
|
|
+ @click="methods.changeCity"
|
|
|
|
|
+ ref="indexedList"
|
|
|
|
|
+ v-if="data.station.indexedListShow"
|
|
|
/>
|
|
/>
|
|
|
</uni-drawer>
|
|
</uni-drawer>
|
|
|
|
|
+ <ayb-carNumber ref="carNumber" />
|
|
|
</ay-container>
|
|
</ay-container>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -124,23 +143,36 @@ import payhistory from '@img/icons/payhistory.png'
|
|
|
import firm from '@img/icons/firm.png'
|
|
import firm from '@img/icons/firm.png'
|
|
|
import card from '@img/icons/card.png'
|
|
import card from '@img/icons/card.png'
|
|
|
const drawer = ref()
|
|
const drawer = ref()
|
|
|
|
|
+const indexedList = ref()
|
|
|
|
|
+const carNumber = ref()
|
|
|
|
|
+
|
|
|
const staticData = {
|
|
const staticData = {
|
|
|
|
|
+ /** 选择的城市 缓存key名 */
|
|
|
|
|
+ cctkn: 'chooseCity',
|
|
|
|
|
+ /** 默认选择城市 */
|
|
|
|
|
+ defCity: '全部',
|
|
|
|
|
+ /** websocket 实例 */
|
|
|
client: null,
|
|
client: null,
|
|
|
- entranceArgs: null as AyContainerEntryArgs,
|
|
|
|
|
|
|
+ // entranceArgs: null as AyContainerEntryArgs,
|
|
|
|
|
+ /** 临时记录位置信息 */
|
|
|
location: { longitude: '', latitude: '' } as any,
|
|
location: { longitude: '', latitude: '' } as any,
|
|
|
|
|
+ indexedListShowed: false,
|
|
|
|
|
+ /** 索引组件数据监听器 */
|
|
|
|
|
+ indexedListWatcher: null,
|
|
|
|
|
+ /** 页面滚动距离 */
|
|
|
|
|
+ scrollTop: 0,
|
|
|
}
|
|
}
|
|
|
const data = reactive({
|
|
const data = reactive({
|
|
|
|
|
+ truckInfo: [] as PersonDriver对象[],
|
|
|
accountInfo: { showBalance: { balance: '', suffix: '' } } as IAccountInfo,
|
|
accountInfo: { showBalance: { balance: '', suffix: '' } } as IAccountInfo,
|
|
|
/** 用户已授权定位 */
|
|
/** 用户已授权定位 */
|
|
|
userLocation: false,
|
|
userLocation: false,
|
|
|
/** 二维码相关 */
|
|
/** 二维码相关 */
|
|
|
qrcode: {
|
|
qrcode: {
|
|
|
- /** 二维码过期倒计时 */
|
|
|
|
|
- countdown: '',
|
|
|
|
|
/** 二维码 */
|
|
/** 二维码 */
|
|
|
img: null,
|
|
img: null,
|
|
|
/** 已过期 */
|
|
/** 已过期 */
|
|
|
- expire: false,
|
|
|
|
|
|
|
+ expire: true,
|
|
|
},
|
|
},
|
|
|
/** 菜单列表 */
|
|
/** 菜单列表 */
|
|
|
menus: [
|
|
menus: [
|
|
@@ -166,15 +198,41 @@ const data = reactive({
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
station: {
|
|
station: {
|
|
|
- /** 首次呈现,解决索引滑动失效问题 */
|
|
|
|
|
- showIndexedList: false,
|
|
|
|
|
|
|
+ /** 头部已吸顶 */
|
|
|
|
|
+ stickyed: false,
|
|
|
cityList: [] /** 附近加气站列表 */,
|
|
cityList: [] /** 附近加气站列表 */,
|
|
|
- curCity: '全部',
|
|
|
|
|
|
|
+ curCity: staticData.defCity,
|
|
|
listApp: [],
|
|
listApp: [],
|
|
|
|
|
+ indexedListShow: false,
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
-const methods = ay.initMethods(
|
|
|
|
|
|
|
+const methods =
|
|
|
|
|
+ // ay.initMethods(
|
|
|
{
|
|
{
|
|
|
|
|
+ getTruckInfo() {
|
|
|
|
|
+ webapi.strategy.get_truck_info().then((res) => {
|
|
|
|
|
+ data.truckInfo = aop.request.AR.truckInfo(res)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ truckManage() {
|
|
|
|
|
+ if (data.truckInfo.length) {
|
|
|
|
|
+ ay.goPage(config.pages.truckInfo_index)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ carNumber.value.open().then((cn) => {
|
|
|
|
|
+ webapi.strategy
|
|
|
|
|
+ .bind_person_truck<{ userId: string }>({
|
|
|
|
|
+ userId: store.user.userInfo.user_id,
|
|
|
|
|
+ newCarNumber: cn,
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res) {
|
|
|
|
|
+ func.native.showToast('添加成功')
|
|
|
|
|
+ methods.getTruckInfo()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
goPerson() {
|
|
goPerson() {
|
|
|
ay.goPage(config.pages.personCenter_index)
|
|
ay.goPage(config.pages.personCenter_index)
|
|
|
},
|
|
},
|
|
@@ -184,18 +242,54 @@ const methods = ay.initMethods(
|
|
|
methods.goPrePay()
|
|
methods.goPrePay()
|
|
|
},
|
|
},
|
|
|
1() {
|
|
1() {
|
|
|
- ay.goPage(config.pages.orderList_index)
|
|
|
|
|
|
|
+ ay.goPage(config.pages.order_index)
|
|
|
|
|
+ },
|
|
|
|
|
+ 2() {
|
|
|
|
|
+ ay.goPage(config.pages.org_index)
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
maps[menu.id]()
|
|
maps[menu.id]()
|
|
|
},
|
|
},
|
|
|
drawerOpen() {
|
|
drawerOpen() {
|
|
|
drawer.value.open()
|
|
drawer.value.open()
|
|
|
- data.station.showIndexedList = true
|
|
|
|
|
|
|
+ data.station.indexedListShow = true
|
|
|
|
|
+ // 解决uni-indexed-list 组件滑动失效问题
|
|
|
|
|
+ // 问题原因: 因为嵌套于uni-drawer内,造成uni-indexed-list的winOffsetY值获取有误
|
|
|
|
|
+ // 解决方法:通过阅读组件源码发现uni-indexed-list在初始化时会设置winOffsetY,再给他设置正确的值。
|
|
|
|
|
+ // 小程序于h5环境设置时机不同;
|
|
|
|
|
+ // 组件内部:小程序仅首次渲染完毕会设置winOffsetY,h5环境每次打开组件都会重新设置winOffsetY
|
|
|
|
|
+ // 通过监听$data.loaded的变化,重新设置winOffsetY为页面滚动距离,以及小程序环境-每次呈现组件后重新设置winOffsetY
|
|
|
|
|
+
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ // 小程序环境-每次呈现组件后重新设置winOffsetY
|
|
|
|
|
+ // #ifdef MP
|
|
|
|
|
+ if (indexedList.value) {
|
|
|
|
|
+ indexedList.value.$data.winOffsetY = staticData.scrollTop
|
|
|
|
|
+ }
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ if (!staticData.indexedListWatcher) {
|
|
|
|
|
+ staticData.indexedListWatcher = watch(
|
|
|
|
|
+ () => indexedList.value?.$data.loaded,
|
|
|
|
|
+ (nv) => {
|
|
|
|
|
+ // 小程序环境仅首次呈现监听到, h5环境每次呈现都会监听到
|
|
|
|
|
+ if (indexedList.value) {
|
|
|
|
|
+ indexedList.value.$data.winOffsetY = staticData.scrollTop
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ // deep: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ )
|
|
|
|
|
+ // 调用可释放监听
|
|
|
|
|
+ // staticData.indexedListWatcher()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- bindClick(args) {
|
|
|
|
|
|
|
+ drawerChange(isopen) {},
|
|
|
|
|
+ changeCity(args) {
|
|
|
drawer.value.close()
|
|
drawer.value.close()
|
|
|
data.station.curCity = args.item.name
|
|
data.station.curCity = args.item.name
|
|
|
|
|
+ uni.setStorageSync(staticData.cctkn, args.item.name)
|
|
|
methods.getListApp()
|
|
methods.getListApp()
|
|
|
},
|
|
},
|
|
|
goAccount() {
|
|
goAccount() {
|
|
@@ -226,7 +320,7 @@ const methods = ay.initMethods(
|
|
|
(res) => {
|
|
(res) => {
|
|
|
const body = JSON.parse(res.body)
|
|
const body = JSON.parse(res.body)
|
|
|
if (body.type === 1) {
|
|
if (body.type === 1) {
|
|
|
- ay.goPage(config.pages.prePay_index, { params: JSON.parse(body.content) })
|
|
|
|
|
|
|
+ ay.goPage(config.pages.order_prePay, { params: JSON.parse(body.content) })
|
|
|
} else if (body.type === 0) {
|
|
} else if (body.type === 0) {
|
|
|
const content = JSON.parse(body.content)
|
|
const content = JSON.parse(body.content)
|
|
|
uni
|
|
uni
|
|
@@ -250,19 +344,21 @@ const methods = ay.initMethods(
|
|
|
JSON.stringify({ content: '1212' }),
|
|
JSON.stringify({ content: '1212' }),
|
|
|
)
|
|
)
|
|
|
},
|
|
},
|
|
|
- async goPrePay() {
|
|
|
|
|
|
|
+ async goPrePay(type: 0 | 1 = 0) {
|
|
|
const nopayfordriver = await webapi.pay.find_unpayfordriver()
|
|
const nopayfordriver = await webapi.pay.find_unpayfordriver()
|
|
|
if (nopayfordriver) {
|
|
if (nopayfordriver) {
|
|
|
// 跳未支付
|
|
// 跳未支付
|
|
|
- ay.goPage(config.pages.prePay_index, { params: { orderId: nopayfordriver.orderId } })
|
|
|
|
|
|
|
+ ay.goPage(config.pages.order_prePay, { params: { orderId: nopayfordriver.orderId } })
|
|
|
return true
|
|
return true
|
|
|
} else {
|
|
} else {
|
|
|
- func.native.showToast('暂无待支付订单!')
|
|
|
|
|
|
|
+ if (type === 0) {
|
|
|
|
|
+ func.native.showToast('暂无待支付订单!')
|
|
|
|
|
+ }
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async scanCode() {
|
|
async scanCode() {
|
|
|
- if (await methods.goPrePay()) {
|
|
|
|
|
|
|
+ if (await methods.goPrePay(1)) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
const reqStr = await uni
|
|
const reqStr = await uni
|
|
@@ -270,13 +366,21 @@ const methods = ay.initMethods(
|
|
|
scanType: ['qrcode'],
|
|
scanType: ['qrcode'],
|
|
|
})
|
|
})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
|
- func.native.showToast('二维码无效')
|
|
|
|
|
|
|
+ // 二维码解析失败
|
|
|
|
|
+ if (err.errMsg !== 'scanCode:fail cancel') {
|
|
|
|
|
+ func.native.showToast('二维码无效')
|
|
|
|
|
+ }
|
|
|
return Promise.reject(err)
|
|
return Promise.reject(err)
|
|
|
})
|
|
})
|
|
|
let ret = { gasstationId: '', cashierId: '' }
|
|
let ret = { gasstationId: '', cashierId: '' }
|
|
|
try {
|
|
try {
|
|
|
ret = JSON.parse(reqStr.result)
|
|
ret = JSON.parse(reqStr.result)
|
|
|
|
|
+ // 没有包含必要信息
|
|
|
|
|
+ if (!(ret.gasstationId && ret.cashierId)) {
|
|
|
|
|
+ func.native.showToast('二维码无效')
|
|
|
|
|
+ }
|
|
|
} catch {
|
|
} catch {
|
|
|
|
|
+ // 反序列化失败
|
|
|
func.native.showToast('二维码无效')
|
|
func.native.showToast('二维码无效')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -305,7 +409,7 @@ const methods = ay.initMethods(
|
|
|
})
|
|
})
|
|
|
if (gasJudge === 1) {
|
|
if (gasJudge === 1) {
|
|
|
// 创建订单
|
|
// 创建订单
|
|
|
- ay.goPage(config.pages.createOrder_index, { params: ret })
|
|
|
|
|
|
|
+ ay.goPage(config.pages.order_createOrder, { params: ret })
|
|
|
} else if (gasJudge === 2) {
|
|
} else if (gasJudge === 2) {
|
|
|
func.native.showModal({
|
|
func.native.showModal({
|
|
|
title: '错误提示',
|
|
title: '错误提示',
|
|
@@ -326,7 +430,7 @@ const methods = ay.initMethods(
|
|
|
},
|
|
},
|
|
|
getCityList() {
|
|
getCityList() {
|
|
|
webapi.strategy.city_list().then((res) => {
|
|
webapi.strategy.city_list().then((res) => {
|
|
|
- res.unshift({ text: '全部', children: [{ text: '全部' }] })
|
|
|
|
|
|
|
+ res.unshift({ text: staticData.defCity, children: [{ text: staticData.defCity }] })
|
|
|
data.station.cityList = res.map((m) => {
|
|
data.station.cityList = res.map((m) => {
|
|
|
return {
|
|
return {
|
|
|
letter: m.text,
|
|
letter: m.text,
|
|
@@ -347,7 +451,7 @@ const methods = ay.initMethods(
|
|
|
let location = staticData.location
|
|
let location = staticData.location
|
|
|
// 上拉不重新获取位置
|
|
// 上拉不重新获取位置
|
|
|
if (!cras.isAdd) {
|
|
if (!cras.isAdd) {
|
|
|
- location = await uni.getLocation()
|
|
|
|
|
|
|
+ location = await func.native.getLocation()
|
|
|
staticData.location = location
|
|
staticData.location = location
|
|
|
}
|
|
}
|
|
|
data.userLocation = true
|
|
data.userLocation = true
|
|
@@ -357,12 +461,12 @@ const methods = ay.initMethods(
|
|
|
page: cras.page,
|
|
page: cras.page,
|
|
|
size: cras.size,
|
|
size: cras.size,
|
|
|
param: {
|
|
param: {
|
|
|
- city: data.station.curCity === '全部' ? '' : data.station.curCity,
|
|
|
|
|
|
|
+ city: data.station.curCity === staticData.defCity ? '' : data.station.curCity,
|
|
|
longitude: location.longitude.toString(),
|
|
longitude: location.longitude.toString(),
|
|
|
latitude: location.latitude.toString(),
|
|
latitude: location.latitude.toString(),
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- { showLoading: first || !cras.isAdd },
|
|
|
|
|
|
|
+ { showLoading: first }, // || !cras.isAdd },
|
|
|
)
|
|
)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (cras.isAdd) {
|
|
if (cras.isAdd) {
|
|
@@ -373,51 +477,31 @@ const methods = ay.initMethods(
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- /** 时长处理 */
|
|
|
|
|
- duration(times) {
|
|
|
|
|
- if (times) {
|
|
|
|
|
- let m: number | string = Math.floor(Number(times) / 60)
|
|
|
|
|
- let s: number | string = Math.floor(Number(times) % 60)
|
|
|
|
|
- if (s < 10) {
|
|
|
|
|
- s = `0${s}`
|
|
|
|
|
- }
|
|
|
|
|
- if (m < 10) {
|
|
|
|
|
- m = `0${m}`
|
|
|
|
|
- }
|
|
|
|
|
- return `${m}:${s}`
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- getQrcode() {
|
|
|
|
|
|
|
+ getQrcode(refresh = false) {
|
|
|
return webapi.strategy.get_user_qrcode().then(async (res) => {
|
|
return webapi.strategy.get_user_qrcode().then(async (res) => {
|
|
|
// await func.awaiter()
|
|
// await func.awaiter()
|
|
|
data.qrcode.img = res
|
|
data.qrcode.img = res
|
|
|
data.qrcode.expire = false
|
|
data.qrcode.expire = false
|
|
|
- func.timer({
|
|
|
|
|
- seconds: 300,
|
|
|
|
|
- ticker(tick) {
|
|
|
|
|
- data.qrcode.countdown = methods.duration(tick)
|
|
|
|
|
- },
|
|
|
|
|
- ender() {
|
|
|
|
|
- data.qrcode.expire = true
|
|
|
|
|
- },
|
|
|
|
|
- })
|
|
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- scanCode: { showLoading: true },
|
|
|
|
|
- },
|
|
|
|
|
-)
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+// {
|
|
|
|
|
+// scanCode: { showLoading: true },
|
|
|
|
|
+// },
|
|
|
|
|
+// )
|
|
|
ay.entrance(
|
|
ay.entrance(
|
|
|
(args) => {
|
|
(args) => {
|
|
|
- staticData.entranceArgs = args
|
|
|
|
|
- // webapi.strategy.getCarNumber<null, { truckId: string }>().then((res) => {
|
|
|
|
|
- // webapi.strategy.getQrcode({}, { appendUrl: '/' + res.truckId }).then((resq) => {
|
|
|
|
|
- // data.qrcode = resq
|
|
|
|
|
- // })
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+ // staticData.entranceArgs = args
|
|
|
const init = async () => {
|
|
const init = async () => {
|
|
|
|
|
+ webapi.strategy.get_driver_balance().then((res) => {
|
|
|
|
|
+ data.accountInfo = {
|
|
|
|
|
+ ...res,
|
|
|
|
|
+ ...aop.request.AR.getAccountInfo(res),
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
// #ifdef MP
|
|
// #ifdef MP
|
|
|
|
|
+ // 用户是否授权了获取地理位置
|
|
|
await uni
|
|
await uni
|
|
|
.getSetting()
|
|
.getSetting()
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
@@ -428,17 +512,13 @@ ay.entrance(
|
|
|
.catch()
|
|
.catch()
|
|
|
// #endif
|
|
// #endif
|
|
|
methods.getListApp({ cras: args.cras })
|
|
methods.getListApp({ cras: args.cras })
|
|
|
- webapi.strategy.get_driver_balance().then((res) => {
|
|
|
|
|
- data.accountInfo = {
|
|
|
|
|
- ...res,
|
|
|
|
|
- ...aop.request.AR.getAccountInfo(res),
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ methods.getTruckInfo()
|
|
|
}
|
|
}
|
|
|
if (args.loadType === enums.LoadType.onLoad) {
|
|
if (args.loadType === enums.LoadType.onLoad) {
|
|
|
methods.initWS()
|
|
methods.initWS()
|
|
|
methods.getQrcode()
|
|
methods.getQrcode()
|
|
|
methods.getCityList()
|
|
methods.getCityList()
|
|
|
|
|
+ data.station.curCity = uni.getStorageSync(staticData.cctkn) || staticData.defCity
|
|
|
init()
|
|
init()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -451,12 +531,41 @@ ay.entrance(
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- // addLoadTypes: [enums.LoadType.onLoad],
|
|
|
|
|
|
|
+ // addLoadTypes: [enums.LoadType.onShow],
|
|
|
},
|
|
},
|
|
|
)
|
|
)
|
|
|
|
|
+
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ // #ifdef MP
|
|
|
|
|
+ const iob = uni.createIntersectionObserver(getCurrentInstance())
|
|
|
|
|
+
|
|
|
|
|
+ iob.relativeTo('#stations').observe('#stationTop', (res) => {
|
|
|
|
|
+ data.station.stickyed = res.intersectionRatio > 0
|
|
|
|
|
+ })
|
|
|
|
|
+ // #endif
|
|
|
|
|
+ // uni
|
|
|
|
|
+ // .createSelectorQuery()
|
|
|
|
|
+ // .select('#stationTop')
|
|
|
|
|
+ // // .boundingClientRect()
|
|
|
|
|
+ // .fields(
|
|
|
|
|
+ // {
|
|
|
|
|
+ // scrollOffset: true,
|
|
|
|
|
+ // rect:true,
|
|
|
|
|
+ // },
|
|
|
|
|
+ // (res) => {
|
|
|
|
|
+ // console.log(res)
|
|
|
|
|
+ // },
|
|
|
|
|
+ // )
|
|
|
|
|
+ // .exec((res) => {
|
|
|
|
|
+ // console.log(res)
|
|
|
|
|
+ // })
|
|
|
|
|
+})
|
|
|
|
|
+onPageScroll((res) => {
|
|
|
|
|
+ staticData.scrollTop = res.scrollTop
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
-<style lang="scss">
|
|
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
.top {
|
|
.top {
|
|
|
padding-bottom: $p-spac;
|
|
padding-bottom: $p-spac;
|
|
|
border-bottom: 1px dashed;
|
|
border-bottom: 1px dashed;
|
|
@@ -486,14 +595,35 @@ ay.entrance(
|
|
|
width: 152rpx;
|
|
width: 152rpx;
|
|
|
height: 116rpx;
|
|
height: 116rpx;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+#stationTop {
|
|
|
|
|
+ top: -1px;
|
|
|
|
|
+ z-index: 1;
|
|
|
|
|
+ padding: $p-spac 0;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ &.stickyed {
|
|
|
|
|
+ border-bottom: 1rpx solid $border-color;
|
|
|
|
|
+ @extend %box-shadow;
|
|
|
|
|
+ &::before,
|
|
|
|
|
+ &::after {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ width: $p-spac;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ content: '';
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ border-bottom: 1rpx solid $border-color;
|
|
|
|
|
+ }
|
|
|
|
|
+ &::before {
|
|
|
|
|
+ left: -$p-spac;
|
|
|
|
|
+ }
|
|
|
|
|
+ &::after {
|
|
|
|
|
+ right: -$p-spac;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
.unit {
|
|
.unit {
|
|
|
margin: 0 $p-spacd2;
|
|
margin: 0 $p-spacd2;
|
|
|
}
|
|
}
|
|
|
$bgc: rgba($p-color, 0.4);
|
|
$bgc: rgba($p-color, 0.4);
|
|
|
-.account {
|
|
|
|
|
- background-color: rgba($p-price-color, 0.1);
|
|
|
|
|
-}
|
|
|
|
|
.cars {
|
|
.cars {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
@@ -521,7 +651,7 @@ $bgc: rgba($p-color, 0.4);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.list-app {
|
|
.list-app {
|
|
|
- margin-top: $p-spac * 2;
|
|
|
|
|
|
|
+ margin-top: $p-spac;
|
|
|
.title {
|
|
.title {
|
|
|
font-size: $p-fz * 1.2;
|
|
font-size: $p-fz * 1.2;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|