瀏覽代碼

修改样式

xiaohaizhao 3 月之前
父節點
當前提交
5138125517
共有 3 個文件被更改,包括 246 次插入209 次删除
  1. 168 168
      pages/tabbar/mine/index.js
  2. 60 13
      pages/tabbar/mine/index.scss
  3. 18 28
      pages/tabbar/mine/index.wxml

+ 168 - 168
pages/tabbar/mine/index.js

@@ -2,173 +2,173 @@ const _Http = getApp().globalData.http;
 let downCount = null;
 Page({
 
-	/**
-	 * 页面的初始数据
-	 */
-	data: {
-		userMsg: {},
-		pathList: [], //功能权限
-		teamAuth: '', //团队管理权限列表 JSON字符串 用于传递
-	},
-	onLoad(options) {
-		this.queryUserMsg();
-		getApp().globalData.Language.getLanguagePackage(this)
-		let authlist = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心']);
-		let pathList = [{
-			name: "修改登录密码",
-			icon: "icon-a-wodeguanyuyingyong",
-			color: "var(--warning)",
-			path: `/pages/tabbar/mine/changePassword/index`
-		}]
-		if (authlist.length) {
-			authlist[0].apps.forEach(v => {
-				switch (v.name) {
-					case "teamManagement":
-						pathList.unshift({
-							name: "团队管理",
-							icon: "icon-a-wodetuanduiguanli",
-							color: "var(--assist)",
-							path: `/${v.path}`
-						})
-						this.setData({
-							teamAuth: JSON.stringify(v.meta.auth)
-						})
-						break;
-				}
-			});
-			this.setData({
-				pathList
-			})
-		};
-	},
-	/* 查询用户信息 */
-	queryUserMsg() {
-		_Http.basic({
-			"classname": "common.usercenter.usercenter",
-			"method": "queryUserMsg",
-			"content": {
-				"nocache": true
-			}
-		}).then(res => {
-			console.log("查询用户信息", res)
-			if (res.code != '1') return wx.showToast({
-				title: res.msg,
-				icon: "none"
-			})
-			this.setData({
-				userMsg: res.data
-			})
-		})
-	},
-	onShow() {
-		this.getTabBar().init();
-	},
-	/* 退出登录 */
-	outLogin() {
-		clearTimeout(downCount);
-		wx.showLoading({
-			title: getApp().globalData.Language.getMapText('加载中') + '...',
-		})
-		downCount = setTimeout(() => {
-			_Http.logout().then(res => {
-				wx.showToast({
-					title: getApp().globalData.Language.getMapText('退出成功')
-				});
-				let loginMsg = wx.getStorageSync("loginMsg"),
-					languagecode = wx.getStorageSync("languagecode"),
-					logins = wx.getStorageSync("logins");
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        userMsg: {},
+        pathList: [], //功能权限
+        teamAuth: '', //团队管理权限列表 JSON字符串 用于传递
+    },
+    onLoad(options) {
+        this.queryUserMsg();
+        getApp().globalData.Language.getLanguagePackage(this)
+        let authlist = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['个人中心']);
+        let pathList = [{
+            name: "修改登录密码",
+            icon: "icon-a-wodeguanyuyingyong",
+            color: "var(--warning)",
+            path: `/pages/tabbar/mine/changePassword/index`
+        }]
+        if (authlist.length) {
+            authlist[0].apps.forEach(v => {
+                switch (v.name) {
+                    case "teamManagement":
+                        pathList.unshift({
+                            name: "团队管理",
+                            icon: "icon-a-wodetuanduiguanli",
+                            color: "var(--assist)",
+                            path: `/${v.path}`
+                        })
+                        this.setData({
+                            teamAuth: JSON.stringify(v.meta.auth)
+                        })
+                        break;
+                }
+            });
+            this.setData({
+                pathList
+            })
+        };
+    },
+    /* 查询用户信息 */
+    queryUserMsg() {
+        _Http.basic({
+            "classname": "common.usercenter.usercenter",
+            "method": "queryUserMsg",
+            "content": {
+                "nocache": true
+            }
+        }).then(res => {
+            console.log("查询用户信息", res)
+            if (res.code != '1') return wx.showToast({
+                title: res.msg,
+                icon: "none"
+            })
+            this.setData({
+                userMsg: res.data
+            })
+        })
+    },
+    onShow() {
+        this.getTabBar().init();
+    },
+    /* 退出登录 */
+    outLogin() {
+        clearTimeout(downCount);
+        wx.showLoading({
+            title: getApp().globalData.Language.getMapText('加载中') + '...',
+        })
+        downCount = setTimeout(() => {
+            _Http.logout().then(res => {
+                wx.showToast({
+                    title: getApp().globalData.Language.getMapText('退出成功')
+                });
+                let loginMsg = wx.getStorageSync("loginMsg"),
+                    languagecode = wx.getStorageSync("languagecode"),
+                    logins = wx.getStorageSync("logins");
 
-				wx.clearStorageSync();
-				wx.setStorageSync('loginMsg', loginMsg)
-				wx.setStorageSync('logins', logins)
-				wx.setStorageSync('isAgree', true)
-				wx.removeStorageSync('languagecode');
-				wx.setStorageSync('languagecode', languagecode)
-				setTimeout(() => {
-					wx.reLaunch({
-						url: '/pages/login/phone',
-					})
-				}, 300)
-			})
-		}, 300);
-	},
-	/* 去修改用户信息 */
-	changeUserMsg() {
-		let {
-			name,
-			phonenumber,
-			attinfos,
-			hr,
-			accountno
-		} = this.data.userMsg;
-		wx.navigateTo({
-			url: `./userMsg/index?attinfos=${JSON.stringify(attinfos)}&name=${name}&phonenumber=${phonenumber}&email=${hr.email}&accountno=${accountno}`
-		})
-	},
-	/* 绑定或解绑微信 */
-	bindingWechat(e) {
-		if (this.data.userMsg.iswechatbinding) {
-			let that = this;
-			wx.showModal({
-				title: getApp().globalData.Language.getMapText('提示'),
-				content: getApp().globalData.Language.getMapText('是否解除绑定'),
-				cancelText: getApp().globalData.Language.getMapText('取消'),
-				confirmText: getApp().globalData.Language.getMapText('确定'),
-				success: (res) => {
-					if (res.confirm) that.handleBDWechat(0);
-				}
-			})
-		} else {
-			this.handleBDWechat(1);
-		}
-	},
-	handleBDWechat(isbinging) {
-		let that = this;
-		wx.getUserProfile({
-			desc: getApp().globalData.Language.getMapText('用于完善用户资料'),
-			success: ({
-				userInfo
-			}) => {
-				wx.login({
-					success(res) {
-						if (res.code) _Http.basic({
-							"classname": "common.usercenter.usercenter",
-							"method": "WechatBinding",
-							content: {
-								"wechat_code": res.code,
-								isbinging, // 0解绑 1绑定
-								wechatuserinfo: userInfo,
-								"appid": "wx197f219a82a89d7b"
-							}
-						}).then(s => {
-							console.log("微信绑定", isbinging, s)
-							if (s.code != '1') return wx.showToast({
-								title: s.data,
-								icon: "none"
-							});
-							setTimeout(() => {
-								wx.showToast({
-									title: isbinging == 0 ? getApp().globalData.Language.getMapText('解绑成功') : getApp().globalData.Language.getMapText('绑定成功'),
-									icon: "none"
-								})
-							}, 100);
-							that.queryUserMsg();
-						})
-					}
-				})
-			},
-			fail: () => {
-				wx.showToast({
-					title: getApp().globalData.Language.getMapText('未获取授权'),
-					icon: "none"
-				})
-			}
-		})
-	},
-	/* 前去查询 */
-	bindingOfficialAccounts() {
-		wx.navigateTo({
-			url: './webView',
-		})
-	}
+                wx.clearStorageSync();
+                wx.setStorageSync('loginMsg', loginMsg)
+                wx.setStorageSync('logins', logins)
+                wx.setStorageSync('isAgree', true)
+                wx.removeStorageSync('languagecode');
+                wx.setStorageSync('languagecode', languagecode)
+                setTimeout(() => {
+                    wx.reLaunch({
+                        url: '/pages/login/phone',
+                    })
+                }, 300)
+            })
+        }, 300);
+    },
+    /* 去修改用户信息 */
+    changeUserMsg() {
+        let {
+            name,
+            phonenumber,
+            attinfos,
+            hr,
+            accountno
+        } = this.data.userMsg;
+        wx.navigateTo({
+            url: `./userMsg/index?attinfos=${JSON.stringify(attinfos)}&name=${name}&phonenumber=${phonenumber}&email=${hr.email}&accountno=${accountno}`
+        })
+    },
+    /* 绑定或解绑微信 */
+    bindingWechat(e) {
+        if (this.data.userMsg.iswechatbinding) {
+            let that = this;
+            wx.showModal({
+                title: getApp().globalData.Language.getMapText('提示'),
+                content: getApp().globalData.Language.getMapText('是否解除绑定'),
+                cancelText: getApp().globalData.Language.getMapText('取消'),
+                confirmText: getApp().globalData.Language.getMapText('确定'),
+                success: (res) => {
+                    if (res.confirm) that.handleBDWechat(0);
+                }
+            })
+        } else {
+            this.handleBDWechat(1);
+        }
+    },
+    handleBDWechat(isbinging) {
+        let that = this;
+        wx.getUserProfile({
+            desc: getApp().globalData.Language.getMapText('用于完善用户资料'),
+            success: ({
+                userInfo
+            }) => {
+                wx.login({
+                    success(res) {
+                        if (res.code) _Http.basic({
+                            "classname": "common.usercenter.usercenter",
+                            "method": "WechatBinding",
+                            content: {
+                                "wechat_code": res.code,
+                                isbinging, // 0解绑 1绑定
+                                wechatuserinfo: userInfo,
+                                "appid": "wx197f219a82a89d7b"
+                            }
+                        }).then(s => {
+                            console.log("微信绑定", isbinging, s)
+                            if (s.code != '1') return wx.showToast({
+                                title: s.data,
+                                icon: "none"
+                            });
+                            setTimeout(() => {
+                                wx.showToast({
+                                    title: isbinging == 0 ? getApp().globalData.Language.getMapText('解绑成功') : getApp().globalData.Language.getMapText('绑定成功'),
+                                    icon: "none"
+                                })
+                            }, 100);
+                            that.queryUserMsg();
+                        })
+                    }
+                })
+            },
+            fail: () => {
+                wx.showToast({
+                    title: getApp().globalData.Language.getMapText('未获取授权'),
+                    icon: "none"
+                })
+            }
+        })
+    },
+    /* 前去查询 */
+    bindingOfficialAccounts() {
+        wx.navigateTo({
+            url: './webView',
+        })
+    }
 })

+ 60 - 13
pages/tabbar/mine/index.scss

@@ -46,15 +46,55 @@
             }
         }
     }
+
+    /* 行动力 */
+    .display-data {
+        display: flex;
+        height: 182rpx;
+        background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, .5) 100%);
+
+        &_l,
+        &_r {
+            display: flex;
+            flex-direction: column;
+            justify-content: center;
+            align-items: center;
+            height: 100%;
+        }
+
+        &_l {
+            width: 320rpx;
+
+            .first-line {
+                height: 66rpx;
+                line-height: 66rpx;
+                font-size: 48rpx;
+                font-family: PingFang SC-Bold, PingFang SC;
+                font-weight: bold;
+            }
+
+            .tow-line {
+                height: 40rpx;
+                line-height: 40rpx;
+                font-size: 28rpx;
+                margin-top: 16rpx;
+            }
+        }
+
+        &_r {
+            flex: 1;
+            font-size: 28rpx;
+            line-height: 40rpx;
+
+            .tow-line {
+                margin-top: 25rpx;
+            }
+        }
+    }
 }
 
 .operating {
-    width: 690rpx;
-    margin: 0 auto;
     background-color: #fff;
-    margin-top: 40rpx;
-    border-radius: 16rpx;
-    overflow: hidden;
 
     .item {
         width: 100%;
@@ -130,12 +170,19 @@
     }
 }
 
-/* 退出登录 */
-.out-login {
-    width: 500rpx;
-    height: 90rpx;
-    border-radius: 90rpx !important;
-    font-size: 28rpx;
-    font-family: PingFang SC-Regular, PingFang SC;
-    color: #333333 !important;
+.but {
+    position: fixed;
+    bottom: 200rpx;
+    width: 100vw;
+    text-align: center;
+
+    /* 退出登录 */
+    .out-login {
+        width: 500rpx;
+        height: 90rpx;
+        border-radius: 90rpx !important;
+        font-size: 28rpx;
+        font-family: PingFang SC-Regular, PingFang SC;
+        color: #333333 !important;
+    }
 }

+ 18 - 28
pages/tabbar/mine/index.wxml

@@ -1,5 +1,5 @@
 <view class="user-box">
-    <navigator url="#" class="user-con" bindtap="changeUserMsg">
+    <navigator url="#" class='user-con' hover bindtap="changeUserMsg">
         <van-image image-class="v-img" round width="128rpx" height="128rpx" src="{{userMsg.attinfos[0].url||'/static/image/user.png'}}" />
         <view class="user-msg">
             <view class="user-name line-1">
@@ -12,19 +12,8 @@
         <van-icon size='40rpx' name="arrow" />
     </navigator>
 </view>
-
-<view class="operating"><!-- wx:if="{{userMsg.enterprise.sys_enterpriseid}}" -->
-    <navigator class="item" url="/pages/tabbar/mine/address/index?id={{userMsg.enterprise.sys_enterpriseid}}">
-        <view class="con">
-            <view class="label">
-                <text class="iconfont icon-a-wodemendianxinxidizhi" style="color: #085CDF;" />
-                {{language['我的地址']||'我的地址'}}
-            </view>
-            <view class="item-right">
-                <van-icon size='30rpx' name="arrow" />
-            </view>
-        </view>
-    </navigator>
+<view style="height: 20rpx;"></view>
+<view class='operating' hover>
     <navigator class="item" url="{{item.name=='团队管理'?item.path+'?auth='+teamAuth:item.path}}" wx:for="{{pathList}}">
         <view class="con">
             <view class="label">
@@ -36,7 +25,6 @@
             </view>
         </view>
     </navigator>
-
     <navigator class="item" url="#" bindtap="bindingWechat">
         <view class="con">
             <view class="label">
@@ -53,19 +41,21 @@
             </view>
         </view>
     </navigator>
-    <!-- 	<navigator wx:if="{{userMsg.iswechatbinding}}" class="item" url="#" bindtap="bindingOfficialAccounts">
-		<view class="con">
-			<view class="label">
-				<text class="iconfont icon-a-wodebangdingweixin" style="color: var(--success);" />
-				消息通知设置
-			</view>
-			<view class="item-right">
-				<van-icon size='30rpx' name="arrow" />
-			</view>
-		</view>
-	</navigator> -->
+    <navigator wx:if="{{userMsg.iswechatbinding}}" class="item" url="#" bindtap="bindingOfficialAccounts">
+        <view class="con">
+            <view class="label">
+                <text class="iconfont icon-a-wodebangdingweixin" style="color: var(--success);" />
+                {{language['消息通知设置']||'消息通知设置'}}
+            </view>
+            <view class="item-right">
+                <van-icon size='30rpx' name="arrow" />
+            </view>
+        </view>
+    </navigator>
 </view>
-<view style="width: 100vw;text-align: center;margin-top: 200rpx;">
-    <van-button custom-class='out-login' color="#CCC" bindtap="outLogin" plain>{{language['退出登录']||'退出登录'}}</van-button>
+<view class="but">
+    <van-button custom-class='out-login' color="#CCC" bindtap="outLogin" plain>
+        {{language['退出登录']||'退出登录'}}
+    </van-button>
 </view>
 <view style="height: 140rpx;" />