master
wangxia 1 week ago
parent ec784f5fac
commit 41dc9d4e84

@ -42,7 +42,7 @@ export default {
let that = this; let that = this;
console.log("show 项目init", options, decodeURIComponent(options.query.scene)); console.log("show 项目init", options, decodeURIComponent(options.query.scene));
let requestComeFrom = this.G.globalConstantData.requestComeFrom; let requestComeFrom = this.G.globalConstantData.requestComeFrom;
uni.setStorageSync("requestComeFrom", (requestComeFrom && (requestComeFrom == "assistant_miniapp" || requestComeFrom == "supply_chain_miniapp")) ? 'isToB' : 'isToC'); uni.setStorageSync("requestComeFrom", requestComeFrom && (requestComeFrom == "assistant_miniapp" || requestComeFrom == "supply_chain_miniapp") ? "isToB" : "isToC");
// id // id
uni.removeStorageSync("scene"); uni.removeStorageSync("scene");
@ -96,6 +96,36 @@ export default {
// console.log("app.vue IM"); // console.log("app.vue IM");
that.checkAndReconnectIM(); that.checkAndReconnectIM();
} }
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function (res) {
console.log("检测是否有新版本:", res.hasUpdate);
});
updateManager.onUpdateReady(function (res) {
uni.showModal({
title: "更新提示",
content: "新版本已经准备好,需重启应用",
showCancel: false,
success(res) {
if (res.confirm) {
console.log("新版本已经准备好,需重启应用");
updateManager.applyUpdate();
}
},
});
});
updateManager.onUpdateFailed(function (res) {
uni.showModal({
title: "更新提示",
content: "新版本下载异常,需重启应用",
showCancel: false,
success(res) {
if (res.confirm) {
console.log("新版本下载异常,需重启应用");
updateManager.applyUpdate();
}
},
});
});
}, },
onHide: function () { onHide: function () {
// //

@ -201,10 +201,7 @@ export default {
that.isLogin = uni.getStorageSync("apply-token") ? true : false; that.isLogin = uni.getStorageSync("apply-token") ? true : false;
console.log("that.isLogin", that.isLogin); console.log("that.isLogin", that.isLogin);
that.loginInfo = uni.getStorageSync("apply-userinfo"); that.loginInfo = uni.getStorageSync("apply-userinfo");
if (uni.getStorageSync("applyType") || uni.getStorageSync("applyType") === 0) {
that.menuActive = uni.getStorageSync("applyType");
uni.removeStorageSync("applyType");
}
this.getList(); this.getList();
if (!that.isLogin) { if (!that.isLogin) {
that.loading = false; that.loading = false;
@ -220,6 +217,10 @@ export default {
onShow() { onShow() {
let that = this; let that = this;
if (that.isLogin) { if (that.isLogin) {
if (uni.getStorageSync("applyType") || uni.getStorageSync("applyType") === 0) {
that.menuActive = uni.getStorageSync("applyType");
uni.removeStorageSync("applyType");
}
this.getList(); this.getList();
} }
this.getGZHInfo(); this.getGZHInfo();

@ -374,7 +374,7 @@ export default {
}, },
handleClickIDcard(e) { handleClickIDcard(e) {
this.info.idCard = e; this.info.idCard = e;
if (this.info.idCard.length == 15 || this.info.idCard.length == 18) { if (this.info.idCard && (this.info.idCard.length == 15 || this.info.idCard.length == 18)) {
let info = this.G.getInfoByIDcard(this.info.idCard); let info = this.G.getInfoByIDcard(this.info.idCard);
this.info.age = info.age; this.info.age = info.age;
this.info.sex = info.sex ? (info.sex == "男" ? 1 : 2) : ""; this.info.sex = info.sex ? (info.sex == "男" ? 1 : 2) : "";

@ -171,7 +171,7 @@ export default {
watch: { watch: {
"info.idCard"() { "info.idCard"() {
console.log("this.info.idCard", this.info.idCard); console.log("this.info.idCard", this.info.idCard);
if (this.info.idCard.length == 15 || this.info.idCard.length == 18) { if (this.info.idCard && (this.info.idCard.length == 15 || this.info.idCard.length == 18)) {
let info = this.G.getInfoByIDcard(this.info.idCard); let info = this.G.getInfoByIDcard(this.info.idCard);
console.log("info info info ", info); console.log("info info info ", info);
this.info.age = info.age; this.info.age = info.age;

@ -112,8 +112,11 @@ export default {
uni.$on("getTownsman", (data) => { uni.$on("getTownsman", (data) => {
console.log("getTownsman", data); console.log("getTownsman", data);
// //
if (data.info.idCard && (data.info.idCard.length == 15 || data.info.idCard.length == 18)) {
let infoByIDcard = this.G.getInfoByIDcard(data.info.idCard); let infoByIDcard = this.G.getInfoByIDcard(data.info.idCard);
data.info.age = infoByIDcard.age; data.info.age = infoByIDcard.age;
}
if (that.persenInfo.length == 0) { if (that.persenInfo.length == 0) {
that.persenInfo[0] = { that.persenInfo[0] = {
...data.info, ...data.info,

@ -1197,10 +1197,16 @@ let data = {
getInfoByIDcard (idCard) { getInfoByIDcard (idCard) {
let info = {} let info = {}
let birthday let birthday
if (idCard.length !== 15 && idCard.length !== 18) {
return {
sex: '',
age: '',
}
}
// 获取性别 // 获取性别
if (idCard.length === 15) { if (idCard.length === 15) {
info.sex = ['女', '男'][idCard.substr(14, 1) % 2] info.sex = ['女', '男'][idCard.substr(14, 1) % 2]
birthday = Y + [idCard.substr(6, 2), idCard.substr(8, 2), idCard.substr(10, 2)].join('-') birthday = [idCard.substr(6, 2), idCard.substr(8, 2), idCard.substr(10, 2)].join('-')
} else if (idCard.length === 18) { } else if (idCard.length === 18) {
info.sex = ['女', '男'][idCard.substr(16, 1) % 2] info.sex = ['女', '男'][idCard.substr(16, 1) % 2]
birthday = [idCard.substr(6, 4), idCard.substr(10, 2), idCard.substr(12, 2)].join('-') birthday = [idCard.substr(6, 4), idCard.substr(10, 2), idCard.substr(12, 2)].join('-')

Loading…
Cancel
Save