微信支付支持小数点

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) {
const { money } = e.currentTarget.dataset;
this.setData({
money: Number(money)
money: money
})
},
onChangeMoney(e) {
this.setData({ money: e.detail ? Number(e.detail) : e.detail })
this.setData({ money: e.detail })
},
async recharge() {
const { user, money, meter, tenement, park } = this.data;
@ -134,7 +134,7 @@ Page({
return;
}
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) {
alertInfo(message)
return;

View File

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