Initial commit to Gitea

This commit is contained in:
root
2026-05-04 00:43:20 +08:00
parent 1e0b2b125b
commit d76c7d5eac
422 changed files with 5233 additions and 1514 deletions
-116
View File
@@ -1,116 +0,0 @@
.page {
background: #f5f5f5;
min-height: 100vh;
.action{
display: flex;
justify-content: flex-end;
padding: 10rpx;
background: #4B79EC;
view{
padding: 10rpx;
margin: 0 10rpx;
border-radius: 8rpx;
width: 45rpx;
height: 45rpx;
&:active{
background: #ccc;
}
image{
width: 45rpx;
height: 45rpx;
}
}
}
.user{
display: flex;
align-items: center;
padding: 25rpx;
background: #4B79EC;
&:active{
background: #f0f0f0;
}
.avatar{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
// border: 3px solid #3a5fb6;
}
.right{
width: 30rpx;
height: 30rpx;
}
.name{
flex-grow: 1;
display: flex;
flex-direction: column;
padding-left: 20rpx;
text{
color: #fff;
&:nth-child(1){
font-size: 16px;
font-weight: bold;
}
&:nth-child(2){
font-size: 12px;
color: #f0f0f0;
}
}
}
}
.card{
background: #fff;
box-sizing: border-box;
width: 700rpx;
margin: auto;
padding: 15rpx;
margin-top: 20rpx;
border-radius: 12rpx;
.menu{
.item{
display: flex;
height: 100rpx;
align-items: center;
padding: 0 20rpx;
box-sizing: border-box;
width: 700rpx;
&:active{
background: #f0f0f0;
}
image{
height: 45rpx;
width: 45rpx;
}
view{
font-size: 14px;
color: #444;
padding-left: 15rpx;
box-sizing: border-box;
width: calc(100% - 100rpx);
}
.arrow{
width: 26rpx;
height: 26rpx;
}
}
}
}
}
+279 -277
View File
@@ -1,59 +1,115 @@
<template>
<view class="page">
<view>
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog type="info" cancelText="关闭" confirmText="继续" title="提示" content="该功能还在开发中!"
@confirm="dialogConfirm" @close="dialogClose">
</uni-popup-dialog>
</uni-popup>
</view>
<view class="action">
<view>
<image src="/static/center/scan.png" @click="toScan()">
</image>
</view>
<view>
<image src="/static/center/setting.png" @click="toSetting()">
</image>
</view>
</view>
<view class="user" @click="toPersonalpage()">
<cloud-image v-if="userInfo.avatar_file"
width="120rpx" height="120rpx" border-radius="50%"
:src="userInfo.avatar_file.url"></cloud-image>
<image class="avatar"
src="https://qnycdn.mymoyu.top/static/avatar.jpg"
mode="" v-else></image>
<view class="name">
<text>{{userInfo.nickname?userInfo.nickname:"未登录"}}</text>
<text>个人签名</text>
</view>
<image class="right" src="/static/center/right.png"></image>
</view>
<view class="card" v-for="(v, k) in menus" :key="k">
<view class="menu">
<view class="item" v-for="(v_, k_) in v" :key="k_" @click="menuClick(v_)">
<image :src="v_.icon"></image>
<view>{{v_.name}}</view>
<image class="arrow" v-if="v_.arrow" src="/static/center/right.png"></image>
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog
type="info"
cancelText="关闭"
confirmText="继续"
title="提示"
content="该功能还在开发中!"
@confirm="dialogConfirm"
@close="dialogClose"
/>
</uni-popup>
<view class="hero">
<view class="hero__toolbar">
<view class="toolbar-btn" @click="toScan">
<image src="/static/center/scan.png" mode="aspectFit" />
</view>
<view class="toolbar-btn" @click="toSetting">
<image src="/static/center/setting.png" mode="aspectFit" />
</view>
</view>
<view class="profile-card" @click="toUserInfoPage">
<view class="profile-main">
<cloud-image
v-if="userInfo.avatar_file"
width="132rpx"
height="132rpx"
border-radius="50%"
:src="userInfo.avatar_file.url"
/>
<image
v-else
class="avatar"
src="/static/center/avatar.png"
mode="aspectFill"
/>
<view class="profile-copy">
<text class="profile-name">{{ isLogin ? (userInfo.nickname || '默认用户') : '立即登录' }}</text>
<text class="profile-desc">{{ profileDesc }}</text>
<view class="profile-tags">
<text class="profile-tag">{{ isLogin ? '已登录' : '游客模式' }}</text>
<text class="profile-tag" v-if="realNameStatus === 1">已实名</text>
</view>
</view>
</view>
<image class="profile-arrow" src="/static/center/right.png" mode="aspectFit" />
</view>
<view class="data-panel">
<view class="data-item" v-for="item in stats" :key="item.label" @click="menuClick(item.menu)">
<text class="data-value">{{ item.value }}</text>
<text class="data-label">{{ item.label }}</text>
</view>
</view>
</view>
<view class="content">
<view class="quick-panel">
<view class="section-head">
<text class="section-title">常用服务</text>
<text class="section-subtitle">快捷进入高频功能</text>
</view>
<view class="quick-grid">
<view class="quick-item" v-for="item in quickMenus" :key="item.type" @click="menuClick(item)">
<view class="quick-icon">
<image :src="item.icon" mode="aspectFit" />
</view>
<text class="quick-name">{{ item.name }}</text>
</view>
</view>
</view>
<view class="menu-panel" v-for="(group, index) in menuGroups" :key="index">
<view class="menu-cell" v-for="item in group" :key="item.type" @click="menuClick(item)">
<view class="menu-cell__left">
<view class="menu-cell__icon">
<image :src="item.icon" mode="aspectFit" />
</view>
<view class="menu-cell__copy">
<text class="menu-cell__name">{{ item.name }}</text>
<text class="menu-cell__desc">{{ item.desc }}</text>
</view>
</view>
<image class="menu-cell__arrow" src="/static/center/right.png" mode="aspectFit" />
</view>
</view>
<view class="logout-btn" @click="menuClick({ type: 'logout' })">退出当前账号</view>
</view>
</view>
</template>
<script>
import cloudImage from "@/components/cloud-image.vue"
const uniIdCo = uniCloud.importObject("uni-id-co")
import {
store,
mutations
} from '@/pages3/uni_modules/uni-id-pages/common/store.js';
} from '@/pages3/uni_modules/uni-id-pages/common/store.js'
export default {
components: {
cloudImage
},
computed: {
userInfo() {
return store.userInfo
return store.userInfo || {}
},
isLogin() {
return !!uni.getStorageSync('uni_id_token')
},
realNameStatus() {
if (!this.userInfo.realNameAuth) {
@@ -61,127 +117,145 @@
}
return this.userInfo.realNameAuth.authStatus
}
},
components:{
cloudImage
},
data() {
return {
avatar_url: "",
menus: [
[
{
name: '我的主页',
icon: '/static/center/self.png',
arrow: true,
type: 'my_account'
},
{
name: '我的关注',
icon: '/static/center/icon-follow.png',
arrow: true,
type: 'my_follow'
},
{
name: '新增文章',
icon: '/static/center/icon-follow.png',
arrow: true,
type: 'edit_cms'
},
{
name: '文章管理',
icon: '/static/center/icon-follow.png',
arrow: true,
type: 'cms_list'
},
{
name: '提现',
icon: '/static/center/withdraw.png',
arrow: true,
type: 'withdraw'
},
{
name: '回复我的',
icon: '/static/center/reply.png',
arrow: false,
type: 'my_reply'
},
{
name: '我的喜欢',
icon: '/static/center/like.png',
arrow: false,
type: 'my_like'
},
{
name: '浏览历史',
icon: '/static/center/history.png',
arrow: false,
type: 'history'
},
{
name: '我的收藏',
icon: '/static/center/collect.png',
arrow: false,
type: 'my_collect'
},
{
name: '充值记录',
icon: '/static/center/recharge.png',
arrow: false,
type: 'recharge'
},
],
[{
name: '联系客服',
icon: '/static/center/kefu.png',
arrow: true,
type: 'customer_service'
},
{
name: '分享应用',
icon: '/static/center/share.png',
arrow: false,
type: 'sharing_app'
},
{
name: '退出登录',
icon: '/static/center/out.png',
arrow: false,
type: 'logout'
},
]
},
profileDesc() {
if (!this.isLogin) {
return '登录后可同步查看收藏、历史与个人主页'
}
return this.userInfo.signature || '点击查看个人资料与账号设置'
},
stats() {
return [{
label: '收藏',
value: this.getCount('my_collection_count'),
menu: this.findMenuItem('my_collect')
}, {
label: '喜欢',
value: this.getCount('like_count'),
menu: this.findMenuItem('my_like')
}, {
label: '历史',
value: this.getCount('read_history_count'),
menu: this.findMenuItem('history')
}, {
label: '关注',
value: this.getCount('following_count'),
menu: this.findMenuItem('my_follow')
}]
},
quickMenus() {
return [
this.findMenuItem('my_collect'),
this.findMenuItem('history'),
this.findMenuItem('my_reply'),
this.findMenuItem('customer_service')
].filter(Boolean)
},
menuGroups() {
return [
['my_account', 'my_follow', 'edit_cms', 'cms_list'].map(this.findMenuItem).filter(Boolean),
['withdraw', 'recharge', 'sharing_app', 'customer_service'].map(this.findMenuItem).filter(Boolean)
]
}
},
onLoad() {
console.log(this.userInfo);
},
async created() {
if (this.userInfo) {
this.avatar_url = await this.getFileUrl();
console.log(this.avatar_url);
data() {
return {
menuMap: {
my_account: {
name: '我的主页',
icon: '/static/center/self.png',
desc: '查看个人主页与公开动态',
type: 'my_account'
},
my_follow: {
name: '我的关注',
icon: '/static/center/icon-follow.png',
desc: '关注的人与内容动态',
type: 'my_follow'
},
edit_cms: {
name: '新增文章',
icon: '/static/center/release.png',
desc: '快速发布新的文章内容',
type: 'edit_cms'
},
cms_list: {
name: '文章管理',
icon: '/static/center/book.png',
desc: '编辑或管理已发布文章',
type: 'cms_list'
},
withdraw: {
name: '提现中心',
icon: '/static/center/withdraw.png',
desc: '查看余额并申请提现',
type: 'withdraw'
},
reply: {
name: '回复我的',
icon: '/static/center/reply.png',
desc: '查看收到的回复消息',
type: 'my_reply'
},
my_reply: {
name: '回复我的',
icon: '/static/center/reply.png',
desc: '查看收到的回复消息',
type: 'my_reply'
},
my_like: {
name: '我的喜欢',
icon: '/static/center/like.png',
desc: '收藏喜欢的内容足迹',
type: 'my_like'
},
history: {
name: '浏览历史',
icon: '/static/center/history.png',
desc: '继续查看最近浏览记录',
type: 'history'
},
my_collect: {
name: '我的收藏',
icon: '/static/center/collect.png',
desc: '集中管理收藏内容',
type: 'my_collect'
},
recharge: {
name: '充值记录',
icon: '/static/center/recharge.png',
desc: '查看账户充值明细',
type: 'recharge'
},
customer_service: {
name: '联系客服',
icon: '/static/center/kefu.png',
desc: '获取帮助与问题反馈',
type: 'customer_service'
},
sharing_app: {
name: '分享应用',
icon: '/static/center/share.png',
desc: '把应用推荐给更多好友',
type: 'sharing_app'
},
logout: {
name: '退出登录',
icon: '/static/center/out.png',
desc: '安全退出当前登录状态',
type: 'logout'
}
}
}
},
methods: {
async getFileUrl() {
try {
const fileID = 'cloud://env-00jxt5y29hrd/67bcf790589f09b6fcf6c1621741070879567';
// 调用云开发 API 转换地址
const {
fileList
} = await uniCloud.getTempFileURL({
fileList: [fileID]
});
const realUrl = fileList[0].tempFileURL;
return realUrl;
} catch (err) {
console.error('转换失败:', err);
return 'https://qnycdn.mymoyu.top/static/avatar.jpg'; // 兜底默认图
}
getCount(field) {
const value = Number(this.userInfo[field] || 0)
return value > 99 ? '99+' : String(value)
},
findMenuItem(type) {
return this.menuMap[type]
},
dialogConfirm() {
console.log('点击确认')
@@ -192,158 +266,86 @@
dialogClose() {
console.log('点击关闭')
},
menuClick(e) {
if (e.type === "my_account") {
this.toPersonalpage();
}
else if (e.type === "my_follow") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
} else {
uni.navigateTo({
url: "/pages2/follow/follow"
})
}
requireLogin(next) {
const token = uni.getStorageSync('uni_id_token')
if (!token) {
this.toLogin()
return false
}
else if (e.type === "withdraw") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
} else {
uni.navigateTo({
url: "/pages2/balance/balance"
})
}
} else if (e.type === "my_reply") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
next && next()
return true
},
menuClick(item) {
if (!item || !item.type) {
return
}
if (!token) {
this.toLogin();
} else {
uni.navigateTo({
url: "/pages2/replyCommentList/replyCommentList"
})
}
} else if (e.type === "cms_list") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
} else {
uni.navigateTo({
url: "/pages2/edit_list/edit_list"
})
}
} else if (e.type === "edit_cms") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
} else {
uni.navigateTo({
url: "/pages2/editCms/editCms"
})
}
} else if (e.type === "my_collect") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
const routeMap = {
my_follow: '/pages2/follow/follow',
withdraw: '/pages2/balance/balance',
my_reply: '/pages2/replyCommentList/replyCommentList',
cms_list: '/pages2/edit_list/edit_list',
edit_cms: '/pages2/editCms/editCms',
my_collect: '/pages2/arctcleCollectList/arctcleCollectList',
my_like: '/pages2/arctcleLikeList/arctcleLikeList',
history: '/pages2/historyList/historyList'
}
if (!token) {
this.toLogin();
} else {
if (item.type === 'my_account') {
this.toPersonalpage()
return
}
if (routeMap[item.type]) {
this.requireLogin(() => {
uni.navigateTo({
url: "/pages2/arctcleCollectList/arctcleCollectList"
url: routeMap[item.type]
})
}
})
return
}
} else if (e.type === "my_like") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (item.type === 'customer_service' || item.type === 'sharing_app' || item.type === 'recharge') {
this.inputDialogToggle()
return
}
if (!token) {
this.toLogin();
} else {
uni.navigateTo({
url: "/pages2/arctcleLikeList/arctcleLikeList"
})
}
} else if (e.type === "customer_service") {
this.inputDialogToggle();
} else if (e.type === "sharing_app") {
this.inputDialogToggle();
} else if (e.type === "logout") {
if (item.type === 'logout') {
mutations.logout()
} else if (e.type === "history") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
} else {
uni.navigateTo({
url: "/pages2/historyList/historyList"
})
}
}
console.log(e);
},
toLogin() {
uni.navigateTo({
url: "../../pages3/uni_modules/uni-id-pages/pages/login/login-withoutpwd?type=weixin"
url: '../../pages3/uni_modules/uni-id-pages/pages/login/login-withoutpwd?type=weixin'
})
},
toUserInfoPage() {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
} else {
this.requireLogin(() => {
uni.navigateTo({
url: "../../pages3/uni_modules/uni-id-pages/pages/userinfo/userinfo?showLoginManage=true"
url: '../../pages3/uni_modules/uni-id-pages/pages/userinfo/userinfo?showLoginManage=true'
})
}
})
},
toPersonalpage() {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.requireLogin(() => {
uni.navigateTo({
url: "../../pages3/uni_modules/uni-id-pages/pages/login/login-withoutpwd?type=weixin"
url: '/uni_modules/zetank-personalpage/pages/personalpage/personalpage?uid=' + this.userInfo._id
})
} else {
uni.navigateTo({
url: "/uni_modules/zetank-personalpage/pages/personalpage/personalpage?uid=" + this
.userInfo._id
})
}
})
},
toScan() {
this.inputDialogToggle();
this.inputDialogToggle()
},
toSetting() {
uni.navigateTo({
url: "/pages2/setting/setting"
url: '/pages2/setting/setting'
})
},
},
}
}
}
</script>
<style lang="scss">
@import "./my.scss";
</style>
@import './my.scss';
</style>