微信支付支持小数点

This commit is contained in:
qiaomu 2024-04-12 09:06:42 +08:00
parent 7992762a35
commit cfeba9bef3
2 changed files with 4 additions and 4 deletions

View File

@ -117,11 +117,11 @@ Page({
changeMoney(e) { changeMoney(e) {
const { money } = e.currentTarget.dataset; const { money } = e.currentTarget.dataset;
this.setData({ this.setData({
money: Number(money) money: money
}) })
}, },
onChangeMoney(e) { onChangeMoney(e) {
this.setData({ money: e.detail ? Number(e.detail) : e.detail }) this.setData({ money: e.detail })
}, },
async recharge() { async recharge() {
const { user, money, meter, tenement, park } = this.data; const { user, money, meter, tenement, park } = this.data;
@ -134,7 +134,7 @@ Page({
return; return;
} }
console.log('this.data', this.data) console.log('this.data', this.data)
const { code, message, data } = await requestRecharge({ money, meter: meter.code, tenement: tenement.id, park: park.id }) const { code, message, data } = await requestRecharge({ money: Number(money), meter: meter.code, tenement: tenement.id, park: park.id })
if (code !== OK) { if (code !== OK) {
alertInfo(message) alertInfo(message)
return; return;

View File

@ -79,7 +79,7 @@
border="{{true}}" border="{{true}}"
bind:change="onChangeMoney" bind:change="onChangeMoney"
size="large" size="large"
type="number" type="digit"
/> />
</view> </view>
</view> </view>