Przeglądaj źródła

全民护河

tags/v1.6.0^2
yufei111 2 lat temu
rodzic
commit
d441523df2
3 zmienionych plików z 57 dodań i 53 usunięć
  1. +55
    -51
      package_A/pages/report/index.js
  2. +1
    -1
      package_A/pages/report/index.wxml
  3. +1
    -1
      package_B/pages/feedbackDetail/index.wxml

+ 55
- 51
package_A/pages/report/index.js Wyświetl plik

@@ -223,62 +223,66 @@ Page({
/* 表单上传 */
submit(){
this.validateForm().then(res => {
let ossForm = this.data.ossForm
let temp = []
if (this.data.imageList.length > 0) {
wx.showLoading({title:"上传中",mask:true})
temp = this.data.imageList.map(item => {
// 设置文件上传路径
const randomString = Math.random().toString(36).slice(2)
const timestamp = new Date().getTime()
const key = `imagedir/${randomString}_${timestamp}.png`
// 上传图片
return new Promise((resolve, reject)=> {
wx.uploadFile({
url: 'https://ta-tech-image.oss-cn-shanghai.aliyuncs.com',
filePath: item,
name: 'file',
formData: {
key,
OSSAccessKeyId: ossForm.OSSAccessKeyId,
signature: ossForm.signature,
policy: ossForm.policy,
'x-oss-security-token': ossForm.SecurityToken
},
success: (res)=> {
if(res.statusCode === 204) {
// 上传成功,将图片路径resolve出去
resolve(key)
} else {
wx.showToast({
title: '图片上传失败',
})
if(res) {
let ossForm = this.data.ossForm
let temp = []
if (this.data.imageList.length > 0) {
wx.showLoading({title:"上传中",mask:true})
temp = this.data.imageList.map(item => {
// 设置文件上传路径
const randomString = Math.random().toString(36).slice(2)
const timestamp = new Date().getTime()
const key = `imagedir/${randomString}_${timestamp}.png`
// 上传图片
return new Promise((resolve, reject)=> {
wx.uploadFile({
url: 'https://ta-tech-image.oss-cn-shanghai.aliyuncs.com',
filePath: item,
name: 'file',
formData: {
key,
OSSAccessKeyId: ossForm.OSSAccessKeyId,
signature: ossForm.signature,
policy: ossForm.policy,
'x-oss-security-token': ossForm.SecurityToken
},
success: (res)=> {
if(res.statusCode === 204) {
// 上传成功,将图片路径resolve出去
resolve(key)
} else {
wx.showToast({
title: '图片上传失败',
})
reject('图片上传失败')
}
},
fail: (e)=> {
console.log(e);
reject('图片上传失败')
}
},
fail: (e)=> {
console.log(e);
reject('图片上传失败')
}
})
})
})
})
Promise.all(temp).then((res)=> {
let form = this.data.form;
form.feedbackUrl = res.join(',')
feedbackPosition(form).then(res => {
if (res.code === 0) {
wx.reLaunch({
url: '/package_A/pages/submitSuccess/index',
})
}
}).finally(()=>{
wx.hideLoading();
Promise.all(temp).then((res)=> {
let form = this.data.form;
form.feedbackUrl = res.join(',')
feedbackPosition(form).then(res => {
if (res.code === 0) {
wx.reLaunch({
url: '/package_A/pages/submitSuccess/index',
})
}
}).finally(()=>{
wx.hideLoading();
})
}).catch(()=> {
wx.hideLoading()
})
}).catch(()=> {
wx.hideLoading()
})
}
}
})

+ 1
- 1
package_A/pages/report/index.wxml Wyświetl plik

@@ -2,7 +2,7 @@
<view class="upload_container">
<image class="head_img" mode="widthFix" src="../../../assets/img/upload_head.png"></image>
<view class="form_container">
<view class="form_item">
<view class="form_item">
<text><text style="color: red;">*</text>选择河道:</text>
<view class="value_box disable_class">
<text class="picker_text">{{form.streamName}}</text>

+ 1
- 1
package_B/pages/feedbackDetail/index.wxml Wyświetl plik

@@ -29,7 +29,7 @@
</view>
<view class="detail_item">
<view class="item_title">处理人:</view>
<text class="item_value">{{dataSource.streamAdminName || ''}}</text>
<text class="item_value">{{dataSource.realname || ''}}</text>
</view>
<view class="image_list">
<view class="item_title">处理结果:</view>

Ładowanie…
Anuluj
Zapisz