优化代码

This commit is contained in:
Your Name 2023-09-20 21:32:19 +08:00
parent a6999b0c6e
commit bca3339e5c
4 changed files with 18 additions and 12 deletions

View File

@ -1,6 +1,6 @@
<template>
<view>
<view class="header flex justify-around">
<view class="header flex justify-around align-center">
<view class="header-item " v-for="(item,index) in headerMenus" :key="index" @click="_toPage(item)">
<view style="position: relative;">
<image :src="item.icon"></image>
@ -69,12 +69,17 @@
<style lang="scss">
.header {
width: 100%;
/** #ifndef H5 **/
height: 220upx;
/** #endif **/
/** #ifdef H5 **/
height: 300upx;
/** #endif **/
background-color: #368CFE;
color: #FFFFFF;
.header-item {
margin-top: 50upx;
//margin-top: 50upx;
text-align: center;
image {

View File

@ -150,9 +150,9 @@
}
image {
height: 44upx;
width: 44upx;
margin-bottom: 10upx;
height: 68upx;
width: 68upx;
margin-bottom: 8upx;
}
.text {

View File

@ -40,6 +40,10 @@ export function login(userName, passwd) {
success: function(res) {
let data = res.data;
if (data.code != 0) {
uni.showToast({
icon:'none',
title:data.msg
})
reject(data.msg);
return;
}

View File

@ -47,12 +47,13 @@
listStaffPrivileges
} from '../../api/index/index.js'
import mapping from '../../constant/mapping.js'
import { rejects } from 'assert';
export default {
data() {
return {
logoUrl: '',
username: '18909711443',
password: '18909711443'
username: '',
password: ''
}
},
onLoad() {
@ -94,12 +95,8 @@
login(this.username, this.password)
.then(res => {
return res;
}, err => {
uni.showToast({
icon: 'none',
title: err
});
rejects(err);
}).then((_data) => {
listStaffPrivileges(_that);
return getCommunity(true);