Commit caf8e60b by 李伟康

commit 提交

1 parent e8319d2b
...@@ -16,126 +16,143 @@ ...@@ -16,126 +16,143 @@
</view> --> </view> -->
<view class="wrapper"> <view class="wrapper">
<view class="wrapper-content"> <view class="wrapper-content">
<view class="first-tab"> <template v-if="views && views[firstIndex] && views[firstIndex].receptionSourceDetailInfoList">
<view
class="tab-item" <view class="first-tab">
v-for="(i, index) in views"
:key="index"
@click="changeIndex(index, 'firstIndex')"
>
<view <view
class="sprite-icon" class="tab-item"
:class="[ v-for="(i, index) in views"
:key="index"
@click="changeIndex(index, 'firstIndex')"
>
<view
class="sprite-icon"
:class="[
firstIndex == index ? `icon-${firstClass[index]} active` : '', firstIndex == index ? `icon-${firstClass[index]} active` : '',
]" ]"
:style="{ left: firstLeft[index] }" :style="{ left: firstLeft[index] }"
></view> ></view>
<view class="text" :class="[firstIndex == index ? `active` : '']">{{ <view
class="text"
:class="[firstIndex == index ? `active` : '']"
>{{
i.tabName i.tabName
}}</view> }}</view>
</view>
</view> </view>
</view> <template v-if="madiaId == 2">
<template v-if="madiaId == 2"> <!-- 套餐 无分组 -->
<!-- 套餐 无分组 --> <view
<view class="content" id="content"> class="content"
<template id="content"
v-if=" >
<template v-if="
views[firstIndex].noGroupReceptionSourceDetailInfoList.length > views[firstIndex].noGroupReceptionSourceDetailInfoList.length >
0 0
" ">
>
<view
class="product-list"
:key="firstIndex"
:class="direction"
style="height: 1120rpx"
>
<view <view
class="product-item" class="product-list"
v-for="(it, ids) in views[firstIndex] :key="firstIndex"
.noGroupReceptionSourceDetailInfoList" :class="direction"
:key="ids" style="height: 1120rpx"
@click="goDetail(it)"
> >
<view
class="product-item"
v-for="(it, ids) in views[firstIndex]
.noGroupReceptionSourceDetailInfoList"
:key="ids"
@click="goDetail(it)"
>
<image
:src="it.thumbnail"
mode="scaleToFill"
class="product-img"
/>
</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image <image
:src="it.thumbnail" class="icon"
mode="scaleToFill" src="../../assets/images/boutique/nothing.png"
class="product-img"
/> />
<view>暂无产品内容</view>
</view> </view>
</view> </template>
</template> </view>
<template v-else> </template>
<view class="nothing flex"> <template v-else>
<image <!-- 其他 有分组 -->
class="icon"
src="../../assets/images/boutique/nothing.png"
/>
<view>暂无产品内容</view>
</view>
</template>
</view>
</template>
<template v-else>
<!-- 其他 有分组 -->
<view class="content" id="content">
<view <view
class="second-tab" class="content"
ref="secondTab" id="content"
v-if="views[firstIndex].receptionSourceDetailInfoList.length > 0"
> >
<view <view
v-for="(item, ind) in views[firstIndex] class="second-tab"
ref="secondTab"
v-if="views[firstIndex].receptionSourceDetailInfoList.length > 0"
>
<view
v-for="(item, ind) in views[firstIndex]
.receptionSourceDetailInfoList" .receptionSourceDetailInfoList"
:key="ind" :key="ind"
class="tab-item" class="tab-item"
:class="[secondIndex == ind ? 'active' : '']" :class="[secondIndex == ind ? 'active' : '']"
@click="changeIndex(ind, 'secondIndex')" @click="changeIndex(ind, 'secondIndex')"
>{{ item.tabName }} >{{ item.tabName }}
</view>
</view> </view>
</view> <template v-if="
<template
v-if="
views[firstIndex].receptionSourceDetailInfoList.length > 0 && views[firstIndex].receptionSourceDetailInfoList.length > 0 &&
views[firstIndex].receptionSourceDetailInfoList[secondIndex] views[firstIndex].receptionSourceDetailInfoList[secondIndex]
.receptionSourceDetailInfoList .receptionSourceDetailInfoList
" ">
> <view
<view class="product-list"
class="product-list" :key="firstIndex + secondIndex"
:key="firstIndex + secondIndex" :class="direction"
:class="direction" :style="{
:style="{
height: views[firstIndex].receptionSourceDetailInfoList height: views[firstIndex].receptionSourceDetailInfoList
? '962rpx' ? '962rpx'
: '1032rpx', : '1032rpx',
}" }"
> >
<view <view
class="product-item" class="product-item"
v-for="(itm, idx) in views[firstIndex] v-for="(itm, idx) in views[firstIndex]
.receptionSourceDetailInfoList[secondIndex] .receptionSourceDetailInfoList[secondIndex]
.receptionSourceDetailInfoList" .receptionSourceDetailInfoList"
:key="idx" :key="idx"
@click="goDetail(itm)" @click="goDetail(itm)"
> >
<image
:src="itm.thumbnail"
mode="scaleToFill"
class="product-img"
/>
</view>
</view>
</template>
<template v-else>
<view class="nothing flex">
<image <image
:src="itm.thumbnail" class="icon"
mode="scaleToFill" src="../../assets/images/boutique/nothing.png"
class="product-img"
/> />
<view>暂无产品内容</view>
</view> </view>
</view> </template>
</template> </view>
<template v-else> </template>
<view class="nothing flex"> </template>
<image <template v-else>
class="icon" <view class="nothing flex">
src="../../assets/images/boutique/nothing.png" <image
/> class="icon"
<view>暂无产品内容</view> src="../../assets/images/boutique/nothing.png"
</view> />
</template> <view>暂无产品内容</view>
</view> </view>
</template> </template>
</view> </view>
...@@ -177,10 +194,10 @@ export default { ...@@ -177,10 +194,10 @@ export default {
}, },
}, },
watch: { watch: {
show(val) { show (val) {
if (val) this.imgKey = Date.now() if (val) this.imgKey = Date.now()
}, },
watchStatus() { watchStatus () {
console.log(111) console.log(111)
this.firstIndex = 0 this.firstIndex = 0
this.secondIndex = 0 this.secondIndex = 0
...@@ -188,7 +205,7 @@ export default { ...@@ -188,7 +205,7 @@ export default {
} }
}, },
methods: { methods: {
changeIndex(index, name) { changeIndex (index, name) {
if (this[name] == index) return // 点击同一个 if (this[name] == index) return // 点击同一个
this.direction = '' this.direction = ''
console.log(index, name, this[name]) console.log(index, name, this[name])
...@@ -209,7 +226,7 @@ export default { ...@@ -209,7 +226,7 @@ export default {
const data = await uni.$api.boutiqueApi.findSoureList({}) const data = await uni.$api.boutiqueApi.findSoureList({})
console.log(data) console.log(data)
}, },
goDetail(data) { goDetail (data) {
console.log(data) console.log(data)
uni.navigateTo({ uni.navigateTo({
url: `/pages/boutique/productDetail?detailUrl=${data.detailUrl}` url: `/pages/boutique/productDetail?detailUrl=${data.detailUrl}`
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!