forked from zhongyuanhaiju/uniapp
【修改】个人中心
This commit is contained in:
parent
a8d5d0a513
commit
f0e189bb7f
|
|
@ -144,48 +144,41 @@
|
|||
v-show="value.style == 2"
|
||||
:style="{ 'margin-left': parseInt(value.infoMargin) * 2 + 'rpx', 'margin-right': parseInt(value.infoMargin) * 2 + 'rpx' }"
|
||||
>
|
||||
<view class="account-item" @click="redirect('/pages_tool/member/balance')">
|
||||
<view class="value price-font">{{ memberInfo ? (parseFloat(memberInfo.balance) + parseFloat(memberInfo.balance_money)).toFixed(2) : '--' }}</view>
|
||||
<view class="title">消费券</view>
|
||||
</view>
|
||||
<view class="solid"></view>
|
||||
<view class="account-item" @click="redirect('/pages_tool/member/point')">
|
||||
<view class="value price-font">{{ memberInfo ? parseFloat(memberInfo.point).toFixed(2) : '--' }}</view>
|
||||
<view class="title">兑换券</view>
|
||||
</view>
|
||||
<view class="solid"></view>
|
||||
<view class="account-item" @click="redirect('/pages_promotion/fenxiao/bill')">
|
||||
<view class="value price-font">{{ fenxiaoInfo && fenxiaoInfo.points != undefined ? fenxiaoInfo.points : '--' }}</view>
|
||||
<view class="title">积分</view>
|
||||
<view>
|
||||
<view class="account-item" @click="redirect('/pages_promotion/fenxiao/bill',{type: 'points'})">
|
||||
<view class="value price-font" style="font-size: 38rpx;">{{ fenxiaoInfo && fenxiaoInfo.points != undefined ? fenxiaoInfo.points : '--' }}</view>
|
||||
<view class="title" style="font-size: 30rpx;">积分</view>
|
||||
</view>
|
||||
<view class="account-item" @click="redirect('/pages_promotion/fenxiao/bill',{type: 'contribution'})">
|
||||
<view class="value price-font">{{ fenxiaoInfo && fenxiaoInfo.contribution != undefined ? fenxiaoInfo.contribution : '--' }}</view>
|
||||
<view class="title">贡献值</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="solid"></view>
|
||||
<view class="account-item" @click="redirect('/pages_promotion/fenxiao/bill')">
|
||||
<view class="value price-font">{{ fenxiaoInfo && fenxiaoInfo.contribution != undefined ? fenxiaoInfo.contribution : '--' }}</view>
|
||||
<view class="title">贡献值</view>
|
||||
<view>
|
||||
<view class="account-item" @click="redirect('/pages_tool/member/balance')">
|
||||
<view class="value price-font" style="font-size: 38rpx;">{{ memberInfo ? (parseFloat(memberInfo.balance) + parseFloat(memberInfo.balance_money)).toFixed(2) : '--' }}</view>
|
||||
<view class="title" style="font-size: 30rpx;">消费券</view>
|
||||
</view>
|
||||
<view class="account-item" @click="redirect('/pages_tool/member/point')">
|
||||
<view class="value price-font">{{ memberInfo ? parseFloat(memberInfo.point).toFixed(2) : '--' }}</view>
|
||||
<view class="title">兑换券</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="solid"></view>
|
||||
<view class="account-item" @click="redirect('/pages_promotion/fenxiao/bill')">
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="account-info"
|
||||
v-show="value.style == 2"
|
||||
:style="{ 'margin-left': parseInt(value.infoMargin) * 2 + 'rpx', 'margin-right': parseInt(value.infoMargin) * 2 + 'rpx' }"
|
||||
>
|
||||
<view class="account-item" @click="redirect('/pages_tool/member/goufang')">
|
||||
<view class="value price-font">{{ fenxiaoInfo && fenxiaoInfo.house_purchase != undefined ? fenxiaoInfo.house_purchase : '--' }}</view>
|
||||
<view class="title">购房券</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 会员码 -->
|
||||
<uni-popup ref="erWeiPopup" type="center">
|
||||
<view class="member-code-popup" v-if="memberCode">
|
||||
<view class="popup-top">
|
||||
<view class="popup-top-title">
|
||||
<view class="iconfont icon-erweima"></view>
|
||||
<view class="popup-top-title-txt">会员码</view>
|
||||
</view>
|
||||
<view class="popup-top-tiao"><image :src="$util.img(memberCode.barcode)" mode=""></image></view>
|
||||
<view class="popup-top-erwei"><image :src="$util.img(memberCode.qrcode)" mode=""></image></view>
|
||||
<view class="popup-top-text">如遇到扫码失败请将屏幕调至最亮重新扫码</view>
|
||||
</view>
|
||||
<view class="popup-bottom"><text class="iconfont iconfont-delete icon-close-guanbi" @click="closeMemberQrcode"></text></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 完善会员资料 -->
|
||||
<view @touchmove.prevent.stop class="member-complete-info-popup">
|
||||
|
|
@ -391,57 +384,18 @@ export default {
|
|||
});
|
||||
},
|
||||
/**
|
||||
* 跳转
|
||||
* @param {Object} url
|
||||
*/
|
||||
redirect(url) {
|
||||
* 跳转
|
||||
* @param {Object} url
|
||||
* @param param
|
||||
*/
|
||||
redirect(url, param = {}) {
|
||||
if (!uni.getStorageSync('token')) {
|
||||
this.$refs.login.open(url);
|
||||
} else {
|
||||
this.$util.redirectTo(url);
|
||||
this.$util.redirectTo(url, param);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 显示会员码
|
||||
*/
|
||||
showMemberQrcode() {
|
||||
if (!this.memberInfo.mobile && !this.memberInfo.member_code) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '使用会员码需先绑定手机号,是否绑定手机号?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$util.redirectTo('/pages_tool/member/info_edit', { action: 'mobile' });
|
||||
}
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.memberCode) {
|
||||
this.$refs.erWeiPopup.open();
|
||||
}
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/membereqrcode',
|
||||
data: {
|
||||
page: ''
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.memberCode = {
|
||||
barcode: res.bar_code,
|
||||
qrcode: res.data.path
|
||||
};
|
||||
this.$refs.erWeiPopup.open();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 关闭会员码
|
||||
*/
|
||||
closeMemberQrcode() {
|
||||
this.$refs.erWeiPopup.close();
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转之前需先进行授权
|
||||
* @param {Object} url
|
||||
|
|
@ -737,9 +691,9 @@ export default {
|
|||
}
|
||||
.account-info {
|
||||
display: flex;
|
||||
padding: 40rpx 0;
|
||||
padding: 20rpx 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: space-evenly;
|
||||
view {
|
||||
color: #fff;
|
||||
}
|
||||
|
|
@ -756,7 +710,7 @@ export default {
|
|||
.value {
|
||||
font-size: 34rpx;
|
||||
font-weight: bold !important;
|
||||
margin-bottom: 4rpx;
|
||||
//margin-bottom: 4rpx;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.title {
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
@font-face {font-family: "iconfont";
|
||||
src: url('~@/components/sx-rate/sx-rate/iconfont.eot?t=1574760464482'); /* IE9 */
|
||||
src: url('~@/components/sx-rate/sx-rate/iconfont.eot?t=1574760464482#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
||||
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAK8AAsAAAAABnAAAAJwAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcAp8gQgBNgIkAwgLBgAEIAWEbQcuG6wFyA4lTcHACOEZBUg8fL/2O3f3fTHEkoh28SSayCSxkkgQG6Uz3UvYITu9Qr5K0Vh6Ij6f+8CXKzVBHDvWa6d0lSfK57mc3gQ6kGt8oBz3ojUG9QLqxYEU6B4YRVYqecPYBS7hMYG6QWF0dlOycoGxxFoViFuxkALGuYAksXRVKNccTOJdSTV7zbSAt/D78Y8XxmRKOavq5CZZAOK+7u2svLVode0TggR0vIQc84BEXNQmjugJxumpJ/SNAvsqD77ui8K3i71aBPvrrNIm6IfSe5K58ltNZ3BbU40Blkf9OmKsIW/Un1qddc4dcSma3ArIX7PPXdlxK5l2zJ+aD6TXnQqmu330wqpeWkYN/OnNm/0trU+YvqNR4UN99f+x/tApIFTfR7u39X4gKPnb9pOX5RAQB6DYyc/zOKCD4OUp6KiiPeqnapbAp56NdegrdhLo5wKq+3UG/0fWcyDpCsuWJVVWO5oZO29bXR0FwJ4uV2ONvTeTCVW9I1wVAylyVeNkYudR0rCOsqoN1M1JPd7QDdMTqYZZXQChwwYybT6Q63BIJvYSJX1eUNYReqi7CrsLGyZDbJqIEUWQAPLroJhWKhjHQUyj8mwkrJJROKsI+XyENeIw5LI4xXQqUiA8xxZNtZBHCAMZrJTDFPAcksmUUIWVEkQTlogQVQSbzdS9iUUr5cDUDgyhEIgAxFcHEqMpKTD+eMK09PlsiFAVGQpu6atJ5kMwDfHsEBcLpweZqlX06ruXVzSqCfEQBANiYEpyUAqYh8jIKEGq+nkSCI1gEY2IqURg28OYvlrW+nr5152AOsuUhV2fSy+EwgAAAA==') format('woff2'),
|
||||
url('~@/components/sx-rate/sx-rate/iconfont.woff?t=1574760464482') format('woff'),
|
||||
url('~@/components/sx-rate/sx-rate/iconfont.ttf?t=1574760464482') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
|
||||
url('~@/components/sx-rate/sx-rate/iconfont.svg?t=1574760464482#iconfont') format('svg'); /* iOS 4.1- */
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: inherit;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-star:before {
|
||||
content: "\e6e3";
|
||||
}
|
||||
|
||||
12
pages.json
12
pages.json
|
|
@ -1036,6 +1036,18 @@
|
|||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "member/goufang",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "member/goufang_to_balance",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "member/balance_detail",
|
||||
"style": {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
accountList: {},
|
||||
showEmpty: true
|
||||
showEmpty: true,
|
||||
type: ''
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
|
|
@ -49,6 +50,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
getData(mescroll) {
|
||||
this.type = this.$route.query.type;
|
||||
if (mescroll.num == 1) {
|
||||
this.accountList = [];
|
||||
}
|
||||
|
|
@ -56,7 +58,8 @@ export default {
|
|||
url: '/fenxiao/api/account/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size
|
||||
page_size: mescroll.size,
|
||||
type: this.type
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
|
||||
<script>
|
||||
import validate from 'common/js/validate.js';
|
||||
import mypOne from '@/components/myp-one/myp-one.vue';
|
||||
import mypOne from '../member/public/myp-one/myp-one.vue';
|
||||
export default {
|
||||
components: {
|
||||
mypOne
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@
|
|||
<text>最小提现金额为{{ $lang('common.currencySymbol') }}{{ withdrawInfo.config.min | moneyFormat }}</text>
|
||||
<text>,手续费为{{ withdrawInfo.config.rate + '%' }}</text>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<text>提现金额需为100的整数倍</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@
|
|||
<view class="withdraw " v-if="addonIsExist.memberwithdraw && withdrawConfig && withdrawConfig.is_use" @click="toWithdrawal">
|
||||
{{ $lang('withdrawal') }}
|
||||
</view>
|
||||
<view class="withdraw " @click="toGoufang">
|
||||
转购房券
|
||||
</view>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
|
|
@ -90,6 +93,9 @@ export default {
|
|||
// #endif
|
||||
},
|
||||
methods: {
|
||||
toGoufang() {
|
||||
this.$util.redirectTo('/pages_tool/member/goufang_to_balance',{type:'balance_to_goufang'});
|
||||
},
|
||||
toWithdrawal() {
|
||||
this.$util.redirectTo('/pages_tool/member/apply_withdrawal');
|
||||
},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,192 @@
|
|||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="balance">
|
||||
<!-- #ifdef MP -->
|
||||
<view class="custom-navbar" :style="{
|
||||
'padding-top': menuButtonBounding.top + 'px',
|
||||
'height': menuButtonBounding.height + 'px'
|
||||
}"
|
||||
>
|
||||
<view class="navbar-wrap">
|
||||
<text class="iconfont icon-back_light back" @click="$util.redirectTo('/pages/member/index')"></text>
|
||||
<view class="navbar-title">
|
||||
我的消费券
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="head-wrap" :style="{ background: 'url(' + $util.img('public/uniapp/balance/balance_bg.png') + ') no-repeat right bottom/ auto 340rpx, linear-gradient(314deg, #FE7849 0%, #FF1959 100%)' }">
|
||||
<view class="balance price-font">{{ fenxiaoInfo && fenxiaoInfo.house_purchase != undefined ? fenxiaoInfo.house_purchase : '--' }}</view>
|
||||
<view class="title">账户购房券</view>
|
||||
<!-- <view class="flex-box">-->
|
||||
<!-- <view class="flex-item">-->
|
||||
<!-- <view class="num price-font">{{ balanceInfo.balance_money|moneyFormat }}</view>-->
|
||||
<!-- <view class="font-size-tag">现金消费券(元)</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="flex-item">-->
|
||||
<!-- <view class="num price-font">{{ balanceInfo.balance|moneyFormat }}</view>-->
|
||||
<!-- <view class="font-size-tag">储值消费券(元)</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
|
||||
<view class="menu-wrap">
|
||||
<view class="menu-item" @click="toBalanceDetail">
|
||||
<view class="icon">
|
||||
<text class="iconfont icon-yuemingxi"></text>
|
||||
</view>
|
||||
<text class="title">购房券明细</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<!-- <view class="menu-item" @click="toOrderList" v-if="addonIsExist.memberrecharge && memberrechargeConfig && memberrechargeConfig.is_use">-->
|
||||
<!-- <view class="icon">-->
|
||||
<!-- <text class="iconfont icon-chongzhijilu"></text>-->
|
||||
<!-- </view>-->
|
||||
<!-- <text class="title">充值记录</text>-->
|
||||
<!-- <text class="iconfont icon-right"></text>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
|
||||
<view class="action">
|
||||
<!-- <view @click="toList" class="recharge-withdraw " v-if="addonIsExist.memberrecharge && memberrechargeConfig && memberrechargeConfig.is_use">-->
|
||||
<!-- {{ $lang('recharge') }}-->
|
||||
<!-- </view>-->
|
||||
<view class="withdraw " v-if="addonIsExist.memberwithdraw && withdrawConfig && withdrawConfig.is_use" @click="toWithdrawal">
|
||||
转消费券
|
||||
</view>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
balanceInfo: {
|
||||
balance: 0,
|
||||
balance_money: 0
|
||||
},
|
||||
withdrawConfig: null,
|
||||
memberrechargeConfig: null,
|
||||
menuButtonBounding: {}, // 小程序胶囊属性
|
||||
fenxiaoInfo: null
|
||||
};
|
||||
},
|
||||
async onShow() {
|
||||
this.getWithdrawConfig();
|
||||
this.getMemberrechargeConfig();
|
||||
if (!uni.getStorageSync('token')) {
|
||||
setTimeout(() => {
|
||||
this.$refs.login.open('/pages_tool/member/balance');
|
||||
});
|
||||
} else {
|
||||
this.getUserInfo();
|
||||
this.getFenxiaoInfo();
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef MP
|
||||
this.menuButtonBounding = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
toWithdrawal() {
|
||||
this.$util.redirectTo('/pages_tool/member/goufang_to_balance');
|
||||
},
|
||||
toOrderList() {
|
||||
this.$util.redirectTo('/pages_tool/recharge/order_list');
|
||||
},
|
||||
toBalanceDetail() {
|
||||
this.$util.redirectTo('/pages_promotion/fenxiao/bill',{type: 'house_purchase'});
|
||||
},
|
||||
toList() {
|
||||
this.$util.redirectTo('/pages_tool/recharge/list');
|
||||
},
|
||||
getFenxiaoInfo(){
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/detail',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.fenxiaoInfo=res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
//获取消费券信息
|
||||
getUserInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/info',
|
||||
data: {
|
||||
account_type: 'balance,balance_money'
|
||||
},
|
||||
success: res => {
|
||||
if (res.data) {
|
||||
this.balanceInfo = res.data;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取消费券提现配置
|
||||
*/
|
||||
getWithdrawConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/config',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.withdrawConfig = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取充值提现配置
|
||||
*/
|
||||
getMemberrechargeConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecharge/api/memberrecharge/config',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.memberrechargeConfig = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo('/pages/member/index', {}, 'reLaunch');
|
||||
return true;
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getUserInfo();
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
storeToken() {
|
||||
return this.$store.state.token;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/balance.scss';
|
||||
</style>
|
||||
|
|
@ -0,0 +1,448 @@
|
|||
<template>
|
||||
<page-meta :page-style="themeColor"></page-meta>
|
||||
<view class="container">
|
||||
<!-- <view class="bank-account-wrap" @click="goAccount()">-->
|
||||
<!-- <view class="tx-wrap" v-if="bankAccountInfo.withdraw_type">-->
|
||||
<!-- <text class="tx-to">提现到</text>-->
|
||||
<!-- <view class="tx-bank" v-if="bankAccountInfo.withdraw_type == 'wechatpay'">微信默认钱包</view>-->
|
||||
<!-- <view class="tx-bank" v-else>{{ bankAccountInfo.bank_account }}</view>-->
|
||||
<!-- <view class="tx-img" v-if="bankAccountInfo.withdraw_type == 'alipay'">-->
|
||||
<!-- <image :src="$util.img('public/uniapp/member/apply_withdrawal/alipay.png')" mode="widthFix"></image>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="tx-img" v-else-if="bankAccountInfo.withdraw_type == 'bank'">-->
|
||||
<!-- <image :src="$util.img('public/uniapp/member/apply_withdrawal/bank.png')" mode="widthFix"></image>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="tx-img" v-else-if="bankAccountInfo.withdraw_type == 'wechatpay'">-->
|
||||
<!-- <image :src="$util.img('public/uniapp/member/apply_withdrawal/wechatpay.png')" mode="widthFix"></image>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <text class="tx-to" v-else>请添加提现方式</text>-->
|
||||
<!-- <view class="iconfont icon-right"></view>-->
|
||||
<!-- </view>-->
|
||||
<view class="empty-box"></view>
|
||||
<view class="withdraw-wrap">
|
||||
<view class="withdraw-wrap-title">转换金额:</view>
|
||||
<view class="money-wrap">
|
||||
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
|
||||
<input type="digit" class="withdraw-money" v-model="withdrawMoney" />
|
||||
<view class="delete" @click="remove" v-if="withdrawMoney"><image :src="$util.img('public/uniapp/member/apply_withdrawal/close.png')" mode="widthFix"></image></view>
|
||||
</view>
|
||||
<view class="bootom">
|
||||
<view>
|
||||
<text class="color-tip">可转换{{ type_name }}:{{ $lang('common.currencySymbol') }}{{ showAmount | moneyFormat }}</text>
|
||||
<text class="all-tx color-base-text" @click="allTx">全部转换</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<!-- <text>最小提现金额为{{ $lang('common.currencySymbol') }}{{ withdrawInfo.config.min | moneyFormat }}</text>-->
|
||||
<!-- <text>,手续费为{{ withdrawInfo.config.rate + '%' }}</text>-->
|
||||
</view>
|
||||
<view class="desc">
|
||||
<text>转换金额需为100的整数倍</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="btn color-base-border ns-gradient-otherpages-member-widthdrawal-withdrawal"
|
||||
:class="{ disabled: withdrawMoney == '' || withdrawMoney == 0 }"
|
||||
@click="withdraw"
|
||||
>
|
||||
转换
|
||||
</view>
|
||||
|
||||
<!-- <view class="recoend" @click="toWithdrawal"><view class="recoend-con">提现记录</view></view>-->
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
withdrawInfo: {
|
||||
config: {
|
||||
is_use: 0,
|
||||
min: 1,
|
||||
rate: 0
|
||||
},
|
||||
member_info: {
|
||||
balance_money: 0,
|
||||
balance_withdraw: 0,
|
||||
balance_withdraw_apply: 0
|
||||
}
|
||||
},
|
||||
bankAccountInfo: {},
|
||||
withdrawMoney: '',
|
||||
isSub: false,
|
||||
type: 'goufang_to_balance',
|
||||
type_name : '购房券',
|
||||
fenxiaoInfo: null,
|
||||
showAmount : 0
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.type = this.$route.query.type === undefined ? 'goufang_to_balance': this.$route.query.type;
|
||||
|
||||
if (uni.getStorageSync('token')) {
|
||||
switch (this.type){
|
||||
case "goufang_to_balance":
|
||||
this.type_name = '购房券'
|
||||
break
|
||||
case "balance_to_goufang":
|
||||
this.type_name = '消费券'
|
||||
break
|
||||
}
|
||||
this.getWithdrawInfo();
|
||||
this.getFenxiaoInfo();
|
||||
this.getBankAccountInfo();
|
||||
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/login/login', {
|
||||
back: '/pages_tool/member/apply_withdrawal'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getFenxiaoInfo(){
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/fenxiao/detail',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.fenxiaoInfo=res.data;
|
||||
switch (this.type){
|
||||
case "goufang_to_balance":
|
||||
this.showAmount = this.fenxiaoInfo.house_purchase;
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
toWithdrawal() {
|
||||
this.$util.redirectTo('/pages_tool/member/withdrawal');
|
||||
},
|
||||
//全部提现
|
||||
allTx() {
|
||||
this.withdrawMoney = this.showAmount;
|
||||
},
|
||||
|
||||
// 删除提现金额
|
||||
remove() {
|
||||
this.withdrawMoney = '';
|
||||
},
|
||||
/**
|
||||
* 获取提现信息
|
||||
*/
|
||||
getWithdrawInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/info',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.withdrawInfo = res.data;
|
||||
switch (this.type){
|
||||
case "balance_to_goufang":
|
||||
this.showAmount = this.withdrawInfo.member_info.balance_money;
|
||||
break
|
||||
}
|
||||
if (this.withdrawInfo.config.is_use == 0) {
|
||||
this.$util.redirectTo('/pages/member/index');
|
||||
}
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 银行账号信息
|
||||
*/
|
||||
getBankAccountInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/defaultinfo',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.bankAccountInfo = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
verify() {
|
||||
if (this.withdrawMoney == '' || this.withdrawMoney == 0 || isNaN(parseFloat(this.withdrawMoney))) {
|
||||
this.$util.showToast({
|
||||
title: '请输入转换金额'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (parseFloat(this.withdrawMoney) > parseFloat(this.withdrawInfo.member_info.balance_money)) {
|
||||
this.$util.showToast({
|
||||
title: '转换金额超出可转换金额'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (parseFloat(this.withdrawMoney) < parseFloat(this.withdrawInfo.config.min)) {
|
||||
this.$util.showToast({
|
||||
title: '转换金额小于最低转换金额'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
goufangverify() {
|
||||
if (this.withdrawMoney == '' || this.withdrawMoney == 0 || isNaN(parseFloat(this.withdrawMoney))) {
|
||||
this.$util.showToast({
|
||||
title: '请输入转换金额'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (parseFloat(this.withdrawMoney) > parseFloat(this.fenxiaoInfo.house_purchase)) {
|
||||
this.$util.showToast({
|
||||
title: '转换金额超出可转换金额'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (parseFloat(this.withdrawMoney) <= parseFloat(0)) {
|
||||
this.$util.showToast({
|
||||
title: '转换金额小于最低转换金额'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
withdraw() {
|
||||
// if (!this.bankAccountInfo.withdraw_type) {
|
||||
// this.$util.showToast({
|
||||
// title: '请先添加提现方式'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
switch (this.type){
|
||||
case "goufang_to_balance":
|
||||
if (!this.goufangverify()) {
|
||||
return;
|
||||
}
|
||||
break
|
||||
case "balance_to_goufang":
|
||||
if (!this.verify()) {
|
||||
return
|
||||
}
|
||||
break
|
||||
}
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/fenxiao/api/account/goufang_to_balance',
|
||||
data: {
|
||||
apply_money: this.withdrawMoney,
|
||||
type: this.type, //转账提现类型
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({
|
||||
title: '转换成功'
|
||||
});
|
||||
setTimeout(() => {
|
||||
switch (this.type){
|
||||
case "goufang_to_balance":
|
||||
this.$util.redirectTo('/pages_tool/member/goufang', {}, 'redirectTo');
|
||||
break
|
||||
case "balance_to_goufang":
|
||||
this.$util.redirectTo('/pages_tool/member/balance', {}, 'redirectTo');
|
||||
break
|
||||
}
|
||||
}, 1500);
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
goAccount() {
|
||||
this.$util.redirectTo(
|
||||
'/pages_tool/member/account',
|
||||
{
|
||||
back: '/pages_tool/member/apply_withdrawal'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
},
|
||||
/**
|
||||
* 微信订阅消息
|
||||
*/
|
||||
subscribeMessage(callback) {
|
||||
this.$api.sendRequest({
|
||||
url: '/weapp/api/weapp/messagetmplids',
|
||||
data: {
|
||||
keywords: 'USER_WITHDRAWAL_SUCCESS'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data.length) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: res.data,
|
||||
fail: res => {
|
||||
console.log('fail', res);
|
||||
},
|
||||
complete: () => {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.empty-box {
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
.bank-account-wrap {
|
||||
margin: 0 20rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
border-bottom: 2rpx solid #f7f7f7;
|
||||
position: relative;
|
||||
|
||||
.tx-wrap {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-right: 60rpx;
|
||||
|
||||
.tx-bank {
|
||||
margin-right: 60rpx;
|
||||
flex: 1;
|
||||
margin-left: 10rpx;
|
||||
text-align: right;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tx-img {
|
||||
position: absolute;
|
||||
right: 100rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.withdraw-wrap {
|
||||
margin: 0 20rpx;
|
||||
padding: 30rpx;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: rgba(110, 110, 110, 0.09) 0 0 20rpx 0;
|
||||
|
||||
.money-wrap {
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #eee;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
.unit {
|
||||
font-size: 60rpx;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.withdraw-money {
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
min-height: 70rpx;
|
||||
padding-left: 20rpx;
|
||||
font-size: 60rpx;
|
||||
flex: 1;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.delete {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bootom {
|
||||
display: flex;
|
||||
padding-top: 20rpx;
|
||||
|
||||
text {
|
||||
line-height: 1;
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.all-tx {
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 0 30rpx;
|
||||
margin-top: 60rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: $border-radius;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background-color: var(--main-color);
|
||||
&.disabled {
|
||||
background: #ccc;
|
||||
border-color: #ccc;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.recoend {
|
||||
margin-top: 40rpx;
|
||||
|
||||
.recoend-con {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
font-size: $font-size-tag;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import mypOne from '@/components/myp-one/myp-one.vue';
|
||||
import mypOne from './public/myp-one/myp-one.vue';
|
||||
export default {
|
||||
components: {
|
||||
mypOne
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import sxRate from '@/components/sx-rate/index.vue';
|
||||
import sxRate from './public/sx-rate/index.vue';
|
||||
import evaluate from './public/js/evaluate.js';
|
||||
export default {
|
||||
components: {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
/*@font-face {font-family: "iconfont";*/
|
||||
/* src: url('~@/pages_tool/order/public/sx-rate/sx-rate/iconfont.eot?t=1574760464482'); !* IE9 *!*/
|
||||
/* src: url('./iconfont.eot?t=1574760464482#iefix') format('embedded-opentype'), !* IE6-IE8 *!*/
|
||||
/* url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAK8AAsAAAAABnAAAAJwAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcAp8gQgBNgIkAwgLBgAEIAWEbQcuG6wFyA4lTcHACOEZBUg8fL/2O3f3fTHEkoh28SSayCSxkkgQG6Uz3UvYITu9Qr5K0Vh6Ij6f+8CXKzVBHDvWa6d0lSfK57mc3gQ6kGt8oBz3ojUG9QLqxYEU6B4YRVYqecPYBS7hMYG6QWF0dlOycoGxxFoViFuxkALGuYAksXRVKNccTOJdSTV7zbSAt/D78Y8XxmRKOavq5CZZAOK+7u2svLVode0TggR0vIQc84BEXNQmjugJxumpJ/SNAvsqD77ui8K3i71aBPvrrNIm6IfSe5K58ltNZ3BbU40Blkf9OmKsIW/Un1qddc4dcSma3ArIX7PPXdlxK5l2zJ+aD6TXnQqmu330wqpeWkYN/OnNm/0trU+YvqNR4UN99f+x/tApIFTfR7u39X4gKPnb9pOX5RAQB6DYyc/zOKCD4OUp6KiiPeqnapbAp56NdegrdhLo5wKq+3UG/0fWcyDpCsuWJVVWO5oZO29bXR0FwJ4uV2ONvTeTCVW9I1wVAylyVeNkYudR0rCOsqoN1M1JPd7QDdMTqYZZXQChwwYybT6Q63BIJvYSJX1eUNYReqi7CrsLGyZDbJqIEUWQAPLroJhWKhjHQUyj8mwkrJJROKsI+XyENeIw5LI4xXQqUiA8xxZNtZBHCAMZrJTDFPAcksmUUIWVEkQTlogQVQSbzdS9iUUr5cDUDgyhEIgAxFcHEqMpKTD+eMK09PlsiFAVGQpu6atJ5kMwDfHsEBcLpweZqlX06ruXVzSqCfEQBANiYEpyUAqYh8jIKEGq+nkSCI1gEY2IqURg28OYvlrW+nr5152AOsuUhV2fSy+EwgAAAA==') format('woff2'),*/
|
||||
/* url('./iconfont.woff?t=1574760464482') format('woff'),*/
|
||||
/* url('./iconfont.ttf?t=1574760464482') format('truetype'), !* chrome, firefox, opera, Safari, Android, iOS 4.2+ *!*/
|
||||
/* url('./iconfont.svg?t=1574760464482#iconfont') format('svg'); !* iOS 4.1- *!*/
|
||||
/*}*/
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: inherit;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-star:before {
|
||||
content: "\e6e3";
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in New Issue