Commit f035a677 by 胡悦

Merge branch 'SAAS+V4.45' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V4.45

2 parents bf6d660a 97d74e59
......@@ -75,15 +75,23 @@ export default {
},
carBrand () {
return this.$store.state.user.customerInfo.carBrand
},
boutiqueDefaultCarBrandId () {
return this.$store.state.user.boutiqueDefaultCarBrandId
}
},
mounted () {
},
methods: {
autoSelect (index = 0) {
const { carBrandList } = this
autoSelect (index = 0, autoHideLoading = true) {
const { carBrandList, boutiqueDefaultCarBrandId } = this
let carIndex = 0
if (boutiqueDefaultCarBrandId) {
carIndex = carBrandList.findIndex(e => e.id == boutiqueDefaultCarBrandId)
if (carIndex < 0) carIndex = 0
}
if (index < 0) index = 0
if (carBrandList.length) this.selectCar(carBrandList[0], true, index)
if (carBrandList.length) this.selectCar(carBrandList[carIndex], true, index, autoHideLoading)
},
open () {
const userInfo = uni.$storage.get("userInfo"),
......@@ -117,9 +125,9 @@ export default {
this.$refs.carBrandListVisible.open()
this.carBrandListOff = true
},
selectCar (e, auto = false, index) {
selectCar (e, auto = false, index, autoHideLoading = true) {
let { clickFlga } = this
if (clickFlga) return
if (clickFlga) return
this.clickFlga = true
this.selectItem = {
carBrand: e.brandName,
......@@ -129,6 +137,7 @@ export default {
}
const carList = uni.getStorageSync(`${e.id}_${e.brandId}_carlist`)
if (carList) {
this.clickFlga = false
this.carlist = carList
if (auto && carList.length) this.handleSelect(carList[index])
else this.$refs.carBoxVisible.open()
......@@ -141,7 +150,7 @@ export default {
brandId: e.brandId,
childBrandId: e.id
}).then(res => {
uni.hideLoading()
if (autoHideLoading) uni.hideLoading()
this.carlist = res
if (res) uni.setStorageSync(`${e.id}_${e.brandId}_carlist`, res)
if (!carList) {
......
......@@ -129,7 +129,12 @@ export default {
'M7': m7,
'M9': m9,
}[newval]
if (this.show && newval && !this.isPreview && this.customerType == 1) this.$refs.carBrandRef.autoSelect(this.carList.findIndex(e => e == newval))
if (this.show && newval && !this.isPreview && this.customerType == 1) {
uni.showLoading({
mask: true
})
this.$refs.carBrandRef.autoSelect(this.carList.findIndex(e => e == newval), false)
}
}
},
watchStatus: {
......@@ -178,9 +183,10 @@ export default {
methods: {
changeCar (item) {
if (this.change_disabled) return
if (this.change_disabled || this.currentCarString == item) return uni.hideLoading()
this.currentCarString = item
this.updateViewKey = Date.now()
},
changePreView (e, leave = true) {
let { currentItem } = this,
......@@ -210,6 +216,7 @@ export default {
this.customerInfo.carModel = item.name
this.$store.dispatch('setCustomerInfo', this.customerInfo)
this.carInfo = item
uni.hideLoading()
},
showPicture (off = true) {
let { detailPicurl } = this.currentItem
......
<template>
<view class="sku-content">
<view class="first-type-box flex">
<view :class="['first-type-box flex',firstClass(boutiqueMediaConfig[currentCar])]">
<view :class="['block',blockClass]"></view>
<template v-for="(i,index) in boutiqueMediaConfig[currentCar]">
<view
......@@ -29,7 +29,7 @@
<view class="padding-right"></view>
</view>
</scroll-view>
<template v-if="tabId == 2 && secondIndex == 0">
<template v-if="tabId == 2 && secondName == '窗膜'">
<view class="sub-title">品牌</view>
<scroll-view
class="thirdly-type-scroll"
......@@ -107,6 +107,7 @@ export default {
scrollTop: 0
},
secondList: [],
secondName: ''
}
},
watch: {
......@@ -167,7 +168,10 @@ export default {
this.setSecondList()
},
async setSecondList () {
let { list } = this.boutiqueMediaConfig[this.currentCar].find(e => e.tabId == this.tabId)
let secondList = this.boutiqueMediaConfig[this.currentCar],
index = secondList.findIndex(e => e.tabId == this.tabId)
if (index == -1) index = 0
let { list } = secondList[index]
this.secondList = list
this.secondClick(0, false)
},
......@@ -182,8 +186,10 @@ export default {
},
secondClick (index, filter = true) {
if (filter && this.secondIndex == index) return
let { secondList } = this
this.secondIndex = index
if (this.tabId == 2 && index == 0) {
this.secondName = secondList[index].category
if (this.tabId == 2 && this.secondName == '窗膜') {
let { infoList } = this.secondList[0],
arr = Array.from(new Set([...infoList.map((e) => e.brand)])),
brandList = []
......@@ -215,20 +221,15 @@ export default {
getGoodsList () {
this.goodsList = []
this.flagObject.goodsFlag = false
uni.showLoading({
mask: true
})
let { secondIndex, secondList, tabId, brandList, thirdlyIndex } = this
uni.hideLoading()
let goodsList = goodsList = this.setGoodsData(tabId == 2 && secondIndex == 0 ? brandList[thirdlyIndex].list : secondList[secondIndex].infoList)
let { secondIndex, secondList, tabId, brandList, thirdlyIndex, secondName } = this
let goodsList = goodsList = this.setGoodsData(tabId == 2 && secondName == '窗膜' ? brandList[thirdlyIndex].list : secondList[secondIndex].infoList)
this.goodsList = goodsList
this.$nextTick(() => {
this.flagObject.goodsFlag = true
this.flagObject.scrollTop = 1
this.flagObject.goodsFlag = true
this.flagObject.scrollTop = -100
this.changeGoods(goodsList[0], 0, false)
setTimeout(() => {
this.setScrollHeight()
this.changeGoods(goodsList[0], 0, false)
})
},100)
},
changePreView () {
this.$emit('changePreView', this.currentItem)
......@@ -240,6 +241,9 @@ export default {
goodsList.push(e)
})
return goodsList
},
firstClass (list = []) {
return list.length == 2 ? 'two-block' : ''
}
}
}
......@@ -274,13 +278,13 @@ export default {
line-height: 44rpx;
position: relative;
z-index: 2;
opacity: .7;
opacity: 0.7;
.sprite-icon {
margin-bottom: 12rpx;
transform: scale(1.45);
}
}
.active{
.active {
opacity: 1;
}
.block {
......@@ -304,6 +308,18 @@ export default {
left: 560rpx;
}
}
.two-block {
.first-type-item,
.block {
width: 420rpx;
}
.block-0 {
left: 0;
}
.block-1 {
left: 420rpx;
}
}
.second-type-scroll {
width: 100%;
animation: show-view-opacity 0.15s forwards;
......
......@@ -265,9 +265,10 @@ export default {
},
// 查询素材
async getSoure () {
let { moduleList, toolList } = await uni.$api.systemApi.getBoutiqueMockData(true)
let { moduleList, toolList, boutiqueDefaultCarBrandId } = await uni.$api.systemApi.getBoutiqueMockData(true)
this.moduleList = moduleList
this.toolList = toolList
this.$store.state.user.boutiqueDefaultCarBrandId = boutiqueDefaultCarBrandId
},
toDetail (item) {
this.chooseItem = item
......
......@@ -182,11 +182,12 @@ export default {
uni.$api.systemApi.updateMockData({
moduleList,
toolList,
}, ['moduleList', 'toolList'],'byd_mock_data')
}, ['moduleList', 'toolList'], 'byd_mock_data')
this.setViewInfo(moduleList, toolList)
} else {
let { moduleList, toolList,
default_moduleList, default_toolList,
boutiqueDefaultCarBrandId
} = await uni.$api.systemApi.getMockData(true)
if (this.channelType == 3) {
/**其他品牌 */
......@@ -220,6 +221,7 @@ export default {
moduleList,
toolList
}, ["moduleList", 'toolList'])
this.$store.state.user.boutiqueDefaultCarBrandId = boutiqueDefaultCarBrandId
this.setViewInfo(moduleList, toolList)
}
}
......
......@@ -29,7 +29,8 @@ export default {
M7: [],
M9: []
},
receptionTrack: {} //接待记录埋点
receptionTrack: {}, //接待记录埋点
boutiqueDefaultCarBrandId: ''
};
},
mutations: {
......@@ -80,7 +81,7 @@ export default {
},
setReceptionTrack ({ state }, { key, value }) {
state.receptionTrack[key] = value
console.log(JSON.parse(JSON.stringify(state.receptionTrack)))
// console.log(JSON.parse(JSON.stringify(state.receptionTrack)))
},
clearReceptionTrack ({ state }) {
state.receptionTrack = {}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!