123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667 |
- <template>
- <app-layout>
- <view class="info">
- <view class="last">可提现金额:{{community.money ? community.money : '0.00'}}元</view>
- </view>
- <view>
- <view class="info input-money main-between cross-center">
- <view class="input">
- <input v-model="moneyInput" type="digit" placeholder-style="color:#cdcdcd" placeholder="请输入提现金额">
- <view class="price" :class="getTheme + '-m-text ' + getTheme">¥</view>
- </view>
- </view>
- <view class="about"
- v-if="config.min_money > 0 || config.cash_service_charge > 0 || config.free_cash_min > 0 || config.free_cash_max > 0">
- <view class="dir-left-nowrap">
- <view>说明:</view>
- <view>
- <view v-if="config.min_money > 0">金额不能少于¥{{config.min_money}}元</view>
- <view v-if="config.cash_service_charge > 0">提现需要加收{{config.cash_service_charge}}%手续费</view>
- <view v-if="config.free_cash_max > 0">
- 免手续费提现金额区间为¥{{config.free_cash_min}}~¥{{config.free_cash_max}}
- </view>
- </view>
- </view>
- </view>
- <view class="dir-left-nowrap cross-center cash-type" @click="cashTypeModel = true">
- <view class="box-grow-1">提现方式</view>
- <view class="box-grow-0">{{cashName}}</view>
- <image class="box-grow-0 arrow-image" src="/static/image/icon/arrow-right.png"></image>
- </view>
- <view v-if="mark_num==1 || mark_num ==2 || mark_num == 3" class="cash-info">
- <view class="info content">
- <view class="enter" v-if="mark_num==3">开户人</view>
- <view class="enter" v-else>姓名</view>
- <input class="info-input" v-model="name" placeholder="请输入正确的姓名"></input>
- </view>
- <view class="info content" v-if="mark_num==3">
- <view class="enter">开户行</view>
- <input class="info-input" v-model="bank_name" placeholder="请输入正确的银行名称"></input>
- </view>
- <view class="info content">
- <view class="enter">帐号</view>
- <input class="info-input" v-model="mobile" v-if="mark_num < 3" :placeholder="mark_num == 1 ? '请输入正确的微信帐号' : '请输入正确的支付宝帐号'"></input>
- <input class="info-input" v-model="mobile" v-if="mark_num==3" type="number"
- placeholder="请输入正确的银行卡帐号"></input>
- </view>
- </view>
- <view class="submit">
- <button @click="subscribe" :class="getTheme + '-m-back ' + getTheme">提交申请</button>
- </view>
- </view>
- <view class="bg" v-if="submitOver || warningInfo">
- <view class="dialog">
- <view class="dialog-title">提示</view>
- <view v-if="submitOver">提现申请提交成功</view>
- <view v-if="warningInfo">{{warningInfo}}</view>
- <view @click="toDetail" v-if="submitOver" class="close-button" :class="getTheme + '-m-text ' + getTheme">确认</view>
- <view @click="warningInfo = false" v-if="warningInfo" class="close-button" :class="getTheme + '-m-text ' + getTheme">确认</view>
- </view>
- </view>
- <app-cash-model
- :is-auto="pay_type.auto"
- :is-wx="pay_type.wechat"
- :is-alipay="pay_type.alipay"
- :is-bank="pay_type.bank"
- :is-balance="pay_type.balance"
- :theme="getTheme"
- :pay-type="cashType"
- @change="payTypeChange"
- v-model="cashTypeModel"
- ></app-cash-model>
- </app-layout>
- </template>
- <script>
- import {mapGetters, mapState} from 'vuex';
- import appCashModel from "../../../components/page-component/app-cash-model/app-cash-model.vue"
- export default {
- data() {
- return {
- cashTypeModel: false,
- visible: false,
- mark_num: -1,
- community: {},
- pay_type: {
- auto: false,
- alipay: false,
- wechat: false,
- bank: false,
- balance: false,
- },
- loading: false,
- warningInfo: '',
- submitOver: false,
- config: [],
- name: '',
- bank_name: '',
- mobile: '',
- template_message: [],
- getMoney: null,
- moneyInput: '',
- cashType: '',
- }
- },
- components: {appCashModel,},
- computed: {
- ...mapState({
- mall: state => state.mallConfig.mall,
- }),
- ...mapGetters('mallConfig', {
- getTheme: 'getTheme',
- }),
- cashName() {
- switch (this.cashType) {
- case 'auto':
- // #ifdef MP-WEIXIN
- return '微信零钱';
- // #endif
- // #ifdef MP-ALIPAY
- return '支付宝余额';
- // #endif
- // #ifndef MP-WEIXIN || MP-ALIPAY
- return '自动';
- // #endif
- case 'wx':
- return '微信线下打款';
- case 'alipay':
- return '支付宝线下打款';
- case 'bank':
- return '银联线下打款';
- case 'balance':
- return '商城余额';
- default:
- return;
- break;
- }
- },
- },
- methods: {
- payTypeChange(value) {
- this.cashType = value;
- switch (value) {
- case 'auto':
- this.mark_num = 0;
- break;
- case 'wx':
- this.mark_num = 1;
- break;
- case 'alipay':
- this.mark_num = 2;
- break;
- case 'bank':
- this.mark_num = 3;
- break;
- case 'balance':
- this.mark_num = 4;
- break;
- default:
- this.mark_num = -1;
- break;
- }
- },
- subscribe() {
- if (this.loading) {
- return false
- }
- if (this.submitOver || this.warningInfo) {
- return false
- }
- if (this.moneyInput > 0) {
- if (this.mark_num == -1) {
- uni.showToast({title: '请选择提现方式', icon: 'none'});
- return;
- }
- this.loading = true;
- this.$subscribe(this.template_message).then(res => {
- this.submit();
- }).catch(res => {
- this.submit();
- });
- }else {
- this.warningInfo = '请输入正确的提现金额'
- }
- },
- submit() {
- let that = this;
- uni.showLoading({
- title: '加载中...'
- });
- let para = {
- model: 'community',
- price: that.moneyInput,
- type: 'auto'
- };
- if (that.mark_num == 4) {
- para.type = 'balance';
- } else if (that.mark_num == 0) {
- para.type = 'auto';
- } else {
- para.name = that.name;
- para.mobile = that.mobile;
- if (that.mark_num == 1) {
- para.type = 'wechat';
- }
- if (that.mark_num == 2) {
- para.type = 'alipay';
- }
- if (that.mark_num == 3) {
- para.type = 'bank';
- para.bank_name = that.bank_name;
- }
- }
- that.$request({
- url: that.$api.finance.cash,
- data: para,
- method: 'post'
- }).then(response=>{
- uni.hideLoading();
- that.loading = false;
- if(response.code == 0) {
- that.submitOver = true;
- }else {
- that.warningInfo = response.msg;
- }
- }).catch(response => {
- that.loading = false;
- uni.hideLoading();
- });
- },
- toDetail() {
- this.submitOver = false;
- uni.redirectTo({
- url: '/plugins/community/cash-detail/cash-detail'
- });
- },
- getStatus() {
- let that = this;
- that.$request({
- url: that.$api.community.index,
- }).then(response=>{
- that.$hideLoading();
- if(response.code == 0) {
- that.community = response.data.middleman;
- }else {
- uni.showToast({
- title: response.msg,
- icon: 'none',
- duration: 1000
- });
- }
- }).catch(response => {
- that.$hideLoading();
- });
- },
- setting() {
- let that = this;
- that.$request({
- url: that.$api.finance.config,
- data: {
- model: 'community'
- },
- method: 'post'
- }).then(response=>{
- that.$hideLoading();
- that.getStatus();
- if(response.code == 0) {
- that.config = response.data.config;
- that.template_message = response.data.template_message;
- for (let i = 0; i < that.config.pay_type.length; i++) {
- switch (that.config.pay_type[i]) {
- case "auto":
- that.pay_type.auto = true;
- //that.mark_num = 0;
- break;
- case "alipay":
- that.pay_type.alipay = true;
- //that.mark_num = 2;
- break;
- case "wechat":
- that.pay_type.wechat = true;
- //that.mark_num = 1;
- break;
- case "balance":
- that.pay_type.balance = true;
- //that.mark_num = 4;
- break;
- case "bank":
- that.pay_type.bank = true;
- //that.mark_num = 3;
- break;
- }
- }
- }else {
- uni.showToast({
- title: response.msg,
- icon: 'none',
- duration: 1000
- });
- }
- }).catch(response => {
- that.$hideLoading();
- });
- },
- },
- onLoad(options) {
- let that = this;
- if (options.money > 0) {
- that.money = options.money;
- };
- that.setting();
- }
- }
- </script>
- <style scoped lang="scss">
- .cash-type {
- height: #{120rpx};
- background: white;
- color: #353535;
- font-size: #{32rpx};
- padding: 0 #{24rpx};
- margin-top: #{24rpx};
- .arrow-image {
- width: #{12rpx};
- height: #{24rpx};
- display: block;
- margin-left: #{12rpx};
- }
- }
- .cash-info {
- margin-top: #{20rpx};
- }
- .info {
- background-color: #fff;
- padding: #{32rpx} #{24rpx};
- border-bottom: #{1rpx} solid #e2e2e2;
- color: #353535;
- }
- .info.input-money {
- border-bottom: 0;
- }
- .info.cash-type {
- margin: #{20rpx} 0;
- padding: #{32rpx} 0;
- }
- .last {
- font-size: #{40rpx};
- margin-bottom: #{15rpx};
- }
- .last-info {
- font-size: #{24rpx};
- color: #666;
- }
- .last-info view {
- float: left;
- height: #{44rpx};
- line-height: #{44rpx};
- }
- .last-info .show-tip {
- color: #666;
- display: inline-block;
- background-color: #fff;
- font-size: #{24rpx};
- padding: 0 #{12rpx};
- height: #{44rpx};
- line-height: #{44rpx};
- border-radius: #{22rpx};
- border: #{1rpx} solid #e2e2e2;
- }
- .last-info button::after {
- border: 0;
- }
- .price {
- height: #{80rpx};
- line-height: #{80rpx};
- font-size: #{46rpx};
- position: absolute;
- left: 0;
- top: 0;
- }
- .all {
- color: #666;
- }
- .input {
- font-size: #{36rpx};
- height: #{80rpx};
- line-height: #{80rpx};
- width: 70%;
- padding-left: #{50rpx};
- position: relative;
- }
- .input input {
- height: #{80rpx};
- line-height: #{80rpx};
- }
- .about {
- font-size: #{24rpx};
- padding: #{32rpx} #{24rpx} #{12rpx};
- color: #666;
- }
- .icon {
- height: #{40rpx};
- width: #{40rpx};
- margin-right: #{16rpx};
- display: flex;
- justify-content: center;
- }
- .mode-item {
- width: #{200rpx};
- border: #{1rpx} solid #999;
- text-align: center;
- padding: 0 #{24rpx};
- height: #{66rpx};
- line-height: #{66rpx};
- border-radius: #{33rpx};
- display: flex;
- align-items: center;
- margin: #{10rpx} #{24rpx};
- font-size: #{30rpx};
- position: relative;
- }
- .mode-title {
- margin-bottom: #{25rpx};
- padding-left: #{24rpx};
- font-size: #{34rpx};
- }
- .enter {
- color: #353535;
- float: left;
- width: #{100rpx};
- height: #{56rpx};
- line-height: #{56rpx};
- font-size: #{32rpx};
- }
- .content {
- height: #{120rpx};
- }
- .info-input {
- font-size: #{32rpx};
- height: #{56rpx};
- padding: 0 #{32rpx};
- }
- .on-active {
- height: #{32rpx};
- width: #{32rpx};
- position: absolute;
- right: 0;
- bottom: 0;
- }
- .submit {
- margin-top: #{40rpx};
- }
- .submit button {
- height: #{80rpx};
- border-radius: #{40rpx};
- line-height: #{80rpx};
- width: 90%;
- margin: 0 auto;
- color: #fff;
- font-size: #{32rpx};
- }
- .bg {
- position: fixed;
- top: 0;
- left: 0;
- height: 100%;
- width: 100%;
- background-color: rgba(0, 0, 0, .3);
- z-index: 10;
- }
- .dialog {
- position: fixed;
- top: #{400rpx};
- left: 0;
- right: 0;
- height: #{300rpx};
- width: #{640rpx};
- margin: 0 auto;
- z-index: 21;
- background-color: #fff;
- border-radius: 10px;
- text-align: center;
- font-size: #{30rpx};
- }
- .dialog-title {
- margin: #{40rpx} auto #{35rpx};
- }
- .dialog-btn {
- height: #{88rpx};
- width: #{640rpx};
- border-top: #{1rpx} solid #e2e2e2;
- line-height: #{88rpx};
- position: absolute;
- bottom: 0;
- left: 0;
- }
- .dialog-close,.dialog-submit {
- width: 50%;
- }
- .line {
- height: #{44rpx};
- margin-top: #{22rpx};
- width: #{1rpx};
- background-color: #e2e2e2;
- }
- .dialog-submit {
- color: #ff4544;
- }
- .bg {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- height: 100%;
- width: 100%;
- z-index: 20;
- background-color: rgba(0, 0, 0, 0.3);
- }
- .dialog {
- position: fixed;
- top: #{400rpx};
- left: 0;
- right: 0;
- height: #{300rpx};
- width: #{640rpx};
- margin: 0 auto;
- z-index: 21;
- background-color: #fff;
- border-radius: 10px;
- text-align: center;
- font-size: #{30rpx};
- }
- .close-button {
- height: #{88rpx};
- width: #{640rpx};
- border-top: #{1rpx} solid #e2e2e2;
- line-height: #{88rpx};
- position: absolute;
- bottom: 0;
- left: 0;
- }
- .dialog-title {
- margin: #{40rpx} auto #{35rpx};
- }
- // 经典红
- $classic-red-main-color: #FE3666;
- $classic-red-secondary-color: #A494F6;
- // 活力黄
- $vibrant-yellow-main-color: #fcc600;
- $vibrant-yellow-secondary-color: #555555;
- // 浪漫粉
- $romantic-powder-main-color: #ff547b;
- $romantic-powder-secondary-color: #ffe6e8;
- // 流光金
- $streamer-gold-main-color: #ddb766;
- $streamer-gold-secondary-color: #f0ebd8;
- // 优雅紫
- $elegant-purple-main-color: #7783ea;
- $elegant-purple-secondary-color: #e9ebff;
- // 品味红
- $taste-red-main-color: #ff4544;
- $taste-red-secondary-color: #555555;
- // 清醒绿
- $fresh-green-main-color: #63be72;
- $fresh-green-secondary-color: #e1f4e3;
- // 商务蓝
- $business-blue-main-color: #4a90e2;
- $business-blue-secondary-color: #dbe9f9;
- // 纯粹黑
- $pure-black-main-color: #333333;
- $pure-black-secondary-color: #dedede;
- // 热情红
- $passionate-red-main-color: #ff4544;
- $passionate-red-secondary-color: #ffdada;
- .classic-red-border {
- border-color: $classic-red-main-color;
- }
- .vibrant-yellow-border {
- border-color: $vibrant-yellow-main-color;
- }
- .romantic-powder-border {
- border-color: $romantic-powder-main-color;
- }
- .streamer-gold-border {
- border-color: $streamer-gold-main-color;
- }
- .elegant-purple-border {
- border-color: $elegant-purple-main-color;
- }
- .taste-red-border {
- border-color: $taste-red-main-color;
- }
- .fresh-green-border {
- border-color: $fresh-green-main-color;
- }
- .business-blue-border {
- border-color: $business-blue-main-color;
- }
- .pure-black-border {
- border-color: $pure-black-main-color;
- }
- .passionate-red-border {
- border-color: $passionate-red-main-color;
- }
- </style>
|