@@ -29,7 +29,7 @@ | |||
<view class="panel-box"> | |||
<view class="panel"> | |||
<view class="panel-item" @click="$util.navTo('/subpackage/personal-center/vehicle-information', true)"> | |||
<view class="panel-text"><text class="num">2</text><text class="txt">辆</text></view> | |||
<view class="panel-text"><text class="num">{{state.carNumber}}</text><text class="txt">辆</text></view> | |||
<text class="type">车辆</text> | |||
</view> | |||
<view class="panel-item"> | |||
@@ -145,26 +145,26 @@ | |||
<view class="cars box"> | |||
<view class="right-head"> | |||
<view class="tit">我的车辆</view> | |||
<view class="more"> | |||
<view class="more" @click="$util.navTo('/subpackage/personal-center/vehicle-information', true)"> | |||
<text class="more-text">查看全部</text> | |||
<image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image> | |||
</view> | |||
</view> | |||
<view class="car-item"> | |||
<view class="car-item" v-for="(item,index) in state.list"> | |||
<image :src="`${$imgUrl}user/icon-car.png`" class="car-pic"></image> | |||
<view class="car-info"> | |||
<view class="car-no"><text class="no">贵ZSC122</text><text class="color">蓝色</text></view> | |||
<view class="card-no">卡号:52011328220202006876</view> | |||
<view class="card-no">签号:5202192509222195</view> | |||
<view class="car-no"><text class="no">{{item.vehiclePlate}}</text><text class="color">{{item.color}}</text></view> | |||
<view class="card-no">卡号:{{item.card_id}}</view> | |||
<view class="card-no">签号:{{item.obu_id}}</view> | |||
</view> | |||
<view class="btn-unbind">解除绑定</view> | |||
<view class="btn-unbind" @click="del(item.vehicleId)">解除绑定</view> | |||
</view> | |||
<view class="sub-bind"> | |||
<view class="item-tit"> | |||
<image :src="`${$imgUrl}user/icon-car-3.png`" class="icon icon-2"></image> | |||
<text>我要关联车辆</text> | |||
</view> | |||
<view class="right-arrow"> | |||
<view class="right-arrow" @click="$util.navTo('/subpackage/personal-center/setting/car-information/car-create', true)"> | |||
<view class="sub-tit">增加未关联车辆</view> | |||
<image :src="`${$imgUrl}user/icon-arrow.png`" class="arrow"></image> | |||
</view> | |||
@@ -196,7 +196,7 @@ | |||
import navBar from "../../components/nav-bar/nav-bar2.vue"; | |||
import { onLoad, onShow, onPageScroll } from "@dcloudio/uni-app"; | |||
import { | |||
userInfoIndex | |||
userInfoIndex,selectCarInfo,delCarInfo | |||
} from "@/utils/network/api.js"; | |||
import { | |||
request | |||
@@ -205,6 +205,7 @@ | |||
stringToJson | |||
} from "@/utils/network/encryption.js"; | |||
import filter from '@/components/filter/filter.vue'; | |||
import {vehiclePlateColor} from "@/datas/vehiclePlateColor.js"; | |||
const height = ref(null); | |||
const top = ref(null); | |||
const margin = ref(null); | |||
@@ -229,6 +230,8 @@ | |||
totalAmount: 0, | |||
}, | |||
vehicleManageList: [], | |||
list:'', //车辆信息 | |||
carNumber:'' //车辆数量 | |||
}); | |||
onMounted(() => { | |||
const res = uni.getMenuButtonBoundingClientRect(); | |||
@@ -248,13 +251,38 @@ | |||
onShow((option : any) => { | |||
state.data.opId = getItem(StorageKeys.OpenId); | |||
if(state.data.opId){ | |||
getUserInfo() | |||
getUserInfo(); | |||
} | |||
}); | |||
// 查询车辆信息 | |||
const queryCarMsg = () => { | |||
const options = { | |||
type: 2, | |||
data: { | |||
"openId":getItem('openId') | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
//调用方式 | |||
request(selectCarInfo, options).then((res) => { | |||
const data = (stringToJson(res.bizContent).vehicleManages) | |||
for(var i=0;i<1;i++){ | |||
for(var j=0;j<vehiclePlateColor.length;j++){ | |||
if(data[i].vehiclePlateColor==vehiclePlateColor[j]['id']){ | |||
data[i].color=vehiclePlateColor[j]['color'] | |||
} | |||
} | |||
} | |||
state.list=data; | |||
state.carNumber=data.length | |||
console.log("state.list",state.list) | |||
}) | |||
.catch((err) => { | |||
}); | |||
} | |||
const getUserInfo = () => { | |||
const options = { | |||
type: 2, | |||
data: { | |||
@@ -271,11 +299,47 @@ | |||
state.accountInfoVo = data.accountInfoVo; | |||
state.monthFlowingVo = data.monthFlowingVo; | |||
state.vehicleManageList = data.monthFlowingVo | |||
queryCarMsg(); | |||
}) | |||
.catch((err) => { | |||
console.log(err); | |||
}); | |||
} | |||
const del = (id) => { | |||
wx.showModal({ | |||
title: '提示', | |||
content: '是否删除该条车辆信息', | |||
success: function(res) { | |||
if (res.confirm) { | |||
console.log('用户点击确定'); | |||
let data = { | |||
vehicleId: id, | |||
openId: getItem('openId') | |||
} | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(delCarInfo, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
console.log(data) | |||
state.list = data.vehicleManages | |||
if (data.info == '成功.') { | |||
uni.showToast({ | |||
title: "删除成功", | |||
icon: "none" | |||
}) | |||
queryCarMsg(); | |||
} | |||
}); | |||
} else if (res.cancel) { | |||
console.log('用户点击取消'); | |||
} | |||
} | |||
}); | |||
} | |||
</script> | |||
<style> | |||
page { |
@@ -44,10 +44,13 @@ | |||
onLoad((option : any) => { | |||
console.log("option",option.cardNumber) | |||
state.form.cardNumber=option.cardNumber; | |||
if(option.value){ | |||
state.form=JSON.parse(decodeURIComponent(option.value)) | |||
} | |||
}); | |||
const goRecharge=()=>{ | |||
for(var i in state.from){ | |||
if(!state.from[i]){ | |||
for(var i in state.form){ | |||
if(!state.form[i]){ | |||
msg('请把信息填写完整!') | |||
return; | |||
} | |||
@@ -55,10 +58,10 @@ | |||
const options = { | |||
type: 2, | |||
data: { | |||
'accountId':state.from.name, //账户编号 | |||
'fee':state.from.fee, //公司营业执照统一社会信用代码 | |||
'bankCardId':state.from.cardNumber, //对公名称 | |||
'imageUrl':state.from.url, //密码 | |||
'accountId':state.form.name, //账户编号 | |||
'fee':state.form.fee, //公司营业执照统一社会信用代码 | |||
'bankCardId':state.form.cardNumber, //对公名称 | |||
'imageUrl':state.form.url, //密码 | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
@@ -73,9 +76,10 @@ | |||
}); | |||
} | |||
const goBank=()=>{ | |||
const params=encodeURIComponent(JSON.stringify(state.form)); | |||
uni.redirectTo({ | |||
//关闭当前页面,跳转到应用内的某个页面。 | |||
url:`/subpackage/personal-center/setting/bank-card/bank-card?choiceCard=1&value=encodeURIComponent(JSON.stringify(state.from))` | |||
url:`/subpackage/personal-center/setting/bank-card/bank-card?choiceCard=1&value=${params}` | |||
}); | |||
// navTo(`/subpackage/personal-center/setting/bank-card/bank-card?choiceCard=1`) | |||
} |
@@ -46,7 +46,7 @@ | |||
</view> | |||
<view class="shibie-wrapper"> | |||
<view class="title"> 识别内容如下 </view> | |||
<u-form label-width="200" :model="state.form" ref="uForm"> | |||
<u-form label-width="230" :model="state.form" ref="uForm"> | |||
<u-form-item label="姓名"> | |||
<u-input v-model="state.form.userName" placeholder='请输入姓名' :disabled="state.isEnableOCRData"/> | |||
</u-form-item> |
@@ -48,13 +48,15 @@ | |||
import {navTo} from '@/utils/utils'; | |||
import { onLoad} from "@dcloudio/uni-app"; | |||
const state = reactive({ | |||
name:'' | |||
name:'', | |||
params:{}, //传过来的参数 | |||
}) | |||
onLoad((option : any) => { | |||
console.log("option",option) | |||
console.log("option",JSON.parse(decodeURIComponent(option.value))) | |||
state.name=option.name; | |||
state.choiceCard=option.choiceCard; | |||
// getBankList(); | |||
state.params=JSON.parse(decodeURIComponent(option.value)) | |||
getBankList(); | |||
}) | |||
const getBankList=()=>{ | |||
const options = { | |||
@@ -92,7 +94,7 @@ | |||
}else{ | |||
uni.redirectTo({ | |||
//关闭当前页面,跳转到应用内的某个页面。 | |||
url:`/subpackage/after-sale/account-recharge/recharge?cardNumber=${cardNumber}` | |||
url:`/subpackage/after-sale/account-recharge/recharge?cardNumber=${cardNumber}&value=${encodeURIComponent(JSON.stringify(state.params))}` | |||
}); | |||
// navTo(`/subpackage/after-sale/account-recharge/recharge?cardNumber=${cardNumber}`) | |||
} |
@@ -1,31 +1,13 @@ | |||
<template> | |||
<view > | |||
<view class="car-item"> | |||
<view class="car-item" v-for="(item,index) in state.list"> | |||
<image :src="`${$imgUrl}user/icon-car.png`" class="car-pic"></image> | |||
<view class="car-info"> | |||
<view class="car-no"><text class="no">贵ZSC122</text><text class="color">蓝色</text></view> | |||
<view class="card-no">卡号:52011328220202006876</view> | |||
<view class="card-no">签号:5202192509222195</view> | |||
<view class="car-no"><text class="no">{{item.vehiclePlate}}</text><text class="color">{{item.color}}</text></view> | |||
<view class="card-no">卡号:{{item.card_id}}</view> | |||
<view class="card-no">签号:{{item.obu_id}}</view> | |||
</view> | |||
<view class="btn-unbind">解除绑定</view> | |||
</view> | |||
<view class="car-item"> | |||
<image :src="`${$imgUrl}user/icon-car.png`" class="car-pic"></image> | |||
<view class="car-info"> | |||
<view class="car-no"><text class="no">贵ZSC122</text><text class="color">蓝色</text></view> | |||
<view class="card-no">卡号:52011328220202006876</view> | |||
<view class="card-no">签号:5202192509222195</view> | |||
</view> | |||
<view class="btn-unbind">解除绑定</view> | |||
</view> | |||
<view class="car-item"> | |||
<image :src="`${$imgUrl}user/icon-car.png`" class="car-pic"></image> | |||
<view class="car-info"> | |||
<view class="car-no"><text class="no">贵ZSC122</text><text class="color">蓝色</text></view> | |||
<view class="card-no">卡号:52011328220202006876</view> | |||
<view class="card-no">签号:5202192509222195</view> | |||
</view> | |||
<view class="btn-unbind">解除绑定</view> | |||
<view class="btn-unbind" @click="del(item.vehicleId)">解除绑定</view> | |||
</view> | |||
</view> | |||
</template> | |||
@@ -35,10 +17,11 @@ | |||
import {request} from "@/utils/network/request.js"; | |||
import {stringToJson} from "@/utils/network/encryption.js"; | |||
import { onLoad} from "@dcloudio/uni-app"; | |||
import {getCarMsg} from "@/utils/network/api.js"; | |||
import {selectCarInfo,delCarInfo} from "@/utils/network/api.js"; | |||
import {getItem} from "@/utils/storage"; | |||
import {vehiclePlateColor} from "@/datas/vehiclePlateColor.js"; | |||
const state = reactive({ | |||
list:'' | |||
}) | |||
onLoad((option : any) => { | |||
queryCarMsg(); | |||
@@ -47,20 +30,64 @@ | |||
const options = { | |||
type: 2, | |||
data: { | |||
// "openId":getItem('openId') | |||
"openId":getItem('openId') | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
//调用方式 | |||
request(getCarMsg, options).then((res) => { | |||
const data = stringToJson(res.bizContent) | |||
console.log("车辆管理信息查询",data); | |||
request(selectCarInfo, options).then((res) => { | |||
const data = stringToJson(res.bizContent).vehicleManages | |||
for(var i=0;i<data.length;i++){ | |||
for(var j=0;j<vehiclePlateColor.length;j++){ | |||
if(data[i].vehiclePlateColor==vehiclePlateColor[j]['id']){ | |||
data[i].color=vehiclePlateColor[j]['color'] | |||
} | |||
} | |||
} | |||
console.log("data",data) | |||
state.list=data; | |||
}) | |||
.catch((err) => { | |||
}); | |||
} | |||
// 删除 | |||
const del = (id) => { | |||
wx.showModal({ | |||
title: '提示', | |||
content: '是否删除该条车辆信息', | |||
success: function(res) { | |||
if (res.confirm) { | |||
console.log('用户点击确定'); | |||
let data = { | |||
vehicleId: id, | |||
openId: getItem('openId') | |||
} | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(delCarInfo, options).then((res) => { | |||
const data = stringToJson(res.bizContent); | |||
console.log(data) | |||
state.list = data.vehicleManages | |||
if (data.info == '成功.') { | |||
uni.showToast({ | |||
title: "删除成功", | |||
icon: "none" | |||
}) | |||
queryCarMsg(); | |||
} | |||
}); | |||
} else if (res.cancel) { | |||
console.log('用户点击取消'); | |||
} | |||
} | |||
}); | |||
} | |||
</script> | |||
<style scoped> |
@@ -207,7 +207,6 @@ export const judageSalesman="35744a8e282a42ddbc63814303e9e441" //判断是否 | |||
export const judageQuanProduct="fe71273c1a394eaa999825afe7daa59b" //判断是否有权益产品 | |||
export const getGlobalParam="d0579171c82443cb9b243c113309119a" //全局配置 | |||
export const getUserMsg="c4a499a2a63042b9a2d4e88fc77d3fc0" //通过opneId查询用户信息 | |||
export const getCarMsg="1030" //车辆管理信息查询 | |||
// 单位账户充值 | |||
export const accountLogin="308679d555fa47da84876a8aeaee40a4" //单位账户登录 |