定位 提现
This commit is contained in:
parent
a197797f9b
commit
9463c13b91
14
src/App.vue
14
src/App.vue
@ -111,13 +111,13 @@ export default {
|
|||||||
wx.ready(() => {
|
wx.ready(() => {
|
||||||
wx.updateAppMessageShareData(shareinfo);
|
wx.updateAppMessageShareData(shareinfo);
|
||||||
wx.updateTimelineShareData(shareinfo);
|
wx.updateTimelineShareData(shareinfo);
|
||||||
// wx.getLocation({
|
wx.getLocation({
|
||||||
// type: 'gcj02',
|
type: 'gcj02',
|
||||||
// success: (e) => {
|
success: (e) => {
|
||||||
// localStorage.setItem('user_latitude', e.latitude)
|
localStorage.setItem('user_latitude', e.latitude)
|
||||||
// localStorage.setItem('user_longitude', e.longitude)
|
localStorage.setItem('user_longitude', e.longitude)
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
});
|
});
|
||||||
wx.error((e) => {
|
wx.error((e) => {
|
||||||
});
|
});
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<div v-if="card" class="card">
|
<div v-if="card" class="card">
|
||||||
<img :src="card.bankspname === '支付宝' ? '/img/aliicon.png' : '/img/bankcardicon.png'"
|
<img :src="card.bankspname === '支付宝' ? '/img/aliicon.png' : '/img/bankcardicon.png'"
|
||||||
height="24" width="24" style="object-fit: cover;" />
|
height="24" width="24" style="object-fit: cover;" />
|
||||||
<span class="code">{{ card.bankcardnumber }}</span>
|
<span class="code">{{ card.realname }}({{ card.bankcardnumber }})</span>
|
||||||
</div>
|
</div>
|
||||||
<span v-else class="card">请选择到账账户</span>
|
<span v-else class="card">请选择到账账户</span>
|
||||||
</div>
|
</div>
|
||||||
@ -29,9 +29,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="cashout-remark">
|
<div class="cashout-remark">
|
||||||
<p>注:</p>
|
<p>注:</p>
|
||||||
<p>1、提现手续费{{ cashoutConfig.CommissionRate * 100 }}%</p>
|
<p>1、提现手续费{{ (cashoutConfig.wdfeeratio * 100)?.toFixed(2) }}%</p>
|
||||||
<p>2、最低提现金额{{ cashoutConfig.BaseCash }}元</p>
|
<p>2、最低提现金额{{ cashoutConfig.wdnumsmin?.toFixed(2) }}元</p>
|
||||||
<p>3、提现后{{ cashoutConfig.Cycle }}个工作日内审核发放</p>
|
<p>3、提现后{{ cashoutConfig.reviewdays }}个工作日内审核发放</p>
|
||||||
</div>
|
</div>
|
||||||
<van-button type="danger" block round @click="cashout"
|
<van-button type="danger" block round @click="cashout"
|
||||||
style="margin: 0 6.667vw; width: calc(100% - 13.333vw);">提现</van-button>
|
style="margin: 0 6.667vw; width: calc(100% - 13.333vw);">提现</van-button>
|
||||||
@ -46,7 +46,7 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<img :src="item.bankspname === '支付宝' ? '/img/aliicon.png' : '/img/bankcardicon.png'"
|
<img :src="item.bankspname === '支付宝' ? '/img/aliicon.png' : '/img/bankcardicon.png'"
|
||||||
height="30" width="30" style="object-fit: cover;" />
|
height="30" width="30" style="object-fit: cover;" />
|
||||||
<span class="code">{{ item.bankcardnumber }}</span>
|
<span class="code">{{ item.realname }}({{ item.bankcardnumber }})</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
@ -83,11 +83,17 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
|
Promise.all([
|
||||||
this.$get('/v1/client/DUsersClient').then(data => {
|
this.$get('/v1/client/DUsersClient').then(data => {
|
||||||
this.wallet.Balance = data.data.zijin;
|
this.wallet.Balance = data.data.zijin;
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.$showFailToast(err.message);
|
this.$showFailToast(err.message);
|
||||||
});
|
}),
|
||||||
|
this.$get('/v1/client/DUserwithdrawsClient/param').then(res => {
|
||||||
|
this.cashoutConfig = res.data;
|
||||||
|
})
|
||||||
|
])
|
||||||
|
|
||||||
},
|
},
|
||||||
selectCard(item) {
|
selectCard(item) {
|
||||||
this.card = item;
|
this.card = item;
|
||||||
@ -99,14 +105,14 @@ export default {
|
|||||||
this.$showFailToast('请选择到账账户');
|
this.$showFailToast('请选择到账账户');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.form.amount || this.form.amount < this.cashoutConfig.BaseCash) {
|
if (!this.form.amount || this.form.amount < this.cashoutConfig.wdnumsmin) {
|
||||||
this.$showFailToast(`提现金额必须大于${this.cashoutConfig.BaseCash}`);
|
this.$showFailToast(`提现金额必须大于${this.cashoutConfig.wdnumsmin}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const commission = (this.form.amount * this.cashoutConfig.CommissionRate).toFixed(2);
|
const commission = (this.form.amount * this.cashoutConfig.wdfeeratio).toFixed(2);
|
||||||
this.$showConfirmDialog({
|
this.$showConfirmDialog({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
message: `您本次提现${this.form.amount}元${commission > 0 ? `,提现手续费${commission}元` : ''},是否确认提现?`,
|
message: `您本次提现${this.form.amount}元,扣除${this.cashoutConfig.wdfeeratio * 100}%手续费,实际到账${(this.form.amount * (1 - this.cashoutConfig.wdfeeratio)).toFixed(2)}元,是否确认提现?`,
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$post('/v1/client/DUserwithdrawsClient', {
|
this.$post('/v1/client/DUserwithdrawsClient', {
|
||||||
bankcardid: this.form.bankcardid,
|
bankcardid: this.form.bankcardid,
|
||||||
|
|||||||
@ -11,12 +11,16 @@
|
|||||||
|
|
||||||
<van-list class="b_l_w" v-model:loading="loading" v-show="!isEmpty" :finished="finished" finished-text="没有更多了"
|
<van-list class="b_l_w" v-model:loading="loading" v-show="!isEmpty" :finished="finished" finished-text="没有更多了"
|
||||||
@load="loadMore">
|
@load="loadMore">
|
||||||
<div class="record" v-for="item in list" :key="item.id">
|
<div class="record-box" v-for="item in list" :key="item.id">
|
||||||
|
<div class="record">
|
||||||
<img src="/img/cashout_record.svg" height="48" width="48" style="object-fit: cover;" />
|
<img src="/img/cashout_record.svg" height="48" width="48" style="object-fit: cover;" />
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<span>{{ item.wdfromname }} -> {{ item.wdtoname }}</span>
|
<span>{{ item.wdfromname }} -> {{ item.wdtoname }}</span>
|
||||||
<span class="time">{{ $formatGMT(item.wdaddtime, 'yyyy-MM-dd HH:mm:ss') }}</span>
|
<span class="time" v-if="item.reviewtime">
|
||||||
|
{{ $formatGMT(item.reviewtime, 'yyyy-MM-dd HH:mm:ss') }}
|
||||||
|
</span>
|
||||||
|
<span class="time" v-else>{{ $formatGMT(item.wdaddtime, 'yyyy-MM-dd HH:mm:ss') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span>{{ item.realname }} {{ item.bankname }}{{ item.bankcardnumber?.substr(-4) }}</span>
|
<span>{{ item.realname }} {{ item.bankname }}{{ item.bankcardnumber?.substr(-4) }}</span>
|
||||||
@ -30,6 +34,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="refund" v-if="item.reviewremark">
|
||||||
|
{{ item.reviewremark }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</van-list>
|
</van-list>
|
||||||
|
|
||||||
<van-empty class="b_l_w" v-show="isEmpty" description="暂无数据" />
|
<van-empty class="b_l_w" v-show="isEmpty" description="暂无数据" />
|
||||||
@ -90,9 +98,10 @@ export default {
|
|||||||
this.list.push(...items);
|
this.list.push(...items);
|
||||||
this.page++;
|
this.page++;
|
||||||
this.finished = items.length < this.pageSize;
|
this.finished = items.length < this.pageSize;
|
||||||
// 计算累计提现
|
// 计算累计提现(只排除已拒绝的)
|
||||||
if (this.page === 2) {
|
if (this.page === 2) {
|
||||||
this.totalCash = items.reduce((sum, item) => sum + (item.wdnums || 0), 0);
|
const filteredItems = items.filter(item => item.wdstate !== 2);
|
||||||
|
this.totalCash = filteredItems.reduce((sum, item) => sum + (item.wdnums || 0), 0);
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.finished = true;
|
this.finished = true;
|
||||||
@ -101,7 +110,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getStateType(state) {
|
getStateType(state) {
|
||||||
const map = { 0: 'warning', 1: 'success', 2: 'danger', 3: 'default' };
|
const map = { 0: 'warning', 2: 'danger', 7: 'success' };
|
||||||
return map[state] || 'default';
|
return map[state] || 'default';
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -130,15 +139,18 @@ export default {
|
|||||||
padding: 3.333vw;
|
padding: 3.333vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.record-box {
|
||||||
|
margin-bottom: 3.333vw;
|
||||||
|
background: #fff;
|
||||||
|
padding: 2vw 2vw;
|
||||||
|
border-radius: 1.333vw;
|
||||||
|
width: 93.333vw;
|
||||||
|
}
|
||||||
|
|
||||||
.record {
|
.record {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 3.333vw;
|
|
||||||
width: 93.333vw;
|
|
||||||
background: #fff;
|
|
||||||
padding: 1vw 2vw;
|
|
||||||
border-radius: 1.333vw;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.record .content {
|
.record .content {
|
||||||
|
|||||||
@ -76,8 +76,8 @@ export default {
|
|||||||
active: 0,
|
active: 0,
|
||||||
categories: [],
|
categories: [],
|
||||||
searchparams: {
|
searchparams: {
|
||||||
latitude: 29.309300,
|
latitude: localStorage.getItem('user_latitude') || 29.309300,
|
||||||
longitude: 120.070380,
|
longitude: localStorage.getItem('user_longitude') || 120.070380,
|
||||||
shopcateid: '',
|
shopcateid: '',
|
||||||
orderby: '',
|
orderby: '',
|
||||||
shopname: '',
|
shopname: '',
|
||||||
@ -145,48 +145,52 @@ export default {
|
|||||||
this.searchparams.shopname = this.searchQuery;
|
this.searchparams.shopname = this.searchQuery;
|
||||||
},
|
},
|
||||||
initLocation() {
|
initLocation() {
|
||||||
if (wx && this.$isWechat()) {
|
// if (wx && this.$isWechat()) {
|
||||||
this.$post('/v1/client/HWxinfoClient/share', JSON.stringify(location.href)).then(res => {
|
// this.$post('/v1/client/HWxinfoClient/share', JSON.stringify(location.href)).then(res => {
|
||||||
const data = res.data || {};
|
// const data = res.data || {};
|
||||||
const jsApiList = data.jsApiList || ['getLocation'];
|
// const jsApiList = data.jsApiList || ['getLocation'];
|
||||||
const openTagList = data.openTagList || ['wx-open-launch-weapp'];
|
// const openTagList = data.openTagList || ['wx-open-launch-weapp'];
|
||||||
jsApiList.push('wx-open-launch-weapp');
|
// jsApiList.push('wx-open-launch-weapp');
|
||||||
wx.config({
|
// wx.config({
|
||||||
debug: false,
|
// debug: false,
|
||||||
appId: data.appid,
|
// appId: data.appid,
|
||||||
timestamp: Number(data.timestamp) || 0,
|
// timestamp: Number(data.timestamp) || 0,
|
||||||
nonceStr: data.noncestr,
|
// nonceStr: data.noncestr,
|
||||||
signature: data.signature,
|
// signature: data.signature,
|
||||||
jsApiList: jsApiList,
|
// jsApiList: jsApiList,
|
||||||
openTagList: openTagList
|
// openTagList: openTagList
|
||||||
});
|
// });
|
||||||
wx.ready(() => {
|
// wx.ready(() => {
|
||||||
wx.getLocation({
|
// wx.getLocation({
|
||||||
type: 'gcj02',
|
// type: 'gcj02',
|
||||||
success: (e) => {
|
// success: (e) => {
|
||||||
this.searchparams.latitude = e.latitude;
|
// this.searchparams.latitude = e.latitude;
|
||||||
this.searchparams.longitude = e.longitude;
|
// this.searchparams.longitude = e.longitude;
|
||||||
},
|
// },
|
||||||
fail: (err) => {
|
// fail: (err) => {
|
||||||
console.log('定位失败:', err)
|
// console.log('定位失败:', err)
|
||||||
// this.$showToast('定位被拒绝,请重新进入页面获取定位')
|
// // this.$showToast('定位被拒绝,请重新进入页面获取定位')
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
wx.error((e) => {
|
// wx.error((e) => {
|
||||||
if (localStorage.getItem('latitude') && localStorage.getItem('longitude')) {
|
// if (localStorage.getItem('latitude') && localStorage.getItem('longitude')) {
|
||||||
this.searchparams.latitude = localStorage.getItem('latitude');
|
// this.searchparams.latitude = localStorage.getItem('latitude');
|
||||||
this.searchparams.longitude = localStorage.getItem('longitude');
|
// this.searchparams.longitude = localStorage.getItem('longitude');
|
||||||
return
|
// return
|
||||||
} else {
|
// } else {
|
||||||
this.$geo.getWebGeo().then(res => {
|
// this.$geo.getWebGeo().then(res => {
|
||||||
this.searchparams.latitude = res.lat;
|
// this.searchparams.latitude = res.lat;
|
||||||
this.searchparams.longitude = res.lon;
|
// this.searchparams.longitude = res.lon;
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (!this.$isWechat()) {
|
||||||
this.$geo.getWebGeo().then(res => {
|
this.$geo.getWebGeo().then(res => {
|
||||||
this.searchparams.latitude = res.lat;
|
this.searchparams.latitude = res.lat;
|
||||||
this.searchparams.longitude = res.lon;
|
this.searchparams.longitude = res.lon;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user