fix: 取消更新后登录页不再自动弹框,等级改为非必填并升至1.1.17

This commit is contained in:
2026-11-01 17:54:32 +08:00
parent 7adec1b960
commit 61bb43f759
6 changed files with 26 additions and 13 deletions
+2 -2
View File
@@ -2,8 +2,8 @@
"name" : "浩拓织厂",
"appid" : "__UNI__F79F300",
"description" : "周尚-浩拓织厂",
"versionName" : "1.1.16",
"versionCode" : 116,
"versionName" : "1.1.17",
"versionCode" : 117,
"transformPx" : false,
"app-plus" : {
"optimization" : {
@@ -376,10 +376,6 @@ export default {
return;
}
const levelIds = normalizeLevelIds(this.detail.grey_fabric_level_id);
if (!levelIds.length) {
this.$u.toast('请选择等级');
return;
}
if (this.submitting) return;
this.submitting = true;
try {
@@ -387,8 +383,10 @@ export default {
fabric_piece_code: fabricPieceCode,
actual_weight: actualWeight,
electronic_scale_weight: actualWeight,
grey_fabric_level_id: levelIds,
};
if (levelIds.length) {
payload.grey_fabric_level_id = levelIds;
}
const inspectorName = String(this.detail.inspector_name || '').trim();
if (inspectorName) {
payload.inspector_name = inspectorName;
+9 -1
View File
@@ -431,10 +431,18 @@ export default {
return { status: 0 };
}
// 用户已取消过该版本:登录页自动检查不再弹框
const dismissedVersion = uni.getStorageSync('appUpdateDismissedVersion');
if (dismissedVersion && String(dismissedVersion) === String(res.latest_version)) {
console.log('用户已取消该版本更新,跳过自动弹框:', dismissedVersion);
return { status: 0 };
}
return {
changelog: res.message + ',最新版本:' + res.latest_version,
status: res.need_update ? 1 : 0, // 0 无新版本 | 1 有新版本
path: res.download_url // 新apk地址
path: res.download_url, // 新apk地址
latest_version: res.latest_version
};
} catch (error) {
console.log('检查版本更新失败:', error);
+2 -1
View File
@@ -133,7 +133,8 @@ export default {
return {
changelog: res.message + ',最新版本:' + res.latest_version,
status: res.need_update ? 1 : 0,
path: res.download_url
path: res.download_url,
latest_version: res.latest_version
};
}, 1);
// #endif
+8 -3
View File
@@ -37,11 +37,12 @@ class AppDialog {
}
// 显示
show(apkUrl, changelog) {
show(apkUrl, changelog, latestVersion = '') {
this.drawView(changelog)
this.maskEl.show()
this.popupEl.show()
this.apkUrl = apkUrl;
this.latestVersion = latestVersion || '';
}
// 隐藏
@@ -309,8 +310,12 @@ class AppDialog {
const buttonWidth = (this.viewWidth - this.viewPadding) / 2;
if (e.clientY > maxTop - 40 && e.clientY < maxTop) {
if (showCancel) {
// 取消
// if(e.clientX>this.viewPadding && e.clientX<maxLeft-buttonWidth-this.viewPadding){}
// 取消:记住已跳过的版本,登录页自动检查不再弹出
if (e.clientX > this.viewPadding && e.clientX < this.viewPadding + buttonWidth) {
if (this.latestVersion) {
uni.setStorageSync('appUpdateDismissedVersion', String(this.latestVersion));
}
}
// 确定
if (e.clientX > maxLeft - buttonWidth && e.clientX < maxLeft) {
upgrade.checkOs(this.apkUrl)
+2 -1
View File
@@ -40,7 +40,8 @@ class CheckUpate{
if(res.status===1){
const path=res.path || '';
const changeLog=res.changelog || '';
appDialog.show(path,changeLog);
const latestVersion=res.latest_version || '';
appDialog.show(path,changeLog,latestVersion);
}
})
this.storageTimeStamp()