|
|
@@ -13,9 +13,15 @@ Page({
|
|
|
authModal: false,
|
|
|
modalText: "位置",
|
|
|
cw: '',
|
|
|
- ch: ''
|
|
|
+ ch: '',
|
|
|
+ disabled: false
|
|
|
},
|
|
|
- test() {
|
|
|
+ takeBill() {
|
|
|
+ if (this.data.disabled) return
|
|
|
+ wx.showLoading({
|
|
|
+ title: '正在上传...',
|
|
|
+ })
|
|
|
+ this.data.disabled = true
|
|
|
const ctx = wx.createCameraContext()
|
|
|
ctx.takePhoto({
|
|
|
quality: 'high',
|
|
|
@@ -75,14 +81,20 @@ Page({
|
|
|
success: async e => {
|
|
|
let res = await uploadFile(e.tempFilePath, {
|
|
|
type: 0,
|
|
|
- // userId: wx.getStorageSync('userId'),
|
|
|
- userId: 89,
|
|
|
+ userId: wx.getStorageSync('userId'),
|
|
|
+ // userId: 89,
|
|
|
location: ''
|
|
|
})
|
|
|
+ wx.hideLoading({
|
|
|
+ success: (res) => {},
|
|
|
+ })
|
|
|
wx.showToast({
|
|
|
title: res.msg,
|
|
|
})
|
|
|
- this.goBack()
|
|
|
+ setTimeout(() => {
|
|
|
+ this.data.disabled = false
|
|
|
+ this.goBack()
|
|
|
+ }, 1000)
|
|
|
},
|
|
|
fail(res) {
|
|
|
console.log('fail');
|