Browse Source

我的页面样式调整等

work_tab_bar
李素 1 year ago
parent
commit
ec899fc1b0
  1. 57
      pages/login/login.js
  2. 2
      pages/login/login.wxml
  3. 14
      pages/mine/mine.js
  4. 9
      pages/mine/mine.wxml
  5. 12
      pages/mine/mine.wxss

57
pages/login/login.js

@ -96,8 +96,6 @@ Page({
})
return
}
//var和const的区别,一个可变,一个不可变,
// const 声明一个不可变的对象parm,并创建了对象
const parm = {
// wxCode对象的初始化
wxCode :'',
@ -108,36 +106,53 @@ Page({
wx.showLoading({
title: '登录中',
})
//微信的api,获取登录凭证
// 在这一步骤中,用户获取凭证
//微信的api,获取登录凭证,用户获取凭证
wx.getUserProfile({
desc: '用于获取用户个人信息',
success: function (res) {
var userInfo = res.userInfo;
var avatarUrl = userInfo.avatarUrl;
wx.setStorageSync('avatarUrl', avatarUrl)
console.log("User's Avatar URL:", avatarUrl);
wx.login({
success: (res) => {
parm.wxCode = res.code
console.log(parm.wxCode);
// 调用登录的接口
userLoginlog(parm).then((res)=>{
console.log(res);
// 不明白这里判断的是什么
if(res.code == 0){
parm.wxCode = res.code
console.log(parm.wxCode);
// 调用登录的接口
userLoginlog(parm).then((res)=>{
console.log(res);
// 判断登录是否成功
if(res.code == 0){
// 用于跳转的api,跳转到某某某
wx.switchTab({
url: '/pages/index/index',
})
//加入本地内存的api
wx.setStorageSync('token', res.data.token)
}
}).catch(err=>{
wx.showToast({
title: res.msg,
icon:'none',
duration:3000
})
console.log(err);
})
wx.hideLoading()
}
}).catch(err=>{
wx.showToast({
title: res.msg,
icon:'none',
duration:3000
})
console.log(err);
})
wx.hideLoading()
},
})
}
})
},
/**
* 用户点击右上角分享

2
pages/login/login.wxml

@ -21,3 +21,5 @@
<!-- tap事件绑定到handelClickSubmit。tab事件,当触摸屏时 -->
<button bind:tap="handelClickSubmit" style="font-weight: 600;">登录</button>
</view>

14
pages/mine/mine.js

@ -10,19 +10,21 @@ Page({
statusHeight:'',
navigationHeight:'',
agencyName:'',
userName:''
userName:'',
avatar:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 获取存储在本地缓存中的用户信息
const avatarU = wx.getStorageSync('avatarUrl');
// 输出用户信息
console.log('12312',avatarU);
this.setData({
statusHeight: app.globalData.deviceInfo.statusHeight,
navigationHeight: app.globalData.deviceInfo.navigationHeight,
share:app.globalData.share,
agencyName:app.globalData.user.agencyName,
userName:app.globalData.user.realName
'avatar': avatarU
})
},
toChangePassword(){

9
pages/mine/mine.wxml

@ -1,15 +1,13 @@
<!--pages/mine/mine.wxml-->
<view class="header">
<view class="navigation" style="height: {{navigationHeight}}px; top: {{statusHeight}}px;">
我的
<view style="margin-top: 60rpx;">我的</view>
</view>
<view class="content">
<view class="left"><image src="../../images/mine/lz.png" mode=""/></view>
<view class="left"><image wx:if="{{avatar}}" src="{{avatar}}" mode="aspectFill"/></view>
<view class="right">
<view class="top"> <b>{{userName}}</b> <text>{{agencyName}}</text></view>
<view class="bto">
<!-- <view> <image src="../../images/mine/wgz.png" mode=""/> 网格长 </view> -->
<!-- <view> <image src="../../images/mine/lz.png" mode=""/> 楼长 </view> -->
<view class="text-wrapper_24">
<text class="text_63">网格长</text>
</view>
@ -20,7 +18,9 @@
</view>
</view>
</view>
<view class="nase">
<view class="body">
<view class="card">
<!-- <view class="item" bind:tap="handelInformation">
<view class="left">
@ -73,5 +73,6 @@
<view class="right"> <image src="../../images/right.png" mode=""/></view>
</view>
</view>
</view>
</view>
<custom-tab-bar></custom-tab-bar>

12
pages/mine/mine.wxss

@ -5,6 +5,15 @@ page{
background-color: #f7f7f7;
}
.nase{
height: 100%;
border: 3rpx solid #F7F7F7;
border-radius: 30rpx;
position: relative;
top: -20rpx;
background: #F7F7F7;
}
.header {
width: 100%;
@ -33,7 +42,7 @@ page{
margin-right: 17rpx;
}
.header .content{
margin:80rpx 0 0;
margin:60rpx 0 0;
height: 130rpx;
width: 100%;
padding: 0 30rpx;
@ -95,6 +104,7 @@ page{
margin-top: 30rpx;
}
.body .card {
background-color: #ffffff;
border-radius: 20rpx;

Loading…
Cancel
Save