|
|
@@ -81,7 +81,6 @@
|
|
|
TopMenu,
|
|
|
Login,
|
|
|
SYJJ,
|
|
|
- // XXLC,
|
|
|
XQDL,
|
|
|
KSXX,
|
|
|
QXZB,
|
|
|
@@ -136,13 +135,59 @@
|
|
|
false, //21实景勘察
|
|
|
false, //22学习资料下载
|
|
|
],
|
|
|
- // bShowLogin: true, //登录
|
|
|
- // bShowSYJJ: false, //实验简介一级页面
|
|
|
- // bShowXXLC: false, //学习流程一级页面
|
|
|
- // bShowSL: false, //开始学习一级页面
|
|
|
checkedIndex_SYJJ: 0, //实验简介选中标题索引值
|
|
|
}
|
|
|
},
|
|
|
+ onLoad(){
|
|
|
+ let account = localStorage.getItem("account");
|
|
|
+ let password = localStorage.getItem("password");
|
|
|
+
|
|
|
+ if(account!=null && password!=null)
|
|
|
+ {
|
|
|
+ let url = this.$Api + "/user/loginin";
|
|
|
+ uni.request({
|
|
|
+ header: {
|
|
|
+ 'Content-Type': 'application/json;charset=UTF-8'
|
|
|
+ },
|
|
|
+ url: url,
|
|
|
+ method: 'POST',
|
|
|
+ data: {
|
|
|
+ "IlabAccount": account,
|
|
|
+ "Password": password
|
|
|
+ },
|
|
|
+ dataType: 'json',
|
|
|
+ success: (res) => {
|
|
|
+ let data = res.data;
|
|
|
+ //登录成功
|
|
|
+ if (data.Code == 100) {
|
|
|
+ // console.log("登陆成功");
|
|
|
+ if (data.Image != '') {
|
|
|
+ mydata_userInfo.avatarSrc = data.Image;
|
|
|
+ }
|
|
|
+ console.log("登陆成功data=",data);
|
|
|
+ mydata_userInfo.Name = data.Name;
|
|
|
+ mydata_userInfo.UserID = data.UserID;
|
|
|
+ mydata_userInfo.Position = data.Position;
|
|
|
+ mydata_userInfo.role = data.Type;
|
|
|
+
|
|
|
+ if (mydata_userInfo.role == '老师') {
|
|
|
+ userController.updateStudentList(null,null);
|
|
|
+ } else {
|
|
|
+ userController.updateScore();
|
|
|
+ }
|
|
|
+ userController.updateUserInfo();
|
|
|
+ MyRequest.SetUserType(mydata_userInfo.role,null,null);
|
|
|
+
|
|
|
+ getApp().globalData.bLogin = true;
|
|
|
+ this.onLogin();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (res) => {
|
|
|
+ console.log("fail+**+*", res)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
onTopSYClick(index) {
|
|
|
if(!getApp().globalData.bLogin) {
|
|
|
@@ -173,26 +218,6 @@
|
|
|
// console.log("登陆成功home");
|
|
|
this.$refs.TopMenu.switchLoginState(true);
|
|
|
this.showPage(4);
|
|
|
-
|
|
|
- // uni.chooseImage({
|
|
|
- // success: (chooseImageRes) => {
|
|
|
- // const tempFilePaths = chooseImageRes.tempFilePaths;
|
|
|
- // uni.uploadFile({
|
|
|
- // url: 'http://39.105.166.141:8085/project/createprojectnew', //仅为示例,非真实的接口地址
|
|
|
- // filePath: tempFilePaths[0],
|
|
|
- // name: 'file',
|
|
|
- // formData: {
|
|
|
- // 'CreateUserID': 'lyy22', // 创建用户 id
|
|
|
- // 'ProjectName': 'test22', // 项目名称
|
|
|
- // 'Describe': 'aaa22', // 项目描述
|
|
|
- // 'Type': 'bbbbb22', // 科幻 现实 历史 主旋律 纪录片
|
|
|
- // },
|
|
|
- // success: (uploadFileRes) => {
|
|
|
- // console.log('upload ok=', uploadFileRes.data);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
- // });
|
|
|
},
|
|
|
showPage(index) {
|
|
|
this.curShowPage = index;
|
|
|
@@ -218,14 +243,12 @@
|
|
|
this.showPage(5)
|
|
|
this.$refs.TopMenu.switchMiddleState(topMenuS.QXZB, index);
|
|
|
this.$refs.QXZB.onTopQXZBClick(index);
|
|
|
- // this.$refs.TopMenu.checkedIndexQXZB = index;
|
|
|
}
|
|
|
//学习与实验
|
|
|
else if (type == "XXYSY") {
|
|
|
this.showPage(6)
|
|
|
this.$refs.TopMenu.switchMiddleState(topMenuS.XXYSY, index);
|
|
|
this.$refs.XXYSY.onTopXXYSYClick(index);
|
|
|
- // this.$refs.TopMenu.checkedIndexXXYSY = index;
|
|
|
} else {
|
|
|
console.log("2级点击---", lineIndex, type, index);
|
|
|
}
|
|
|
@@ -246,9 +269,6 @@
|
|
|
let topMiddleState = '';
|
|
|
switch (indexArr[0]) {
|
|
|
case 0: //首页
|
|
|
- // targetPage = 4;
|
|
|
- // topMiddleState = topMenuS.SY;
|
|
|
- // this.$refs.SY.initData();
|
|
|
if (indexArr[1] == 0) {
|
|
|
targetPage = 9;
|
|
|
topMiddleState = topMenuS.home1;
|
|
|
@@ -274,7 +294,6 @@
|
|
|
topMiddleState = topMenuS.SYJJ;
|
|
|
this.$refs.SYJJ2.showPage(indexArr[1]);
|
|
|
this.$refs.TopMenu.switchState_syjj(indexArr[1]);
|
|
|
- // this.$forceUpdate();
|
|
|
break;
|
|
|
case 2: //学习流程
|
|
|
switch (indexArr[1]) {
|
|
|
@@ -295,7 +314,6 @@
|
|
|
topMiddleState = topMenuS.XXZLXZ;
|
|
|
break;
|
|
|
default:
|
|
|
-
|
|
|
}
|
|
|
break;
|
|
|
case 3: //开始学习
|
|
|
@@ -370,7 +388,6 @@
|
|
|
onClick_KSRZ() {
|
|
|
this.showPage(7);
|
|
|
this.$refs.TopMenu.switchMiddleState(topMenuS.YLRZ, -1);
|
|
|
- // this.$refs.TopMenu.switchRightState(2);
|
|
|
},
|
|
|
//开始学习-实景勘察-开始勘察按钮
|
|
|
onClick_KSKC() {
|
|
|
@@ -387,7 +404,6 @@
|
|
|
else if (type == 5 || type == 6 || type == 7 || type == 8) {
|
|
|
this.showPage(2);
|
|
|
}
|
|
|
- //
|
|
|
else {
|
|
|
switch (type) {
|
|
|
case 1: //前序准备-返回上一层:返回到开始学习-前序准备的展开页 type-1
|
|
|
@@ -497,7 +513,6 @@
|
|
|
}
|
|
|
this.showPage(targetPage);
|
|
|
this.$refs.TopMenu.switchMiddleState(topMiddleState, index);
|
|
|
-
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
//项目管理平台
|