浏览代码

解决服务业数据不显示

master
yangteng 6 个月前
父节点
当前提交
00ee2f29b5

+ 248
- 311
pages/service/service.vue 查看文件

@@ -1,66 +1,70 @@
<template>
<view class="wrapper">
<view class="search-box">
<image :src="`${$imgUrl}service/icon-search.png`" class="icon" mode="aspectFill" @click="search()"></image>
<input class="search" placeholder="请输入业务名称" v-model="state.searchVal" @confirm="search()" />
</view>
<view class="content">
<view class="left">
<view v-for="(item,index) in menuShow.list" :key="index"
:class="activeTab === item.name ? 'menu active' : 'menu'" @click="tabHandle(item.name,index)">
<view :class="activeTab === item.name ? 'border on' : 'border'" :style="{ '--background': bgOn }"></view>
<view class="menu-text">{{item.name}}</view>
</view>
</view>
<view class="right">
<rightListVue class="rightListVue" :menuList='menuShow.list[tableSelectIndex].children'
v-if="menuShow.list.length > 0" />
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import { source } from "@/utils/network/difference";
import rightListVue from "./components/rightList.vue";
import {
ref,
reactive,
} from "vue";
import {
onLoad
} from "@dcloudio/uni-app";
import {
fileURL, fileURLList
} from "@/datas/fileURL.js";
import {
queryMenuConfig
} from "@/utils/network/api.js";
import {requestNew} from "@/utils/network/request.js";
import {
getItem,
StorageKeys,
} from "@/utils/storage";
const bgOn = `url(${fileURL}image/newHome/bg-on.png) center center no-repeat`;
import {hasLogin,confirm} from "@/utils/utils";
const activeTab = ref("");
const tableSelectIndex = ref(0);
// 切换
function tabHandle(val, index) {
activeTab.value = val;
tableSelectIndex.value = index
console.log(tableSelectIndex.value)
}
const menu = reactive({
list: [] //请求的真正的不会变得
});
const menuShow = reactive({
list: [],//展示的
});
const state = reactive({
searchVal: '', //input输入值
newArr: []
<template>
<view class="wrapper">
<view class="search-box">
<image :src="`${$imgUrl}service/icon-search.png`" class="icon" mode="aspectFill" @click="search()"></image>
<input class="search" placeholder="请输入业务名称" v-model="state.searchVal" @confirm="search()" />
</view>
<view class="content">
<view class="left">
<view v-for="(item,index) in menuShow.list" :key="index"
:class="activeTab === item.name ? 'menu active' : 'menu'" @click="tabHandle(item.name,index)">
<view :class="activeTab === item.name ? 'border on' : 'border'" :style="{ '--background': bgOn }"></view>
<view class="menu-text">{{item.name}}</view>
</view>
</view>
<view class="right">
<rightListVue class="rightListVue" :menuList='menuShow.list[tableSelectIndex].children'
v-if="menuShow.list.length > 0" />
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import { source } from "@/utils/network/difference";
import rightListVue from "./components/rightList.vue";
import {
ref,
reactive,
} from "vue";
import {
onLoad
} from "@dcloudio/uni-app";
import {
fileURL, fileURLList
} from "@/datas/fileURL.js";
import {
queryMenuConfig
} from "@/utils/network/api.js";
import {requestNew} from "@/utils/network/request.js";
import {
getItem,
StorageKeys,
} from "@/utils/storage";
const bgOn = `url(${fileURL}image/newHome/bg-on.png) center center no-repeat`;
import {hasLogin,confirm,navTo} from "@/utils/utils";
const activeTab = ref("");
const tableSelectIndex = ref(0);
// 切换
function tabHandle(val, index) {
activeTab.value = val;
tableSelectIndex.value = index
console.log(tableSelectIndex.value)
}
const menu = reactive({
list: [] //请求的真正的不会变得
});
const menuShow = reactive({
list: [],//展示的
});
const state = reactive({
searchVal: '', //input输入值
newArr: []
});
onLoad(() => {
load()
});
onLoad(() => {
function load(){
console.log("1")
if (!hasLogin()) {
console.log("2")
@@ -81,253 +85,186 @@
activeTab.value = val.menuList[0]['name']
})
}
});
// 深拷贝
const deepClone = (obj) => {
if (typeof obj !== 'object' || obj === null) {
return obj;
}
let clone = Array.isArray(obj) ? [] : {};
for (let key in obj) {
if (obj.hasOwnProperty(key)) {
clone[key] = deepClone(obj[key]);
}
}
return clone;
}
const search = () => {
for (var i = 0; i < menu.list.length; i++) {
state.newArr[i]['children'] = [];
for (var j = 0; j < menu.list[i]['children'].length; j++) {
const name = menu.list[i]['children'][j].name;
if (name.indexOf(state.searchVal) >= 0) {
state.newArr[i]['children'].push(menu.list[i]['children'][j])
}
}
}
// 清除没有孩子的父亲
const lastArr = []
for (var k = 0; k < state.newArr.length; k++) {
if (state.newArr[k]['children'].length != 0) {
lastArr.push(state.newArr[k])
}
}
console.log("lastArr", lastArr)
if (state.searchVal) {
tableSelectIndex.value = 0
}
menuShow.list = lastArr
console.log("menuShow.list", menuShow.list, tableSelectIndex.value)
}
const queryMenuConfigAction = () => {
var data = {
openId: getItem(StorageKeys.OpenId),
systemType: source == "WECHAT" ? '6' : "9",
loginSource: getItem("loginSource")
};
const options = {
type: 2,
data: data,
method: "POST",
showLoading: true,
};
return new Promise(async (resolve, reject) => {
const res = await requestNew(queryMenuConfig, options);
const data = res;
console.log("dataqueryMenuConfigAction", data.menuList)
resolve(data);
}).catch((error) => {
reject(error);
});
}
function toNext(url) {
uni.navigateTo({
url: url,
});
}
</script>
<style>
page {
height: 100%;
background: white;
}
.wrapper {
display: flex;
background: #01243A;
flex-direction: column;
height: 100%;
}
.search-box {
margin: 50rpx 40rpx;
height: 72rpx;
border-radius: 36rpx;
background: #f7f7f7;
display: flex;
justify-content: center;
align-items: center;
}
.search-box .icon {
width: 48rpx;
height: 48rpx;
margin: 0 20rpx;
}
.search-box .search {
flex: 1;
margin-right: 20rpx;
height: 100%;
padding: 0 10rpx;
font-size: 28rpx;
color: black;
background: transparent;
}
.content {
display: flex;
flex: 1;
flex-grow: 1;
background: #fff;
border-radius: 30rpx 30rpx 0 0;
padding-top: 40rpx;
}
.left {
width: 180rpx;
border-right: 1px solid #dcdcdc;
margin-right: 29rpx;
}
.left .menu-text {
font-size: 26rpx;
color: #666666;
width: 120rpx;
}
.left .menu {
padding-left: 15rpx;
display: flex;
align-items: center;
margin: 20rpx 0 60rpx 0;
}
.left .active .menu-text {
font-weight: bold;
line-height: 32rpx;
font-family: NotoSansHans, NotoSansHans;
font-size: 28rpx;
color: #01243A;
}
.left .border {
width: 9rpx;
height: 26rpx;
border-radius: 4rpx;
margin-right: 20rpx;
}
.left .on {
/* background: linear-gradient(0deg, #43a1e0 0%, #13e7c1 100%); */
/* background: linear-gradient(0deg, #fff 0%, #C2A75F 50%, #C2A75F 100%); */
border-radius: 4rpx;
font-size: 28rpx;
background: var(--background);
background-size: 100% 100%;
}
.right {
flex: 1;
}
/* .right-content {
display: flex;
flex-wrap: wrap;
}
// #ifdef MP-ALIPAY
.item {
width: 95rpx;
height: 95rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 20rpx;
}
.right .item-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-right: 26rpx;
margin-bottom: 39rpx;
}
// #endif
// #ifdef MP-WEIXIN
.item {
width: 105rpx;
height: 105rpx;
display: flex;
justify-content: center;
align-items: center;
border-radius: 20rpx;
}
.right .item-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-right: 30rpx;
margin-bottom: 39rpx;
}
// #endif
.item image {
width: 64rpx;
height: 64rpx;
}
.right .text {
width: 105rpx;
font-size: 22rpx;
text-align: center;
height: 60rpx;
display: flex;
justify-content: center;
align-items: center;
margin-top: 19rpx;
color: #666666;
} */
.bg-blue {
background: var(--background);
}
.bg-orange {
background: var(--background);
}
.right .text-orange {
color: #fd8362;
}
.rightListVue {
height: 100%;
}
</style>
// 深拷贝
const deepClone = (obj) => {
if (typeof obj !== 'object' || obj === null) {
return obj;
}

let clone = Array.isArray(obj) ? [] : {};

for (let key in obj) {
if (obj.hasOwnProperty(key)) {
clone[key] = deepClone(obj[key]);
}
}

return clone;
}
const search = () => {
for (var i = 0; i < menu.list.length; i++) {
state.newArr[i]['children'] = [];
for (var j = 0; j < menu.list[i]['children'].length; j++) {
const name = menu.list[i]['children'][j].name;
if (name.indexOf(state.searchVal) >= 0) {
state.newArr[i]['children'].push(menu.list[i]['children'][j])
}
}
}
// 清除没有孩子的父亲
const lastArr = []
for (var k = 0; k < state.newArr.length; k++) {
if (state.newArr[k]['children'].length != 0) {
lastArr.push(state.newArr[k])
}
}
console.log("lastArr", lastArr)
if (state.searchVal) {
tableSelectIndex.value = 0
}
menuShow.list = lastArr

console.log("menuShow.list", menuShow.list, tableSelectIndex.value)
}
const queryMenuConfigAction = () => {
var data = {
openId: getItem(StorageKeys.OpenId),
systemType: source == "WECHAT" ? '6' : "9",
loginSource: getItem("loginSource")
};
const options = {
type: 2,
data: data,
method: "POST",
showLoading: true,
};

return new Promise(async (resolve, reject) => {
const res = await requestNew(queryMenuConfig, options,false, ()=>{
console.log('---------------------我执行了!')
load()
});
const data = res;
console.log("dataqueryMenuConfigAction", data.menuList)
resolve(data);
}).catch((error) => {
reject(error);
});
}

function toNext(url) {
navTo(url);
}
</script>

<style>
page {
height: 100%;
background: white;
}

.wrapper {
display: flex;
background: #01243A;
flex-direction: column;
height: 100%;
}

.search-box {
margin: 50rpx 40rpx;
height: 72rpx;
border-radius: 36rpx;
background: #f7f7f7;
display: flex;
justify-content: center;
align-items: center;
}

.search-box .icon {
width: 48rpx;
height: 48rpx;
margin: 0 20rpx;
}

.search-box .search {
flex: 1;
margin-right: 20rpx;
height: 100%;
padding: 0 10rpx;
font-size: 28rpx;
color: black;
background: transparent;
}

.content {
display: flex;
flex: 1;
flex-grow: 1;
background: #fff;
border-radius: 30rpx 30rpx 0 0;
padding-top: 40rpx;
}

.left {
width: 180rpx;
border-right: 1px solid #dcdcdc;
margin-right: 29rpx;
}

.left .menu-text {
font-size: 26rpx;
color: #666666;
width: 120rpx;
}

.left .menu {
padding-left: 15rpx;
display: flex;
align-items: center;
margin: 20rpx 0 60rpx 0;
}

.left .active .menu-text {
font-weight: bold;
line-height: 32rpx;
font-family: NotoSansHans, NotoSansHans;
font-size: 28rpx;
color: #01243A;
}

.left .border {
width: 9rpx;
height: 26rpx;
border-radius: 4rpx;
margin-right: 20rpx;
}

.left .on {
border-radius: 4rpx;
font-size: 28rpx;
background: var(--background);
background-size: 100% 100%;
}

.right {
flex: 1;
}

.bg-blue {
background: var(--background);
}

.bg-orange {
background: var(--background);
}

.right .text-orange {
color: #fd8362;
}

.rightListVue {
height: 100%;
}
</style>

+ 1
- 24
pages/user/user.vue 查看文件

@@ -197,9 +197,6 @@
import {
request,requestNew
} from "@/utils/network/request.js";
import {
stringToJson
} from "@/utils/network/encryption.js";
import filter from '@/components/filter/filter.vue';
import { source } from "@/utils/network/difference";
import { vehiclePlateColor, vehiclePlateColorPai, getVehiclePlateColorPaiShow } from "@/datas/vehiclePlateColor.js";
@@ -278,7 +275,6 @@
console.log("state.data.opId", state.data.opId)
if (state.data.opId) {
getUserInfo();
// showEquityListRequest(); //权益请求
} else {
state.userVehicleInfoSumQueryVo = {
vehicleSum: 0,
@@ -394,9 +390,7 @@
});
}
const goOrder = (index) => {
uni.navigateTo({
url: `../order/order?index=${index}`
})
navTo(`../order/order?index=${index}`)
}
const goLogin = () => {
if (!getItem('openId')) {
@@ -405,23 +399,6 @@
})
}
}
const showEquityListRequest = () => {
const options = {
type: 2,
data: {
"openId": getItem(StorageKeys.OpenId),
"pageNo": 1,
"pageSize": 100,
},
method: 'POST',
showLoading: true,
}
request(showEquityListApi, options).then((res) => {
const data = stringToJson(res.bizContent);
console.log("购买2", data)
state.equityNumber = data.data.length
})
}
const goEquity = () => {
navTo('/subpackage/service/equityList/equityList')
}

+ 0
- 5
stores/user.js 查看文件

@@ -132,11 +132,6 @@ export const useUserStore = defineStore("userStore", {
}
},
loginAll(code){
},



/*退出登录*/
loginOutNoConfirm() {

+ 0
- 1
subpackage/orders/essential-information-two.vue 查看文件

@@ -95,7 +95,6 @@
import {
addressQueryNew,
productReCode,
addProduct,
orderAdd, orderDetailQuery
} from "@/utils/network/api.js";
import { request, requestNew } from "@/utils/network/request.js";

+ 10
- 36
subpackage/orders/essential-information.vue 查看文件

@@ -97,18 +97,14 @@
import carNumberInput from "./components/car-number-input.vue";
import numberplateColor from "./components/layout-numberplate-color";
import { getItem, StorageKeys } from "@/utils/storage";
import { stringToJson } from "@/utils/network/encryption";
import navBar from "@/components/nav-bar/nav-bar2.vue";
import { onLoad, onShow, onPageScroll, onUnload } from "@dcloudio/uni-app";
import {
isSubmitOrderApi,
plateCheck,
addressQueryNew,
productReCode,
addProduct,
orderAdd, orderDetailQuery
} from "@/utils/network/api.js";
import { request, requestNew } from "@/utils/network/request.js";
import { requestNew } from "@/utils/network/request.js";
import { reactive, ref } from "vue";
import { msg, noticeUser,navTo } from "@/utils/utils";

@@ -174,7 +170,12 @@
state.show = false;
};
const nextAction = () => {
uni.showLoading({
title:"请稍后",
mask: true //是否显示透明蒙层,防止触摸穿透
})
if (!state.data.vehiclePlate) {
uni.hideLoading()
msg("请输入申办车牌");
return;
}
@@ -184,6 +185,7 @@
};
const nextActionRequest = () => {
if (!state.data.vehiclePlate) {
uni.hideLoading()
msg("请输入申办车牌");
return;
}
@@ -192,22 +194,21 @@


if (state.data.vehiclePlate.length < 7) {
uni.hideLoading()
msg("请输入正确的申办车牌");
return;
}
if (!state.data.region) {
uni.hideLoading()
msg("请选择收货地址");
return;
}
//1.优先车牌校验 2.在进行订单创建
// isSubmitOrderRequest(state.data.vehiclePlate, state.data.vehiclePlateColor).then((item) => {
// console.log("item.data.data.canSubmit", item.data.data.canSubmit)
// if (item.data.data.canSubmit == 1) {
var vehicleData = {
vehiclePlate: state.data.vehiclePlate,
vehiclePlateColor: state.data.vehiclePlateColor,
};
const options = {
type: 2,
data: vehicleData,
@@ -217,15 +218,8 @@
console.log("车牌信息", options)
// 车牌校验有问题 还没改好
requestNew(plateCheck, options).then((res) => {
// uni.redirectTo({
// url: `/subpackage/orders/essential-information-two?userType=${state.data.userType}&vanType=${state.data.vanType}&isValueCard=${state.isValueCard}&cardType=${state.data.cardType}&totalAmount=${state.totalAmount}&equityId=${state.equityId}&vehiclePlate=${state.data.vehiclePlate}&vehiclePlateColor=${state.data.vehiclePlateColor}&productId=${state.data.productId}`,
// });
nextAddress()
});
// } else {
// msg(item.data.data.canSubmitMsg);
// }
// })
}
onLoad((option : any) => {
state.data.vanType = option.vanType; //1客车 2货车
@@ -400,26 +394,6 @@
});
}
};
// 老中台-检测能否提交订单
// const isSubmitOrderRequest = (vehiclePlate, vehiclePlateColor) => {
// const options = {
// type: 2,
// data: {
// vehicleId: vehiclePlate + "_" + vehiclePlateColor
// },
// method: "POST",
// showLoading: true,
// };
// return new Promise(async (resolve, reject) => {
// const res = await request(isSubmitOrderApi, options);
// const data = stringToJson(res.bizContent);
// console.log("111")
// resolve(data);
// }).catch((error) => {
// console.log("222")
// reject(error);
// });
// }
</script>

<style lang="scss" scoped>

+ 4
- 4
subpackage/orders/sign-up-ali-yd.vue 查看文件

@@ -164,8 +164,8 @@
//已签约
// msg("已签约");
confirm("您已完成签约,等待业务员审核发货", () => {
uni.switchTab({
url: "/pages/index/index"
uni.redirectTo({
url: `/pages/order/order?index=0`
})
}, "已完成签约", false);
} else if (data.signStatusCode === "UNSIGN") {
@@ -174,8 +174,8 @@
confirm(
"您已解约!",
() => {
uni.switchTab({
url: "/pages/index/index"
uni.redirectTo({
url: `/pages/order/order?index=0`
})
},
"您已解约",

+ 4
- 4
subpackage/orders/sign-up-ali.vue 查看文件

@@ -179,8 +179,8 @@
//已签约
// msg("已签约");
confirm("您已完成签约,等待业务员审核发货", () => {
uni.switchTab({
url: "/pages/index/index"
uni.redirectTo({
url: `/pages/order/order?index=0`
})
}, "已完成签约", false);
} else if (data.signStatus === "UNSIGN") {
@@ -189,8 +189,8 @@
confirm(
"您已解约!",
() => {
uni.switchTab({
url: "/pages/index/index"
uni.redirectTo({
url: `/pages/order/order?index=0`
})
},
"您已解约",

+ 2
- 2
subpackage/orders/sign-up.vue 查看文件

@@ -262,8 +262,8 @@
} else if (data.userState === "NORMAL") {
msg("已开通车主服务");
setTimeout(() => {
uni.switchTab({
url: "/pages/index/index"
uni.redirectTo({
url: `/pages/order/order?index=0`
})
}, 1500)


+ 7
- 0
subpackage/personal-center/setting/car-information/car-create.vue 查看文件

@@ -137,6 +137,13 @@
strReplace, uploadFile
} from "@/utils/utils";
const savaHandle = () => {
if(!state.form.vehBodyUrl){
uni.showToast({
title: "请上传车头照",
icon: "none"
})
return;
}
if (state.showCaridCorlor) {
state.form.vehicleId = state.form.vehicleId + '_' + state.carIdcorlorCode
var data = state.form;

+ 5
- 3
utils/network/request.js 查看文件

@@ -323,7 +323,7 @@ function updateGetTokenNew() {
});
}
//请求
export function requestNew(code, options = {}, start = false) {
export function requestNew(code, options = {}, start = false,clie=()=>{}) {
//公参
const Common = {
agentId: agentId,
@@ -387,12 +387,13 @@ export function requestNew(code, options = {}, start = false) {
if (options.showLoading) {
uni.hideLoading()
}
console.log("返回结果"+code,res)
console.log("返回结果"+code,res,res.statusCode,res.data.code,res.statusCode == 200 && res.data.code == 0)
if (res.statusCode == 200 && res.data.code == 0) {
resolve(res.data.data)
} else {
// 未知错误:登录凭证失效!
if(res.data.code == 403003 && res.data.message=='未知错误:登录凭证失效!'){
if(res.data.code == 403003){
uni.showModal({
title: '提示',
content: res.data.message,
@@ -409,6 +410,7 @@ export function requestNew(code, options = {}, start = false) {
}else if(res.data.code == 401002){
updateGetTokenNew().then((data) => {
console.log("token刷新", data);
clie(data)
requestNew(code, options, true)
})
}else if(res.data.code == 403001 || res.data.code == 403004){

+ 18
- 48
utils/utils.ts 查看文件

@@ -1,12 +1,9 @@
import { getItem, StorageKeys } from "./storage";
import { OrderStatus, OrderTypes } from "@/datas/enum.ts";
import { envs,interceptNDApi } from "@/utils/network/api.js";
import {
stringToJson
} from "@/utils/network/encryption";
import { envs } from "@/utils/network/api.js";
import { agentId } from "@/utils/network/difference";
import {
request,requestNew
requestNew
} from "@/utils/network/request.js";
export const msg = (title : string = "", param : any = {}) => {
if (!title) return;
@@ -60,24 +57,22 @@ export const navTo = (url : string = "", login : boolean = false) => {
});
}, '温馨提示', true, '去登录');
} else {
let pages = getCurrentPages();
// 获取页面栈总页数
// this.pagesCount = pages.length;
// 如果页面栈总数大于10
console.log("pages.length",pages.length)
if(pages.length >= 10){
// 使用重定向跳转页面
uni.redirectTo({
url
})
}else{
// 如果页面栈总数小于10,则打开新页面
uni.navigateTo({
url,
});
}

let pages = getCurrentPages();
// 获取页面栈总页数
// this.pagesCount = pages.length;
// 如果页面栈总数大于10
console.log("pages.length",pages.length)
if(pages.length >= 10){
// 使用重定向跳转页面
uni.redirectTo({
url
})
}else{
// 如果页面栈总数小于10,则打开新页面
uni.navigateTo({
url,
});
}
}
};

@@ -694,31 +689,6 @@ export const chooseImageCompress = ( callback : Function) => {
},
})
}
export const interceptND = (vehicleId) => {
var data = {
vehicleId: vehicleId,
source:"MINI_PROGRAM"
};
console.log("data==",data)
const options = {
type: 2,
data: data,
method: "POST",
showLoading: true,
};
return new Promise(async (resolve, reject) => {
const res = await request(interceptNDApi, options);
const data = stringToJson(res.bizContent);
if(data.pass=='on'){
confirm('鉴于系统正在进行升级维护,请您前往贵州黔通智联九州ETC服务小程序,以便顺利办理相关业务。', () => {
}, '温馨提示', true, '确定');
}else{
resolve(data);
}
}).catch((error) => {
reject(error);
});
}
// 身份证有效期是否过期
export function compareDates(specifiedDateString) {
const newTime=specifiedDateString.substring(0,4)+"-"+specifiedDateString.substring(4,6)+"-"+specifiedDateString.substring(6,8)

正在加载...
取消
保存