Commit 9c98bce9 by 李伟康

commit 车型、销售增加缓存

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