main
lion 9 months ago
parent 75952b14b1
commit 75407dc8f1

@ -264,8 +264,8 @@
// 模拟微信登录(仅用于本地测试) // 模拟微信登录(仅用于本地测试)
mockAccountLogin(username, password) { mockAccountLogin(username, password) {
// uni.setStorageSync('token', "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3h1a291c2h1bml1LjExNS5sYW5neWUubmV0L2FwaS9jdXN0b21lci9sb2dpbi1ieS13ZWNoYXQtY29kZSIsImlhdCI6MTc2OTM4OTc4NiwiZXhwIjoxNzY5MzkzMzg2LCJuYmYiOjE3NjkzODk3ODYsImp0aSI6IjRTM085ZlF4RTF0bkhOeFoiLCJzdWIiOiIxNiIsInBydiI6IjFkMGEwMjBhY2Y1YzRiNmM0OTc5ODlkZjFhYmYwZmJkNGU4YzhkNjMifQ.FA77-z6ETJqbsN2O7RD-xcR9NsKVxkk3GN5GGeJBu8g") uni.setStorageSync('token', "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3h1a291c2h1bml1LjExNS5sYW5neWUubmV0L2FwaS9jdXN0b21lci9sb2dpbi1ieS13ZWNoYXQtY29kZSIsImlhdCI6MTc2OTY3OTExMCwiZXhwIjoxNzY5NjgyNzEwLCJuYmYiOjE3Njk2NzkxMTAsImp0aSI6Iks5MmRBc3Q5TDZaWUlMZ0EiLCJzdWIiOiIxNiIsInBydiI6IjFkMGEwMjBhY2Y1YzRiNmM0OTc5ODlkZjFhYmYwZmJkNGU4YzhkNjMifQ.FpSIvyHtemsAVM4cymHp18kysPyeonqIgl-y-jdI4d0")
// return; return;
uni.request({ uni.request({
url: API.LOGIN_ACCOUNT, url: API.LOGIN_ACCOUNT,
method: 'GET', method: 'GET',

@ -284,6 +284,41 @@
</view> </view>
</view> </view>
</view> </view>
<view class="divider"></view>
<!-- 第四页 -->
<view class="upload-section">
<text class="form-label required">第四页</text>
<view class="upload-row">
<view class="upload-img-box">
<image v-if="page4Img" :src="page4Img" class="upload-img" />
<view v-else class="upload-add" @click="chooseImage('page4')">
<text>+</text>
<text>添加图片</text>
</view>
<view
v-if="page4Img"
class="upload-del"
@click="deleteImage('page4')"
>×</view
>
</view>
<view class="upload-desc">
<view v-if="getExampleByIndex(3)" class="example-info">
<image
v-if="getExampleByIndex(3).image_url"
:src="getExampleByIndex(3).image_url"
class="example-img"
mode="aspectFit"
@click="previewExample(getExampleByIndex(3).image_url)"
></image>
<text class="example-text">{{
getExampleByIndex(3).description || "第四页相关说明"
}}</text>
</view>
<text v-else class="example-text">第四页相关说明</text>
</view>
</view>
</view>
</view> </view>
<!-- 第四步:签名确认 --> <!-- 第四步:签名确认 -->
<view v-if="currentStep === 4" class="info-card"> <view v-if="currentStep === 4" class="info-card">
@ -382,9 +417,11 @@ export default {
page1Img: "", page1Img: "",
page2Img: "", page2Img: "",
page3Img: "", page3Img: "",
page4Img: "",
originalPage1Img: "", originalPage1Img: "",
originalPage2Img: "", originalPage2Img: "",
originalPage3Img: "", originalPage3Img: "",
originalPage4Img: "",
signChecked: false, signChecked: false,
signImg: "", signImg: "",
isSigning: false, isSigning: false,
@ -416,6 +453,7 @@ export default {
page1FileId: "", page1FileId: "",
page2FileId: "", page2FileId: "",
page3FileId: "", page3FileId: "",
page4FileId: "",
}, },
isWeixinBrowser: false, isWeixinBrowser: false,
}; };
@ -805,6 +843,14 @@ export default {
const page3Result = await this.uploadFile(this.page3Img); const page3Result = await this.uploadFile(this.page3Img);
this.form.page3FileId = page3Result.data.id; this.form.page3FileId = page3Result.data.id;
} }
// 检查第四页是否需要上传
if (
this.page4Img !== this.originalPage4Img ||
!this.form.page4FileId
) {
const page4Result = await this.uploadFile(this.page4Img);
this.form.page4FileId = page4Result.data.id;
}
uni.hideLoading(); uni.hideLoading();
} catch (error) { } catch (error) {
uni.hideLoading(); uni.hideLoading();
@ -865,6 +911,7 @@ export default {
picture1: this.form.page1FileId, picture1: this.form.page1FileId,
picture2: this.form.page2FileId, picture2: this.form.page2FileId,
picture3: this.form.page3FileId, picture3: this.form.page3FileId,
picture4: this.form.page4FileId,
signature: signValue, signature: signValue,
}; };
@ -945,6 +992,10 @@ export default {
this.page3Img = res.tempFilePaths[0]; this.page3Img = res.tempFilePaths[0];
this.originalPage3Img = res.tempFilePaths[0]; this.originalPage3Img = res.tempFilePaths[0];
} }
if (page === "page4") {
this.page4Img = res.tempFilePaths[0];
this.originalPage4Img = res.tempFilePaths[0];
}
}, },
}); });
}, },
@ -964,11 +1015,16 @@ export default {
this.originalPage3Img = ""; this.originalPage3Img = "";
this.form.page3FileId = ""; this.form.page3FileId = "";
} }
if (page === "page4") {
this.page4Img = "";
this.originalPage4Img = "";
this.form.page4FileId = "";
}
}, },
viewExample() { viewExample() {
uni.showToast({ title: "查看示例", icon: "none" }); uni.showToast({ title: "查看示例", icon: "none" });
}, },
// 根据索引获取对应的示例数据(直接按数组顺序,最多显示前3条) // 根据索引获取对应的示例数据(直接按数组顺序,可按需扩展)
getExampleByIndex(index) { getExampleByIndex(index) {
if ( if (
!Array.isArray(this.shipInspectionExamples) || !Array.isArray(this.shipInspectionExamples) ||
@ -976,8 +1032,8 @@ export default {
) { ) {
return null; return null;
} }
// 只显示前3条数据,索引范围 0-2 // 安全范围校验(当前最多支持到 index 3,即前4条)
if (index < 0 || index >= 3) { if (index < 0 || index >= 4) {
return null; return null;
} }
// 如果索引超出数组长度,返回 null // 如果索引超出数组长度,返回 null

@ -39,6 +39,10 @@
<text>第三页</text> <text>第三页</text>
<image :src="ship.picture3_file ? ship.picture3_file.url : ''" style="width:80px;height:80px;" mode="aspectFill" /> <image :src="ship.picture3_file ? ship.picture3_file.url : ''" style="width:80px;height:80px;" mode="aspectFill" />
</view> </view>
<view class="section-row">
<text>第四页</text>
<image :src="ship.picture4_file ? ship.picture4_file.url : ''" style="width:80px;height:80px;" mode="aspectFill" />
</view>
</view> </view>
<view v-if="ship" class="ship-section"> <view v-if="ship" class="ship-section">
<view class="section-title">签名确认</view> <view class="section-title">签名确认</view>

@ -1,2 +1,2 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>胥口闸站购票</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) <!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>胥口闸站购票</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/h5/static/index.883130ca.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/h5/static/js/chunk-vendors.f93c9f80.js></script><script src=/h5/static/js/index.27b8ce93.js></script></body></html> document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/h5/static/index.883130ca.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/h5/static/js/chunk-vendors.f93c9f80.js></script><script src=/h5/static/js/index.1f404e4e.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save