This commit is contained in:
曹辉 2022-10-10 17:49:31 +08:00
parent 669e845324
commit 870d0eec2a
2 changed files with 31 additions and 53 deletions

View File

@ -8,7 +8,7 @@ var request = function(config) {
method: config.method,
timeout: 5000,
header: {
// token: uni.getStorageSync('token')
// token: uni.getStorageSync('token')
},
success(res) {
resolve(res.data)

View File

@ -2,24 +2,25 @@
<view class="content">
<view class="" style="width:100%">
<view class="top" v-show="top"></view>
<view class="nicheng" v-if="login">
<view class="nicheng" v-if="login" @tap='wxGetUserInfo'>
<view class="tx-w">
<view class="tx">
<image class="tx-img" src="/static/dl.png" v-if="yonghuwx.avatarUrl==''"></image>
<image class="tx-img" src="/static/dl.png" v-if="yonghuwx.length==0"></image>
<image class="tx-img" src="/static/dl.png" v-else-if="yonghuwx.avatarUrl==''"></image>
<image class="tx-img" :src="yonghuwx.avatarUrl" v-else></image>
<view class="zx"></view>
</view>
<view class="infos">
<view class="studentName" v-if="parentList.parentName==''">姓名:{{yonghuwx.nickName}}</view>
<view class="studentName" v-else>姓名:{{parentList.parentName}}</view>
<view class="name" v-if="yonghuwx.nickName==''">昵称:{{parentList.parentName}} </view>
<view class="name" v-if="yonghuwx.length==0">昵称:{{parentList.parentName}} </view>
<view class="name" v-else-if="yonghuwx.nickName==''">昵称:{{parentList.parentName}} </view>
<view class="name" v-else>昵称:{{yonghuwx.nickName}} </view>
</view>
</view>
</view>
<view class="nicheng2" v-else>
<view class="tx-w" @tap='wxGetUserInfo'>
<view class="tx-w">
<view class="tx" style="margin-left: 130rpx;">
<image class="tx-img" src="/static/dl.png"></image>
<view class="zx"></view>
@ -33,14 +34,14 @@
</view>
<view class="top2" v-show="top2"></view>
<view class="tip" v-show="tip">
<button @tap='wxGetUserInfo'>授权登录</button>
<!-- <button @tap='wxGetUserInfo'>授权登录</button> -->
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumberp">授权登录</button>
</view>
<view class="stuinfos" v-show="stuinfos">
<view class="student">
<view class="stinfo">
<img src="/static/student.png" alt="" sizes="" srcset="">
<view class="st">学生信息</view>
</view>
<view class="th">
<view class="stname">姓名</view>
@ -76,8 +77,6 @@
<span class='teachername'> {{item.classTeacher}}</span>
</view>
</view>
</view>
<view class="parentinfo">
<view class="stinfo">
@ -99,7 +98,7 @@
<view class="title">
提示
</view>
<view class="text">
<view class="text" style="margin-top:40rpx">
您的手机号不符合请更改信息
</view>
<view class="btns">
@ -108,13 +107,13 @@
</view>
</view>
</view>
<view class="masks" style="" v-if="mask2">
<!-- <view class="masks" style="" v-if="mask2">
<view class="mask2">
<view class="title">
微信授权
</view>
<view class="sq">
<!-- <img src="/static/sq.png" alt="" sizes="" srcset=""> -->
<img src="/static/sq.png" alt="" sizes="" srcset="">
<img src="/static/sq1.png" alt="" sizes="" srcset="">
</view>
<view class="text">
@ -122,12 +121,10 @@
</view>
<view class="btns">
<button class="btn1" @tap='mask2=false'>拒绝</button>
<!-- <view class="btn1" @tap='mask=false'>拒绝</view> -->
<button class="btn2" open-type="getPhoneNumber" @getphonenumber="getPhoneNumberp">允许</button>
<!-- <view class="btn2" @tap='gophone()'>确定</view> -->
</view>
</view>
</view>
</view> -->
</view>
</view>
</template>
@ -166,7 +163,6 @@
key: 'user',
success: function(res) {
that.yonghuwx = res.data
console.log(that.yonghuwx);
that.login = true
that.stuinfos = true
that.tip = false
@ -186,7 +182,6 @@
},
getPreOrderById() {
getPreOrderById(this.logincode, this.phonecode).then(res => {
console.log((res))
if (res.code == 200) {
if (res.data.flag == "EMPTY") {
this.mask = true;
@ -206,7 +201,7 @@
this.tip = false
this.top2 = true
this.top = false
this.mask2 = false;
// this.mask2 = false;
}
}
})
@ -214,16 +209,13 @@
getPhoneNumberp(val) {
this.phonecode = val.detail.code
console.log(val)
let that = this;
wx.login({
provider: 'weixin',
success: function(loginRes) {
console.log(loginRes)
that.logincode = loginRes.code
console.log(that.logincode)
that.getPreOrderById();
that.mask2 = false;
// that.mask2 = false;
}
});
},
@ -233,7 +225,6 @@
desc: "获取用户信息",
lang: "zh_CN",
success(res) {
console.log(res)
that.yonghuwx = res.userInfo
uni.setStorage({
key: 'user',
@ -245,17 +236,23 @@
//home
},
});
},
getInfoByPhoneinfo() {
var that = this
getInfoByPhone(this.phone).then(res => {
if (res.code == 200) {
console.log(res)
this.studentList = res.data.studentInfoList;
this.classList = res.data.classInfoList;
this.parentList = res.data;
that.login = true
that.stuinfos = true
that.tip = false
that.top2 = true
that.top = false
// this.mask = true;
} else {
}
})
}
@ -267,43 +264,19 @@
"FAMELE": "女",
"MALE": "男",
}
return sexEnum[str];
},
},
onShow() {},
onLoad(options) {
let that = this;
uni.getStorage({
key: 'user',
success: function(res) {
that.yonghuwx = res.data
that.login = true
that.stuinfos = true
that.tip = false
that.top2 = true
that.top = false
// that.mask = true
},
fail: function(err) {
console.log('1', (err))
that.login = false
that.stuinfos = false
that.tip = true
that.top2 = false
that.top = true
}
});
uni.getStorage({
key: 'phone',
success: function(res) {
console.log((res))
that.phone = res.data
// that.mask = true
that.getInfoByPhoneinfo();
},
fail: function(err) {
console.log('1', (err))
that.login = false
that.stuinfos = false
that.tip = true
@ -311,7 +284,14 @@
that.top = true
}
});
uni.getStorage({
key: 'user',
success: function(res) {
that.yonghuwx = res.data
// that.mask = true
},
fail: function(err) {}
});
@ -319,7 +299,6 @@
// this.yonghuwx = JSON.parse(options.userinfo)
// console.log(this.yonghuwx)
// uni.request({
// url: '/kindergarten/applet/appletLogin', //
// method:'GET'
@ -328,7 +307,6 @@
// },
// success: (res) => {
// console.log(res.data);
// this.text = 'request success';
// }
// });