...
|
...
|
@@ -31,16 +31,16 @@ Page({ |
|
|
upimg: function() {
|
|
|
let that = this
|
|
|
let imgarr = that.data.imgarr
|
|
|
let allow_image = 6 - that.data.imgarr.length
|
|
|
let allow_image = 9 - that.data.imgarr.length
|
|
|
if (allow_image == 0) {
|
|
|
wx.showToast({
|
|
|
title: '最多添加6张图片',
|
|
|
title: '最多添加9张图片',
|
|
|
icon: 'none',
|
|
|
duration: 1000
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
wx.chooseImage({
|
|
|
wx. ({
|
|
|
count: allow_image,
|
|
|
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
|
|
|
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
|
...
|
...
|
@@ -53,6 +53,10 @@ Page({ |
|
|
},
|
|
|
// 图片上传
|
|
|
upload_img(imgarr) {
|
|
|
wx.showLoading({
|
|
|
title: '提交中',
|
|
|
mask: true
|
|
|
})
|
|
|
let that = this
|
|
|
let myimgurl = that.data.myimgurl
|
|
|
let header = {
|
...
|
...
|
@@ -76,6 +80,7 @@ Page({ |
|
|
myimgurl: myimgurl
|
|
|
})
|
|
|
if (that.data.myimgurl.length == imgarr.length){
|
|
|
wx.hideLoading()
|
|
|
that.push()
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -133,6 +138,10 @@ Page({ |
|
|
},
|
|
|
push(){
|
|
|
let that = this
|
|
|
wx.showLoading({
|
|
|
title: '提交中',
|
|
|
mask: true
|
|
|
})
|
|
|
let url = 'index/index/sginIn'
|
|
|
let params = {
|
|
|
id: that.data.id,
|
...
|
...
|
@@ -145,6 +154,7 @@ Page({ |
|
|
'XX-Token': wx.getStorageSync('token')
|
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
wx.hideLoading()
|
|
|
wx.showToast({
|
|
|
title: '提交成功',
|
|
|
duration: 1000,
|
...
|
...
|
|