[fix]页面展示样式

main
huyuanxiang 2 years ago
parent 523cba431a
commit da1e72a878

@ -24,7 +24,7 @@
justify-content: center; justify-content: center;
} }
.flex-col-end { .flex-col-end {
align-items: flex-end; justify-content: flex-end;
} }
.flex-column { .flex-column {
flex-direction: column; flex-direction: column;

@ -62,8 +62,8 @@ http.interceptor.response(async (response) => { /* 请求之后拦截器 */
let data = response.data let data = response.data
const token = uni.getStorageSync(ACCESS_TOKEN) const token = uni.getStorageSync(ACCESS_TOKEN)
console.log("------异常响应------",token) console.log("------异常响应------",token)
console.log("------异常响应------",data.status) console.log("------异常响应------",data)
switch (data.status) { switch (data.code) {
case 403: case 403:
tip.error('拒绝访问'); tip.error('拒绝访问');
break break
@ -82,11 +82,11 @@ http.interceptor.response(async (response) => { /* 请求之后拦截器 */
break break
case 401: case 401:
if (token) { if (token) {
/* store.dispatch('Logout').then(() => { let timeout=setTimeout(tip.alert('登录已过期'), 1000);
setTimeout(() => { store.dispatch('Logout').then(() => {
window.location.reload() clearTimeout(timeout)
}, 1500) window.location.reload()
}) */ })
} }
break break
default: default:

@ -34,7 +34,11 @@
}, },
onLoad: function (option) { onLoad: function (option) {
api.logout().then(res=>{ api.logout().then(res=>{
uni.clearStorageSync() // uni.clearStorageSync()
uni.removeStorageSync('Access-Token')
uni.removeStorageSync('login_user_info')
uni.removeStorageSync('_pro_stations')
uni.removeStorageSync('_pro_selectStation')
}) })
}, },
methods: { methods: {

@ -5,7 +5,7 @@
<block v-if="loginWay==1"> <block v-if="loginWay==1">
<view class="cu-form-group margin-top shadow-warp input" :class="[shape=='round'?'round':'']"> <view class="cu-form-group margin-top shadow-warp input" :class="[shape=='round'?'round':'']">
<view class="title"><text class="cuIcon-people margin-right-xs"></text>账号:</view> <view class="title"><text class="cuIcon-people margin-right-xs"></text>账号:</view>
<input placeholder="请输入账号" name="input" v-model="userName"></input> <input placeholder="请输入账号" name="input" v-model="username"></input>
</view> </view>
<view class="cu-form-group margin-top shadow-warp input" :class="[shape=='round'?'round':'']"> <view class="cu-form-group margin-top shadow-warp input" :class="[shape=='round'?'round':'']">
<view class="title"><text class="cuIcon-lock margin-right-xs"></text>密码:</view> <view class="title"><text class="cuIcon-lock margin-right-xs"></text>密码:</view>
@ -14,6 +14,17 @@
<text :class="[showPassword ? 'cuIcon-attention' : 'cuIcon-attentionforbid']" @click="changePassword"></text> <text :class="[showPassword ? 'cuIcon-attention' : 'cuIcon-attentionforbid']" @click="changePassword"></text>
</view> </view>
</view> </view>
<view class="rember flex flex-row-end flex-col-end">
<u-checkbox-group v-model="checkBox">
<u-checkbox
label="记住密码"
name="1"
>
</u-checkbox>
</u-checkbox-group>
</view>
<view class="padding text-center margin-top"> <view class="padding text-center margin-top">
<button style="width: 100%;" class="cu-btn bg-gr1 lg margin-right shadow" :loading="loading" :class="[shape=='round'?'round':'']" <button style="width: 100%;" class="cu-btn bg-gr1 lg margin-right shadow" :loading="loading" :class="[shape=='round'?'round':'']"
@tap="onLogin"><text space="emsp">{{loading ? "登录中...":" 登录 "}}</text> @tap="onLogin"><text space="emsp">{{loading ? "登录中...":" 登录 "}}</text>
@ -22,6 +33,7 @@
@tap="loginWay=3-loginWay">短信登录 @tap="loginWay=3-loginWay">短信登录
</button> --> </button> -->
</view> </view>
</block> </block>
<!-- <block v-else> <!-- <block v-else>
<view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']"> <view class="cu-form-group margin-top shadow-warp" :class="[shape=='round'?'round':'']">
@ -78,9 +90,10 @@
export default { export default {
data() { data() {
return { return {
checkBox: [],
shape:'',//round shape:'',//round
loading: false, loading: false,
userName: 'admin', username: 'admin',
password: '', password: '',
phoneNo: '', phoneNo: '',
smsCode: '', smsCode: '',
@ -97,12 +110,18 @@
bindingPhoneModal:false, bindingPhoneModal:false,
thirdUserUuid:'', thirdUserUuid:'',
imageURL: '@/static/long_2.png', imageURL: '@/static/long_2.png',
url: { // url: {
bindingThirdPhone: '/sys/thirdLogin/bindingThirdPhone' // bindingThirdPhone: '/sys/thirdLogin/bindingThirdPhone'
} // }
}; };
}, },
onLoad:function(){ onLoad:function(){
const info = uni.getStorageSync('_usr_info')
if (info) {
this.password = info.password
this.username = info.username
this.checkBox = ['1']
}
// #ifdef APP-PLUS // #ifdef APP-PLUS
var that=this var that=this
plus.runtime.getProperty( plus.runtime.appid, function ( wgtinfo ) { plus.runtime.getProperty( plus.runtime.appid, function ( wgtinfo ) {
@ -122,16 +141,16 @@
} }
}, },
canSMSLogin() { canSMSLogin() {
return this.userName.length > 4 && this.smsCode.length > 4; return this.username.length > 4 && this.smsCode.length > 4;
}, },
canPwdLogin() { canPwdLogin() {
return this.userName.length > 4 && this.password.length > 4; return this.username.length > 4 && this.password.length > 4;
}, },
}, },
methods: { methods: {
...mapActions([ "mLogin","PhoneLogin","ThirdLogin" ]), ...mapActions([ "mLogin","PhoneLogin","ThirdLogin" ]),
onLogin: function (){ onLogin: function (){
if(!this.userName || this.userName.length==0){ if(!this.username || this.username.length==0){
this.$tip.toast('请填写用户名'); this.$tip.toast('请填写用户名');
return; return;
} }
@ -140,13 +159,18 @@
return; return;
} }
let loginParams = { let loginParams = {
username:this.userName, username:this.username,
password:this.password password:this.password
} }
this.loading=true; this.loading=true;
this.mLogin(loginParams).then((res) => { this.mLogin(loginParams).then((res) => {
this.loading=false; this.loading=false;
if(res.data.success){ if(res.data.success){
if (this.checkBox.length) {
uni.setStorageSync('_usr_info', loginParams)
} else {
uni.removeStorageSync('_usr_info')
}
// #ifdef APP-PLUS // #ifdef APP-PLUS
this.saveClientId() this.saveClientId()
// #endif // #endif
@ -257,6 +281,10 @@
</script> </script>
<style> <style>
.rember {
margin-top: 20upx;
font-size: 28upx !important;
}
.compony { .compony {
font-size: 24upx; font-size: 24upx;
transform: scale(0.9); transform: scale(0.9);

@ -695,7 +695,7 @@
} }
.station-search-box { .station-search-box {
position: sticky; position: sticky;
top: 90upx; top: 88upx;
width: 100%; width: 100%;
z-index: 2; z-index: 2;

@ -297,7 +297,7 @@
} }
.right { .right {
color: #4aaf0b; color: #4aaf0b;
font-weight: 600; letter-spacing: 2upx;
} }
} }

@ -19,7 +19,7 @@
</view> </view>
<!-- 列表list--> <!-- 列表list-->
<view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius"> <view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
<view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]"> <!-- <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
<view class="content" > <view class="content" >
<text class="cuIcon-favorfill text-yellow"></text> <text class="cuIcon-favorfill text-yellow"></text>
<text class="text-grey">收藏</text> <text class="text-grey">收藏</text>
@ -30,19 +30,8 @@
<text class="cuIcon-redpacket_fill text-red"></text> <text class="cuIcon-redpacket_fill text-red"></text>
<text class="text-grey">红包</text> <text class="text-grey">红包</text>
</view> </view>
</view> </view> -->
<view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.3s'}]" @tap="scan"> <!-- -->
<view class="content">
<text class="cuIcon-scan text-red"></text>
<text class="text-grey">扫码</text>
</view>
</view>
<navigator class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.4s'}]" url="/pages/user/location" hover-class="none">
<view class="content" >
<text class="cuIcon-location text-cyan"></text>
<text class="text-grey">定位</text>
</view>
</navigator>
<navigator class="cu-item arrow animation-slide-bottom" url="/pages/user/userdetail" :style="[{animationDelay: '0.6s'}]"> <navigator class="cu-item arrow animation-slide-bottom" url="/pages/user/userdetail" :style="[{animationDelay: '0.6s'}]">
<view class="content"> <view class="content">
<text class="cuIcon-settingsfill text-cyan"></text> <text class="cuIcon-settingsfill text-cyan"></text>

Loading…
Cancel
Save