tmp: 部分代码与UnishopV5结合,但是代码有严重缺陷
This commit is contained in:
@@ -23,25 +23,28 @@
|
||||
:interval="swiperConfig.interval" :duration="swiperConfig.duration" :circular="swiperConfig.circular"
|
||||
:previous-margin="swiperConfig.previousMargin" :next-margin="swiperConfig.nextMargin"
|
||||
@change="swiperChange" @animationfinish="animationfinish" :current="curIndex">
|
||||
<swiper-item :class="levelList.length == 1 ? 'image-container-box' : ''" v-for="(item, i) in levelList"
|
||||
:key="i">
|
||||
<swiper-item :class="levelList.length == 1 ? 'image-container-box' : ''" v-for="(item, i) in levelList" :key="i">
|
||||
<view class="image-container" :class="[
|
||||
curIndex === 0
|
||||
? i === listLen - 1
|
||||
? 'item-left'
|
||||
: i === 1
|
||||
? i === 1
|
||||
? 'item-right'
|
||||
: i === listLen - 1
|
||||
? 'item-left'
|
||||
: 'item-center'
|
||||
: curIndex === listLen - 1
|
||||
? i === 0
|
||||
? i === curIndex - 1
|
||||
? 'item-left'
|
||||
: i === curIndex + 1
|
||||
? 'item-right'
|
||||
: i === 0
|
||||
? 'item-right'
|
||||
: i === listLen - 2
|
||||
? 'item-left'
|
||||
: 'item-center'
|
||||
: i === curIndex - 1
|
||||
? 'item-left'
|
||||
: i === curIndex + 1
|
||||
? 'item-right'
|
||||
? 'item-left'
|
||||
: i === curIndex + 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
]">
|
||||
<view class="slide-image" style="background-size: 100% 100%;background-repeat:no-repeat" :style="{
|
||||
@@ -49,34 +52,35 @@
|
||||
transitionDuration: '.3s',
|
||||
transitionTimingFunction: 'ease'
|
||||
}">
|
||||
<image v-if="levelList[curIndex]['level_picture']" :src="$util.img(levelList[curIndex]['level_picture'])"/>
|
||||
<image v-else :style="{backgroundColor:levelList[curIndex]['bg_color']}"/>
|
||||
<image v-if="item['level_picture']" :src="$util.img(item['level_picture'])"/>
|
||||
<image v-else :style="{backgroundColor:item['bg_color']}"/>
|
||||
|
||||
<view class="info">
|
||||
<view class="level-detail" :style="{color:levelList[curIndex]['level_text_color']}">
|
||||
{{ levelList[curIndex].level_name }}
|
||||
<text class="isnow " :style="{color:levelList[curIndex]['level_text_color']}" v-if="levelId == item.level_id">当前等级</text>
|
||||
<view class="level-detail" :style="{color:item['level_text_color']}">
|
||||
{{ item.level_name }}
|
||||
<text class="isnow " :style="{color:item['level_text_color']}" v-if="levelId == item.level_id">当前等级</text>
|
||||
</view>
|
||||
<view class="growr-name" :style="{color:levelList[curIndex]['level_text_color']}">当前成长值</view>
|
||||
<view class="growr-value" :style="{color:levelList[curIndex]['level_text_color']}">{{ growth }}</view>
|
||||
<view class="growr-name" :style="{color:item['level_text_color']}">当前成长值</view>
|
||||
<view class="growr-value" :style="{color:item['level_text_color']}">{{ growth }}</view>
|
||||
<block v-if="levelId == item.level_id">
|
||||
<block v-if="levelList[curIndex + 1] != undefined">
|
||||
<ns-progress :progress="levelList[curIndex + 1].rate"></ns-progress>
|
||||
<view class="residue-growr-value"
|
||||
:style="{color:levelList[curIndex]['level_text_color']}">
|
||||
再获得{{ levelList[curIndex + 1].needGrowth > 0 ? levelList[curIndex + 1].needGrowth : 0 }}成长值成为{{
|
||||
<block v-if="levelList[i + 1] != undefined">
|
||||
<ns-progress :progress="levelList[i + 1].rate"></ns-progress>
|
||||
<view class="residue-growr-value" :style="{color:item['level_text_color']}">
|
||||
再获得{{ levelList[i + 1].needGrowth > 0 ? levelList[i + 1].needGrowth : 0 }}成长值成为下一等级
|
||||
<!-- {{
|
||||
levelList[curIndex + 1].level_name
|
||||
}}
|
||||
}} -->
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="residue-growr-value" :style="{color:levelList[curIndex]['level_text_color']}">您现在已经是最高等级</view>
|
||||
<view class="residue-growr-value" :style="{color:item['level_text_color']}">您现在已经是最高等级</view>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<ns-progress :progress="levelList[curIndex].rate" v-if="levelList[curIndex].needGrowth > 0"></ns-progress>
|
||||
<view class="residue-growr-value" v-if="levelList[curIndex].needGrowth > 0" :style="{color:levelList[curIndex]['level_text_color']}">
|
||||
再获得{{ levelList[curIndex].needGrowth }}成长值成为{{ levelList[curIndex].level_name }}
|
||||
<ns-progress :progress="item.rate" v-if="item.needGrowth > 0"></ns-progress>
|
||||
<view class="residue-growr-value" v-if="item.needGrowth > 0" :style="{color:item['level_text_color']}">
|
||||
再获得{{ item.needGrowth }}成长值成为当前等级
|
||||
<!-- {{ levelList[curIndex].level_name }} -->
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
@@ -97,7 +101,7 @@
|
||||
<image :src="$util.img('public/uniapp/level/consumption_discount.png')" mode="aspectFit"></image>
|
||||
<view class="equity-content" :class="{ active: levelList[curIndex].point_feedback > 0 }">
|
||||
<text>享受消费折扣服务</text>
|
||||
<text class="equity-desc" v-if="levelList[curIndex].is_default == 1">不享受任何消费折扣和其他权益</text>
|
||||
<text class="equity-desc" v-if="levelList[curIndex].consume_discount == 10">不享受任何消费折扣</text>
|
||||
<text class="equity-desc" v-else>提供{{ levelList[curIndex].consume_discount }}折消费折扣</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -220,7 +224,6 @@
|
||||
}
|
||||
},
|
||||
nextIndex() {
|
||||
let num = 0;
|
||||
if (this.curIndex == this.levelList.length - 1) {
|
||||
return this.curIndex;
|
||||
} else {
|
||||
@@ -287,8 +290,7 @@
|
||||
this.levelList = res.data;
|
||||
for (var i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].send_coupon) {
|
||||
this.levelList[i].coupon_length = this.levelList[i].send_coupon.split(',')
|
||||
.length;
|
||||
this.levelList[i].coupon_length = this.levelList[i].send_coupon.split(',').length;
|
||||
}
|
||||
}
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
@@ -306,8 +308,7 @@
|
||||
v.needGrowth = 0;
|
||||
v.rate = 100;
|
||||
} else {
|
||||
v.needGrowth = (parseFloat(v.growth) - parseFloat(this.growth))
|
||||
.toFixed(2);
|
||||
v.needGrowth = (parseFloat(v.growth) - parseFloat(this.growth)).toFixed(2);
|
||||
v.rate = (this.growth / v.growth).toFixed(2) * 100;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user