chore(组件): 全部使用easycom来处理组件问题
This commit is contained in:
@@ -3,7 +3,8 @@
|
||||
<mescroll-uni ref="mescroll" @getData="getData" v-if="storeToken">
|
||||
<block slot="list">
|
||||
<view class="nc-info-list-content">
|
||||
<view class="list-item balance-item" @click="setBalanceDefault()" v-if="type=='fenxiao' && payList && payList.balance">
|
||||
<view class="list-item balance-item" @click="setBalanceDefault()"
|
||||
v-if="type == 'fenxiao' && payList && payList.balance">
|
||||
<view class="item-top">
|
||||
<view class="item-left">
|
||||
<view class="title-text">提现到余额</view>
|
||||
@@ -32,9 +33,10 @@
|
||||
</view>
|
||||
|
||||
<view class="item-bottom">
|
||||
<view class="account-default" @click="setDefault(item.id,item.is_default)">
|
||||
<view class="account-default" @click="setDefault(item.id, item.is_default)">
|
||||
<text class="default">设为默认账户</text>
|
||||
<switch v-if="item.is_default == 1" checked disabled style="transform:scale(0.7)" :color="themeStyle.main_color" />
|
||||
<switch v-if="item.is_default == 1" checked disabled style="transform:scale(0.7)"
|
||||
:color="themeStyle.main_color" />
|
||||
<switch v-else style="transform:scale(0.7)" :color="themeStyle.main_color" />
|
||||
</view>
|
||||
<view class="account-btn">
|
||||
@@ -46,10 +48,13 @@
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view v-if="dataList.length <= 0 && (type != 'fenxiao' || (type == 'fenxiao' && payList && !payList.balance))" class="empty-box">
|
||||
<view
|
||||
v-if="dataList.length <= 0 && (type != 'fenxiao' || (type == 'fenxiao' && payList && !payList.balance))"
|
||||
class="empty-box">
|
||||
<image :src="$util.img('public/uniapp/member/account/empty.png')" mode="widthFix"></image>
|
||||
<view class="tips">暂无账户信息,请添加</view>
|
||||
<button type="primary" class="add-account" @click="editAccount('add')">{{ $lang('newAddAccount') }}</button>
|
||||
<button type="primary" class="add-account" @click="editAccount('add')">{{ $lang('newAddAccount')
|
||||
}}</button>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
@@ -62,404 +67,398 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
// #endif
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
// #endif
|
||||
|
||||
export default {
|
||||
components: {
|
||||
MescrollUni,
|
||||
nsLogin,
|
||||
loadingCover,
|
||||
nsEmpty,
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
// #endif
|
||||
export default {
|
||||
components: {
|
||||
MescrollUni,
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
// #endif
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataList: [], //账号列表
|
||||
back: '', // 返回页
|
||||
redirect: 'redirectTo', // 跳转方式
|
||||
type: 'member',
|
||||
payList: null
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
if (option.type) this.type = option.type;
|
||||
if (option.redirect) this.redirect = option.redirect;
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
this.getTransferType();
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/account');
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 编辑提现账户信息
|
||||
editAccount(type, id) {
|
||||
let data = {};
|
||||
data.type = this.type;
|
||||
if (type == 'edit') data.id = id;
|
||||
if (this.back) data.back = this.back;
|
||||
this.$util.redirectTo('/pages_tool/member/account_edit', data);
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataList: [], //账号列表
|
||||
back: '', // 返回页
|
||||
redirect: 'redirectTo', // 跳转方式
|
||||
type: 'member',
|
||||
payList: null
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
if (option.type) this.type = option.type;
|
||||
if (option.redirect) this.redirect = option.redirect;
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
this.getTransferType();
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/account');
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 编辑提现账户信息
|
||||
editAccount(type, id) {
|
||||
let data = {};
|
||||
data.type = this.type;
|
||||
if (type == 'edit') data.id = id;
|
||||
if (this.back) data.back = this.back;
|
||||
this.$util.redirectTo('/pages_tool/member/account_edit', data);
|
||||
},
|
||||
deleteAccount(id) {
|
||||
uni.showModal({
|
||||
title: '操作提示',
|
||||
content: '确定要删除该账户吗?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/delete',
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
success: result => {
|
||||
if (result.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: '删除成功'
|
||||
});
|
||||
this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '删除失败'
|
||||
});
|
||||
}
|
||||
deleteAccount(id) {
|
||||
uni.showModal({
|
||||
title: '操作提示',
|
||||
content: '确定要删除该账户吗?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/delete',
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
success: result => {
|
||||
if (result.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: '删除成功'
|
||||
});
|
||||
this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '删除失败'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
setDefault(id, is_default) {
|
||||
if (is_default == 1) return;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/setdefault',
|
||||
data: {
|
||||
id
|
||||
},
|
||||
success: res => {
|
||||
if (res.data >= 0) {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(this.back, {}, this.redirect);
|
||||
} else {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.show();
|
||||
this.dataList = [];
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
setBalanceDefault() {
|
||||
this.$util.redirectTo(this.back, {
|
||||
'is_balance': 1
|
||||
}, this.redirect);
|
||||
},
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num
|
||||
},
|
||||
success: res => {
|
||||
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.dataList = []; //如果是第一页需手动制空列表
|
||||
this.dataList = this.dataList.concat(newArr); //追加新数据
|
||||
|
||||
let withdrawType = {
|
||||
bank: '银行',
|
||||
alipay: '支付宝',
|
||||
wechatpay: '微信'
|
||||
};
|
||||
|
||||
this.dataList.forEach(item => {
|
||||
item.withdraw_type_name = withdrawType[item.withdraw_type] ? withdrawType[
|
||||
item.withdraw_type] : '';
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
getTransferType() {
|
||||
let url = this.type == "member" ? "/api/memberwithdraw/transferType" :
|
||||
"/fenxiao/api/withdraw/transferType";
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.payList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
});
|
||||
},
|
||||
setDefault(id, is_default) {
|
||||
if (is_default == 1) return;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/setdefault',
|
||||
data: {
|
||||
id
|
||||
},
|
||||
success: res => {
|
||||
if (res.data >= 0) {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(this.back, {}, this.redirect);
|
||||
} else {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.show();
|
||||
this.dataList = [];
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
setBalanceDefault() {
|
||||
this.$util.redirectTo(this.back, {
|
||||
'is_balance': 1
|
||||
}, this.redirect);
|
||||
},
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num
|
||||
},
|
||||
success: res => {
|
||||
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.dataList = []; //如果是第一页需手动制空列表
|
||||
this.dataList = this.dataList.concat(newArr); //追加新数据
|
||||
|
||||
let withdrawType = {
|
||||
bank: '银行',
|
||||
alipay: '支付宝',
|
||||
wechatpay: '微信'
|
||||
};
|
||||
|
||||
this.dataList.forEach(item => {
|
||||
item.withdraw_type_name = withdrawType[item.withdraw_type] ? withdrawType[
|
||||
item.withdraw_type] : '';
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
getTransferType() {
|
||||
let url = this.type == "member" ? "/api/memberwithdraw/transferType" :
|
||||
"/fenxiao/api/withdraw/transferType";
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.payList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function (nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.empty-box {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.empty-box {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
image {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.tips {
|
||||
color: #999999;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.get-account,
|
||||
.add-account {
|
||||
width: 50%;
|
||||
height: 78rpx;
|
||||
line-height: 78rpx;
|
||||
border-radius: 78rpx;
|
||||
margin-top: 50rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.get-account {
|
||||
width: 50%;
|
||||
background: #fff;
|
||||
color: $base-color;
|
||||
border: 2rpx solid $base-color;
|
||||
margin-top: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
image {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.mescroll-downwarp+.empty-box {
|
||||
height: calc(100vh - 260rpx);
|
||||
.tips {
|
||||
color: #999999;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.get-account,
|
||||
.add-account {
|
||||
width: 50%;
|
||||
height: 78rpx;
|
||||
line-height: 78rpx;
|
||||
border-radius: 78rpx;
|
||||
margin-top: 50rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.btn-add {
|
||||
margin-top: 60rpx;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
.get-account {
|
||||
width: 50%;
|
||||
background: #fff;
|
||||
position: fixed;
|
||||
padding: 0 30rpx;
|
||||
color: $base-color;
|
||||
border: 2rpx solid $base-color;
|
||||
margin-top: 20rpx;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
|
||||
.add-account {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 80rpx;
|
||||
margin: 30rpx 0 30rpx;
|
||||
font-size: $font-size-toolbar;
|
||||
.mescroll-downwarp+.empty-box {
|
||||
height: calc(100vh - 260rpx);
|
||||
}
|
||||
|
||||
text {
|
||||
margin-right: 10rpx;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
||||
.btn-add {
|
||||
margin-top: 60rpx;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
position: fixed;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
z-index: 10;
|
||||
|
||||
.add-account {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 80rpx;
|
||||
margin: 30rpx 0 30rpx;
|
||||
font-size: $font-size-toolbar;
|
||||
|
||||
text {
|
||||
margin-right: 10rpx;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.zw {
|
||||
margin-top: 250rpx;
|
||||
}
|
||||
.zw {
|
||||
margin-top: 250rpx;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
margin: 0 0;
|
||||
padding: 24rpx $margin-both;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
margin-bottom: 18rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
&.balance-item {
|
||||
.item-top {
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.item-mr {
|
||||
font-size: $font-size-activity-tag;
|
||||
color: #fff;
|
||||
height: 150rpx;
|
||||
width: 150rpx;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
right: -90rpx;
|
||||
top: -90rpx;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
.list-item {
|
||||
margin: 0 0;
|
||||
padding: 24rpx $margin-both;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
margin-bottom: 18rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
&.balance-item {
|
||||
.item-top {
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
padding-bottom: 26rpx;
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.item-mr {
|
||||
font-size: $font-size-activity-tag;
|
||||
color: #fff;
|
||||
height: 150rpx;
|
||||
width: 150rpx;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
right: -90rpx;
|
||||
top: -90rpx;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.item-top {
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
padding-bottom: 26rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.item-left {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-direction: column;
|
||||
width: calc(100% - 100rpx);
|
||||
|
||||
.item-left {
|
||||
.title-text {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.info-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: calc(100% - 100rpx);
|
||||
|
||||
.title-text {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.info-content {
|
||||
display: flex;
|
||||
|
||||
.top-title {
|
||||
font-size: 26rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.top-num {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content-bottom {
|
||||
.top-title {
|
||||
font-size: 26rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.top-num {
|
||||
font-size: 26rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item-btn {
|
||||
width: 100rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #999;
|
||||
font-size: 24rpx;
|
||||
justify-content: flex-end;
|
||||
.content-bottom {
|
||||
font-size: 26rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.item-bottom {
|
||||
.item-btn {
|
||||
width: 100rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-top: 24rpx;
|
||||
align-items: center;
|
||||
color: #999;
|
||||
font-size: 24rpx;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.account-default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.item-bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-top: 24rpx;
|
||||
|
||||
.account-default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
line-height: 1;
|
||||
color: #666666;
|
||||
|
||||
.default {}
|
||||
|
||||
.iconfont {
|
||||
line-height: 1;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.default {}
|
||||
.account-btn {
|
||||
font-size: $font-size-base;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.iconfont {
|
||||
line-height: 1;
|
||||
.edit {
|
||||
text {
|
||||
vertical-align: center;
|
||||
margin-right: 10rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.account-btn {
|
||||
font-size: $font-size-base;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
.delete {
|
||||
background: #F1F1F1;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
padding: 10rpx;
|
||||
text-align: center;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.edit {
|
||||
text {
|
||||
vertical-align: center;
|
||||
margin-right: 10rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.delete {
|
||||
background: #F1F1F1;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
padding: 10rpx;
|
||||
text-align: center;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
/deep/ .mescroll-upwarp {
|
||||
padding-bottom: 150rpx;
|
||||
}
|
||||
/deep/ .mescroll-upwarp {
|
||||
padding-bottom: 150rpx;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.item-bottom>>>.uni-switch-wrapper .uni-switch-input {
|
||||
height: 48rpx !important;
|
||||
width: 88rpx !important;
|
||||
}
|
||||
.item-bottom>>>.uni-switch-wrapper .uni-switch-input {
|
||||
height: 48rpx !important;
|
||||
width: 88rpx !important;
|
||||
}
|
||||
|
||||
.item-bottom>>>.uni-switch-wrapper .uni-switch-input:after {
|
||||
height: 44rpx !important;
|
||||
width: 44rpx !important;
|
||||
}
|
||||
.item-bottom>>>.uni-switch-wrapper .uni-switch-input:after {
|
||||
height: 44rpx !important;
|
||||
width: 44rpx !important;
|
||||
}
|
||||
|
||||
.item-bottom>>>.uni-switch-wrapper .uni-switch-input:before {
|
||||
background-color: #EDEDED !important;
|
||||
height: 44rpx !important;
|
||||
width: 90rpx !important;
|
||||
}
|
||||
.item-bottom>>>.uni-switch-wrapper .uni-switch-input:before {
|
||||
background-color: #EDEDED !important;
|
||||
height: 44rpx !important;
|
||||
width: 90rpx !important;
|
||||
}
|
||||
</style>
|
||||
@@ -101,10 +101,6 @@ import {
|
||||
Weixin
|
||||
} from 'common/js/wx-jssdk.js';
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
// #endif
|
||||
@@ -112,9 +108,6 @@ import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
export default {
|
||||
components: {
|
||||
MescrollUni,
|
||||
nsLogin,
|
||||
loadingCover,
|
||||
nsEmpty,
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
// #endif
|
||||
|
||||
@@ -79,14 +79,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pickRegions from '@/components/pick-regions/pick-regions.vue';
|
||||
import validate from 'common/js/validate.js';
|
||||
import Config from '@/common/js/config.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
pickRegions
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
|
||||
@@ -72,11 +72,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
|
||||
export default {
|
||||
components: { nsLogin, loadingCover },
|
||||
data() {
|
||||
return {
|
||||
balanceInfo: {
|
||||
|
||||
@@ -50,18 +50,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
// #endif
|
||||
export default {
|
||||
components: {
|
||||
nsEmpty,
|
||||
nsLogin,
|
||||
loadingCover,
|
||||
MescrollUni,
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
</view>
|
||||
<view class="banner-container">
|
||||
<view class="memberInfo">
|
||||
<image :src="$util.img(memberInfo.headimg)" v-if="memberInfo.headimg" @error="headimgError" mode="aspectFill"/>
|
||||
<image :src="$util.getDefaultImage().head" v-else mode="aspectFill"/>
|
||||
<image :src="$util.img(memberInfo.headimg)" v-if="memberInfo.headimg" @error="headimgError"
|
||||
mode="aspectFill" />
|
||||
<image :src="$util.getDefaultImage().head" v-else mode="aspectFill" />
|
||||
<view class="member-desc">
|
||||
<view class="font-size-toolbar">{{ memberInfo.nickname }}</view>
|
||||
<view class="font-size-tag expire-time" v-if="memberInfo.level_expire_time > 0">
|
||||
@@ -22,15 +23,18 @@
|
||||
<view class="level-detail">{{ levelInfo.level_name }}</view>
|
||||
<view class="growr-name">{{ levelInfo.level_name }}可享受消费折扣和</view>
|
||||
<view class="growr-value">会员大礼包等权益</view>
|
||||
<view class="growth-rules font-size-tag" @click="openExplainPopup" v-if="levelInfo.remark != ''">
|
||||
<view class="growth-rules font-size-tag" @click="openExplainPopup"
|
||||
v-if="levelInfo.remark != ''">
|
||||
<text class="iconfont icon-wenhao font-size-tag"></text>
|
||||
</view>
|
||||
<button type="default" class="renew-btn" @click="$util.redirectTo('/pages_tool/member/card_buy')">立即续费</button>
|
||||
<button type="default" class="renew-btn"
|
||||
@click="$util.redirectTo('/pages_tool/member/card_buy')">立即续费</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-content" v-if="levelInfo.is_free_shipping || levelInfo.consume_discount < 100 || levelInfo.point_feedback > 0">
|
||||
<view class="card-content"
|
||||
v-if="levelInfo.is_free_shipping || levelInfo.consume_discount < 100 || levelInfo.point_feedback > 0">
|
||||
<view class="card-content-head">
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
@@ -118,113 +122,106 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||
import nsGoodsRecommend from '@/components/ns-goods-recommend/ns-goods-recommend.vue';
|
||||
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uniPopup,
|
||||
nsGoodsRecommend,
|
||||
nsLogin
|
||||
},
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
isSub: false, // 是否已提交
|
||||
isIphoneX: false,
|
||||
levelId: 0,
|
||||
levelInfo: {
|
||||
bg_color: '#333'
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
//会员卡
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/card');
|
||||
});
|
||||
return;
|
||||
export default {
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
isSub: false, // 是否已提交
|
||||
isIphoneX: false,
|
||||
levelId: 0,
|
||||
levelInfo: {
|
||||
bg_color: '#333'
|
||||
}
|
||||
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
|
||||
let levelInfo = this.memberInfo.member_level_info;
|
||||
let charge_rule = levelInfo.charge_rule ? JSON.parse(levelInfo.charge_rule) : {};
|
||||
levelInfo.charge_rule_arr = [];
|
||||
Object.keys(charge_rule).forEach(key => {
|
||||
levelInfo.charge_rule_arr.push({
|
||||
key: key,
|
||||
value: charge_rule[key]
|
||||
});
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
//会员卡
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/card');
|
||||
});
|
||||
this.levelInfo = levelInfo;
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
headimgError() {
|
||||
this.memberInfo.headimg = this.$util.getDefaultImage().head;
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
openExplainPopup() {
|
||||
this.$refs.explainPopup.open();
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
closeExplainPopup() {
|
||||
this.$refs.explainPopup.close();
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo('/pages/member/index');
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
|
||||
let levelInfo = this.memberInfo.member_level_info;
|
||||
let charge_rule = levelInfo.charge_rule ? JSON.parse(levelInfo.charge_rule) : {};
|
||||
levelInfo.charge_rule_arr = [];
|
||||
Object.keys(charge_rule).forEach(key => {
|
||||
levelInfo.charge_rule_arr.push({
|
||||
key: key,
|
||||
value: charge_rule[key]
|
||||
});
|
||||
});
|
||||
this.levelInfo = levelInfo;
|
||||
},
|
||||
onShow() { },
|
||||
methods: {
|
||||
headimgError() {
|
||||
this.memberInfo.headimg = this.$util.getDefaultImage().head;
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
openExplainPopup() {
|
||||
this.$refs.explainPopup.open();
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
closeExplainPopup() {
|
||||
this.$refs.explainPopup.close();
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo('/pages/member/index');
|
||||
return true;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/card.scss';
|
||||
@import './public/css/card.scss';
|
||||
|
||||
.banner-container .image-container .slide-image {
|
||||
width: calc(100% - 60rpx);
|
||||
height: 360rpx;
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.banner-container .image-container .slide-image {
|
||||
width: calc(100% - 60rpx);
|
||||
height: 360rpx;
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.banner-container .image-container image {
|
||||
background-color: #e3b66b;
|
||||
}
|
||||
.banner-container .image-container image {
|
||||
background-color: #e3b66b;
|
||||
}
|
||||
|
||||
.banner-container .slide-image .renew-btn {
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
height: 56rpx;
|
||||
border-radius: $border-radius;
|
||||
width: 160rpx;
|
||||
font-size: $font-size-tag;
|
||||
color: #e3b66b !important;
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
bottom: 40rpx;
|
||||
border: none;
|
||||
z-index: 10;
|
||||
}
|
||||
.banner-container .slide-image .renew-btn {
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
height: 56rpx;
|
||||
border-radius: $border-radius;
|
||||
width: 160rpx;
|
||||
font-size: $font-size-tag;
|
||||
color: #e3b66b !important;
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
bottom: 40rpx;
|
||||
border: none;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
</style>
|
||||
@@ -6,7 +6,8 @@
|
||||
</view>
|
||||
<view class="banner-container">
|
||||
<view class="memberInfo">
|
||||
<image :src="$util.img(memberInfo.headimg)" v-if="memberInfo.headimg" @error="headimgError" mode="aspectFill"/>
|
||||
<image :src="$util.img(memberInfo.headimg)" v-if="memberInfo.headimg" @error="headimgError"
|
||||
mode="aspectFill" />
|
||||
<image :src="$util.getDefaultImage().head" v-else mode="aspectFill"></image>
|
||||
<view class="member-desc">
|
||||
<view class="font-size-toolbar">{{ memberInfo.nickname }}</view>
|
||||
@@ -22,26 +23,27 @@
|
||||
: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
|
||||
curIndex === 0
|
||||
? i === listLen - 1
|
||||
? 'item-left'
|
||||
: i === 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
: curIndex === listLen - 1
|
||||
: curIndex === listLen - 1
|
||||
? i === 0
|
||||
? 'item-right'
|
||||
: i === listLen - 2
|
||||
? 'item-left'
|
||||
: 'item-center'
|
||||
? 'item-left'
|
||||
: 'item-center'
|
||||
: i === curIndex - 1
|
||||
? 'item-left'
|
||||
: i === curIndex + 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
]">
|
||||
? '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)',
|
||||
@@ -50,14 +52,19 @@
|
||||
}">
|
||||
<view class="bg-border"></view>
|
||||
|
||||
<image v-if="levelList[curIndex] && levelList[curIndex]['level_picture']" :src="$util.img(levelList[curIndex]['level_picture'])"/>
|
||||
<image v-else :style="{backgroundColor:levelList[curIndex]['bg_color']}"/>
|
||||
<image v-if="levelList[curIndex] && 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 }}</view>
|
||||
<view class="growr-name" :style="{color:levelList[curIndex]['level_text_color']}">{{ levelList[curIndex].level_name }}可享受消费折扣和</view>
|
||||
<view class="growr-value" :style="{color:levelList[curIndex]['level_text_color']}">会员大礼包等权益</view>
|
||||
<view class="growth-rules font-size-tag" @click="openExplainPopup" v-if="levelList[curIndex].remark != ''">
|
||||
<view class="level-detail" :style="{ color: levelList[curIndex]['level_text_color'] }">
|
||||
{{ levelList[curIndex].level_name }}</view>
|
||||
<view class="growr-name" :style="{ color: levelList[curIndex]['level_text_color'] }">{{
|
||||
levelList[curIndex].level_name }}可享受消费折扣和</view>
|
||||
<view class="growr-value" :style="{ color: levelList[curIndex]['level_text_color'] }">
|
||||
会员大礼包等权益</view>
|
||||
<view class="growth-rules font-size-tag" @click="openExplainPopup"
|
||||
v-if="levelList[curIndex].remark != ''">
|
||||
<text class="iconfont icon-wenhao font-size-tag"></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -78,8 +85,10 @@
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
<view class="card-time-list">
|
||||
<view class="card-item-box" :class="{ small: currCard.charge_rule_arr.length == 4 }" v-for="(item, index) in currCard.charge_rule_arr" :key="index">
|
||||
<view class="card-time-item" :class="{ active: choiceIndex == index }" @click="choice(index)">
|
||||
<view class="card-item-box" :class="{ small: currCard.charge_rule_arr.length == 4 }"
|
||||
v-for="(item, index) in currCard.charge_rule_arr" :key="index">
|
||||
<view class="card-time-item" :class="{ active: choiceIndex == index }"
|
||||
@click="choice(index)">
|
||||
<image :src="$util.img('public/uniapp/level/card-icon.png')" mode="widthFix"></image>
|
||||
<view class="time-name">{{ cardType[item.key].name }}</view>
|
||||
<view class="time-price">
|
||||
@@ -172,7 +181,8 @@
|
||||
</view>
|
||||
<view class="agreement" v-if="agreement">
|
||||
购买既视为同意
|
||||
<text @click="$util.redirectTo('/pages_tool/member/card_agreement')">《{{ agreement.title }}》</text>
|
||||
<text @click="$util.redirectTo('/pages_tool/member/card_agreement')">《{{ agreement.title
|
||||
}}》</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
@@ -198,7 +208,8 @@
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<ns-payment ref="choosePaymentPopup" :payMoney="currCard.charge_rule_arr[choiceIndex].value" @confirm="toPay" v-if="currCard.charge_rule_arr.length"></ns-payment>
|
||||
<ns-payment ref="choosePaymentPopup" :payMoney="currCard.charge_rule_arr[choiceIndex].value"
|
||||
@confirm="toPay" v-if="currCard.charge_rule_arr.length"></ns-payment>
|
||||
</block>
|
||||
<block v-else><ns-empty text="暂无可开会员卡" :isIndex="false"></ns-empty></block>
|
||||
|
||||
@@ -209,221 +220,210 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
import nsPayment from '@/components/ns-payment/ns-payment.vue';
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uniPopup,
|
||||
nsEmpty,
|
||||
nsLogin,
|
||||
loadingCover,
|
||||
nsPayment
|
||||
},
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
isSub: false, // 是否已提交
|
||||
isIphoneX: false,
|
||||
couponPopList: [],
|
||||
curIndex: 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'
|
||||
|
||||
export default {
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
isSub: false, // 是否已提交
|
||||
isIphoneX: false,
|
||||
couponPopList: [],
|
||||
curIndex: 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: [],
|
||||
levelId: 0,
|
||||
cardType: {
|
||||
week: {
|
||||
name: '周卡',
|
||||
unit: '周'
|
||||
},
|
||||
levelList: [],
|
||||
levelId: 0,
|
||||
cardType: {
|
||||
week: {
|
||||
name: '周卡',
|
||||
unit: '周'
|
||||
},
|
||||
month: {
|
||||
name: '月卡',
|
||||
unit: '月'
|
||||
},
|
||||
quarter: {
|
||||
name: '季卡',
|
||||
unit: '季'
|
||||
},
|
||||
year: {
|
||||
name: '年卡',
|
||||
unit: '年'
|
||||
}
|
||||
month: {
|
||||
name: '月卡',
|
||||
unit: '月'
|
||||
},
|
||||
choiceIndex: 0,
|
||||
outTradeNo: '',
|
||||
agreement: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listLen() {
|
||||
return this.levelList.length;
|
||||
quarter: {
|
||||
name: '季卡',
|
||||
unit: '季'
|
||||
},
|
||||
year: {
|
||||
name: '年卡',
|
||||
unit: '年'
|
||||
}
|
||||
},
|
||||
currCard() {
|
||||
if (this.levelList[this.curIndex]) {
|
||||
let card = this.levelList[this.curIndex];
|
||||
let charge_rule = card.charge_rule ? JSON.parse(card.charge_rule) : {};
|
||||
card.charge_rule_arr = [];
|
||||
Object.keys(charge_rule).forEach(key => {
|
||||
card.charge_rule_arr.push({
|
||||
key: key,
|
||||
value: charge_rule[key]
|
||||
});
|
||||
choiceIndex: 0,
|
||||
outTradeNo: '',
|
||||
agreement: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listLen() {
|
||||
return this.levelList.length;
|
||||
},
|
||||
currCard() {
|
||||
if (this.levelList[this.curIndex]) {
|
||||
let card = this.levelList[this.curIndex];
|
||||
let charge_rule = card.charge_rule ? JSON.parse(card.charge_rule) : {};
|
||||
card.charge_rule_arr = [];
|
||||
Object.keys(charge_rule).forEach(key => {
|
||||
card.charge_rule_arr.push({
|
||||
key: key,
|
||||
value: charge_rule[key]
|
||||
});
|
||||
return card;
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
//会员卡
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
|
||||
if (this.storeToken) {
|
||||
this.getCardList();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/card_buy');
|
||||
});
|
||||
return card;
|
||||
}
|
||||
this.getAgreement();
|
||||
},
|
||||
onShow() {},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getCardList();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
swiperChange(e) {
|
||||
this.curIndex = e.detail.current;
|
||||
this.choiceIndex = 0;
|
||||
this.isDescAnimating = true;
|
||||
},
|
||||
animationfinish(e) {
|
||||
this.isDescAnimating = false;
|
||||
},
|
||||
getCardList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/supermember/api/membercard/lists',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.levelList = res.data;
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
for (let i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].level_id == this.levelId) {
|
||||
this.curIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
choice(index) {
|
||||
this.choiceIndex = index;
|
||||
},
|
||||
/**
|
||||
* 创建
|
||||
*/
|
||||
create() {
|
||||
if (this.memberInfo.member_level_type && this.memberInfo.member_level != this.currCard.level_id) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您有尚未过期的会员卡,再次购卡会覆盖掉之前的卡,是否继续?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$refs.choosePaymentPopup.open();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$refs.choosePaymentPopup.open();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
toPay() {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/supermember/api/ordercreate/create',
|
||||
data: {
|
||||
level_id: this.currCard.level_id,
|
||||
period_unit: this.currCard.charge_rule_arr[this.choiceIndex].key
|
||||
},
|
||||
success: res => {
|
||||
if (res.data && res.code == 0) {
|
||||
this.outTradeNo = res.data.out_trade_no;
|
||||
uni.setStorageSync('paySource', 'membercard');
|
||||
this.$refs.choosePaymentPopup.getPayInfo(this.outTradeNo);
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
headimgError() {
|
||||
this.memberInfo.headimg = this.$util.getDefaultImage().head;
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
openExplainPopup() {
|
||||
this.$refs.explainPopup.open();
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
closeExplainPopup() {
|
||||
this.$refs.explainPopup.close();
|
||||
},
|
||||
getAgreement() {
|
||||
this.$api.sendRequest({
|
||||
url: '/supermember/api/membercard/agreement',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data && res.data.title != '' && res.data.content != '') {
|
||||
this.agreement = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo('/pages/member/index');
|
||||
return true;
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
//会员卡
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
|
||||
if (this.storeToken) {
|
||||
this.getCardList();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/card_buy');
|
||||
});
|
||||
}
|
||||
this.getAgreement();
|
||||
},
|
||||
onShow() { },
|
||||
watch: {
|
||||
storeToken: function (nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getCardList();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
swiperChange(e) {
|
||||
this.curIndex = e.detail.current;
|
||||
this.choiceIndex = 0;
|
||||
this.isDescAnimating = true;
|
||||
},
|
||||
animationfinish(e) {
|
||||
this.isDescAnimating = false;
|
||||
},
|
||||
getCardList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/supermember/api/membercard/lists',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.levelList = res.data;
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
for (let i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].level_id == this.levelId) {
|
||||
this.curIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
choice(index) {
|
||||
this.choiceIndex = index;
|
||||
},
|
||||
/**
|
||||
* 创建
|
||||
*/
|
||||
create() {
|
||||
if (this.memberInfo.member_level_type && this.memberInfo.member_level != this.currCard.level_id) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您有尚未过期的会员卡,再次购卡会覆盖掉之前的卡,是否继续?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$refs.choosePaymentPopup.open();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$refs.choosePaymentPopup.open();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
toPay() {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/supermember/api/ordercreate/create',
|
||||
data: {
|
||||
level_id: this.currCard.level_id,
|
||||
period_unit: this.currCard.charge_rule_arr[this.choiceIndex].key
|
||||
},
|
||||
success: res => {
|
||||
if (res.data && res.code == 0) {
|
||||
this.outTradeNo = res.data.out_trade_no;
|
||||
uni.setStorageSync('paySource', 'membercard');
|
||||
this.$refs.choosePaymentPopup.getPayInfo(this.outTradeNo);
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
headimgError() {
|
||||
this.memberInfo.headimg = this.$util.getDefaultImage().head;
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
openExplainPopup() {
|
||||
this.$refs.explainPopup.open();
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
closeExplainPopup() {
|
||||
this.$refs.explainPopup.close();
|
||||
},
|
||||
getAgreement() {
|
||||
this.$api.sendRequest({
|
||||
url: '/supermember/api/membercard/agreement',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data && res.data.title != '' && res.data.content != '') {
|
||||
this.agreement = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo('/pages/member/index');
|
||||
return true;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/card.scss';
|
||||
@import './public/css/card.scss';
|
||||
</style>
|
||||
@@ -35,10 +35,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import nsGoodsRecommend from '@/components/ns-goods-recommend/ns-goods-recommend.vue';
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
@@ -47,10 +44,6 @@ import collection from './public/js/collection.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsGoodsRecommend,
|
||||
nsEmpty,
|
||||
nsLogin,
|
||||
loadingCover,
|
||||
MescrollUni,
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
|
||||
@@ -70,18 +70,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
// #endif
|
||||
export default {
|
||||
components: {
|
||||
nsEmpty,
|
||||
nsLogin,
|
||||
loadingCover,
|
||||
MescrollUni,
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
|
||||
@@ -64,9 +64,7 @@
|
||||
|
||||
<script>
|
||||
var dateList = [];
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
@@ -74,9 +72,6 @@ import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsEmpty,
|
||||
nsLogin,
|
||||
loadingCover,
|
||||
MescrollUni,
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
|
||||
@@ -74,16 +74,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||
import nsNavbar from '@/components/ns-navbar/ns-navbar.vue';
|
||||
import diyJs from '@/common/js/diy.js';
|
||||
import indexJs from './public/js/index.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uniPopup,
|
||||
nsNavbar
|
||||
},
|
||||
mixins: [diyJs, indexJs],
|
||||
methods: {
|
||||
|
||||
|
||||
@@ -107,13 +107,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniNavBar from '@/pages_tool/components/uni-nav-bar/uni-nav-bar.vue';
|
||||
import info from './public/js/info.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uniNavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
version: ''
|
||||
|
||||
@@ -157,16 +157,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniNavBar from '@/pages_tool/components/uni-nav-bar/uni-nav-bar.vue';
|
||||
import pickRegions from '@/components/pick-regions/pick-regions.vue';
|
||||
import info from './public/js/info.js';
|
||||
import auth from '@/common/js/auth.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uniNavBar,
|
||||
pickRegions
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
|
||||
@@ -232,15 +232,7 @@
|
||||
|
||||
<script>
|
||||
import inviteFriends from './public/js/invite_friends.js';
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
export default {
|
||||
components: {
|
||||
nsEmpty,
|
||||
nsLogin,
|
||||
loadingCover
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inviteList: [],
|
||||
|
||||
@@ -168,19 +168,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import nsProgress from '@/pages_tool/components/ns-progress/ns-progress.vue';
|
||||
import toTop from '@/components/toTop/toTop.vue';
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsProgress,
|
||||
toTop,
|
||||
uniPopup
|
||||
},
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -43,15 +43,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import nsProgress from '@/pages_tool/components/ns-progress/ns-progress.vue';
|
||||
import toTop from '@/components/toTop/toTop.vue';
|
||||
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsProgress,
|
||||
toTop
|
||||
},
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import imgCropping from '@/pages_tool/components/img-cropping/cropping.vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -38,9 +37,6 @@
|
||||
imgurl: ''
|
||||
};
|
||||
},
|
||||
components: {
|
||||
imgCropping
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(
|
||||
|
||||
@@ -16,11 +16,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mypOne from '@/pages_tool/components/myp-one/myp-one.vue';
|
||||
export default {
|
||||
components: {
|
||||
mypOne
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isClick: false,
|
||||
|
||||
@@ -75,14 +75,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsLogin,
|
||||
loadingCover
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pointInfo: {
|
||||
|
||||
@@ -45,18 +45,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
// #endif
|
||||
export default {
|
||||
components: {
|
||||
nsEmpty,
|
||||
nsLogin,
|
||||
loadingCover,
|
||||
MescrollUni,
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
|
||||
@@ -30,18 +30,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
// #endif
|
||||
export default {
|
||||
components: {
|
||||
nsEmpty,
|
||||
nsLogin,
|
||||
loadingCover,
|
||||
MescrollUni,
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
|
||||
@@ -53,12 +53,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
loadingCover
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
|
||||
Reference in New Issue
Block a user