Commit 9c98bce9 by 李伟康

commit 车型、销售增加缓存

1 parent 7c9bc515
...@@ -128,12 +128,19 @@ export default { ...@@ -128,12 +128,19 @@ export default {
}).then(res => { }).then(res => {
uni.hideLoading() uni.hideLoading()
this.carlist = res this.carlist = res
uni.setStorageSync(`${e.id}_${e.brandId}_carlist`, res)
if (auto && res.length) this.handleSelect(res[0]) if (auto && res.length) this.handleSelect(res[0])
else this.$refs.carBoxVisible.open() else this.$refs.carBoxVisible.open()
this.clickFlga = false this.clickFlga = false
}).catch(err => { }).catch(err => {
this.clickFlga = false this.clickFlga = false
uni.hideLoading() uni.hideLoading()
const carList = uni.getStorageSync(`${e.id}_${e.brandId}_carlist`)
if (carList) {
this.carlist = carList
if (auto && carList.length) this.handleSelect(res[0])
else this.$refs.carBoxVisible.open()
}
}) })
}, },
handleSelect (item) { handleSelect (item) {
......
<template> <template>
<view class="layout"> <view class="layout">
<wnCanvas :drawStatus="penSwitch" :canvasId="`c-${madiaId}`" custom> <wnCanvas
:drawStatus="penSwitch"
:canvasId="`c-${madiaId}`"
custom
>
<template slot="customContent"> <template slot="customContent">
<view class="title">{{ title }}</view> <view class="title">{{ title }}</view>
<view class="container"> <view class="container">
<view class="container-left"> <view class="container-left">
<view v-for="(item, index) in views" :key="item.name" class="item" @click="showSection(index)" :class="item.class" :style="item.style"> <view
v-for="(item, index) in views"
:key="item.name"
class="item"
@click="showSection(index)"
:class="item.class"
:style="item.style"
>
<view class="image-container"> <view class="image-container">
<image :src="item.detailUrl" mode="widthFix" class="item-image" /> <image
:src="item.detailUrl"
mode="widthFix"
class="item-image"
/>
<view class="item-text">{{item.name}}</view> <view class="item-text">{{item.name}}</view>
</view> </view>
<view class="details-container"> <view class="details-container">
<view class="details-section" :class="showIndex == index ? 'show' : 'hide'"> <view
class="details-section"
:class="showIndex == index ? 'show' : 'hide'"
>
<view class="section-title">{{item.name}}</view> <view class="section-title">{{item.name}}</view>
<view class="section-description">冷却风扇电机、散热器、冷却液水壶盖、冷却液水壶、冷却液循环泵</view> <view class="section-description">冷却风扇电机、散热器、冷却液水壶盖、冷却液水壶、冷却液循环泵</view>
</view> </view>
...@@ -19,12 +37,23 @@ ...@@ -19,12 +37,23 @@
</view> </view>
</view> </view>
<view class="container-right"> <view class="container-right">
<image src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-15.webp" mode="widthFix" class="serice-image" /> <image
src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-15.webp"
mode="widthFix"
class="serice-image"
/>
<view class="ul"> <view class="ul">
<view class="ul-title">高价值零部件</view> <view class="ul-title">高价值零部件</view>
<view class="li-item" v-for="i in ulList" :key="i.index" @click="open(i.flagName)"> <view
class="li-item"
v-for="i in ulList"
:key="i.index"
@click="open(i.flagName)"
>
<view class="li-content"> <view class="li-content">
<view class="li-item-content"><view class="li-number">{{i.index}}</view>{{i.name}}</view> <view class="li-item-content">
<view class="li-number">{{i.index}}</view>{{i.name}}
</view>
<image <image
v-if="i.hasArrow" v-if="i.hasArrow"
src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/icon-arrow.webp" src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/icon-arrow.webp"
...@@ -85,18 +114,18 @@ const list = [ ...@@ -85,18 +114,18 @@ const list = [
style: 'width: 284rpx;height: 242rpx;float: right;', style: 'width: 284rpx;height: 242rpx;float: right;',
class: 'm-r-b' class: 'm-r-b'
}, },
{ {
name: "电气系统", name: "电气系统",
detailUrl: detailUrl:
"https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-7.webp", "https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-7.webp",
style: 'width: 584rpx;height: 498rpx;float: right;', style: 'width: 584rpx;height: 498rpx;float: right;',
class: 'm-r-b' class: 'm-r-b'
}, },
{ {
name: "空调系统", name: "空调系统",
detailUrl: detailUrl:
"https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-6.webp", "https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-6.webp",
style: 'width: 286rpx;height: 498rpx;float: right;', style: 'width: 286rpx;height: 498rpx;float: right;',
class: 'm-r-b' class: 'm-r-b'
}, },
...@@ -104,7 +133,7 @@ const list = [ ...@@ -104,7 +133,7 @@ const list = [
name: "安全气囊系统", name: "安全气囊系统",
detailUrl: detailUrl:
"https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-5.webp", "https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-5.webp",
style: 'width: 284rpx;height: 330rpx;float: right;', style: 'width: 284rpx;height: 330rpx;float: right;',
class: 'm-r-b' class: 'm-r-b'
}, },
{ {
...@@ -112,34 +141,34 @@ const list = [ ...@@ -112,34 +141,34 @@ const list = [
detailUrl: detailUrl:
"https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-10.webp", "https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-10.webp",
style: 'width: 584rpx;height: 240rpx;position: absolute;top:604rpx;right:0;', style: 'width: 584rpx;height: 240rpx;position: absolute;top:604rpx;right:0;',
class: '' class: ''
}, },
{ {
name: "增程器", name: "增程器",
detailUrl: detailUrl:
"https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-11.webp", "https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-11.webp",
style: 'width: 586rpx;height: 332rpx;float: left;', style: 'width: 586rpx;height: 332rpx;float: left;',
class: 'm-r' class: 'm-r'
}, },
{ {
name: "舒适系统", name: "舒适系统",
detailUrl: detailUrl:
"https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-12.webp", "https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-12.webp",
style: 'width: 284rpx;height: 332rpx;float: left;', style: 'width: 284rpx;height: 332rpx;float: left;',
class: 'm-r' class: 'm-r'
}, },
{ {
name: "ABS防抱死制动系统", name: "ABS防抱死制动系统",
detailUrl: detailUrl:
"https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-13.webp", "https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-13.webp",
style: 'width: 582rpx;height: 332rpx;float: left;', style: 'width: 582rpx;height: 332rpx;float: left;',
class: 'm-r' class: 'm-r'
}, },
{ {
name: "娱乐系统", name: "娱乐系统",
detailUrl: detailUrl:
"https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-14.webp", "https://img02.glsx.com.cn/weapp/resource/app-tape/media/guarantee/6-14.webp",
style: 'width: 286rpx;height: 332rpx;float: left;' style: 'width: 286rpx;height: 332rpx;float: left;'
}, },
]; ];
const ulList = [ const ulList = [
...@@ -188,7 +217,7 @@ export default { ...@@ -188,7 +217,7 @@ export default {
title: String, title: String,
madiaId: Number, madiaId: Number,
}, },
data() { data () {
return { return {
viewIndex: 6, viewIndex: 6,
list, list,
...@@ -196,14 +225,14 @@ export default { ...@@ -196,14 +225,14 @@ export default {
showIndex: -1 showIndex: -1
}; };
}, },
mounted() { mounted () {
console.log(this.views); console.log(this.views);
}, },
methods: { methods: {
open(name) { open (name) {
console.log(name) console.log(name)
}, },
showSection(index) { showSection (index) {
console.log(index) console.log(index)
if (this.showIndex === index) { if (this.showIndex === index) {
// 如果当前点击的项已经是翻转状态,则关闭它 // 如果当前点击的项已经是翻转状态,则关闭它
...@@ -245,7 +274,7 @@ export default { ...@@ -245,7 +274,7 @@ export default {
position: relative; position: relative;
column-gap: 16rpx; column-gap: 16rpx;
border-radius: 24rpx; border-radius: 24rpx;
&::after{ &::after {
content: ""; content: "";
display: block; display: block;
clear: both; clear: both;
...@@ -262,7 +291,7 @@ export default { ...@@ -262,7 +291,7 @@ export default {
left: 24rpx; left: 24rpx;
bottom: 24rpx; bottom: 24rpx;
font-size: 30rpx; font-size: 30rpx;
color: #FFFFFF; color: #ffffff;
line-height: 44rpx; line-height: 44rpx;
} }
.details-container { .details-container {
...@@ -280,14 +309,13 @@ export default { ...@@ -280,14 +309,13 @@ export default {
// left: 0; // left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
color: #FFFFFF; color: #ffffff;
padding: 24rpx; padding: 24rpx;
border-radius: 24rpx; border-radius: 24rpx;
background-image: linear-gradient(180deg, #21425cb3 0%, #4A84F9 68%); background-image: linear-gradient(180deg, #21425cb3 0%, #4a84f9 68%);
display: none;
flex-direction: column; flex-direction: column;
justify-content: flex-end; justify-content: flex-end;
animation: show-gradient .2s linear; transform: translateY(100%);
// overflow: hidden; // overflow: hidden;
// animation: slide-top 2s linear; // animation: slide-top 2s linear;
.section-title { .section-title {
...@@ -299,7 +327,7 @@ export default { ...@@ -299,7 +327,7 @@ export default {
} }
} }
.show { .show {
display: flex; animation: show-gradient 0.2s linear forwards;
} }
.hide { .hide {
// display: none; // display: none;
...@@ -314,18 +342,18 @@ export default { ...@@ -314,18 +342,18 @@ export default {
} }
.ul { .ul {
width: 100%; width: 100%;
border: 4rpx solid #FDFDFF; border: 4rpx solid #fdfdff;
border-radius: 24rpx; border-radius: 24rpx;
margin-top: 36rpx; margin-top: 36rpx;
box-sizing: border-box; box-sizing: border-box;
&-title { &-title {
background-color: #4A84F9; background-color: #4a84f9;
box-shadow: inset 0 0 16rpx 0 #FFFFFF; box-shadow: inset 0 0 16rpx 0 #ffffff;
border-radius: 24rpx 24rpx 0 0; border-radius: 24rpx 24rpx 0 0;
height: 88rpx; height: 88rpx;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #FFFFFF; color: #ffffff;
line-height: 88rpx; line-height: 88rpx;
text-align: center; text-align: center;
} }
...@@ -338,7 +366,7 @@ export default { ...@@ -338,7 +366,7 @@ export default {
flex-direction: column; flex-direction: column;
padding-left: 40rpx; padding-left: 40rpx;
// margin-bottom: 4rpx; // margin-bottom: 4rpx;
border: 2rpx solid #FDFDFF; border: 2rpx solid #fdfdff;
.li-number { .li-number {
font-size: 32rpx; font-size: 32rpx;
margin-right: 12rpx; margin-right: 12rpx;
...@@ -359,18 +387,18 @@ export default { ...@@ -359,18 +387,18 @@ export default {
.li-value { .li-value {
margin-top: 8rpx; margin-top: 8rpx;
font-size: 22rpx; font-size: 22rpx;
color: #1462FF; color: #1462ff;
}
&:nth-child(odd) {
background-color: #e5edff;
}
&:nth-child(even) {
background-color: rgba(255, 255, 255, 0.35);
}
&:last-child {
border-radius: 0 0 24rpx 24rpx;
height: 140rpx;
} }
&:nth-child(odd) {
background-color: #E5EDFF;
}
&:nth-child(even) {
background-color: rgba(255, 255, 255, 0.35);
}
&:last-child {
border-radius: 0 0 24rpx 24rpx;
height: 140rpx;
}
} }
} }
} }
...@@ -405,5 +433,4 @@ export default { ...@@ -405,5 +433,4 @@ export default {
transform: translateY(100%); transform: translateY(100%);
} }
} }
</style> </style>
...@@ -94,7 +94,11 @@ export default { ...@@ -94,7 +94,11 @@ export default {
this.getSoure(); this.getSoure();
this.findPayInfo(); this.findPayInfo();
const userInfo = uni.$storage.get("userInfo"), const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo; storageCarBrandList = uni.$storage.get('carBrandList'),
storageEmployeeList = uni.$storage.get('employeeList'),
{ shopMerchantId } = userInfo
if (storageCarBrandList) this.$store.dispatch("setCarBrandsList", storageCarBrandList);
if (storageEmployeeList) this.$store.dispatch("setEmployeeList", storageEmployeeList);
/**获取品牌车型 */ /**获取品牌车型 */
uni.$api.commonApi uni.$api.commonApi
.getMerchantCarBrandList([shopMerchantId]) .getMerchantCarBrandList([shopMerchantId])
...@@ -108,7 +112,8 @@ export default { ...@@ -108,7 +112,8 @@ export default {
}); });
}); });
this.$store.dispatch("setCarBrandsList", carBrandList); this.$store.dispatch("setCarBrandsList", carBrandList);
}); uni.$storage.set('carBrandList', carBrandList)
})
/**获取销售人员 */ /**获取销售人员 */
uni.$api.commonApi uni.$api.commonApi
.getEmployeeList({ .getEmployeeList({
...@@ -116,6 +121,7 @@ export default { ...@@ -116,6 +121,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.$store.dispatch("setEmployeeList", res); this.$store.dispatch("setEmployeeList", res);
uni.$storage.set('employeeList', res)
}); });
}, },
// 查询素材 // 查询素材
......
...@@ -16,6 +16,8 @@ export const STORAGE_OBJECTkEY = { ...@@ -16,6 +16,8 @@ export const STORAGE_OBJECTkEY = {
noSignInUuid: "noSignInUuid", noSignInUuid: "noSignInUuid",
noviceGuideStatus: "noviceGuideStatus", noviceGuideStatus: "noviceGuideStatus",
accountLength: "accountLength", accountLength: "accountLength",
carBrandList:'carBrandList',
employeeList:'employeeList'
}; };
// export const IMG_VERSION = async () => { // export const IMG_VERSION = async () => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!