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({ ...@@ -205,6 +205,10 @@ Page({
getStatByStatus() { getStatByStatus() {
let { tabList, tabListTemplate } = this.data let { tabList, tabListTemplate } = this.data
const obj = this.getParams() const obj = this.getParams()
// 切换tab或状态值在tabList中,无需传参施工状态
if (obj.constructionStatus != 2) {
delete obj.constructionStatus
}
api api
.statByStatus(obj) .statByStatus(obj)
.then((result) => { .then((result) => {
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</block> </block>
</view> </view>
<view class="duration"> <view class="duration">
<text class="label">施工时长</text> <text class="label">总施工时长</text>
<block> <block>
{{li.constructionDuration !== null && li.constructionDuration !== undefined ? li.constructionDuration : '-'}}<text class="unit">分钟</text> {{li.constructionDuration !== null && li.constructionDuration !== undefined ? li.constructionDuration : '-'}}<text class="unit">分钟</text>
</block> </block>
......
...@@ -586,39 +586,50 @@ Page({ ...@@ -586,39 +586,50 @@ Page({
// 上传施工图 // 上传施工图
handleUpload(e) { handleUpload(e) {
let that = this let _this = this
let { index } = e.currentTarget.dataset let { index } = e.currentTarget.dataset
let { detailInfo } = this.data let { detailInfo } = this.data
wx.chooseImage({ wx.chooseImage({
count: 1, count: 9 - detailInfo.pictureList?.length,
mediaType: ['image'],
success(res) { 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({ wx.showLoading({
title: '上传中...', title: '上传中...',
}) })
uploadImg({ 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}` file: `${type}@${_res.data}`
}).then(img => { })
wx.hideLoading() const { code, data, message } = img
let { code, data, message } = img
if (code == 0) { if (code == 0) {
detailInfo.pictureList.push(data) detailInfo.pictureList.push(data)
that.setData({ _this.setData({
detailInfo detailInfo
}) })
} else { } else {
wx.$util.showToast(message) wx.$util.showToast(message)
} }
})
} }
}) } catch (error) {
wx.$util.showToast("上传失败,请重试")
} finally {
wx.hideLoading()
}
}
uploadImages(res?.tempFiles)
} }
}) })
}, },
......
...@@ -162,8 +162,10 @@ page { ...@@ -162,8 +162,10 @@ page {
font-weight: 500; font-weight: 500;
font-size: var(--fontSize18); font-size: var(--fontSize18);
color: #35C376; color: #35C376;
border: 1px solid #35C376; border: var(--fontSize2) solid #35C376;
line-height: var(--fontSize26); display: flex;
align-items: center;
justify-content: center;
text-align: center; text-align: center;
border-radius: var(--fontSize4); 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!