chore(分包): 拆分pages_tooll子包
This commit is contained in:
421
pages_tool/member/rights/coupon.vue
Normal file
421
pages_tool/member/rights/coupon.vue
Normal file
@@ -0,0 +1,421 @@
|
||||
<template>
|
||||
<view :style="themeColor" :class="isIphoneX ? 'iphone-x' : ''">
|
||||
<view class="cf-container color-line-border" v-if="storeToken">
|
||||
<view class="tab">
|
||||
<view @click="changeState(1)"><text
|
||||
:class="state == 1 ? 'color-base-text active color-base-border-bottom' : ''">未使用</text></view>
|
||||
<view @click="changeState(2)"><text
|
||||
:class="state == 2 ? 'color-base-text active color-base-border-bottom' : ''">已使用</text></view>
|
||||
<view @click="changeState(3)"><text
|
||||
:class="state == 3 ? 'color-base-text active color-base-border-bottom' : ''">已过期</text></view>
|
||||
</view>
|
||||
<!-- <view class="coupon-head">
|
||||
<view class="sort" :class="sort == 1 ? 'color-base-border color-base-text' : ''" @click="changeSort(1, '')">全部</view>
|
||||
<view class="sort" :class="sort == 2 ? 'color-base-border color-base-text' : ''" @click="changeSort(2, 'reward')">满减券</view>
|
||||
<view class="sort" :class="sort == 3 ? 'color-base-border color-base-text' : ''" @click="changeSort(3, 'discount')">折扣券</view>
|
||||
<view class="sort" :class="sort == 4 ? 'color-base-border color-base-text' : ''" @click="changeSort(4, 'no_threshold')">无门槛券</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<mescroll-uni ref="mescroll" top="100" @getData="getMemberCounponList" v-if="storeToken">
|
||||
<block slot="list">
|
||||
<view class="coupon-listone">
|
||||
<view class="item" :class="['item', item.state != 1 && 'item-disabled']" v-for="(item, index) in list"
|
||||
:key="index" @click="toGoodsList(item)"
|
||||
:style="{ backgroundColor: item.state != 1 ? '#FFF' : 'var(--main-color-shallow)' }">
|
||||
<view class="item-base">
|
||||
<image class="coupon-line" mode="heightFix"
|
||||
:src="$util.img('public/uniapp/coupon/coupon_line.png')" />
|
||||
<view>
|
||||
<view class="use_price " v-if="item.type == 'divideticket'">
|
||||
<text>¥</text>
|
||||
{{ parseFloat(item.money) }}
|
||||
</view>
|
||||
<view class="use_price " v-if="item.type == 'reward'">
|
||||
<text>¥</text>
|
||||
{{ parseFloat(item.money) }}
|
||||
</view>
|
||||
<view class="use_price" v-else-if="item.type == 'discount'">
|
||||
{{ parseFloat(item.discount) }}
|
||||
<text>折</text>
|
||||
</view>
|
||||
<view class="use_condition font-size-tag" v-if="item.at_least > 0">
|
||||
满{{ item.at_least }}元可用</view>
|
||||
<view class="use_condition font-size-tag" v-else>无门槛优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-info">
|
||||
<view class="use_title">
|
||||
<view class="title">{{ item.coupon_name }}</view>
|
||||
<view class="max_price" v-if="item.goods_type == 2 || item.goods_type == 3"
|
||||
:class="{ disabled: item.state == 3 }">指定商品</view>
|
||||
<view class="max_price" v-if="item.discount_limit != '0.00'">(最大优惠{{ item.discount_limit
|
||||
}}元)</view>
|
||||
<view class="max_price" :class="{ disabled: item.useState == 2 }">{{
|
||||
item.use_channel_name }}</view>
|
||||
<!-- <view class="max_price truncate" v-if="item.use_channel!='online'" :class="{ disabled: item.useState == 2 }">
|
||||
{{ item.use_store==='all'?'适用门店:全部门店': '适用门店:'+item.use_store_name}}
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="use_time" v-if="item.end_time">有效期:{{ $util.timeStampTurnTime(item.end_time) }}
|
||||
</view>
|
||||
<view class="use_time" v-else>有效期:长期有效</view>
|
||||
</view>
|
||||
<view class="item-btn">
|
||||
<view class="tag" v-if="item.state == 1">去使用</view>
|
||||
<view class="tag disabled" v-if="item.state == 2">已使用</view>
|
||||
<view class="tag disabled" v-if="item.state == 3">已过期</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!list.length && showEmpty" class="margin-top cart-empty" :fixed="false">
|
||||
<ns-empty :isIndex="true" :emptyBtn="{ url: '/pages/index/index', text: '去逛逛' }"
|
||||
text="暂无优惠券"></ns-empty>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<ns-login ref="ns-login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
|
||||
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
|
||||
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
|
||||
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue')
|
||||
// #endif
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: '',
|
||||
types: '',
|
||||
state: 1,
|
||||
sort: 1,
|
||||
list: [],
|
||||
isIphoneX: false, //判断手机是否是iphoneX以上
|
||||
showEmpty: false,
|
||||
related_id: 0
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
setTimeout(() => {
|
||||
if (!this.addonIsExist.coupon) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启优惠券',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
if (data.related_id) this.related_id = data.related_id ? data.related_id : 0;
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/coupon');
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//切换状态
|
||||
changeState(state) {
|
||||
this.list = [];
|
||||
this.state = state;
|
||||
this.$refs.mescroll.refresh(false);
|
||||
},
|
||||
changeSort(sort, types) {
|
||||
this.list = [];
|
||||
this.sort = sort;
|
||||
this.types = types;
|
||||
this.$refs.mescroll.refresh(false);
|
||||
},
|
||||
getMemberCounponList(mescroll) {
|
||||
this.showEmpty = false;
|
||||
this.$api.sendRequest({
|
||||
url: '/coupon/api/coupon/memberpage',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size,
|
||||
state: this.state,
|
||||
is_own: this.type,
|
||||
type: this.types,
|
||||
related_id: this.related_id
|
||||
},
|
||||
success: res => {
|
||||
this.showEmpty = true;
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) {
|
||||
this.list = []; //如果是第一页需手动制空列表
|
||||
this.related_id = 0;
|
||||
}
|
||||
this.list = this.list.concat(newArr); //追加新数据
|
||||
let data = res.data;
|
||||
if (data) this.couponList = data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.list[index].logo = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
toGoodsList(item) {
|
||||
if (item.state == 1) {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
coupon: item.coupon_type_id
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function (nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cart-empty {
|
||||
margin-top: 208rpx !important;
|
||||
}
|
||||
|
||||
.active {
|
||||
border-bottom: 4rpx solid;
|
||||
}
|
||||
|
||||
.coupon-head {
|
||||
display: flex;
|
||||
background: #fff;
|
||||
padding: 20rpx 50rpx;
|
||||
|
||||
.sort {
|
||||
border: 2rpx solid #c5c5c5;
|
||||
padding: 1rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
cursor: pointer;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cf-container {
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.tab {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 86rpx;
|
||||
|
||||
>view {
|
||||
text-align: center;
|
||||
width: 33%;
|
||||
height: 86rpx;
|
||||
|
||||
text {
|
||||
display: inline-block;
|
||||
line-height: 86rpx;
|
||||
height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-listone {
|
||||
margin: 0 30rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
background-color: #fff2f0;
|
||||
background-size: 100% 100%;
|
||||
border-radius: 20rpx;
|
||||
align-items: stretch;
|
||||
margin-top: $padding;
|
||||
overflow: hidden;
|
||||
|
||||
&.item-disabled {
|
||||
.item-base {
|
||||
background: #e7e7e7 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.item-base {
|
||||
position: relative;
|
||||
width: 197rpx;
|
||||
min-width: 197rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(to left, var(--bg-color), var(--bg-color-shallow));
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding: 38rpx 10rpx 38rpx 18rpx;
|
||||
|
||||
&.disabled {
|
||||
background: #dedede;
|
||||
}
|
||||
|
||||
.coupon-line {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
>view {
|
||||
width: calc(100%);
|
||||
height: auto;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
|
||||
.use_price {
|
||||
font-size: 60rpx;
|
||||
line-height: 1;
|
||||
color: #fff;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.use_condition {
|
||||
color: #fff;
|
||||
margin-top: $padding;
|
||||
|
||||
&.margin_top_none {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
background-color: #f8f8f8;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
height: 30rpx;
|
||||
width: 15rpx;
|
||||
border-radius: 0 30rpx 30rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.item-btn {
|
||||
position: relative;
|
||||
width: 160rpx;
|
||||
min-width: 160rpx;
|
||||
align-self: center;
|
||||
|
||||
view {
|
||||
width: 100rpx;
|
||||
height: 50rpx;
|
||||
border-radius: $border-radius;
|
||||
line-height: 50rpx;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
background-image: linear-gradient(to right, var(--bg-color), var(--bg-color-shallow));
|
||||
color: var(--btn-text-color);
|
||||
;
|
||||
font-size: $font-size-tag;
|
||||
|
||||
&.disabled {
|
||||
background: $color-line !important;
|
||||
color: $color-tip !important;
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
background-color: #f8f8f8;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
height: 30rpx;
|
||||
width: 15rpx;
|
||||
border-radius: 30rpx 0 0 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
margin-left: $padding;
|
||||
overflow: hidden;
|
||||
background-repeat-x: no-repeat;
|
||||
background-repeat-y: repeat;
|
||||
|
||||
.use_time {
|
||||
padding: $padding 0;
|
||||
border-top: 2rpx dashed #cccccc;
|
||||
font-size: $font-size-activity-tag;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.use_title {
|
||||
font-size: $font-size-base;
|
||||
font-weight: 500;
|
||||
padding: $padding 0;
|
||||
|
||||
.title {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.max_price {
|
||||
font-weight: 400;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.truncate {
|
||||
overflow: hidden;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
291
pages_tool/member/rights/invite_friends.vue
Normal file
291
pages_tool/member/rights/invite_friends.vue
Normal file
@@ -0,0 +1,291 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view v-if="info" style="background-color: #fff;">
|
||||
|
||||
<view class="invite_adv">
|
||||
<image :src="$util.img('public/uniapp/member/invite/top_bg.png')" mode="widthFix"></image>
|
||||
|
||||
<view class="desc" @click="openRulePopup" v-if="info.remark != ''">
|
||||
<text class="iconfont icon-bangzhu"></text>
|
||||
活动说明
|
||||
</view>
|
||||
<image class="font" :src="$util.img('public/uniapp/member/invite/top_font.png')" mode="widthFix" />
|
||||
<view class="time">
|
||||
活动时间:{{ $util.timeStampTurnTime(info.start_time, 1) }}至{{ $util.timeStampTurnTime(info.end_time, 1)
|
||||
}}
|
||||
</view>
|
||||
|
||||
<view class="btn"
|
||||
:style="{ 'background-image': 'url(' + $util.img('public/uniapp/member/invite/top_btn.png') + ')' }"
|
||||
@click="openSharePopup">立即邀请</view>
|
||||
</view>
|
||||
<view class="content invite-list">
|
||||
<view class="title">我的好友</view>
|
||||
<block v-if="inviteList.length > 0">
|
||||
<view class="invitelist_block">
|
||||
<view class="invitelist">
|
||||
<view class="list-item" v-for="(item, index) in inviteList" :key="index">
|
||||
<view class="img color-base-border">
|
||||
<image mode="aspectFit"
|
||||
:src="item.headimg == '' ? $util.img($util.getDefaultImage().head) : $util.img(item.headimg)" />
|
||||
</view>
|
||||
<view class="list-left">
|
||||
<view class="info">
|
||||
<view class="name font-size-tag">{{ item.source_member_nickname }}</view>
|
||||
<view class="time font-size-activity-tag color-tip">
|
||||
{{ $util.timeStampTurnTime(item.create_time) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="prize color-base-text font-size-activity-tag">
|
||||
<block v-if="item.balance > 0">{{ item.balance }}元现金红包</block>
|
||||
<block v-if="(item.point > 0 || item.coupon_num) && item.balance > 0">+</block>
|
||||
<block v-if="item.point > 0">{{ parseInt(item.point) }}积分</block>
|
||||
<block v-if="item.point > 0 && item.balance > 0 && item.coupon_num > 0">+
|
||||
</block>
|
||||
<block v-if="item.coupon_num > 0">{{ item.coupon_num }}张优惠券</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="more_invite color-tip font-size-tag " @click="moreList"
|
||||
v-if="isClick && total_num > page">
|
||||
查看更多
|
||||
<text class="iconfont icon-iconangledown"></text>
|
||||
</view>
|
||||
<view class="more_invite color-tip font-size-tag " @click="moreList"
|
||||
v-if="!isClick && inviteList.length > 5 && total_num <= page">没有更多数据了</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="empty">
|
||||
<view class="tip">您还没有邀请到新朋友哦</view>
|
||||
<view class="tip">邀请好友,赚取好礼。赶紧去试试吧~</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="title">邀请好友奖励</view>
|
||||
<view class="invite_active">
|
||||
<view class="list">
|
||||
<view class="item" v-if="$util.inArray('balance', info.type) != -1">
|
||||
<image :src="$util.img('public/uniapp/member/invite/coupon_bg.png')" mode="aspectFill" />
|
||||
<view class="desc">
|
||||
<view class="price">
|
||||
<text class="font-size-base">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text>{{ info.balance }}</text>
|
||||
</view>
|
||||
<view class="type">现金红包</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item" v-if="$util.inArray('point', info.type) != -1">
|
||||
<image :src="$util.img('public/uniapp/member/invite/coupon_bg.png')" mode="aspectFill" />
|
||||
<view class="desc">
|
||||
<view class="price">
|
||||
<text>{{ parseInt(info.point) }}</text>
|
||||
</view>
|
||||
<view class="type">积分</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item margin_right_none" v-if="$util.inArray('coupon', info.type) != -1">
|
||||
<image :src="$util.img('public/uniapp/member/invite/coupon_bg.png')" mode="aspectFill">
|
||||
</image>
|
||||
<view class="desc">
|
||||
<view class="price">
|
||||
<text>{{ info.coupon.split(',').length }}</text>
|
||||
张
|
||||
</view>
|
||||
<view class="type">优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view class="title_desc color-tip">分享给好友,让好友通过你的分享链接进入并注册登录,可获得以下奖励:</view>
|
||||
<view class="desc_list">
|
||||
<view class="" v-if="$util.inArray('balance', info.type) != -1">
|
||||
<text>●</text>
|
||||
可得{{ info.balance }}元红包奖励
|
||||
</view>
|
||||
<view class="" v-if="$util.inArray('point', info.type) != -1">
|
||||
<text>●</text>
|
||||
可得{{ info.point }}积分
|
||||
</view>
|
||||
<view class="" v-if="$util.inArray('coupon', info.type) != -1">
|
||||
<text>●</text>
|
||||
可得{{ info.coupon.split(',').length }}张优惠券
|
||||
</view>
|
||||
|
||||
<view class="" v-if="info.max_fetch == 0">
|
||||
<text>●</text>
|
||||
可得奖励不受限制
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
<text>●</text>
|
||||
奖励上限为{{ info.max_fetch }}人
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="title">如何邀请好友</view>
|
||||
<view class="invite_active">
|
||||
<view class="step">
|
||||
<view>
|
||||
<view class="img">
|
||||
<image :src="$util.img('public/uniapp/member/invite/fenxiang.png')" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="text">分享链接给好友</view>
|
||||
</view>
|
||||
<view>
|
||||
<image :src="$util.img('public/uniapp/member/invite/jiantou.png')" class="jiantou"></image>
|
||||
</view>
|
||||
<view>
|
||||
<view class="img">
|
||||
<image :src="$util.img('public/uniapp/member/invite/shouji.png')" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="text">好友进入</view>
|
||||
</view>
|
||||
<view>
|
||||
<image :src="$util.img('public/uniapp/member/invite/jiantou.png')" class="jiantou"></image>
|
||||
</view>
|
||||
<view>
|
||||
<view class="img">
|
||||
<image :src="$util.img('public/uniapp/member/invite/hongbao.png')" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="text">好友注册成功获得奖励</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 海报 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="posterPopup" type="bottom" class="poster-layer">
|
||||
<template v-if="poster != '-1'">
|
||||
<view>
|
||||
<view class="image-wrap">
|
||||
<image :src="$util.img(poster)" mode="widthFix" :show-menu-by-longpress="true" />
|
||||
</view>
|
||||
<!-- #ifdef MP || APP-PLUS -->
|
||||
<view class="save" @click="savePoster()">保存图片</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="save">长按保存图片</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="close iconfont icon-close" @click="closePosterPopup()"></view>
|
||||
</template>
|
||||
<view v-else class="msg">{{ posterMsg }}</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<!-- 分享弹窗 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="sharePopup" type="bottom" class="share-popup">
|
||||
<view>
|
||||
<view class="share-title">分享</view>
|
||||
<view class="share-content">
|
||||
<!-- #ifdef MP -->
|
||||
<view class="share-box">
|
||||
<button class="share-btn" :plain="true" open-type="share">
|
||||
<view class="iconfont icon-share-friend"></view>
|
||||
<text>分享给好友</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view class="share-box" @click="openPosterPopup">
|
||||
<button class="share-btn" :plain="true">
|
||||
<view class="iconfont icon-pengyouquan"></view>
|
||||
<text>生成分享海报</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="share-box" @click="copyUrl">
|
||||
<button class="share-btn" :plain="true">
|
||||
<view class="iconfont icon-fuzhilianjie"></view>
|
||||
<text>复制链接</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="share-footer" @click="closeSharePopup"><text>取消分享</text></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<!-- 弹出规则 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="rulePopup" type="bottom">
|
||||
<view class="tips-layer">
|
||||
<view class="head" @click="closeRulePopup()">
|
||||
<view class="title">活动说明</view>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="detail margin-bottom">{{ info.remark }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
<ns-empty v-else text="暂无相关数据"></ns-empty>
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import inviteFriends from '../public/js/invite_friends.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
|
||||
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
|
||||
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
|
||||
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inviteList: [],
|
||||
info: null,
|
||||
page: 1,
|
||||
page_size: 5,
|
||||
total_num: 0,
|
||||
isClick: true,
|
||||
poster: '-1', //海报
|
||||
posterMsg: '' //海报错误信息
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.getBaseInfo();
|
||||
if (this.storeToken) {
|
||||
this.getList();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/invite_friends');
|
||||
});
|
||||
}
|
||||
},
|
||||
onShow() { },
|
||||
mixins: [inviteFriends],
|
||||
onReady() { }
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '../public/css/invite_friends.scss';
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .uni-popup__wrapper.bottom {
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.poster-layer>>>.uni-popup__wrapper-box {
|
||||
max-height: initial !important;
|
||||
}
|
||||
</style>
|
||||
391
pages_tool/member/rights/level.vue
Normal file
391
pages_tool/member/rights/level.vue
Normal file
@@ -0,0 +1,391 @@
|
||||
<template>
|
||||
<view :style="themeColor" class="member-level">
|
||||
<view class="level-top">
|
||||
<image :src="$util.img('public/uniapp/level/level-top-bg.png')"></image>
|
||||
</view>
|
||||
<view class="banner-container">
|
||||
<view class="memberInfo" v-if="memberInfo">
|
||||
<image :src="$util.img(memberInfo.headimg)" v-if="memberInfo.headimg"
|
||||
@error="memberInfo.headimg = $util.getDefaultImage().head" mode="aspectFill"></image>
|
||||
<image :src="$util.getDefaultImage().head" v-else mode="aspectFill"></image>
|
||||
<view class="member-desc">
|
||||
<view class="font-size-base">{{ memberInfo.nickname }}</view>
|
||||
<view class="font-size-activity-tag">当前等级:{{ memberInfo.member_level_name }}</view>
|
||||
</view>
|
||||
<view class="growth-rules font-size-tag" @click="growthRules">
|
||||
<text class="iconfont icon-wenhao font-size-tag"></text>
|
||||
成长规则
|
||||
</view>
|
||||
</view>
|
||||
<swiper :style="{ width: '100vw', height: '390rpx' }" class="margin-bottom"
|
||||
:indicator-dots="swiperConfig.indicatorDots" :indicator-color="swiperConfig.indicatorColor"
|
||||
:indicator-active-color="swiperConfig.indicatorActiveColor" :autoplay="false"
|
||||
: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">
|
||||
<view class="image-container" :class="[
|
||||
curIndex === 0
|
||||
? i === listLen - 1
|
||||
? 'item-left'
|
||||
: i === 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
: curIndex === listLen - 1
|
||||
? i === 0
|
||||
? 'item-right'
|
||||
: i === listLen - 2
|
||||
? 'item-left'
|
||||
: 'item-center'
|
||||
: i === curIndex - 1
|
||||
? 'item-left'
|
||||
: i === curIndex + 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
]">
|
||||
<view class="slide-image" style="background-size: 100% 100%;background-repeat:no-repeat" :style="{
|
||||
transform: curIndex === i ? 'scale(' + scaleX + ',' + scaleY + ')' : 'scale(1,1)',
|
||||
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'] }" />
|
||||
|
||||
<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>
|
||||
<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>
|
||||
<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 }}成长值成为{{
|
||||
levelList[curIndex + 1].level_name
|
||||
}}
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="residue-growr-value"
|
||||
:style="{ color: levelList[curIndex]['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 }}
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view class="member-equity"
|
||||
v-if="levelList[curIndex].is_free_shipping > 0 || levelList[curIndex].consume_discount > 0 || levelList[curIndex].point_feedback > 0">
|
||||
<view class="equity-title">会员权益</view>
|
||||
<view class="equity-itme" v-if="levelList[curIndex].is_free_shipping > 0">
|
||||
<image :src="$util.img('public/uniapp/level/exemption_postage.png')" mode="aspectFit"></image>
|
||||
<view class="equity-content" :class="{ active: levelList[curIndex].consume_discount > 0 }">
|
||||
<text>包邮服务</text>
|
||||
<text class="equity-desc">提供商品包邮服务</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="equity-itme" v-if="levelList[curIndex].consume_discount > 0">
|
||||
<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-else>提供{{ levelList[curIndex].consume_discount }}折消费折扣</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="equity-itme" v-if="levelList[curIndex].point_feedback > 0">
|
||||
<image :src="$util.img('public/uniapp/level/integral_feedback.png')" mode="aspectFit"></image>
|
||||
<view class="equity-content">
|
||||
<text>享受积分回馈服务</text>
|
||||
<text class="equity-desc">提供{{ levelList[curIndex].point_feedback }}倍积分回馈倍率</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="member-gift"
|
||||
v-if="levelList[curIndex].send_balance > 0 || levelList[curIndex].send_balance > 0 || levelList[curIndex].send_coupon">
|
||||
<view class="gift-title">会员礼包</view>
|
||||
<view class="gift-itme" v-if="levelList[curIndex].send_point > 0">
|
||||
<image :src="$util.img('public/uniapp/level/integral.png')" mode="aspectFit"></image>
|
||||
<view class="gift-content" :class="{ active: levelList[curIndex].send_balance > 0 }">
|
||||
<text>积分礼包</text>
|
||||
<text class="gift-desc">赠送{{ levelList[curIndex].send_point }}积分</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="gift-itme" v-if="levelList[curIndex].send_balance > 0">
|
||||
<image :src="$util.img('public/uniapp/level/red_packet.png')" mode="aspectFit"></image>
|
||||
<view class="gift-content" :class="{ active: levelList[curIndex].send_coupon }">
|
||||
<text>红包礼包</text>
|
||||
<text class="gift-desc">赠送{{ levelList[curIndex].send_balance }}元红包</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="gift-itme" v-if="levelList[curIndex].send_coupon"
|
||||
@click="openCoupon(levelList[curIndex].send_coupon)">
|
||||
<image :src="$util.img('public/uniapp/level/coupon.png')" mode="aspectFit"></image>
|
||||
<view class="gift-content">
|
||||
<text>优惠券礼包</text>
|
||||
<text class="gift-desc">赠送{{ levelList[curIndex].coupon_length }}张优惠券</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 优惠券 -->
|
||||
<uni-popup ref="couponPopup" type="bottom">
|
||||
<view class="coupon-popup-box">
|
||||
<view class="coupon-popup-title" @click="closeCoupon">
|
||||
优惠券
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<scroll-view class="coupon-popup-content" scroll-y>
|
||||
<view class="coupon-item" v-for="(item, index) in couponPopList" :key="index">
|
||||
<view class="coupon-name">
|
||||
<text class="name">{{ item.coupon_name }}</text>
|
||||
<text class="desc"></text>
|
||||
</view>
|
||||
<view class="coupon-price" v-if="item.type == 'reward'">
|
||||
<text>{{ item.money }}</text>
|
||||
元
|
||||
</view>
|
||||
<view class="coupon-price" v-if="item.type == 'discount'">
|
||||
<text>{{ $util.numberFixed(item.discount, 1) }}</text>
|
||||
折
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
export default {
|
||||
components: {
|
||||
nsProgress: () => import('@/pages_tool/components/ns-progress/ns-progress.vue'),
|
||||
toTop: () => import('@/components/toTop/toTop.vue'),
|
||||
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
|
||||
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
|
||||
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
|
||||
},
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
couponPopList: [],
|
||||
curIndex: 0,
|
||||
descIndex: 0,
|
||||
isDescAnimating: false,
|
||||
scaleX: (634 / 540).toFixed(4),
|
||||
scaleY: (378 / 330).toFixed(4),
|
||||
swiperConfig: {
|
||||
indicatorDots: false,
|
||||
indicatorColor: 'rgba(255, 255, 255, .4)',
|
||||
indicatorActiveColor: 'rgba(255, 255, 255, 1)',
|
||||
interval: 3000,
|
||||
duration: 300,
|
||||
circular: false,
|
||||
previousMargin: '58rpx',
|
||||
nextMargin: '58rpx'
|
||||
},
|
||||
levelList: [{
|
||||
needGrowth: 0,
|
||||
growth: 0
|
||||
}],
|
||||
levelId: 0,
|
||||
growth: 0,
|
||||
|
||||
nowIndex: 0, //我当前所在等级的index
|
||||
rule: [] //成长值规则
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listLen() {
|
||||
return this.levelList.length;
|
||||
},
|
||||
remark() {
|
||||
if (this.levelList[this.curIndex]) {
|
||||
return this.levelList[this.curIndex].remark;
|
||||
}
|
||||
},
|
||||
nextIndex() {
|
||||
let num = 0;
|
||||
if (this.curIndex == this.levelList.length - 1) {
|
||||
return this.curIndex;
|
||||
} else {
|
||||
return this.curIndex + 1;
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getLevelRule();
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/level');
|
||||
});
|
||||
} else {
|
||||
this.getLevelList();
|
||||
}
|
||||
// #ifdef MP-ALIPAY
|
||||
this.scaleX = 1
|
||||
this.scaleY = 1
|
||||
// #endif
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
filters: {
|
||||
rate(index, list, growth) {
|
||||
let nowGrowth = Number(growth);
|
||||
let minGrouth = Number(list[index].growth);
|
||||
if (index == list.length - 1) {
|
||||
return nowGrowth > minGrouth ? 100 : 0;
|
||||
} else {
|
||||
let maxGrouth = Number(list[index + 1].growth);
|
||||
let num2 = nowGrowth - minGrouth;
|
||||
let num1 = maxGrouth - minGrouth;
|
||||
let num = Math.floor((num2 / num1) * 100);
|
||||
return num > 100 ? 100 : num;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
swiperChange(e) {
|
||||
let that = this;
|
||||
this.curIndex = e.detail.current;
|
||||
this.isDescAnimating = true;
|
||||
let timer = setTimeout(function () {
|
||||
that.descIndex = e.detail.current;
|
||||
clearTimeout(timer);
|
||||
}, 150);
|
||||
},
|
||||
animationfinish(e) {
|
||||
this.isDescAnimating = false;
|
||||
},
|
||||
getBannerDetail(index) {
|
||||
uni.showLoading({
|
||||
title: '将前往详情页面',
|
||||
duration: 2000,
|
||||
mask: true
|
||||
});
|
||||
},
|
||||
getLevelList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberlevel/lists',
|
||||
success: res => {
|
||||
if (res.data && res.code == 0) {
|
||||
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.levelId = this.memberInfo.member_level;
|
||||
this.growth = this.memberInfo.growth;
|
||||
for (let i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].level_id == this.levelId) {
|
||||
this.curIndex = i;
|
||||
this.descIndex = i;
|
||||
this.nowIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.levelList.forEach((v, i) => {
|
||||
if (parseFloat(v.growth) < parseFloat(this.growth)) {
|
||||
v.needGrowth = 0;
|
||||
v.rate = 100;
|
||||
} else {
|
||||
v.needGrowth = (parseFloat(v.growth) - parseFloat(this.growth))
|
||||
.toFixed(2);
|
||||
v.rate = (this.growth / v.growth).toFixed(2) * 100;
|
||||
}
|
||||
});
|
||||
|
||||
this.levelList.forEach(v => {
|
||||
if (v.consume_discount) {
|
||||
v.consume_discount = (v.consume_discount / 10).toFixed(2);
|
||||
}
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getLevelRule() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/accountrule',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data && res.data.growth) {
|
||||
this.rule = res.data.growth;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
growthRules() {
|
||||
this.$util.redirectTo('/pages_tool/member/level_growth_rules');
|
||||
},
|
||||
openCoupon(data) {
|
||||
this.couponPopList = [];
|
||||
this.$api.sendRequest({
|
||||
url: '/coupon/api/coupon/couponbyid',
|
||||
data: {
|
||||
id: data
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.couponPopList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.$refs.couponPopup.open();
|
||||
},
|
||||
closeCoupon() {
|
||||
this.$refs.couponPopup.close();
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo('/pages/member/index');
|
||||
return true;
|
||||
},
|
||||
watch: {
|
||||
storeToken: function (nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getLevelList();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '../public/css/level.scss';
|
||||
</style>
|
||||
274
pages_tool/member/rights/level_growth_rules.vue
Normal file
274
pages_tool/member/rights/level_growth_rules.vue
Normal file
@@ -0,0 +1,274 @@
|
||||
<template>
|
||||
<view :style="themeColor" class="member-level">
|
||||
<view class="grow-explain">
|
||||
<view class="explain-title">
|
||||
<image :src="$util.img('public/uniapp/level/growth_that_left.png')" mode="aspectFit"></image>
|
||||
成长值说明
|
||||
<image :src="$util.img('public/uniapp/level/growth_that_right.png')" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="explain-table">
|
||||
<view class="explain-tr">
|
||||
<text class="explain-th">等级</text>
|
||||
<text class="explain-th">成长值</text>
|
||||
</view>
|
||||
<view class="explain-tr" v-for="(item, index) in levelList" :key="index">
|
||||
<text class="explain-td">{{ item.level_name }}</text>
|
||||
<text class="explain-td">{{ item.growth }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grow-value">
|
||||
<view class="title">
|
||||
<image :src="$util.img('public/uniapp/level/explain.png')" mode="aspectFit"></image>
|
||||
<text>什么是成长值</text>
|
||||
</view>
|
||||
<view class="content color-tip">成长值是消费者在店铺成为会员后,通过消费计算出来的值。成长值决定会员等级,会员等级越高,所享受的会员权益和会员礼包就越多。</view>
|
||||
</view>
|
||||
<view class="acquisition-grow">
|
||||
<view class="title">
|
||||
<image :src="$util.img('public/uniapp/level/explain.png')" mode="aspectFit"></image>
|
||||
<text>如何获得成长值</text>
|
||||
</view>
|
||||
<view class="content color-tip">
|
||||
<text>1、注册会员送x成长值。</text>
|
||||
<text>2、会员充值到余额送x成长值。</text>
|
||||
<text>3、会员签到送x成长值。</text>
|
||||
<text>4、会员消费x元,交易完成即可获得x个成长值。</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsProgress: () => import('@/pages_tool/components/ns-progress/ns-progress.vue'),
|
||||
toTop: () => import('@/components/toTop/toTop.vue'),
|
||||
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
|
||||
},
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
curIndex: 0,
|
||||
descIndex: 0,
|
||||
isDescAnimating: false,
|
||||
scaleX: (634 / 540).toFixed(4),
|
||||
scaleY: (378 / 330).toFixed(4),
|
||||
swiperConfig: {
|
||||
//type==1时的默认参数
|
||||
indicatorDots: false,
|
||||
indicatorColor: 'rgba(255, 255, 255, .4)',
|
||||
indicatorActiveColor: 'rgba(255, 255, 255, 1)',
|
||||
interval: 3000,
|
||||
duration: 300,
|
||||
circular: false,
|
||||
previousMargin: '58rpx',
|
||||
nextMargin: '58rpx'
|
||||
},
|
||||
levelList: [{
|
||||
needGrowth: 0,
|
||||
growth: 0
|
||||
}],
|
||||
levelId: 0,
|
||||
growth: 0,
|
||||
|
||||
nowIndex: 0, //我当前所在等级的index
|
||||
rule: [] //成长值规则
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listLen() {
|
||||
return this.levelList.length;
|
||||
},
|
||||
},
|
||||
onLoad() {
|
||||
//会员等级
|
||||
this.getLevelList();
|
||||
this.getLevelRule();
|
||||
},
|
||||
onShow() { },
|
||||
filters: {
|
||||
rate(index, list, growth) {
|
||||
let nowGrowth = Number(growth);
|
||||
let minGrouth = Number(list[index].growth);
|
||||
if (index == list.length - 1) {
|
||||
return nowGrowth > minGrouth ? 100 : 0;
|
||||
} else {
|
||||
let maxGrouth = Number(list[index + 1].growth);
|
||||
let num2 = nowGrowth - minGrouth;
|
||||
let num1 = maxGrouth - minGrouth;
|
||||
let num = Math.floor((num2 / num1) * 100);
|
||||
return num > 100 ? 100 : num;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
swiperChange(e) {
|
||||
let that = this;
|
||||
this.curIndex = e.detail.current;
|
||||
this.isDescAnimating = true;
|
||||
let timer = setTimeout(function () {
|
||||
that.descIndex = e.detail.current;
|
||||
clearTimeout(timer);
|
||||
}, 150);
|
||||
},
|
||||
animationfinish(e) {
|
||||
this.isDescAnimating = false;
|
||||
},
|
||||
getBannerDetail(index) {
|
||||
uni.showLoading({
|
||||
title: '将前往详情页面',
|
||||
duration: 2000,
|
||||
mask: true
|
||||
});
|
||||
},
|
||||
getLevelList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberlevel/lists',
|
||||
success: res => {
|
||||
if (res.data && res.code == 0) {
|
||||
this.levelList = res.data;
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
this.growth = this.memberInfo.growth;
|
||||
for (let i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].level_id == this.levelId) {
|
||||
this.curIndex = i;
|
||||
this.descIndex = i;
|
||||
this.nowIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.levelList.forEach((v, i) => {
|
||||
let rate = 0;
|
||||
if (i != this.levelList.length - 1) {
|
||||
v.needGrowth = Number(this.levelList[i + 1].growth) - Number(this.growth); //距离下一阶段需要多少成长值
|
||||
|
||||
if (v.needGrowth <= 0) {
|
||||
rate = 100;
|
||||
} else {
|
||||
rate = (this.growth / this.levelList[i + 1].growth).toFixed(2) * 100;
|
||||
}
|
||||
} else {
|
||||
v.needGrowth = Number(this.levelList[i].growth) - Number(this.growth); //距离下一阶段需要多少成长值
|
||||
if (v.needGrowth <= 0) {
|
||||
rate = 100;
|
||||
} else {
|
||||
rate = (this.growth / this.levelList[i].growth).toFixed(2) * 100;
|
||||
}
|
||||
}
|
||||
v.rate = rate;
|
||||
});
|
||||
|
||||
this.levelList.forEach(v => {
|
||||
if (v.consume_discount) {
|
||||
v.consume_discount = (v.consume_discount / 10).toFixed(2);
|
||||
}
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getLevelRule() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/accountrule',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data && res.data.growth) {
|
||||
this.rule = res.data.growth;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.grow-explain {
|
||||
padding: 30rpx;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.explain-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
line-height: 1;
|
||||
|
||||
image {
|
||||
margin: 0 20rpx;
|
||||
width: 54rpx;
|
||||
height: 18rpx;
|
||||
}
|
||||
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.explain-tr {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.explain-th {
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
&~.explain-th {
|
||||
border-left: 4rpx solid #fff;
|
||||
}
|
||||
|
||||
flex: 1;
|
||||
background-color: #f6f1e4;
|
||||
}
|
||||
|
||||
.explain-td {
|
||||
padding: 10rpx 30rpx;
|
||||
|
||||
&~.explain-td {
|
||||
border-left: 4rpx solid #fff;
|
||||
}
|
||||
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
flex: 1;
|
||||
background-color: #fcfbf7;
|
||||
}
|
||||
}
|
||||
|
||||
.grow-value,
|
||||
.acquisition-grow {
|
||||
padding: 0 30rpx 30rpx;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
font-size: 24rpx;
|
||||
margin-left: 40rpx;
|
||||
|
||||
text {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user