Browse Source

Signed-off-by: yukangzhe <382985154@qq.com>

yukangzhe 3 years ago
parent
commit
eb64126856
8 changed files with 125 additions and 35 deletions
  1. 1 1
      app.js
  2. 3 3
      pages/index/index.js
  3. 2 2
      pages/index/index.wxml
  4. 60 26
      pages/login/login.js
  5. 22 1
      pages/login/login.wxml
  6. 34 0
      pages/login/login.wxss
  7. 1 1
      pages/pianoDetail/pianoDetail.js
  8. 2 1
      utils/urls.js

+ 1 - 1
app.js

@@ -68,7 +68,7 @@ App({
   },
   },
 
 
   globalData: {
   globalData: {
-    ver:'1.0.0',
+    ver:'1.0.2',
     userInfo: null,
     userInfo: null,
     openId: '',
     openId: '',
     imageUrl: 'https://app.schoolwisdoms.com/static/wx/images/',
     imageUrl: 'https://app.schoolwisdoms.com/static/wx/images/',

+ 3 - 3
pages/index/index.js

@@ -34,12 +34,12 @@ Page({
     appList: [{
     appList: [{
       img: '/images/kb.png',
       img: '/images/kb.png',
       title: '我的课表',
       title: '我的课表',
-      url: "/pages/schedule/schedule"
+      url: "/pages/schedule/schedule",
     },
     },
     {
     {
       img: '/images/zy.png',
       img: '/images/zy.png',
       title: '提交作业',
       title: '提交作业',
-      url: "/pages/task/task"
+      url: "/pages/task/task",
     },
     },
     {
     {
       img: '/images/dp.png',
       img: '/images/dp.png',
@@ -155,7 +155,7 @@ Page({
    */
    */
   onLoad: function (options) {
   onLoad: function (options) {
     this.setData({
     this.setData({
-      isShow: wx.getStorageSync('isShow')
+      isShow: wx.getStorageSync('isShow'),
     })
     })
   },
   },
 
 

+ 2 - 2
pages/index/index.wxml

@@ -34,7 +34,7 @@
   <view class="class-view">
   <view class="class-view">
     <view class="title">课程数据</view>
     <view class="title">课程数据</view>
     <view class="class-list">
     <view class="class-list">
-      <view class="class-box" wx:for="{{classList}}" wx:key="index" data-url="{{item.url}}" bindtap="toPage">
+      <view class="class-box" wx:for="{{classList}}" wx:key="index" data-url="{{item.url}}" bindtap="toPage" wx:if="{{index == 1 ? isShow : true}}">
         <view class="class-img">
         <view class="class-img">
           <image src="{{item.img}}"></image>
           <image src="{{item.img}}"></image>
         </view>
         </view>
@@ -51,7 +51,7 @@
   <view class="app-view">
   <view class="app-view">
     <view class="title">我的应用</view>
     <view class="title">我的应用</view>
     <view class="app-list">
     <view class="app-list">
-      <view class="app-box" wx:for="{{appList}}" wx:key="index" data-url="{{item.url}}" bindtap="toPage">
+      <view class="app-box" wx:for="{{appList}}" wx:key="index" data-url="{{item.url}}" bindtap="toPage"  wx:if="{{index == 1 ? isShow : true}}">
         <view class="app-img">
         <view class="app-img">
           <image src="{{item.img}}"></image>
           <image src="{{item.img}}"></image>
         </view>
         </view>

+ 60 - 26
pages/login/login.js

@@ -10,6 +10,9 @@ Page({
     isPage: '',
     isPage: '',
     isId: '',
     isId: '',
     imageUrl: app.globalData.imageUrl,
     imageUrl: app.globalData.imageUrl,
+    isShow: true,
+    testName: '',
+    testPwd: ''
   },
   },
 
 
   update: function () {
   update: function () {
@@ -36,19 +39,6 @@ Page({
       }
       }
     })
     })
 
 
-    updateManager.onUpdateReady(function () {
-      wx.showModal({
-        title: '更新提示',
-        content: '新版本已经准备好,是否重启应用?',
-        success(res) {
-          if (res.confirm) {
-            // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
-            updateManager.applyUpdate()
-          }
-        }
-      })
-    })
-
     updateManager.onUpdateFailed(function () {
     updateManager.onUpdateFailed(function () {
       // 新版本下载失败
       // 新版本下载失败
       wx.showModal({
       wx.showModal({
@@ -93,8 +83,11 @@ Page({
         wx.setStorageSync('isShow', false)
         wx.setStorageSync('isShow', false)
       } else {
       } else {
         wx.setStorageSync('isShow', true)
         wx.setStorageSync('isShow', true)
-        this.getOpenId()
       }
       }
+      this.getOpenId()
+      this.setData({
+        isShow: res.version == app.globalData.ver
+      })
     })
     })
   },
   },
 
 
@@ -114,19 +107,22 @@ Page({
         })
         })
       },
       },
       fail: res => {
       fail: res => {
-        wx.hideLoading({
-          success: (res) => {
-            wx.showToast({
-              title: '提示',
-              icon: 'none',
-              content: '连接失败,请重试'
-            })
-          },
+        wx.showToast({
+          title: '提示',
+          icon: 'none',
+          content: '连接失败,请重试'
         })
         })
       }
       }
     })
     })
   },
   },
 
 
+  loginBtn:function(){
+    wx.showLoading({
+      title: '正在登陆',
+      mask: true
+    })
+  },
+
   //授权手机号
   //授权手机号
   getPhoneNumber: function (e) {
   getPhoneNumber: function (e) {
     const that = this;
     const that = this;
@@ -143,8 +139,11 @@ Page({
         }
         }
       ).then(rs => {
       ).then(rs => {
         if (rs.success > 0) {
         if (rs.success > 0) {
-          wx.setStorageSync('phone', rs.data.phoneNumber);
-          // wx.setStorageSync('phone', '13871019618')
+          if(that.data.isShow){
+            wx.setStorageSync('phone', rs.data.phoneNumber);
+          } else {
+            wx.setStorageSync('phone', '13293333334');
+          }
           this.autoLogin();
           this.autoLogin();
         } else {
         } else {
           wx.showToast({
           wx.showToast({
@@ -159,13 +158,48 @@ Page({
     })
     })
   },
   },
 
 
+  getName:function(e){
+    this.setData({
+      testName : e.detail.value
+    })
+  },
+  getPwd:function(e){
+    this.setData({
+      testPwd : e.detail.value
+    })
+  },
+
+  testLogin:function(){
+    if(this.data.testName != '13293333334'){
+      wx.showToast({
+        title: '账号错误',
+        icon: 'none'
+      })
+      return
+    } else if(this.data.testPwd != '333334') {
+      wx.showToast({
+        title: '密码错误',
+        icon: 'none'
+      })
+      return
+    } else {
+      wx.setStorageSync('phone', '13293333334')
+      this.autoLogin()
+    }
+  },
+
   autoLogin: function () {
   autoLogin: function () {
+    var openId = ''
+    if(this.data.isShow){
+     openId = wx.getStorageSync('openId')
+    } else {
+      openId ='o9b5O5J24HLeDEJtZ2BfGXd8z6J4'
+    }
     util.doPost(
     util.doPost(
       'autoLogin', {
       'autoLogin', {
-        openId: wx.getStorageSync('openId'),
+        openId ,
       }
       }
     ).then(rs => {
     ).then(rs => {
-      wx.hideLoading()
       if (rs.success > 0) {
       if (rs.success > 0) {
         wx.setStorageSync('sso-token', rs.data.token);
         wx.setStorageSync('sso-token', rs.data.token);
         wx.showToast({
         wx.showToast({

+ 22 - 1
pages/login/login.wxml

@@ -3,7 +3,28 @@
 	<image lazy-load class="background" mode="aspectFill" src="{{imageUrl ? imageUrl+'bg0608.png': ''}}"></image>
 	<image lazy-load class="background" mode="aspectFill" src="{{imageUrl ? imageUrl+'bg0608.png': ''}}"></image>
 	<image lazy-load class="logo" mode="aspectFill" src="/images/logo.png"></image>
 	<image lazy-load class="logo" mode="aspectFill" src="/images/logo.png"></image>
 	<!-- <text class="name">艾克斯朗学生端</text> -->
 	<!-- <text class="name">艾克斯朗学生端</text> -->
-	<button class="button" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" hidden="{{btnShow}}">
+	<button wx:if="{{isShow}}" class="button" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber"
+		hidden="{{btnShow}}">
 		登陆
 		登陆
 	</button>
 	</button>
+	<!-- <button wx:if="{{!isShow}}" class="button" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" hidden="{{btnShow}}">
+		登陆
+	</button> -->
+	<view wx:if="{{!isShow}}" class="login-view">
+		<view class="userName-view">
+			<view class="isTitle">账号:</view>
+			<view>
+				<input maxlength="11" bindinput="getName" />
+			</view>
+		</view>
+		<view class="pwd-view">
+			<view class="isTitle">密码:</view>
+			<view>
+				<input maxlength="6" type="password" bindinput="getPwd" />
+			</view>
+		</view>
+		<view class="tip">本系统仅供已在艾克斯朗注册的学生使用</view>
+		<view class="login-btn button" bindtap="testLogin">确定</view>
+	</view>
+
 </view>
 </view>

+ 34 - 0
pages/login/login.wxss

@@ -13,6 +13,7 @@
 }
 }
 .background {
 .background {
   position: fixed;
   position: fixed;
+  z-index: -1;
   top: 0;
   top: 0;
   left: 0;
   left: 0;
   width: 750rpx;
   width: 750rpx;
@@ -42,4 +43,37 @@
   border-radius: 42rpx;
   border-radius: 42rpx;
   font-size: 32rpx;
   font-size: 32rpx;
   color: #005033;
   color: #005033;
+  font-weight: 600;
+}
+
+.login-view{
+  position: fixed;
+  width: 500rpx;
+  bottom: 240rpx;
+  margin: 0 auto ;
+  font-size: 32rpx;
+}
+.userName-view{
+  display: flex;
+    margin-bottom: 40rpx;
+}
+.isTitle{
+  line-height: 60rpx;
+}
+.login-view input{
+  border: 1px solid #ccc;
+    width: 300rpx;
+    margin-left: 10rpx;
+    height: 40rpx;
+    line-height: 40rpx;
+    padding: 5px 15px;
+}
+.pwd-view{
+  display: flex;
+}
+.tip{
+  font-size: 26rpx;
+    margin: 20rpx auto;
+    color: red;
+    text-align: center;
 }
 }

+ 1 - 1
pages/pianoDetail/pianoDetail.js

@@ -132,7 +132,7 @@ Page({
       // extraData: {
       // extraData: {
       //   foo: 'bar'
       //   foo: 'bar'
       // },
       // },
-      envVersion: 'release',
+      envVersion: 'develop',
       success(res) {
       success(res) {
         // 打开成功
         // 打开成功
       }
       }

+ 2 - 1
utils/urls.js

@@ -1,6 +1,7 @@
 // const baseUrl = 'https://demo.schoolwisdoms.com';
 // const baseUrl = 'https://demo.schoolwisdoms.com';
 // const baseUrl = 'https://app.schoolwisdoms.com';
 // const baseUrl = 'https://app.schoolwisdoms.com';
-const baseUrl = 'https://excl.schoolwisdoms.com';
+// const baseUrl = 'https://excl.schoolwisdoms.com';
+const baseUrl = 'https://excellent.schoolwisdoms.com'
 
 
 // const baseUrl = 'http://192.168.2.103';
 // const baseUrl = 'http://192.168.2.103';