修改118

master
Lee-1203 2022-01-18 14:47:20 +08:00
parent edccf1a538
commit a76e7d5bdc
10 changed files with 127 additions and 16 deletions

View File

@ -76,10 +76,10 @@ checkbox{
}
checkbox+.point{
box-sizing: border-box;
width: 26rpx;
height: 26rpx;
border: 2rpx solid #cccccc;
border-radius: 4rpx;
width: 13px;
height: 13px;
border: 1px solid #cccccc;
border-radius: 2px;
background-color: #FFFFFF;
}
.a-checkbox-checked+.point{
@ -87,7 +87,7 @@ checkbox+.point{
background-image: url(/static/success.png);
background-position: center;
background-repeat: no-repeat;
background-size: 18rpx 18rpx;
background-size: 7px 7px;
}
radio{
width: 0 !important;
@ -108,20 +108,20 @@ label{
}
radio+.point{
box-sizing: border-box;
width: 28rpx;
height: 28rpx;
border: 2rpx solid #cccccc;
width: 14px;
height: 14px;
border: 1px solid #cccccc;
border-radius: 100%;
background-color: #FFFFFF;
position: relative;
}
.a-radio-checked+.point{
border: 2rpx solid #2e80b6;
border: 1px solid #2e80b6;
}
.a-radio-checked+.point>text{
display: block;
width: 16rpx;
height: 16rpx;
width: 8px;
height: 8px;
border-radius: 100%;
background-color:#2e80b6;
position: absolute;

3
app.js
View File

@ -1,3 +1,6 @@
import utils from '/utils/utils'
dd['utils'] = utils
App({
onLaunch(options) {
// 第一次打开

View File

@ -1,8 +1,8 @@
{
"pages": [
"pages/index/index",
"components/otherBar/otherBar",
"pages/login/login",
"components/tabBar/tabBar",
"components/otherBar/otherBar",
"pages/counselor/account/bind/bind",
"pages/counselor/free/freedetail/freedetail",
"pages/counselor/personal/list/list",
@ -12,6 +12,7 @@
"pages/examinee/service/answer/answer",
"pages/examinee/information/report/report",
"pages/examinee/information/revise/revise",
"pages/counselor/position/position"
"pages/counselor/position/position",
"pages/index/index"
]
}

View File

@ -1,6 +1,7 @@
Component({
mixins: [],
data: {},
data: {
},
props: {},
didMount() {},
didUpdate() {},
@ -31,7 +32,7 @@ Page({
// "selectedIconPath": "/image/icon_biz.png",
"text": "考生信息"
}
]
],
},
onLoad() {
dd.setNavigationBar({

3
config/config.js Normal file
View File

@ -0,0 +1,3 @@
export default {
BASE_URL: 'http://aspiration.scdxtc.cn' // api接口服务器地址
}

0
pages/login/login.acss Normal file
View File

3
pages/login/login.axml Normal file
View File

@ -0,0 +1,3 @@
<view>
</view>

72
pages/login/login.js Normal file
View File

@ -0,0 +1,72 @@
Page({
data:{
authCode:''
},
onLoad(){
// 提取免登码
dd.getStorage({
key: 'authCode',
success: function(res) {
// dd.alert({content: '获取成功:' + res.data.authCode});
// 登录
let params = {
code: res.data.authCode
}
dd.utils.$http('/api/user/login','POST',params).then(
(data) => {
console.log(res.data.authCode)
dd.redirectTo({
url: '/pages/index/index'
})
},
(err) => {
console.log('错误:'+err)
}
);
},
fail: function(res){
//dd.alert({content: res.errorMessage});
let _this = this;
// 获取免登码
dd.getAuthCode({
success:(res)=>{
_this.setData({
authCode:res.authCode
})
this.data.authCode = res.authCode;
// 缓存免登码
dd.setStorage({
key: 'authCode',
data: {
authCode: res.authCode,
},
success: function() {
// dd.alert({content: '写入成功'});
}
});
// 登录
let params = {
code: res.authCode,
}
dd.utils.$http('/api/user/login','POST',params).then(
(data) => {
console.log(data)
dd.redirectTo({
url: '/pages/index/index'
})
},
(err) => {
console.log('错误:'+err)
}
);
},
fail: (err)=>{
dd.alert({
content: JSON.stringify(err)
})
}
})
}
});
}
})

3
pages/login/login.json Normal file
View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

25
utils/utils.js Normal file
View File

@ -0,0 +1,25 @@
import config from '/config/config'
export default {
$http(url, method, data, h) {
return new Promise(function(resolve, reject) {
dd.httpRequest({
url: config.BASE_URL+url,
method: method,
data: data,
header:{
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
},
success: (res) => {
if (res.status == 200) {
resolve(res);
} else {
reject(res);
}
},
fail: () => {
reject();
}
})
})
}
}