定位 提现

This commit is contained in:
chenhao 2026-06-08 09:57:11 +08:00
parent a197797f9b
commit 9463c13b91
4 changed files with 111 additions and 89 deletions

View File

@ -111,13 +111,13 @@ export default {
wx.ready(() => {
wx.updateAppMessageShareData(shareinfo);
wx.updateTimelineShareData(shareinfo);
// wx.getLocation({
// type: 'gcj02',
// success: (e) => {
// localStorage.setItem('user_latitude', e.latitude)
// localStorage.setItem('user_longitude', e.longitude)
// }
// });
wx.getLocation({
type: 'gcj02',
success: (e) => {
localStorage.setItem('user_latitude', e.latitude)
localStorage.setItem('user_longitude', e.longitude)
}
});
});
wx.error((e) => {
});

View File

@ -9,7 +9,7 @@
<div v-if="card" class="card">
<img :src="card.bankspname === '支付宝' ? '/img/aliicon.png' : '/img/bankcardicon.png'"
height="24" width="24" style="object-fit: cover;" />
<span class="code">{{ card.bankcardnumber }}</span>
<span class="code">{{ card.realname }}({{ card.bankcardnumber }})</span>
</div>
<span v-else class="card">请选择到账账户</span>
</div>
@ -29,9 +29,9 @@
</div>
<div class="cashout-remark">
<p></p>
<p>1提现手续费{{ cashoutConfig.CommissionRate * 100 }}%</p>
<p>2最低提现金额{{ cashoutConfig.BaseCash }}</p>
<p>3提现后{{ cashoutConfig.Cycle }}个工作日内审核发放</p>
<p>1提现手续费{{ (cashoutConfig.wdfeeratio * 100)?.toFixed(2) }}%</p>
<p>2最低提现金额{{ cashoutConfig.wdnumsmin?.toFixed(2) }}</p>
<p>3提现后{{ cashoutConfig.reviewdays }}个工作日内审核发放</p>
</div>
<van-button type="danger" block round @click="cashout"
style="margin: 0 6.667vw; width: calc(100% - 13.333vw);">提现</van-button>
@ -46,7 +46,7 @@
<div class="card">
<img :src="item.bankspname === '支付宝' ? '/img/aliicon.png' : '/img/bankcardicon.png'"
height="30" width="30" style="object-fit: cover;" />
<span class="code">{{ item.bankcardnumber }}</span>
<span class="code">{{ item.realname }}({{ item.bankcardnumber }})</span>
</div>
</template>
</van-cell>
@ -83,11 +83,17 @@ export default {
},
methods: {
init() {
Promise.all([
this.$get('/v1/client/DUsersClient').then(data => {
this.wallet.Balance = data.data.zijin;
}).catch(err => {
this.$showFailToast(err.message);
});
}),
this.$get('/v1/client/DUserwithdrawsClient/param').then(res => {
this.cashoutConfig = res.data;
})
])
},
selectCard(item) {
this.card = item;
@ -99,14 +105,14 @@ export default {
this.$showFailToast('请选择到账账户');
return;
}
if (!this.form.amount || this.form.amount < this.cashoutConfig.BaseCash) {
this.$showFailToast(`提现金额必须大于${this.cashoutConfig.BaseCash}`);
if (!this.form.amount || this.form.amount < this.cashoutConfig.wdnumsmin) {
this.$showFailToast(`提现金额必须大于${this.cashoutConfig.wdnumsmin}`);
return;
}
const commission = (this.form.amount * this.cashoutConfig.CommissionRate).toFixed(2);
const commission = (this.form.amount * this.cashoutConfig.wdfeeratio).toFixed(2);
this.$showConfirmDialog({
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(() => {
this.$post('/v1/client/DUserwithdrawsClient', {
bankcardid: this.form.bankcardid,

View File

@ -11,12 +11,16 @@
<van-list class="b_l_w" v-model:loading="loading" v-show="!isEmpty" :finished="finished" finished-text="没有更多了"
@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;" />
<div class="content">
<div class="title">
<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 class="info">
<span>{{ item.realname }} {{ item.bankname }}{{ item.bankcardnumber?.substr(-4) }}</span>
@ -30,6 +34,10 @@
</div>
</div>
</div>
<div class="refund" v-if="item.reviewremark">
{{ item.reviewremark }}
</div>
</div>
</van-list>
<van-empty class="b_l_w" v-show="isEmpty" description="暂无数据" />
@ -90,9 +98,10 @@ export default {
this.list.push(...items);
this.page++;
this.finished = items.length < this.pageSize;
//
//
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(() => {
this.finished = true;
@ -101,7 +110,7 @@ export default {
});
},
getStateType(state) {
const map = { 0: 'warning', 1: 'success', 2: 'danger', 3: 'default' };
const map = { 0: 'warning', 2: 'danger', 7: 'success' };
return map[state] || 'default';
},
}
@ -130,15 +139,18 @@ export default {
padding: 3.333vw;
}
.record-box {
margin-bottom: 3.333vw;
background: #fff;
padding: 2vw 2vw;
border-radius: 1.333vw;
width: 93.333vw;
}
.record {
position: relative;
display: flex;
align-items: center;
margin-bottom: 3.333vw;
width: 93.333vw;
background: #fff;
padding: 1vw 2vw;
border-radius: 1.333vw;
}
.record .content {

View File

@ -76,8 +76,8 @@ export default {
active: 0,
categories: [],
searchparams: {
latitude: 29.309300,
longitude: 120.070380,
latitude: localStorage.getItem('user_latitude') || 29.309300,
longitude: localStorage.getItem('user_longitude') || 120.070380,
shopcateid: '',
orderby: '',
shopname: '',
@ -145,48 +145,52 @@ export default {
this.searchparams.shopname = this.searchQuery;
},
initLocation() {
if (wx && this.$isWechat()) {
this.$post('/v1/client/HWxinfoClient/share', JSON.stringify(location.href)).then(res => {
const data = res.data || {};
const jsApiList = data.jsApiList || ['getLocation'];
const openTagList = data.openTagList || ['wx-open-launch-weapp'];
jsApiList.push('wx-open-launch-weapp');
wx.config({
debug: false,
appId: data.appid,
timestamp: Number(data.timestamp) || 0,
nonceStr: data.noncestr,
signature: data.signature,
jsApiList: jsApiList,
openTagList: openTagList
});
wx.ready(() => {
wx.getLocation({
type: 'gcj02',
success: (e) => {
this.searchparams.latitude = e.latitude;
this.searchparams.longitude = e.longitude;
},
fail: (err) => {
console.log('定位失败:', err)
// this.$showToast('')
},
});
});
wx.error((e) => {
if (localStorage.getItem('latitude') && localStorage.getItem('longitude')) {
this.searchparams.latitude = localStorage.getItem('latitude');
this.searchparams.longitude = localStorage.getItem('longitude');
return
} else {
this.$geo.getWebGeo().then(res => {
this.searchparams.latitude = res.lat;
this.searchparams.longitude = res.lon;
});
}
});
});
} else {
// if (wx && this.$isWechat()) {
// this.$post('/v1/client/HWxinfoClient/share', JSON.stringify(location.href)).then(res => {
// const data = res.data || {};
// const jsApiList = data.jsApiList || ['getLocation'];
// const openTagList = data.openTagList || ['wx-open-launch-weapp'];
// jsApiList.push('wx-open-launch-weapp');
// wx.config({
// debug: false,
// appId: data.appid,
// timestamp: Number(data.timestamp) || 0,
// nonceStr: data.noncestr,
// signature: data.signature,
// jsApiList: jsApiList,
// openTagList: openTagList
// });
// wx.ready(() => {
// wx.getLocation({
// type: 'gcj02',
// success: (e) => {
// this.searchparams.latitude = e.latitude;
// this.searchparams.longitude = e.longitude;
// },
// fail: (err) => {
// console.log(':', err)
// // this.$showToast('')
// },
// });
// });
// wx.error((e) => {
// if (localStorage.getItem('latitude') && localStorage.getItem('longitude')) {
// this.searchparams.latitude = localStorage.getItem('latitude');
// this.searchparams.longitude = localStorage.getItem('longitude');
// return
// } else {
// this.$geo.getWebGeo().then(res => {
// this.searchparams.latitude = res.lat;
// this.searchparams.longitude = res.lon;
// });
// }
// });
// });
// } else {
// }
if (!this.$isWechat()) {
this.$geo.getWebGeo().then(res => {
this.searchparams.latitude = res.lat;
this.searchparams.longitude = res.lon;