四端上传
This commit is contained in:
1 parent
25bbb5f9c8
commit
c6e2cb4d5b
276 files changed
+17812
-3
No files matched your search
@@ -0,0 +1,85 @@
|
||||
// pages/wode/wode.js
|
||||
const api = require('../../utils/api');
|
||||
const store = require('../../utils/store');
|
||||
const config = require('../../config/index');
|
||||
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
showCode: false,
|
||||
headiconUrl: '',
|
||||
isLoggedIn: false,
|
||||
userNameText: '未登录',
|
||||
loginBtnText: '登录注册',
|
||||
version: '',
|
||||
qrcodeUrl: '',
|
||||
text2: '',
|
||||
text3: '',
|
||||
text4: '',
|
||||
text5: '',
|
||||
text6: '',
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
app.ready().then(() => {
|
||||
this.applyConfig();
|
||||
this.applyUser();
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
if (store.getSiteConfig() && Object.keys(store.getSiteConfig()).length) this.applyConfig();
|
||||
this.applyUser();
|
||||
},
|
||||
|
||||
applyConfig() {
|
||||
const qrcodeName = store.cfg('profile.qrcode_image', '');
|
||||
this.setData({
|
||||
version: store.cfg('site.version', 'V0.0.9'),
|
||||
text2: store.cfg('profile.menu.change_info', '修改资料'),
|
||||
text3: store.cfg('profile.menu.share', '好友分享'),
|
||||
text4: store.cfg('profile.menu.contact', '在线沟通'),
|
||||
text5: store.cfg('profile.menu.wechat', '添加微信:叶雷讲数学'),
|
||||
text6: store.cfg('profile.qrcode_caption', '长按识别二维码'),
|
||||
qrcodeUrl: qrcodeName ? config.STATIC_BASE_URL + '/Images/WXCode/' + qrcodeName + '.png' : '',
|
||||
});
|
||||
},
|
||||
|
||||
applyUser() {
|
||||
const user = store.getUser();
|
||||
// 已登录 = 有 token 且设置过昵称;未设置昵称的仍是游客,与旧版语义一致
|
||||
const registered = !!(user && user.nickname);
|
||||
this.setData({
|
||||
isLoggedIn: registered,
|
||||
userNameText: registered ? user.nickname : '未登录',
|
||||
loginBtnText: registered ? '退出登录' : '登录注册',
|
||||
headiconUrl: user && user.headiconUrl ? user.headiconUrl : config.STATIC_BASE_URL + config.PLACEHOLDER.USER,
|
||||
});
|
||||
},
|
||||
|
||||
toLoginOrOut() {
|
||||
wx.navigateTo({ url: '/pages/LoginOrOutDetails/LoginOrOutDetails' });
|
||||
},
|
||||
|
||||
toChangeUserInfo() {
|
||||
if (!this.data.isLoggedIn) {
|
||||
wx.showToast({ mask: true, icon: 'error', title: '请先登录' });
|
||||
return;
|
||||
}
|
||||
wx.navigateTo({ url: '/pages/ChangeUserInfo/ChangeUserInfo' });
|
||||
},
|
||||
|
||||
showQrcode() {
|
||||
this.setData({ showCode: true });
|
||||
},
|
||||
|
||||
onCodeClose() {
|
||||
this.setData({ showCode: false });
|
||||
},
|
||||
|
||||
onShareAppMessage() {
|
||||
return { title: '叶雷讲数学', path: '/pages/index/index' };
|
||||
},
|
||||
});
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-popup": "@vant/weapp/popup/index",
|
||||
"van-image": "@vant/weapp/image/index"
|
||||
},
|
||||
"navigationBarTitleText": "个人中心"
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<!--pages/wode/wode.wxml-->
|
||||
<van-popup show="{{ showCode }}" bind:close="onCodeClose">
|
||||
<view class="code-container">
|
||||
<text class="tip-text">{{text6}}</text>
|
||||
<van-image
|
||||
show-menu-by-longpress="true"
|
||||
use-loading-slot
|
||||
use-error-slot
|
||||
width="600rpx"
|
||||
height="816rpx"
|
||||
src="{{qrcodeUrl}}"
|
||||
/>
|
||||
<van-loading slot="loading" type="spinner" size="20" vertical />
|
||||
</view>
|
||||
</van-popup>
|
||||
|
||||
<scroll-view class="container" scroll-y enable-flex type="custom">
|
||||
<view class="login">
|
||||
<view class="touxiangimg">
|
||||
<image class="loginuserimg" src="{{headiconUrl}}" mode="aspectFill" />
|
||||
</view>
|
||||
|
||||
<view class="userinfo_name">
|
||||
<text>{{userNameText}}</text>
|
||||
<button class="loginbtn" bindtap="toLoginOrOut" plain>{{loginBtnText}}</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<button wx:if="{{isLoggedIn}}" class="functions2" bind:tap="toChangeUserInfo">
|
||||
<text class="zuobianwenzi">{{text2}}</text>
|
||||
<text class="jiantou"> > </text>
|
||||
</button>
|
||||
|
||||
<button class="functions2" open-type="share">
|
||||
<text class="zuobianwenzi">{{text3}}</text>
|
||||
<text class="jiantou"> > </text>
|
||||
</button>
|
||||
|
||||
<button class="functions2" open-type="contact">
|
||||
<text class="zuobianwenzi">{{text4}}</text>
|
||||
<text class="jiantou"> > </text>
|
||||
</button>
|
||||
|
||||
<button class="functions2" bind:tap="showQrcode">
|
||||
<text class="zuobianwenzi">{{text5}}</text>
|
||||
<text class="jiantou"> > </text>
|
||||
</button>
|
||||
|
||||
<view class="version">
|
||||
<text style="display: block;">Version {{version}}</text>
|
||||
<text style="font-size: 20rpx;display: block;">Copyright<text style="font-size: 15rpx;position: relative;top: -10rpx;right: 0rpx;">©</text> 2026 YelayMaths. All Rights Reserved.</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
/* pages/wode/wode.wxss */
|
||||
.container {
|
||||
padding:0;
|
||||
align-items:center;
|
||||
flex-direction:column;
|
||||
justify-content:space-between;
|
||||
}
|
||||
.code-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center; /* 水平居中 */
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: rgb(0, 201, 77);
|
||||
}
|
||||
|
||||
/* 文字样式:可选加粗、颜色、间距等 */
|
||||
.tip-text {
|
||||
font-size: 34rpx;
|
||||
color: #ffffff;
|
||||
margin-bottom: 20rpx; /* 与图片保持间距 */
|
||||
text-align: center; /* 冗余保险,虽然 flex 已居中 */
|
||||
}
|
||||
|
||||
.login {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
/* border: 3rpx solid rgb(110, 110, 110); */
|
||||
width: 710rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 20rpx;
|
||||
margin: 20rpx;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.touxiangimg {
|
||||
display: flex;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
.userinfo_name {
|
||||
width: 500rpx;
|
||||
height: 150rpx;
|
||||
margin-left: 30rpx;
|
||||
border-radius: 75rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.loginbtn {
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
.loginbtn[plain] {
|
||||
color: #353535;
|
||||
background-color: transparent;
|
||||
border: 0px solid #353535;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
|
||||
padding: 0rpx 20rpx;
|
||||
}
|
||||
.loginuserimg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.functions1 {
|
||||
border: 3rpx solid rgb(110, 110, 110);
|
||||
width: 670rpx;
|
||||
border-radius: 20rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
|
||||
padding: 20rpx;
|
||||
}
|
||||
.functions2 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
/* border: 3rpx solid rgb(110, 110, 110); */
|
||||
background-color: white;
|
||||
width: 710rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 20rpx;
|
||||
margin: 8rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.jiantou {
|
||||
font-size: 40rpx;
|
||||
}
|
||||
.zuobianwenzi {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.function001 {
|
||||
height: 150rpx;
|
||||
width: 75rpx;
|
||||
|
||||
padding: 10rpx 47rpx;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
.functionimg001 {
|
||||
width: 75rpx;
|
||||
height: 75rpx;
|
||||
}
|
||||
|
||||
.functionimg002 {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
.functiontext001 {
|
||||
font-size: 25rpx;
|
||||
}
|
||||
.functionstools {
|
||||
position: relative;
|
||||
top: 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
.version {
|
||||
position: fixed;
|
||||
bottom: 10rpx;
|
||||
color: rgb(197, 197, 197);
|
||||
font-size: 25rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user