Commit da0bd622 by 李伟康

commit 轻改适配车型

1 parent 38428392
......@@ -175,7 +175,6 @@ export default {
watchStatus: {
handler (val) {
this.selectIndex = '全部'
// console.log(val)
// this.name = '';
// this.isSearch = false
// this.list = this.views
......@@ -232,7 +231,6 @@ export default {
this.isSelect = false
},
chooseType (val) {
console.log(val)
this.selectIndex = val.value
this.isSelect = false
this.getCaseList(this.selectIndex == '全部' ? '' : this.selectIndex, this.name)
......@@ -244,7 +242,6 @@ export default {
const params = { merchantId: shopMerchantId, category }
if (name) params.materialName = name
const res = await uni.$api.boutiqueApi.getCaseList(params)
console.log(res)
this.list = res.list
this.searchList = res.list
this.scrollTop = 1
......@@ -256,7 +253,6 @@ export default {
const userInfo = uni.$storage.get("userInfo"),
{ shopMerchantId } = userInfo;
const res = await uni.$api.boutiqueApi.getCategory({ merchantId: shopMerchantId })
console.log(res)
const _list = res.map(item => {
return {
label: item,
......
......@@ -8,16 +8,26 @@
ref="receptionCanvas"
>
<template slot="customContent">
<view class="tab-box flex">
<template v-for="(item, index) in carList">
<view class="select-box flex">
<view
class="select flex"
@click.stop="showSelect"
>
{{currentCarString}}
<view class="sprite-icon icon-arrow-bottom" v-if="carList.length > 1 && !change_disabled"></view>
</view>
<view
class="pop-box"
v-show="isSelect"
>
<view
:key="index"
:class="['tab',`${currentIndex == index ? 'active' : ''}`]"
@click="changeCar(item)"
>
{{item}}
</view>
</template>
v-for="i in carList"
:key="i.label"
class="type-item flex"
:class="i == currentCarString ? 'active' : ''"
@click="changeCar(i)"
>{{i}}</view>
</view>
</view>
<view
class="risk-informed flex"
......@@ -46,14 +56,6 @@
>* 点击图片查看详情 &gt;</view>
</view>
</template>
<template v-else>
<view class="left-content">
<image
class="default"
:src="defaultImg"
/>
</view>
</template>
<view class="right-content">
<view :class="['sku-box',isPreview ? 'preview' : '']">
<sku-box
......@@ -132,7 +134,6 @@ export default {
},
data () {
return {
carList: ['M5', 'M7', 'M9'],
currentCarString: '',
customerInfo: {},
updateViewKey: Date.now(),
......@@ -140,7 +141,8 @@ export default {
currentImgUrl: '',
currentItem: null,
tabs: ['加装', '选装'],
tabIndex: 0
tabIndex: 0,
isSelect: false,
}
},
watch: {
......@@ -160,11 +162,6 @@ export default {
immediate: true,
handler (newval) {
if (!this.hasOptionals && this.tabIndex == 1) this.tabIndex = 0
this.defaultImg = {
'M5': m5,
'M7': m7,
'M9': m9,
}[newval]
if (this.show && newval && !this.isPreview && this.customerType == 1) {
uni.showLoading({
mask: true
......@@ -185,6 +182,7 @@ export default {
immediate: true,
handler (newval) {
if (newval) {
this.isSelect = false
if (newval && this.currentItem && this.tabIndex == 0) this.changePreView(this.currentItem, false, false)
}
}
......@@ -223,6 +221,13 @@ export default {
let flag = false
if (this.show) flag = this.boutiqueMediaConfig[this.currentCarString].optionals && this.boutiqueMediaConfig[this.currentCarString].optionals.length
return flag
},
carList () {
let { boutiqueMediaConfig } = this,
carList = []
Object.keys(boutiqueMediaConfig).map(e => carList.push(e))
console.log(carList)
return carList
}
},
......@@ -231,6 +236,7 @@ export default {
changeCar (item) {
if (this.change_disabled || this.currentCarString == item) return uni.hideLoading()
this.currentCarString = item
this.isSelect = false
this.updateViewKey = Date.now()
this.clearCanvas()
},
......@@ -274,7 +280,7 @@ export default {
this.$emit('reception', e)
},
clearCustomerReceivedTimer () {
if (this.couponPopupRef.pageParams.qrTimer) {
if (this.couponPopupRef?.pageParams?.qrTimer) {
clearInterval(this.couponPopupRef.pageParams.qrTimer)
this.couponPopupRef.pageParams.qrTimer = null
}
......@@ -302,6 +308,10 @@ export default {
if (index == 1) this.previewLeave(this.currentItem)
else this.$refs.sku.changeCar(this.currentCarString)
this.clearCanvas()
},
showSelect(){
if(this.carList.length == 1 || this.change_disabled) return
this.isSelect = !this.isSelect
}
}
}
......@@ -327,44 +337,41 @@ export default {
margin-left: 8rpx;
}
}
.tab-box {
.select-box {
padding-top: 66rpx;
position: fixed;
left: 0;
top: 0;
width: 100%;
justify-content: center;
.tab {
padding: 0 32rpx;
font-weight: 500;
z-index: 2;
.select {
color: #333333;
font-size: 36rpx;
color: #333333b3;
font-weight: 500;
line-height: 44rpx;
width: 130rpx;
text-align: center;
position: relative;
}
.active {
font-weight: 700;
color: #333333;
transition: all 1s;
&::after {
content: '';
position: absolute;
left: 50%;
width: 8rpx;
height: 8rpx;
background: #333333;
border-radius: 100%;
transform: translateX(-50%);
animation: show-dot 0.15s forwards;
}
@keyframes show-dot {
0% {
bottom: 16rpx;
.pop-box {
width: 272rpx;
border-radius: 16rpx;
background: #ffffff;
box-shadow: 0 0 16rpx 0 #99999933;
position: absolute;
top: 122rpx;
left: 50%;
transform: translateX(-50%);
padding: 12rpx 0;
.type-item {
padding: 0 24rpx;
margin-bottom: 8rpx;
height: 56rpx;
color: #292d33;
font-size: 28rpx;
&:last-child {
margin-bottom: 0;
}
100% {
bottom: -16rpx;
&.active {
background-color: #ecf1ff;
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!