Commit da0bd622 by 李伟康

commit 轻改适配车型

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