"enablePullDownRefresh": false | "enablePullDownRefresh": false | ||||
} | } | ||||
}, | }, | ||||
{ | |||||
"path": "progress-query/select-car", | |||||
"style": { | |||||
"navigationBarTitleText": "选择车辆", | |||||
"enablePullDownRefresh": false | |||||
} | |||||
}, | |||||
{ | { | ||||
"path": "add-equity/equity-list", | "path": "add-equity/equity-list", | ||||
"style": { | "style": { |
type: 2, | type: 2, | ||||
data: { | data: { | ||||
"openId": getItem(StorageKeys.OpenId), | "openId": getItem(StorageKeys.OpenId), | ||||
"pageNo": 100, | |||||
"pageSize": 1, | |||||
"pageNo": 1, | |||||
"pageSize": 100, | |||||
}, | }, | ||||
method: 'POST', | method: 'POST', | ||||
showLoading: true, | showLoading: true, |
<text class="add" @click="add(item.equtyId)">加购</text> | <text class="add" @click="add(item.equtyId)">加购</text> | ||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="bottom-line" v-if="state.flags">我是有底线的~~~</view> | |||||
</view> | </view> | ||||
<view v-else> | <view v-else> | ||||
<empty title='暂无权益列表' /> | <empty title='暂无权益列表' /> | ||||
<script setup lang="ts"> | <script setup lang="ts"> | ||||
import empty from "@/components/empty/empty.vue"; | import empty from "@/components/empty/empty.vue"; | ||||
import { onLoad } from "@dcloudio/uni-app"; | |||||
import { onLoad,onReachBottom } from "@dcloudio/uni-app"; | |||||
import { reactive } from "vue"; | import { reactive } from "vue"; | ||||
import { equityProductsApi, addEquityListApi } from "@/utils/network/api.js"; | import { equityProductsApi, addEquityListApi } from "@/utils/network/api.js"; | ||||
import { stringToJson } from "@/utils/network/encryption"; | import { stringToJson } from "@/utils/network/encryption"; | ||||
const state = reactive({ | const state = reactive({ | ||||
list: [], //权益数据 | list: [], //权益数据 | ||||
pageNo:1, | |||||
pageSize:15, | |||||
flags:false | |||||
}) | }) | ||||
onLoad((option : any) => { | onLoad((option : any) => { | ||||
const options = { | const options = { | ||||
type: 2, | type: 2, | ||||
data: { | data: { | ||||
"pageNo": 100, | |||||
"pageSize": 1, | |||||
"pageNo": state.pageNo, | |||||
"pageSize": state.pageSize, | |||||
}, | }, | ||||
method: 'POST', | method: 'POST', | ||||
showLoading: true, | showLoading: true, | ||||
} | } | ||||
request(getEquityListApi, options).then((res) => { | request(getEquityListApi, options).then((res) => { | ||||
const data = stringToJson(res.bizContent); | |||||
state.list = data.data | |||||
console.log("222", data.data) | |||||
// const data = stringToJson(res.bizContent); | |||||
state.list = [ ...state.list,...stringToJson(res.bizContent).data] | |||||
// console.log("222", data.data) | |||||
}) | }) | ||||
} | } | ||||
const add = (equtyId) => { | const add = (equtyId) => { | ||||
navTo(`/subpackage/after-sale/add-equity/choice-order?equtyId=${equtyId}`, true) | navTo(`/subpackage/after-sale/add-equity/choice-order?equtyId=${equtyId}`, true) | ||||
} | } | ||||
// 触底加载 | |||||
onReachBottom(() => { | |||||
if (state.list.length < state.pageNo * 15) return state.flags = true | |||||
console.log("触底了") | |||||
state.pageNo++ | |||||
getList() | |||||
}) | |||||
</script> | </script> | ||||
<style scoped lang="scss"> | <style scoped lang="scss"> | ||||
display: inline-block; | display: inline-block; | ||||
margin-left: 20rpx; | margin-left: 20rpx; | ||||
} | } | ||||
.bottom-line { | |||||
text-align: center; | |||||
margin: 30rpx 0 50rpx 0; | |||||
} | |||||
</style> | </style> |
<view class="selectCar-box"> | <view class="selectCar-box"> | ||||
<view v-if="state.list" class="item" v-for="(item,i) in state.list" :key="i"> | <view v-if="state.list" class="item" v-for="(item,i) in state.list" :key="i"> | ||||
<view class="iten-left"> | <view class="iten-left"> | ||||
<view>权益名称:{{item.productName}}</view> | |||||
<view>权益金额:{{item.discountPrice * 0.01}}</view> | |||||
<view>权益名称:{{item.name}}</view> | |||||
<view>权益金额:¥{{item.fee * 0.01}}元</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view v-else> | <view v-else> | ||||
list: [],//车辆list, | list: [],//车辆list, | ||||
equtyId: "",//权益id | equtyId: "",//权益id | ||||
flags: false, | flags: false, | ||||
pageSize: 1, | |||||
pageNo: 10 | |||||
pageSize: 10, | |||||
pageNo: 1 | |||||
}); | }); | ||||
const flag = ref('0') //默认选择0 | const flag = ref('0') //默认选择0 | ||||
onLoad((option) => { | onLoad((option) => { | ||||
} | } | ||||
request(showEquityListApi, options).then((res) => { | request(showEquityListApi, options).then((res) => { | ||||
const data = stringToJson(res.bizContent); | const data = stringToJson(res.bizContent); | ||||
state.list = data.data | |||||
state.list = [...state.list,...stringToJson(res.bizContent).data] | |||||
console.log("购买2", data.data, state.list.length > 0) | console.log("购买2", data.data, state.list.length > 0) | ||||
}) | }) | ||||
} | } | ||||
// 触底加载 | |||||
onReachBottom(() => { | onReachBottom(() => { | ||||
if (state.list.length < state.pageSize * 10) return state.flags = true | |||||
if (state.list.length < state.pageNo * 10) return state.flags = true | |||||
console.log("触底了") | console.log("触底了") | ||||
state.pageSize++ | |||||
state.pageNo++ | |||||
showEquityListRequest() | showEquityListRequest() | ||||
}) | }) | ||||
</script> | </script> |
const getObuRenewal = () => { | const getObuRenewal = () => { | ||||
console.log("899执行之前",); | console.log("899执行之前",); | ||||
let cmdArray1 = [cmd.HOME_DIRECTORY, cmd.OBU_DF01, cmd.OBU_EF01, cmd.RANDOM_NUMBER]; | let cmdArray1 = [cmd.HOME_DIRECTORY, cmd.OBU_DF01, cmd.OBU_EF01, cmd.RANDOM_NUMBER]; | ||||
if (cmdArray1.length > 0) { | |||||
tools.showLoadingAlert("正在执行指令"); | tools.showLoadingAlert("正在执行指令"); | ||||
bluetoothUtil.transCmd(cmdArray1, "20", function(res) { | bluetoothUtil.transCmd(cmdArray1, "20", function(res) { | ||||
tools.hideLoadingAlert(); | tools.hideLoadingAlert(); | ||||
let datas = stringToJson(res.bizContent); | let datas = stringToJson(res.bizContent); | ||||
// let cmdArray = result.command.split(","); | // let cmdArray = result.command.split(","); | ||||
console.log("899",datas,datas.data.APDU); | console.log("899",datas,datas.data.APDU); | ||||
// if (datas.data.APDU) { | |||||
// tools.showLoadingAlert("正在执行指令"); | |||||
// bluetoothUtil.transCmd([datas.data.APDU], "20", function(res) { | |||||
// tools.hideLoadingAlert(); | |||||
// console.log("res=====",res,res[0]) | |||||
// // var str = res[3].substring(res[3].length - 4, res[3].length); | |||||
// if (res[0] == "9000") { | |||||
// cmdRandNum = res[3].substring(0, res[3].length - 4); | |||||
// getFileData((demos) => { | |||||
// modifyVehicle(demos); | |||||
// }) | |||||
// } else { | |||||
// tools.alertF("RANDOM_NUMBER指令长度不符" + res[1]); | |||||
// } | |||||
// }) | |||||
// } | |||||
if (datas.data.APDU) { | |||||
tools.showLoadingAlert("正在执行指令"); | |||||
bluetoothUtil.transCmd([datas.data.APDU], "20", function(res) { | |||||
tools.hideLoadingAlert(); | |||||
console.log("res=====",res,res[0]) | |||||
// var str = res[3].substring(res[3].length - 4, res[3].length); | |||||
// if (res[0] == "9000") { | |||||
// cmdRandNum = res[3].substring(0, res[3].length - 4); | |||||
// getFileData((demos) => { | |||||
// modifyVehicle(demos); | |||||
// }) | |||||
// } else { | |||||
// tools.alertF("RANDOM_NUMBER指令长度不符" + res[1]); | |||||
// } | |||||
}) | |||||
} | |||||
}) | }) | ||||
} else { | } else { | ||||
tools.alertF("RANDOM_NUMBER指令长度不符" + res[1]); | tools.alertF("RANDOM_NUMBER指令长度不符" + res[1]); | ||||
} | } | ||||
}) | }) | ||||
} | |||||
}; | }; | ||||
/** | /** | ||||
* 修改车辆信息 请求 | * 修改车辆信息 请求 |
<template> | <template> | ||||
<view class="content"> | <view class="content"> | ||||
<view class="top-content"> | <view class="top-content"> | ||||
<view class="item"> | |||||
<!-- <view class="item"> | |||||
<text>车牌号:</text><input placeholder="请输入车牌号" v-model="state.vehiclePlate" /> | <text>车牌号:</text><input placeholder="请输入车牌号" v-model="state.vehiclePlate" /> | ||||
</view> | </view> | ||||
<view class="item"> | <view class="item"> | ||||
<uni-data-select v-model="state.status" :localdata="state.statusArr" @change="changeStatus" | <uni-data-select v-model="state.status" :localdata="state.statusArr" @change="changeStatus" | ||||
:clear="false"></uni-data-select> | :clear="false"></uni-data-select> | ||||
</view> | </view> | ||||
</view> | |||||
</view> --> | |||||
<view class="item last"> | <view class="item last"> | ||||
<text>业务类型:</text> | <text>业务类型:</text> | ||||
<uni-data-select v-model="state.businessTypeVal" :localdata="state.businessRange" | <uni-data-select v-model="state.businessTypeVal" :localdata="state.businessRange" | ||||
obj['text'] = getBusiness[k]['name'] | obj['text'] = getBusiness[k]['name'] | ||||
state.businessRange.push(obj) | state.businessRange.push(obj) | ||||
} | } | ||||
state.vehiclePlate=option.vehiclePlate | |||||
state.vehiclePlateColor=option.vehiclePlateColor | |||||
search(1) | search(1) | ||||
}) | }) | ||||
.uni-container { | .uni-container { | ||||
margin: 50rpx 0; | margin: 50rpx 0; | ||||
margin-top: 330rpx; | |||||
margin-top: 180rpx; | |||||
} | } | ||||
/deep/.uni-table-th, | /deep/.uni-table-th, |
} | } | ||||
const choose = (i, item) => { | const choose = (i, item) => { | ||||
console.log("item",item) | |||||
flag.value = i | flag.value = i | ||||
navTo(`/subpackage/after-sale/replace-equipment/replace-equipment-confirm?id=${item.id}`) | |||||
uni.navigateTo({ | |||||
url: `/subpackage/after-sale/progress-query/progress-query-business?vehiclePlate=${item.vehiclePlate}&vehiclePlateColor=${item.vehiclePlateColor}` | |||||
}) | |||||
} | } | ||||
</script> | </script> | ||||
<style scoped> | <style scoped> | ||||
.allContent { | .allContent { | ||||
background-color: #EEF7F7; | background-color: #EEF7F7; | ||||
margin-top: 20rpx; | |||||
/* margin-top: 20rpx; */ | |||||
overflow: hidden; | overflow: hidden; | ||||
} | } | ||||
padding: 12rpx; | padding: 12rpx; | ||||
box-sizing: border-box; | box-sizing: border-box; | ||||
background-color: white; | background-color: white; | ||||
margin: 20rpx auto; | |||||
} | } | ||||
.list-item>view { | .list-item>view { |