Commit 97d74e59 by 李伟康

commit 修复

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