feat: 保洁详情
This commit is contained in:
parent
a569565bfb
commit
b306ba4cdb
|
@ -44,9 +44,8 @@ export const ReportingNFCDanger = (data) =>
|
|||
request.post("/api/App/ReportingNFCDanger", data);
|
||||
|
||||
// 上传图片
|
||||
export const UploadFiles = (formData) =>
|
||||
request.upload("/api/App/UploadFiles", formData);
|
||||
export const UploadFiles = (fileList, params) =>
|
||||
request.upload("/api/App/UploadFiles", fileList, params);
|
||||
|
||||
// 修改上传接口定义
|
||||
export const UploadArea = (fileList, formData) =>
|
||||
request.upload("/api/App/UploadArea", fileList, formData);
|
||||
export const UploadArea = (data) => request.post("/api/App/UploadArea", data);
|
||||
|
|
|
@ -2,10 +2,12 @@ let BASE_URL
|
|||
//开发环境中
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// 开发环境
|
||||
BASE_URL = 'http://10.30.2.228:8556' //开发环境请求地址
|
||||
// BASE_URL = 'http://10.30.2.228:8556' //开发环境请求地址
|
||||
BASE_URL = 'http://sl.vrgon.com:8005' //开发环境请求地址
|
||||
} else {
|
||||
// 生产环境
|
||||
BASE_URL = 'http://10.30.2.228:8556' //生成环境请求地址
|
||||
// BASE_URL = 'http://10.30.2.228:8556' //生成环境请求地址
|
||||
BASE_URL = 'http://sl.vrgon.com:8005' //生成环境请求地址
|
||||
}
|
||||
|
||||
export default BASE_URL
|
|
@ -2,64 +2,78 @@
|
|||
<view class="content">
|
||||
<u-navbar title="保洁详情"></u-navbar>
|
||||
<view class="area-info">
|
||||
<view class="name">保洁区域名称</view>
|
||||
<view class="position">所在区域:学校操场</view>
|
||||
<view class="name">{{ dataInfo.name }}</view>
|
||||
<view class="position">所属计划:{{ dataInfo.planName }}</view>
|
||||
</view>
|
||||
<view class="area-details">
|
||||
<view class="title">区域详情</view>
|
||||
<view class="details">
|
||||
<view class="block">
|
||||
<view class="value">室内/室外</view>
|
||||
<view class="value"> {{ dataInfo.areaType }}</view>
|
||||
<view class="label">区域类型</view>
|
||||
</view>
|
||||
<view class="block">
|
||||
<view class="value">保洁员1号</view>
|
||||
<view class="value">{{ dataInfo.userName }}</view>
|
||||
<view class="label">保洁人员</view>
|
||||
</view>
|
||||
<view class="block">
|
||||
<view class="value">2024/1/27 9:53:35</view>
|
||||
<view class="value">{{ dataInfo.cleanTime }}</view>
|
||||
<view class="label">清扫时间</view>
|
||||
</view>
|
||||
<view class="block">
|
||||
<view class="value">清扫完成</view>
|
||||
<view class="value">{{ dataInfo.note }}</view>
|
||||
<view class="label">备注</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="title">保洁区域图片</view>
|
||||
<view class="images">
|
||||
<u-image
|
||||
<image
|
||||
class="image"
|
||||
v-for="(v, i) in 7"
|
||||
v-for="(v, i) in dataInfo.pictures"
|
||||
:key="i"
|
||||
width="212rpx"
|
||||
height="212rpx"
|
||||
src="https://cdn.uviewui.com/uview/example/fade.jpg"
|
||||
></u-image>
|
||||
mode="scaleToFill"
|
||||
style="width: 180rpx; height: 180rpx; border-radius: 18rpx"
|
||||
:src="BASE_URL + '/uploads/' + v.path"
|
||||
></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BASE_URL from "@/api/env.js"; //引入接口共用地址
|
||||
import { GetPlanInfoAre } from "@/api/apiList";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: "",
|
||||
|
||||
params: {},
|
||||
|
||||
dataInfo: {},
|
||||
|
||||
BASE_URL,
|
||||
};
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
this.id = options.id;
|
||||
console.log("options", JSON.parse(decodeURIComponent(options.params)));
|
||||
this.params = JSON.parse(decodeURIComponent(options.params));
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.getAreaInfo();
|
||||
},
|
||||
|
||||
methods: {
|
||||
async getAreaInfo() {
|
||||
const res = await GetPlanInfoAre({
|
||||
id: this.id,
|
||||
id: this.params.id,
|
||||
});
|
||||
console.log(res);
|
||||
|
||||
if (res.succeed) {
|
||||
this.dataInfo = res.data;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -123,11 +137,11 @@ export default {
|
|||
}
|
||||
}
|
||||
.images {
|
||||
margin-top: 46rpx;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, 212rpx);
|
||||
gap: 20rpx; // 图片间距
|
||||
}
|
||||
margin-top: 46rpx;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, 212rpx);
|
||||
gap: 20rpx; // 图片间距
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="arealist" v-if="dataInfo.areas.length > 0">
|
||||
<view class="block-info" v-for="item in dataInfo.areas" :key="item.id">
|
||||
<view class="block-info" v-for="item in dataInfo.areas" :key="item.id" @click="toItemPage(item)">
|
||||
<view v-if="!item.isCompleted" class="schedule schedule-wait"
|
||||
>待保洁</view
|
||||
>
|
||||
|
@ -57,7 +57,13 @@
|
|||
:text="item.areaType"
|
||||
class="tag"
|
||||
border-color="transparent"
|
||||
:type="item.areaType === '室外' ? 'success' : 'primary'"
|
||||
:type="
|
||||
item.areaType === '室外'
|
||||
? 'success'
|
||||
: item.areaType === '特殊'
|
||||
? 'warning'
|
||||
: 'primary'
|
||||
"
|
||||
/>
|
||||
<!-- 特殊先隐藏,没有这个字段 -->
|
||||
<!-- <u-tag text="特殊" border-color="transparent" type="warning" /> -->
|
||||
|
@ -212,7 +218,9 @@ export default {
|
|||
// 先关闭弹窗再跳转
|
||||
this.successShow = false;
|
||||
uni.navigateTo({
|
||||
url: "/pages/index/uploadPhoto?params=" + encodeURIComponent(JSON.stringify(params)),
|
||||
url:
|
||||
"/pages/index/uploadPhoto?params=" +
|
||||
encodeURIComponent(JSON.stringify(params)),
|
||||
});
|
||||
},
|
||||
// 异常上报
|
||||
|
@ -225,6 +233,14 @@ export default {
|
|||
url: "/pages/index/list",
|
||||
});
|
||||
},
|
||||
|
||||
toItemPage(item) {
|
||||
console.log("%c%s", "color:red", "跳转至详情页");
|
||||
uni.navigateTo({
|
||||
url: "/pages/index/cleanDetails?params=" + encodeURIComponent(JSON.stringify(item)),
|
||||
});
|
||||
},
|
||||
|
||||
openFn() {},
|
||||
closeFn() {},
|
||||
changeTab(i) {
|
||||
|
|
|
@ -141,7 +141,7 @@ export default {
|
|||
uni.chooseImage({
|
||||
count: 1, // 每次拍摄1张
|
||||
sourceType: ["camera"], // 仅限拍照
|
||||
sizeType: ["compressed"], // 压缩图片
|
||||
sizeType: ["compressed", "original"],
|
||||
success: async (res) => {
|
||||
// console.log("拍照成功", res);
|
||||
this.imageList = [...this.imageList, res.tempFilePaths[0]];
|
||||
|
@ -153,8 +153,8 @@ export default {
|
|||
},
|
||||
|
||||
// 上传图片
|
||||
async uploadFiles(filePath) {
|
||||
const res = await UploadFiles(filePath);
|
||||
async uploadFiles() {
|
||||
const res = await UploadFiles(this.imageList);
|
||||
if (res.succeed) {
|
||||
this.imageList = [...this.imageList, res.data];
|
||||
}
|
||||
|
@ -180,17 +180,23 @@ export default {
|
|||
return;
|
||||
}
|
||||
|
||||
const res = await UploadArea(
|
||||
this.imageList, // 文件路径数组
|
||||
{
|
||||
id: this.params.areaId,
|
||||
note: this.remark,
|
||||
}
|
||||
);
|
||||
const params = {
|
||||
id: this.params.areaId,
|
||||
note: this.remark,
|
||||
picturesDto: [],
|
||||
};
|
||||
|
||||
const res = await UploadFiles(this.imageList);
|
||||
if (res.succeed) {
|
||||
params.picturesDto = res.data;
|
||||
}
|
||||
|
||||
const res2 = await UploadArea(params);
|
||||
if (res2.succeed) {
|
||||
// 成功的处理
|
||||
uni.showToast({ title: "上传成功", icon: "success" });
|
||||
} else {
|
||||
uni.showToast({ title: res2.error || "上传失败", icon: "none" });
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue