小程序

This commit is contained in:
shidongli 2022-08-25 09:57:30 +08:00
parent 201245bd45
commit a3c83995b4
4 changed files with 92 additions and 35 deletions

View File

@ -16,9 +16,9 @@
</view> </view>
</view> </view>
<view class="nicheng2" v-else> <view class="nicheng2" v-else>
<view class="tx-w"> <view class="tx-w" @tap='wxGetUserInfo'>
<view class="tx" style="margin-left: 130rpx;"> <view class="tx" style="margin-left: 130rpx;">
<image class="tx-img" src="/static/登陆头像.png"></image> <image class="tx-img" src="/static/dl.png"></image>
<view class="zx"></view> <view class="zx"></view>
</view> </view>
<view class="login" style="margin-left:45% ;"> <view class="login" style="margin-left:45% ;">
@ -31,7 +31,6 @@
<view class="top2" v-show="top2"></view> <view class="top2" v-show="top2"></view>
<view class="tip" v-show="tip"> <view class="tip" v-show="tip">
<button @tap='wxGetUserInfo'>授权登录</button> <button @tap='wxGetUserInfo'>授权登录</button>
</view> </view>
<view class="stuinfos" v-show="stuinfos"> <view class="stuinfos" v-show="stuinfos">
<view class="student"> <view class="student">
@ -42,7 +41,6 @@
</view> </view>
<view class="th"> <view class="th">
<!-- <button open-type="getPhoneNumber" @getphonenumber="getPhoneNumberp">获取手机号</button> -->
<view class="stname">姓名</view> <view class="stname">姓名</view>
<view class="sex">性别</view> <view class="sex">性别</view>
<view class="age">年龄</view> <view class="age">年龄</view>
@ -80,7 +78,6 @@
</view> </view>
<view class="parentinfo"> <view class="parentinfo">
<view class="stinfo"> <view class="stinfo">
<img src="/static/parent.png" alt="" sizes="" srcset=""> <img src="/static/parent.png" alt="" sizes="" srcset="">
<text>家长信息</text> <text>家长信息</text>
@ -109,6 +106,29 @@
</view> </view>
</view> </view>
</view> </view>
<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/sq1.png" alt="" sizes="" srcset="">
</view>
<view class="text">
授权绑定您的手机号码
</view>
<view class="btns">
<button class="btn1" @tap='mask=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> </view>
</template> </template>
@ -124,11 +144,13 @@
top2: false, top2: false,
login: false, login: false,
mask: false, mask: false,
mask2: false,
before: false, before: false,
stuinfos: false, stuinfos: false,
tip: true, tip: true,
yonghuwx: [], yonghuwx: [],
code: 11, logincode: '',
phonecode: '',
studentList: [], studentList: [],
classList: [], classList: [],
parentList: [], parentList: [],
@ -159,13 +181,14 @@
}) })
}, },
getPreOrderById() { getPreOrderById() {
getPreOrderById(this.code).then(res => { getPreOrderById(this.logincode, this.phonecode).then(res => {
console.log((res)) console.log((res))
if (res.code == 200) { if (res.code == 200) {
this.studentList = res.data.studentInfoList; this.studentList = res.data.studentInfoList;
this.classList = res.data.classInfoList; this.classList = res.data.classInfoList;
this.parentList = res.data; this.parentList = res.data;
// this.mask = true; // this.mask = true;
this.mask2=false;
} else if (res.code == 500 && res.msg == "EMPTY") { } else if (res.code == 500 && res.msg == "EMPTY") {
this.mask = true; this.mask = true;
} }
@ -173,10 +196,21 @@
}, },
getPhoneNumberp(val) { getPhoneNumberp(val) {
this.phonecode = val.detail.code
console.log(this.phonecode)
let that = this;
wx.login({ wx.login({
provider: 'weixin', provider: 'weixin',
success: function(loginRes) { success: function(loginRes) {
console.log(loginRes) console.log(loginRes)
that.logincode = loginRes.code
console.log(that.logincode)
that.getPreOrderById();
that.login = true
that.stuinfos = true
that.tip = false
that.top2 = true
that.top = false
} }
}); });
}, },
@ -192,13 +226,7 @@
key: 'user', key: 'user',
data: res.userInfo data: res.userInfo
}); });
that.getPreOrderById() that.mask2 = true
that.getPhoneNumberp();
that.login = true
that.stuinfos = true
that.tip = false
that.top2 = true
that.top = false
}, },
fail(res) { fail(res) {
//home //home
@ -219,6 +247,7 @@
}, },
}, },
onLoad(options) { onLoad(options) {
// this.wxGetUserInfo();
this.setitem(); this.setitem();
// this.yonghuwx = JSON.parse(options.userinfo) // this.yonghuwx = JSON.parse(options.userinfo)
// console.log(this.yonghuwx) // console.log(this.yonghuwx)
@ -257,15 +286,17 @@
} }
.btn2 { .btn2 {
border-top: 1px solid #4486e8; border-top: 1px solid #eeeeee;
/* background-color: #4486e8; */
right: 0; right: 0;
} }
.btn1 { .btn1 {
border-top: 1px solid #4486e8; border-top: 1px solid #eeeeee;
border-right: 1px solid #4486e8; border-right: 1px solid #eeeeee;
background-color: #4486e8;
color: #fff; /* color: #fff; */
left: 0; left: 0;
} }
@ -278,21 +309,45 @@
top: 0; top: 0;
z-index: 999; z-index: 999;
} }
.mask2{
width: 70%;
height: 400rpx;
background-color: #fff;
margin: 200rpx auto;
position: relative;
}
.sq{
width: 90rpx;
height: 90rpx;
/* background-color: red; */
margin:0 auto;
padding-top: 25rpx;
padding-bottom: 40rpx;
}
.masks img{
width: 90rpx;
height: 90rpx;
}
.text { .text {
font-size: 30rpx; font-size: 30rpx;
width: 100%; width: 100%;
text-align: left; text-align: left;
padding-top: 40rpx; /* padding-top: 40rpx; */
text-align: center; text-align: center;
} }
.title { .title {
font-size: 40rpx; height: 100rpx;
margin: 0 auto; line-height: 100rpx;
width: 20%; border-bottom: 1px solid #eeeeee;
/* background-color: red; */
font-size: 36rpx;
margin: 0px auto;
width: 100%;
text-align: center; text-align: center;
line-height: 80rpx; /* line-height: 80rpx; */
} }
.mask { .mask {
@ -367,10 +422,11 @@
} }
.name { .name {
text-align: center; /*text-align: center;*/
margin-top: -120rpx; /*margin-top: -120rpx;*/
/* margin-left: 10rpx; */ /* margin-left: 10rpx; */
margin-top: 10rpx; /*margin-top: 10rpx;*/
margin-left: 280rpx;
} }
.name-qm { .name-qm {

View File

@ -1,3 +1,4 @@
<template> <template>
<view class="content"> <view class="content">
<uni-section class="card"> <uni-section class="card">
@ -37,16 +38,16 @@
return { return {
data: { data: {
// 370883199909083232 // 370883199909083232
// 18363008969 // 18363008969
// //
cardNo: "", cardNo: "",
parentName: "", parentName: "",
phone: "", phone: "",
}, },
} }
}, },
methods: { methods: {
bindParent() { bindParent() {
bindParent(this.data).then(res => { bindParent(this.data).then(res => {

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB