Browse Source

全民护河

tags/v1.6.0^2
yufei111 2 years ago
parent
commit
d441523df2
3 changed files with 57 additions and 53 deletions
  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 View File

/* 表单上传 */ /* 表单上传 */
submit(){ submit(){
this.validateForm().then(res => { 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('图片上传失败') 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 View File

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

+ 1
- 1
package_B/pages/feedbackDetail/index.wxml View File

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

Loading…
Cancel
Save