main
scout 2 months ago
parent 4db5fa0085
commit 641364d8e9

@ -52,7 +52,7 @@ export default {
response = newResponse; response = newResponse;
} }
} }
if (response.data.status === 401) { if (response.data.code === 401) {
// 若token过期则尝试获取RefreshToken重新获取token // 若token过期则尝试获取RefreshToken重新获取token
const newToken = await this.getRefreshToken(); const newToken = await this.getRefreshToken();
if (newToken) { if (newToken) {

@ -1,5 +1,5 @@
{ {
"name" : "sing-h5", "name" : "repair-h5",
"appid" : "__UNI__9473E40", "appid" : "__UNI__9473E40",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",

@ -38,7 +38,7 @@
</view> </view>
<view class="item"> <view class="item">
<view class="sub1">画作类型</view> <view class="sub1">画作类型</view>
<view class="sub2">{{ detailData.ArtworkType }}</view> <view class="sub2">{{ artworkTyoeDict[detailData.ArtworkType] }}</view>
</view> </view>
</view> </view>
<view class="list"> <view class="list">
@ -78,6 +78,7 @@
:fileList="fileList" :fileList="fileList"
@delete="deletePic" @delete="deletePic"
@afterRead="afterRead" @afterRead="afterRead"
accept="image"
name="3" name="3"
width="100" width="100"
height="100" height="100"
@ -98,6 +99,7 @@
<u-upload <u-upload
:fileList="repFileList" :fileList="repFileList"
@delete="repDeletePic" @delete="repDeletePic"
accept="image"
@afterRead="repAfterRead" @afterRead="repAfterRead"
name="3" name="3"
width="100" width="100"
@ -114,7 +116,13 @@
></u--textarea> ></u--textarea>
</view> </view>
</view> </view>
<u-button type="primary" :loading="loading" class="search" @click="goSubmit"></u-button> <u-button
type="primary"
:loading="loading"
class="search"
@click="goSubmit"
>提交</u-button
>
</view> </view>
</view> </view>
</view> </view>
@ -139,6 +147,12 @@ export default {
repFileList: [], repFileList: [],
actName: "破损", actName: "破损",
loading: false, loading: false,
artworkTyoeDict: {
1: "优秀画作",
2: "赠画",
3: "卷轴",
4: "普通画作",
},
}; };
}, },
@ -146,6 +160,31 @@ export default {
changeTab(e) { changeTab(e) {
this.actName = e.name; this.actName = e.name;
}, },
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
const Authorization = uni.getStorageSync("repari-token");
const userId = uni.getStorageSync("repari-refresh-token").ID;
let a = uni.uploadFile({
url: this.$baseUrl + "/upload/img",
filePath: url,
name: "file",
formData: {
type: "image",
source: "user",
mask: userId,
},
header: {
Authorization,
},
success: (res) => {
console.log(res, "res");
res.data = JSON.parse(res.data);
resolve(res.data.data.ori_url);
this.uploadFlag = true;
},
});
});
},
// //
deletePic(event) { deletePic(event) {
this[`fileList`].splice(event.index, 1); this[`fileList`].splice(event.index, 1);
@ -177,32 +216,6 @@ export default {
fileListLen++; fileListLen++;
} }
}, },
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
const Authorization = uni.getStorageSync("repari-token");
const userId = uni.getStorageSync("repari-refresh-token").ID;
let a = uni.uploadFile({
url: this.$baseUrl + "/upload/img",
filePath: url,
name: "file",
formData: {
type: "image",
source: "user",
mask: userId,
},
header: {
Authorization,
},
success: (res) => {
console.log(res, "res");
res.data = JSON.parse(res.data);
resolve(res.data.data.ori_url);
this.uploadFlag = true;
},
});
});
},
// //
repDeletePic(event) { repDeletePic(event) {
this[`repFileList`].splice(event.index, 1); this[`repFileList`].splice(event.index, 1);
@ -236,54 +249,23 @@ export default {
}, },
// //
async goSubmit() { async goSubmit() {
// //
if (this.actName === "破损") { if (
if (this.fileList.length === 0) { this.fileList < 1 &&
this.$refs.uNotify.show({ this.DamagedRemark == "" &&
top: 10, this.repFileList < 1 &&
type: "error", this.RepairedRemark == ""
message: "请上传破损图片", ) {
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop: true,
});
return;
}
if (!this.DamagedRemark) {
this.$refs.uNotify.show({
top: 10,
type: "error",
message: "请填写破损备注",
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop: true,
});
return;
}
} else {
if (this.repFileList.length === 0) {
this.$refs.uNotify.show({ this.$refs.uNotify.show({
top: 10, top: 10,
type: "error", type: "error",
message: "请上传修复图片", message: "请填写破损或修复信息",
duration: 1000 * 3, duration: 1000 * 3,
fontSize: 20, fontSize: 20,
safeAreaInsetTop: true, safeAreaInsetTop: true,
}); });
return; return;
} }
if (!this.RepairedRemark) {
this.$refs.uNotify.show({
top: 10,
type: "error",
message: "请填写修复备注",
duration: 1000 * 3,
fontSize: 20,
safeAreaInsetTop: true,
});
return;
}
}
this.loading = true; this.loading = true;
let data = { let data = {
RepairID: this.detailData.RepairID, RepairID: this.detailData.RepairID,
@ -325,25 +307,27 @@ export default {
}, },
onLoad(item) { onLoad(item) {
this.detailData = JSON.parse(item.detailData); this.detailData = JSON.parse(item.detailData);
this.fileList = this.detailData.DamagedImgs ? this.detailData.DamagedImgs.map((item) => { this.fileList = this.detailData.DamagedImgs
? this.detailData.DamagedImgs.map((item) => {
return { return {
url: item, url: item,
status: "success", status: "success",
message: "", message: "",
}; };
}) : []; })
this.repFileList = this.detailData.RepairedImgs ? this.detailData.RepairedImgs.map((item) => { : [];
this.repFileList = this.detailData.RepairedImgs
? this.detailData.RepairedImgs.map((item) => {
return { return {
url: item, url: item,
status: "success", status: "success",
message: "", message: "",
}; };
}) : []; })
: [];
this.DamagedRemark = this.detailData.DamagedRemark; this.DamagedRemark = this.detailData.DamagedRemark;
this.RepairedRemark = this.detailData.RepairedRemark; this.RepairedRemark = this.detailData.RepairedRemark;
}, },
}; };
</script> </script>
@ -422,11 +406,10 @@ page {
font-size: 32rpx; font-size: 32rpx;
color: #666666; color: #666666;
margin-top: 10rpx; margin-top: 10rpx;
// //
width: 140rpx; white-space: normal;
overflow: hidden; word-wrap: break-word;
text-overflow: ellipsis; width: 200rpx;
white-space: nowrap;
} }
.sub1 { .sub1 {
font-size: 32rpx; font-size: 32rpx;

Loading…
Cancel
Save