perry-mall/pagesA/member/member.vue

182 lines
6.3 KiB
Vue

<template>
<view>
<!-- 状态栏 -->
<status-nav :backgroudColor="publicColor" :tabcolor="publicColor" :statusTitle="true" :backColor="1"></status-nav>
<image src="/static/public/member-head.png" style="position: absolute;top: 0;left: 0;right: 0;height: 436rpx;width: 100%;"></image>
<view class="mar-zy32 posir" :style="{paddingTop:statusHNH+26+'px'}">
<view class="radius30 posir gao mar-zy40 fon24 pad-x20" style="box-shadow: 0px 16rpx 30rpx rgba(141, 141, 141, 0.26);">
<view class="posir pad-zy20" style="z-index: 2;">
<view class="disjb">
<view class="disac">
<!-- 头像 -->
<image class="mar-sx20" :src="levelInfo.headimgurl" style="width:90rpx;height: 90rpx;border-radius: 100%;" mode="aspectFill"></image>
<view class="mar-z20">
<!-- 昵称 -->
<view class="fon28 bold disac">{{levelInfo.nickname}}<view style="background: #FFFFFF;border-radius: 10rpx;text-align: center;font-size: 22rpx;color: #FFBD39;padding: 5rpx 16rpx;margin-left: 10rpx;">VIP</view></view>
<view class="mar-s10" style="color: #C27417;">{{levelInfo.level.name}}</view>
</view>
</view>
<view class="mar-s30 " style="color: #C27417;">当前等级</view>
</view>
<view style="margin-top: 62rpx;color: #C27417;">还差{{levelInfo.level.value}}积分升级</view>
<view class="fon28 mar-s10" style="color: #C49F74;">升级到钻石会员享有更多权益</view>
</view>
<image class="posia" style="top: 0;left: 0;right: 0;bottom: 0;width: 100%;height: 100%;z-index: 0;" src="/static/public/member.png" mode=""></image>
</view>
<!-- 功能列表 -->
<view class="bacf radius20 mar-s20">
<view v-if="levelInfo.level.name!='普通会员'" class="disac fon28 fw pad-x20" style="color: #C27417;">
<view v-if="levelInfo.level.rights[indexh]==itemh.ntype" v-for="(itemh,indexh) in huiList" :key="indexh" class="mar-s20" style="width: 25%;">
<view class="disac fc">
<image :src="itemh.src" style="width: 50rpx;height: 50rpx;" mode="aspectFill"></image>
<view class="mar-s20 mar-x10">{{itemh.title}}</view>
</view>
</view>
</view>
</view>
<!-- 当前权益介绍 -->
<view class="bacf radius20 mar-s20 pad20">
<view class="mar-x30 fon32 bold" style="color: #C27417;">当前权益介绍</view>
<rich-text :nodes="detailInfo"></rich-text>
<!-- <image src="../../static/public/dang-quan.png" style="width: 100%;" mode="widthFix"></image> -->
</view>
<view class="fon30 bold tc mar-s50 mar-x30" :style="{color:publicColor}">积分兑换</view>
</view>
<scoreList :dataList="dataList"></scoreList>
<!-- 弹框授权 -->
<empower @buttonH="buttonH" :vision="vision" :isWhere="2"></empower>
<!-- -->
<auth-phone v-if="isShowP"></auth-phone>
</view>
</template>
<script>
import scoreList from '@/components/score-list.vue';
export default {
components:{
scoreList
},
data() {
return {
vision:false,
statusHNH:uni.getStorageSync('statusHNH'),
publicColor:uni.getStorageSync('publicColor'),
huiList:[
{src:'/static/public/ru-hui50.png',title:'入会权益',ntype:'membership_interests'},
{src:'/static/public/birthday50.png',title:'生日礼物',ntype:'birthday'},
{src:'/static/public/member-scor50.png',title:'积分权益',ntype:'score'},
{src:'/static/public/te-quan50.png',title:'特权日',ntype:'privilege_day'},
{src:'/static/public/share-hai50.png',title:'分享海报',ntype:'poster'},
],
dataList:[],
levelInfo:{},
detailInfo:'',//富文本
vision:false,
isShowP:false,
}
},
onShareAppMessage() {
var shareObj = {
path: `/pagesA/member/member?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
};
return shareObj;
},
onLoad(options) {
if(uni.getStorageSync('is_active')!=1){this.vision = true;}
if(options.invite_code!='' && options.invite_code!=undefined){
this.loginEv(options.invite_code);
} else if(options.source_code!='' && options.source_code!=undefined){
this.loginEv('',options.source_code,options.channel);
}
this.$toolAll.tools.isLogin();
this.checkList();
this.checkInfo();
},
methods: {
loginEv(invite_code='',source='',channel=''){
uni.login({
provider: 'weixin',
success: (res)=> {
if (res.code) {
var params = {
code:res.code,
invite_code:invite_code,//用户邀请码
source_code:source,
channel:channel
}
this.$requst.post('user/login',params).then(res => {
if(res.data.token!=''){
if(res.data.is_active==0) {
this.haveImg = false;
this.vision = true;
}
}
},error => {})
}
},
});
},
buttonH(e){//授权成功
this.haveImg = e
if(e) {
this.vision = false
this.isShowP = true
}
},
checkInfo(){
this.$requst.post('level/index').then(res=>{
if(res.code==0){
this.levelInfo = res.data;
// 富文本
this.detailInfo = this.$toolAll.tools.escape2Html(this.levelInfo.level.content)
}
})
},
checkList(){//查询列表事件
let params = {
keyword:'',//商品关键字 支持模糊搜索
page:1,
size:10,
type:'normal',//type=normal综合 newest=最新
sort_field:'',//排序字段 score=积分 num=兑换量
sort_value:''//排序值 asc=升序 desc=降序
}
this.$requst.post('spu/score',params).then(res=>{
if(res.code==0){
this.dataList = [];
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let obj = {
id:item.id,
imgSrc: this.$http + item.cover,
saleable:item.saleable,//是否下架
stock:item.stock,//库存
title: item.name,
zhePrice:item.price,
yuanPrice:item.original_price,
integral:item.score,
isTuan:false,
isPing:false,
isXian:false,
isIntegral:true,
grade:item.level_id,
published_at:item.published_at,//发布时间
amount:item.amount,//销量
level_text:item.level_text//会员限制提示 如青铜会员可购买
}
this.dataList.push(obj)
})
} else {
this.$toolAll.tools.showToast('暂无更多积分商品')
}
}
})
},
}
}
</script>
<style>
</style>