fix: 取消更新后登录页不再自动弹框,等级改为非必填并升至1.1.17
This commit is contained in:
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
"name" : "浩拓织厂",
|
"name" : "浩拓织厂",
|
||||||
"appid" : "__UNI__F79F300",
|
"appid" : "__UNI__F79F300",
|
||||||
"description" : "周尚-浩拓织厂",
|
"description" : "周尚-浩拓织厂",
|
||||||
"versionName" : "1.1.16",
|
"versionName" : "1.1.17",
|
||||||
"versionCode" : 116,
|
"versionCode" : 117,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"optimization" : {
|
"optimization" : {
|
||||||
|
|||||||
@@ -376,10 +376,6 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const levelIds = normalizeLevelIds(this.detail.grey_fabric_level_id);
|
const levelIds = normalizeLevelIds(this.detail.grey_fabric_level_id);
|
||||||
if (!levelIds.length) {
|
|
||||||
this.$u.toast('请选择等级');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.submitting) return;
|
if (this.submitting) return;
|
||||||
this.submitting = true;
|
this.submitting = true;
|
||||||
try {
|
try {
|
||||||
@@ -387,8 +383,10 @@ export default {
|
|||||||
fabric_piece_code: fabricPieceCode,
|
fabric_piece_code: fabricPieceCode,
|
||||||
actual_weight: actualWeight,
|
actual_weight: actualWeight,
|
||||||
electronic_scale_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();
|
const inspectorName = String(this.detail.inspector_name || '').trim();
|
||||||
if (inspectorName) {
|
if (inspectorName) {
|
||||||
payload.inspector_name = inspectorName;
|
payload.inspector_name = inspectorName;
|
||||||
|
|||||||
@@ -431,10 +431,18 @@ export default {
|
|||||||
return { status: 0 };
|
return { status: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 用户已取消过该版本:登录页自动检查不再弹框
|
||||||
|
const dismissedVersion = uni.getStorageSync('appUpdateDismissedVersion');
|
||||||
|
if (dismissedVersion && String(dismissedVersion) === String(res.latest_version)) {
|
||||||
|
console.log('用户已取消该版本更新,跳过自动弹框:', dismissedVersion);
|
||||||
|
return { status: 0 };
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
changelog: res.message + ',最新版本:' + res.latest_version,
|
changelog: res.message + ',最新版本:' + res.latest_version,
|
||||||
status: res.need_update ? 1 : 0, // 0 无新版本 | 1 有新版本
|
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) {
|
} catch (error) {
|
||||||
console.log('检查版本更新失败:', error);
|
console.log('检查版本更新失败:', error);
|
||||||
|
|||||||
@@ -133,7 +133,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
changelog: res.message + ',最新版本:' + res.latest_version,
|
changelog: res.message + ',最新版本:' + res.latest_version,
|
||||||
status: res.need_update ? 1 : 0,
|
status: res.need_update ? 1 : 0,
|
||||||
path: res.download_url
|
path: res.download_url,
|
||||||
|
latest_version: res.latest_version
|
||||||
};
|
};
|
||||||
}, 1);
|
}, 1);
|
||||||
// #endif
|
// #endif
|
||||||
|
|||||||
@@ -37,11 +37,12 @@ class AppDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 显示
|
// 显示
|
||||||
show(apkUrl, changelog) {
|
show(apkUrl, changelog, latestVersion = '') {
|
||||||
this.drawView(changelog)
|
this.drawView(changelog)
|
||||||
this.maskEl.show()
|
this.maskEl.show()
|
||||||
this.popupEl.show()
|
this.popupEl.show()
|
||||||
this.apkUrl = apkUrl;
|
this.apkUrl = apkUrl;
|
||||||
|
this.latestVersion = latestVersion || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 隐藏
|
// 隐藏
|
||||||
@@ -309,8 +310,12 @@ class AppDialog {
|
|||||||
const buttonWidth = (this.viewWidth - this.viewPadding) / 2;
|
const buttonWidth = (this.viewWidth - this.viewPadding) / 2;
|
||||||
if (e.clientY > maxTop - 40 && e.clientY < maxTop) {
|
if (e.clientY > maxTop - 40 && e.clientY < maxTop) {
|
||||||
if (showCancel) {
|
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) {
|
if (e.clientX > maxLeft - buttonWidth && e.clientX < maxLeft) {
|
||||||
upgrade.checkOs(this.apkUrl)
|
upgrade.checkOs(this.apkUrl)
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ class CheckUpate{
|
|||||||
if(res.status===1){
|
if(res.status===1){
|
||||||
const path=res.path || '';
|
const path=res.path || '';
|
||||||
const changeLog=res.changelog || '';
|
const changeLog=res.changelog || '';
|
||||||
appDialog.show(path,changeLog);
|
const latestVersion=res.latest_version || '';
|
||||||
|
appDialog.show(path,changeLog,latestVersion);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.storageTimeStamp()
|
this.storageTimeStamp()
|
||||||
|
|||||||
Reference in New Issue
Block a user