@@ -0,0 +1,40 @@ | |||
<template> | |||
<view class="no-data-wrapper"> | |||
<img src="@/static/image/no-data.png" alt="" class="img"/> | |||
<view class="text">{{props.text || '暂无数据'}}</view> | |||
</view> | |||
</template> | |||
<script script="ts" setup > | |||
import { defineProps } from 'vue'; | |||
const props = defineProps({ | |||
text: { | |||
type: String, | |||
}, | |||
imgSrc: { | |||
type: String | |||
} | |||
}) | |||
</script> | |||
<style lang="scss" scoped> | |||
.no-data-wrapper { | |||
width: 100%; | |||
height: 100%; | |||
display: flex; | |||
flex-direction: column; | |||
align-items: center; | |||
.img { | |||
width: 60%; | |||
margin-bottom: 40rpx; | |||
} | |||
.text { | |||
font-family: Microsoft YaHei; | |||
font-weight: 400; | |||
font-size: 40rpx; | |||
color: #666666; | |||
line-height: 50rpx; | |||
} | |||
} | |||
</style> |
@@ -47,16 +47,16 @@ | |||
</view> | |||
<view class="as-layout-vertical as-gravity-center" @click=" | |||
state.loginType === 'pwd' | |||
? (state.loginType = 'code') | |||
: (state.loginType = 'pwd') | |||
"> | |||
state.loginType === 'pwd' | |||
? (state.loginType = 'code') | |||
: (state.loginType = 'pwd') | |||
"> | |||
<view class="bg orange as-gravity-center"> | |||
<image :src="`${$imgUrl}login/icon_code.png`" class="img" mode="aspectFill" /> | |||
</view> | |||
<view class="label">{{ | |||
state.loginType === "pwd" ? "验证码登录" : "密码登录" | |||
}}</view> | |||
state.loginType === "pwd" ? "验证码登录" : "密码登录" | |||
}}</view> | |||
</view> | |||
<view class="as-layout-vertical as-gravity-center" @click="navTo('/login/forget-pwd-step1')"> | |||
@@ -77,8 +77,10 @@ | |||
import { requestNew} from "@/utils/network/request.js"; | |||
import { useUserStore } from "@/stores/user"; | |||
import { setItem,getItem } from "@/utils/storage"; | |||
import { customerQuery, userInfoIndex } from "@/utils/network/api.js"; | |||
const userStore = useUserStore(); | |||
const { fetchToken } = userStore; | |||
const { fetchToken, saveUserInfo } = userStore; | |||
const state = reactive({ | |||
checked: false, //是否勾选协议 | |||
@@ -180,6 +182,32 @@ | |||
setItem('mobile', state.username) | |||
subscribeMessages(); | |||
msg("登录成功!"); | |||
let getUserInfo = requestNew(userInfoIndex, { | |||
type: 2, | |||
data: {}, | |||
method: "POST", | |||
showLoading: true, | |||
}); | |||
let getEtcAccounts = requestNew(customerQuery, { | |||
type: 2, | |||
data: {}, | |||
method: "POST", | |||
showLoading: true, | |||
}) | |||
Promise.all([getUserInfo, getEtcAccounts]).then(reses => { | |||
let userInfoRes = reses[0]; | |||
if (userInfoRes.mobile) { | |||
saveUserInfo(userInfoRes); | |||
} | |||
let userCustomerId = userInfoRes.customerId || ''; | |||
let etcAccounts = reses[1]; | |||
let customerObj = etcAccounts.find(val => val.customerId == userCustomerId); | |||
if(customerObj) { | |||
setItem('customerObj', customerObj); | |||
} | |||
}) | |||
uni.$emit("refreshOrder"); | |||
if (state.back == 1) { | |||
uni.navigateBack({ |
@@ -50,7 +50,7 @@ | |||
</view> | |||
</view> | |||
<view style="margin-right: 26rpx;"> | |||
{{state.customerObj.vehicleCount?state.customerObj.vehicleCount:'无'}}辆车 | |||
{{state.customerObj.vehicleCount?state.customerObj.vehicleCount + '辆车':'无车辆'}} | |||
</view> | |||
</view> | |||
@@ -52,7 +52,9 @@ | |||
></image> | |||
</view> | |||
</template> | |||
<view v-else class="flex"> 暂无车辆订单信息 </view> | |||
<NoDataView v-else /> | |||
<!-- <EmptyView v-else :mode="list" :content="'暂无数据'" /> --> | |||
<!-- <view v-else class="flex"> 暂无车辆订单信息 </view> --> | |||
<view v-if="state.loading" class="flex">加载中...</view> | |||
<view v-if="state.finished && state.list.length > 0" class="flex" | |||
>没有更多了</view | |||
@@ -81,6 +83,7 @@ import { | |||
} from "@/datas/vehiclePlateColor"; | |||
import { getCodeName } from "@/datas/queryKey.js"; | |||
import useOrderListItem from "@/composables/order/useOrderListItem"; | |||
import NoDataView from "@/components/no-data-view/no-data-view.vue"; | |||
const props = defineProps({ | |||
index: { | |||
type: Number, |
@@ -136,12 +136,13 @@ | |||
} | |||
const switchCustomer = (choiceData) => { | |||
requestNew(etcChange, { | |||
customerId: choiceData.customerId | |||
data:{customerId: choiceData.customerId} | |||
}) | |||
.then((res) => { | |||
console.log('用户信息', res) | |||
let userInfo = getItem('userInfo'); | |||
userInfo.customerId = choiceData.customerId; | |||
setItem('customerObj', choiceData); | |||
saveUserInfo(userInfo); | |||
uni.navigateBack() | |||
}) |