Commit 275162a1 by 张立顺

Merge branch 'SAAS+V5.1.0' of http://192.168.3.233:8090/saas_plus/dj-car-boutiqu…

…e-work-wechat into SAAS+V5.1.0
2 parents 10072a9b b36e0371
......@@ -205,6 +205,10 @@ Page({
getStatByStatus() {
let { tabList, tabListTemplate } = this.data
const obj = this.getParams()
// 切换tab或状态值在tabList中,无需传参施工状态
if (obj.constructionStatus != 2) {
delete obj.constructionStatus
}
api
.statByStatus(obj)
.then((result) => {
......
......@@ -101,7 +101,7 @@
</block>
</view>
<view class="duration">
<text class="label">施工时长</text>
<text class="label">总施工时长</text>
<block>
{{li.constructionDuration !== null && li.constructionDuration !== undefined ? li.constructionDuration : '-'}}<text class="unit">分钟</text>
</block>
......
......@@ -586,39 +586,50 @@ Page({
// 上传施工图
handleUpload(e) {
let that = this
let _this = this
let { index } = e.currentTarget.dataset
let { detailInfo } = this.data
wx.chooseImage({
count: 1,
count: 9 - detailInfo.pictureList?.length,
mediaType: ['image'],
success(res) {
let [tempFiles] = res.tempFilePaths
let tempFilesList = tempFiles.split('.')
let imgType = tempFilesList[tempFilesList.length - 1]
let type = imgType == 'unknown' ? 'jpg' : imgType
wx.getFileSystemManager().readFile({
filePath: tempFiles, //选择图片返回的相对路径
encoding: 'base64', //编码格式
success(_res) {
wx.showLoading({
title: '上传中...',
})
uploadImg({
file: `${type}@${_res.data}`
}).then(img => {
wx.hideLoading()
let { code, data, message } = img
wx.showLoading({
title: '上传中...',
})
const uploadImages = async (tempFiles) => {
try {
for (const item of tempFiles) {
const val = item.path
const imgType = val.split('.')[1]
const type = imgType === 'unknown' ? 'jpg' : imgType
const _res = await new Promise((resolve, reject) => {
wx.getFileSystemManager().readFile({
filePath: val, // 选择图片返回的相对路径
encoding: 'base64', // 编码格式
success: resolve,
fail: reject
})
})
const img = await uploadImg({
file: `${type}@${_res.data}`
})
const { code, data, message } = img
if (code == 0) {
detailInfo.pictureList.push(data)
that.setData({
_this.setData({
detailInfo
})
} else {
wx.$util.showToast(message)
}
})
}
} catch (error) {
wx.$util.showToast("上传失败,请重试")
} finally {
wx.hideLoading()
}
})
}
uploadImages(res?.tempFiles)
}
})
},
......
......@@ -162,8 +162,10 @@ page {
font-weight: 500;
font-size: var(--fontSize18);
color: #35C376;
border: 1px solid #35C376;
line-height: var(--fontSize26);
border: var(--fontSize2) solid #35C376;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
border-radius: var(--fontSize4);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!