添加组件及页面

This commit is contained in:
zhengw
2026-01-21 17:05:30 +08:00
parent a89e69c381
commit 7ff1a911dd
54 changed files with 1078 additions and 1009 deletions

View File

@@ -1,6 +1,7 @@
import { base, defaultAvatarUrl } from "@/utils/config";
import { Subscribe } from "@/utils/subscribe";
import { setStorage } from "@/utils/util";
import { base, defaultAvatarUrl } from '@/utils/config';
import { login } from '@/utils/https';
import { Subscribe } from '@/utils/subscribe';
import { isArray, setStorage } from '@/utils/util';
// import { IStorage } from "@/utils/storage";
// const app = getApp();
@@ -13,6 +14,7 @@ Component({
loading: Boolean,
isAuth: null,
customStyle: null,
hasTabBar: null,
},
// attached() {
@@ -35,24 +37,24 @@ Component({
appletName: base.appletName,
show: false,
companyList: [],
encryptedData: "",
iv: "",
encryptedData: '',
iv: '',
},
methods: {
handleLogin(e: any) {
this.triggerEvent("handleLogin", e.detail);
this.triggerEvent('handleLogin', e.detail);
},
getPhoneNumberToast() {
setStorage("isLogin", 1);
Subscribe.set("isLogin", "zzzuz");
wx.showToast({ title: "请先勾选协议", icon: "none" });
setStorage('isLogin', 1);
Subscribe.set('isLogin', 'zzzuz');
wx.showToast({ title: '请先勾选协议', icon: 'none' });
},
changeAgreementCheck(event: any) {
this.setData({ isAgree: event.detail.checked });
},
navAgreement(e: any) {
wx.navigateTo({
url: "../agreement/agreement?type=" + e.target.dataset.type,
url: '../agreement/agreement?type=' + e.target.dataset.type,
});
},
// getPhoneNumber(e) {
@@ -64,23 +66,23 @@ Component({
this.data.iv = e.detail.iv;
console.log(e);
// login(e.detail.encryptedData, e.detail.iv)
// .then((res) => {
// console.log(res);
// if (isArray(res.data)) {
// this.setData({
// companyList: res.data,
// show: true,
// });
// } else {
// this.triggerEvent("handleLogin", true);
// }
// })
// .catch((err) => {
// this.triggerEvent("handleLogin", false);
// });
login(e.detail.encryptedData, e.detail.iv)
.then((res) => {
console.log(res);
if (isArray(res.data)) {
this.setData({
companyList: res.data,
show: true,
});
} else {
this.triggerEvent('handleLogin', true);
}
})
.catch((err) => {
this.triggerEvent('handleLogin', false);
});
} else {
wx.showToast({ title: e.detail.errMsg, icon: "none" });
wx.showToast({ title: e.detail.errMsg, icon: 'none' });
}
},
login2(e: any) {