You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong_qianduan/pages/member/index.vue

633 lines
14 KiB

11 months ago
<template>
<view class="member">
11 months ago
<view>
10 months ago
<u-navbar title="会员中心" :border-bottom="false" title-color="#333" :background="background"></u-navbar>
11 months ago
</view>
<view class="khy">
10 months ago
开通<text v-if="type=='fx'">分销</text>会员人均立省<text>2389</text>
11 months ago
</view>
<view class="tips">
<image src="/static/default-logo.png" mode="" class="headIcon"></image>
<view class="meInfo">
<view class="info">
<view class="name">
10 months ago
{{userInfo.nick_name}}
11 months ago
</view>
<view class="hy">
10 months ago
{{userInfo.user_type_text}}
11 months ago
</view>
</view>
<view class="time">
10 months ago
有效期至{{userInfo.effective_time}}
11 months ago
</view>
</view>
11 months ago
<view class="buyInfo" @click="goBuyInfo">
购买记录
<u-icon name="arrow-right"></u-icon>
</view>
11 months ago
</view>
11 months ago
<view class="notVip">
11 months ago
<view class="openVip">
10 months ago
开通<text v-if="type=='fx'">分销</text>会员获得以下 <text>10</text>特权
11 months ago
</view>
<view class="vipList">
11 months ago
<view class="vipItem">
10 months ago
<image :src="$picUrl+'/static/member/my.png'" mode="" class="itemImg"></image>
11 months ago
<view class="vipInfo">
10 months ago
天天免邮
11 months ago
</view>
</view>
<view class="vipItem">
10 months ago
<image :src="$picUrl+'/static/member/lp.png'" mode="" class="itemImg"></image>
11 months ago
<view class="vipInfo">
10 months ago
超低会员价
11 months ago
</view>
</view>
<view class="vipItem">
10 months ago
<image :src="$picUrl+'/static/member/dz.png'" mode="" class="itemImg"></image>
11 months ago
<view class="vipInfo">
10 months ago
折上95折
11 months ago
</view>
</view>
<view class="vipItem">
10 months ago
<image :src="$picUrl+'/static/member/th.png'" mode="" class="itemImg"></image>
11 months ago
<view class="vipInfo">
10 months ago
退换免运费
11 months ago
</view>
</view>
<view class="vipItem">
10 months ago
<image :src="$picUrl+'/static/member/cx.png'" mode="" class="itemImg"></image>
11 months ago
<view class="vipInfo">
10 months ago
促销福利
11 months ago
</view>
</view>
<view class="vipItem">
10 months ago
<image :src="$picUrl+'/static/member/tq.png'" mode="" class="itemImg"></image>
11 months ago
<view class="vipInfo">
10 months ago
极速售后
11 months ago
</view>
</view>
<view class="vipItem">
10 months ago
<image :src="$picUrl+'/static/member/my.png'" mode="" class="itemImg"></image>
11 months ago
<view class="vipInfo">
10 months ago
门店特权
11 months ago
</view>
</view>
<view class="vipItem">
10 months ago
<image :src="$picUrl+'/static/member/cj.png'" mode="" class="itemImg"></image>
11 months ago
<view class="vipInfo">
10 months ago
不回本退差价
11 months ago
</view>
</view>
<view class="vipItem">
10 months ago
<image :src="$picUrl+'/static/member/tg.png'" mode="" class="itemImg"></image>
11 months ago
<view class="vipInfo">
10 months ago
团购优惠券
11 months ago
</view>
</view>
<view class="vipItem">
10 months ago
<image :src="$picUrl+'/static/member/jf.png'" mode="" class="itemImg"></image>
11 months ago
<view class="vipInfo">
10 months ago
双倍积分
11 months ago
</view>
</view>
</view>
<view class="choseType">
<view class="typeTitle">
10 months ago
选择 <text v-if="userInfo.effective_time">续费</text> <text v-if="!userInfo.effective_time">开卡</text> 套餐
11 months ago
</view>
<view class="typeList">
10 months ago
<view class="first common" v-for="(item,index) in packageList" :key="index"
:style="{'border':isChose==index?'2rpx solid #F34A40':none}" @click="chosePackage(item,index)">
11 months ago
<view class="limitPrice" v-if="index==0">
11 months ago
限时活动价
</view>
10 months ago
<!-- :style="{'marginTop':isChose!=index?'62rpx':0}" -->
<view class="timeLong" >
10 months ago
{{item.month}}个月
11 months ago
</view>
<view class="firPrice">
10 months ago
{{item.price}}
11 months ago
</view>
<view class="avePrice">
10 months ago
{{Number(item.price)/Number(item.month)}}/
11 months ago
</view>
</view>
</view>
<view class="payType">
10 months ago
<view v-for="(item,index) in paymentMethods" :key="index" @click="chosePayType(item,index)">
<view class="firLine">
<view class="left">
<image src="/static/order/wChat.png" mode="" class="weChatImg"
v-if="item.method=='wechat'"></image>
10 months ago
<image :src="$picUrl+'/static/member/others.png'" mode="" class="weChatImg"
10 months ago
v-if="item.method=='balance'"></image>
<text v-if="item.method=='wechat'">微信支付</text>
<text v-if="item.method=='balance'">余额支付</text>
</view>
<image src="../../static/order/right.png" mode="" class="choseImg" v-if="item.is_default">
</image>
11 months ago
</view>
10 months ago
<view class="line">
11 months ago
11 months ago
</view>
</view>
</view>
</view>
</view>
10 months ago
11 months ago
<view class="footer">
<view class="fLeft">
10 months ago
<view class="ys" v-if="choseItem.cheap_price!=0">
10 months ago
已省 <text>{{choseItem.cheap_price}}</text>
11 months ago
</view>
<view class="yj">
10 months ago
原价 {{choseItem.price}}
11 months ago
</view>
</view>
10 months ago
<view class="btn" @click="gotoPay">
<text>{{choseItem.price}}</text>开卡{{choseItem.month}}个月
11 months ago
</view>
</view>
</view>
</template>
<script>
10 months ago
// import img from "@/static/member/top.png";
10 months ago
import * as member from '@/api/member/index.js';
import {
Wechat
} from '@/core/payment'
11 months ago
export default {
data() {
10 months ago
let img = 'https://www.royaum.com.cn/static/member/top.png'
11 months ago
return {
10 months ago
packageList: [],
userInfo: {},
payTypeChose: true,
11 months ago
isChose: 0,
isVip: false,
11 months ago
background: {
11 months ago
background: 'url(' + img + ') center top no-repeat',
11 months ago
backgroundSize: '100% auto',
},
10 months ago
paymentMethods: [],
choseItem: {},
payType: 'wechat',
type: 'hy',
11 months ago
}
11 months ago
},
10 months ago
onShow() {
this.getMemberInfo()
},
onLoad(options) {
this.type = options.type
},
methods: {
getMemberInfo() {
const that = this
let params = {
client: 'MP-WEIXIN'
}
if (that.type == 'hy') {
member.info(params)
.then(res => {
if (res.status == 200) {
that.userInfo = res.data.list.personal;
that.packageList = res.data.list.list;
that.paymentMethods = res.data.list.paymentMethods;
that.choseItem = that.packageList[0]
}
})
.finally(() => that.isLoading = false)
} else {
member.dealerPriceList(params)
.then(res => {
if (res.status == 200) {
that.userInfo = res.data.list.personal;
that.packageList = res.data.list.list;
that.paymentMethods = res.data.list.paymentMethods;
that.choseItem = that.packageList[0]
}
})
.finally(() => that.isLoading = false)
}
},
chosePackage(item, index) {
this.isChose = index;
this.choseItem = item;
},
goBuyInfo() {
11 months ago
uni.navigateTo({
10 months ago
url: '/pages/memberInfo/index?userInfo=' + JSON.stringify(this.userInfo)
11 months ago
})
},
10 months ago
chosePayType(item, index) {
// 选择支付方式
this.paymentMethods[index].is_default = true;
this.payType = item.method;
for (var i = 0; i < this.paymentMethods.length; i++) {
if (i != index) {
this.paymentMethods[i].is_default = false
}
}
},
gotoPay() {
// 去支付
if (this.payType == 'wechat') {
this.weChatPay()
} else if (this.payType == 'balance') {
this.balancePay()
}
},
weChatPay() {
// 微信支付
const that = this
let params = {
identity_id: that.choseItem.identity_id,
method: 'wechat',
client: 'MP-WEIXIN'
}
member.submit(params)
.then(res => {
let paymentData = res.data.payment
Wechat.payment({
orderKey: res.data.payment.out_trade_no,
...paymentData
})
.then((result) => {
console.log(result)
})
.catch(err => {
console.log(err)
})
})
.finally(() => that.isLoading = false)
},
balancePay() {
// 余额支付
const that = this
let params = {
identity_id: that.choseItem.identity_id,
method: 'balance',
client: 'MP-WEIXIN'
}
member.submit(params)
.then(res => {
that.$toast(res.message)
})
.finally(() => that.isLoading = false)
},
11 months ago
}
}
</script>
<style lang="scss" scoped>
11 months ago
.member {
11 months ago
width: 100%;
10 months ago
background: url('https://www.royaum.com.cn/static/member/merBack.png') center top no-repeat;
background-size: 100% auto;
11 months ago
position: relative;
11 months ago
}
11 months ago
.khy {
11 months ago
height: 36rpx;
font-size: 26rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #785B45;
line-height: 36rpx;
text-align: center;
margin: 40rpx 0 28rpx 0;
11 months ago
image {
11 months ago
width: 15rpx;
height: 10rpx;
}
11 months ago
text {
11 months ago
height: 56rpx;
font-size: 40rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 600;
color: #785B45;
line-height: 56rpx;
margin-right: 8rpx;
}
}
11 months ago
.tips {
11 months ago
width: 698rpx;
height: 234rpx;
11 months ago
margin: 46rpx 0 0 26rpx;
10 months ago
background-image: url('https://www.royaum.com.cn/static/member/bg.png');
11 months ago
background-repeat: no-repeat;
background-size: 100% 100%;
display: flex;
align-items: center;
padding: 0rpx 0 0 34rpx;
11 months ago
.headIcon {
11 months ago
width: 114rpx;
height: 114rpx;
margin-right: 30rpx;
margin-top: 12rpx;
10 months ago
border-radius: 50%;
11 months ago
}
11 months ago
.meInfo {
.info {
11 months ago
display: flex;
margin-bottom: 26rpx;
11 months ago
.name {
11 months ago
height: 50rpx;
font-size: 36rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #785B45;
line-height: 50rpx;
margin-right: 18rpx;
}
11 months ago
.hy {
11 months ago
width: 126rpx;
height: 42rpx;
11 months ago
background: rgba(255, 255, 255, 0.71);
11 months ago
border-radius: 62rpx 62rpx 62rpx 62rpx;
opacity: 1;
text-align: center;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #785B45;
line-height: 42rpx;
}
}
11 months ago
.time {
11 months ago
height: 34rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #785B45;
line-height: 34rpx;
11 months ago
11 months ago
}
}
10 months ago
.buyInfo {
11 months ago
// width: 112rpx;
height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #785B45;
line-height: 40rpx;
10 months ago
// margin-left: 86rpx;
11 months ago
}
11 months ago
}
11 months ago
.notVip {
10 months ago
padding-bottom: 200rpx;
11 months ago
.openVip {
11 months ago
height: 44rpx;
font-size: 32rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #8B4338;
line-height: 44rpx;
margin: 30rpx 0 0 38rpx;
11 months ago
text {
11 months ago
color: #EF2C21;
}
}
11 months ago
.vipList {
11 months ago
display: flex;
flex-wrap: wrap;
11 months ago
margin: 24rpx 0 0 0rpx;
11 months ago
.vipItem {
11 months ago
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
11 months ago
margin-right: 6rpx;
10 months ago
margin-bottom: 8rpx;
11 months ago
.itemImg {
11 months ago
width: 88rpx;
height: 88rpx;
}
11 months ago
.vipInfo {
11 months ago
width: 144rpx;
11 months ago
height: 34rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #7D2D21;
line-height: 34rpx;
margin-top: 30rpx;
11 months ago
text-align: center;
11 months ago
}
}
}
11 months ago
.choseType {
11 months ago
width: 726rpx;
height: 546rpx;
background: #FFFFFF;
border-radius: 12rpx 12rpx 12rpx 12rpx;
opacity: 1;
11 months ago
margin: 28rpx 0 0 12rpx;
11 months ago
padding: 18rpx 0 0 26rpx;
11 months ago
.typeTitle {
11 months ago
height: 44rpx;
font-size: 32rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #8B4338;
line-height: 44rpx;
}
11 months ago
.typeList {
11 months ago
display: flex;
margin: 28rpx 0 0 22rpx;
11 months ago
.first {
11 months ago
margin-right: 12rpx;
width: 220rpx;
height: 242rpx;
background: #FFEEE8;
border-radius: 8rpx 8rpx 8rpx 8rpx;
opacity: 1;
11 months ago
// border: 2rpx solid #F34A40;
.limitPrice {
11 months ago
width: 169rpx;
height: 46rpx;
background: linear-gradient(180deg, #FFFFFF 0%, #FEF8F5 100%);
border-radius: 0rpx 0rpx 0rpx 0rpx;
opacity: 1;
margin: 0 0 20rpx 32rpx;
10 months ago
text-align: center;
11 months ago
}
11 months ago
.timeLong {
11 months ago
width: 100%;
text-align: center;
height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #7D2D21;
line-height: 40rpx;
margin: 30rpx 0 12rpx 0;
}
11 months ago
.sec {
11 months ago
margin-top: 62rpx;
}
11 months ago
.firPrice {
11 months ago
width: 100%;
text-align: center;
height: 72rpx;
10 months ago
font-size: 36rpx;
11 months ago
font-family: PingFang SC, PingFang SC;
font-weight: 600;
color: #F34A40;
line-height: 72rpx;
}
11 months ago
.avePrice {
11 months ago
width: 100%;
text-align: center;
height: 34rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #F34A40;
line-height: 34rpx;
}
}
}
11 months ago
.payType {
11 months ago
margin-top: 30rpx;
11 months ago
.firLine {
11 months ago
display: flex;
justify-content: space-between;
11 months ago
.left {
11 months ago
height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #7D2D21;
line-height: 40rpx;
display: flex;
align-items: center;
11 months ago
.weChatImg {
11 months ago
width: 28rpx;
height: 24rpx;
margin-right: 12rpx;
}
}
11 months ago
.choseImg {
11 months ago
width: 34rpx;
height: 24rpx;
margin-right: 60rpx;
}
}
11 months ago
.line {
11 months ago
width: 622rpx;
height: 0rpx;
opacity: 1;
border: 2rpx solid #F6F6F6;
11 months ago
margin: 26rpx 0 26rpx 60rpx;
11 months ago
}
}
}
}
10 months ago
11 months ago
.footer {
11 months ago
position: fixed;
bottom: 0rpx;
height: 200rpx;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
10 months ago
z-index: 99;
background-color: #fff;
11 months ago
.fLeft {
11 months ago
margin: 24rpx 0 0 74rpx;
11 months ago
.ys {
11 months ago
height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #7D2D21;
line-height: 40rpx;
11 months ago
text {
11 months ago
height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #F34A40;
line-height: 40rpx;
}
}
11 months ago
.yj {
11 months ago
height: 34rpx;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #CAABA6;
line-height: 34rpx;
}
}
11 months ago
.btn {
11 months ago
width: 440rpx;
height: 80rpx;
background: #F34A40;
border-radius: 8rpx 8rpx 8rpx 8rpx;
opacity: 1;
11 months ago
margin: 22rpx 70rpx 0 0;
11 months ago
text-align: center;
font-size: 24rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FFFFFF;
11 months ago
text {
11 months ago
font-size: 44rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FFFFFF;
11 months ago
line-height: 80rpx;
11 months ago
}
}
}
</style>