This commit is contained in:
2025-03-28 16:27:26 +08:00
parent f654e16c18
commit a3e6a6d8b8
494 changed files with 4072 additions and 47246 deletions
+147 -192
View File
@@ -2,45 +2,28 @@
<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 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>
<image src="/static/center/scan.png" @click="toScan()">
</image>
</view>
<view>
<image
src="/static/center/setting.png"
@click="toSetting()">
</image></view>
<image src="/static/center/setting.png" @click="toSetting()">
</image>
</view>
</view>
<view class="user" @click="toPersonalpage()">
<!-- <svg t="1739689350355" class="avatar" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4351" width="16" height="16"><path d="M499.952941 0c-144.564706 0-265.035294 123.482353-265.035294 268.047059 0 147.576471 120.470588 268.047059 265.035294 268.047059s268.047059-120.470588 268.047059-268.047059C764.988235 120.470588 644.517647 0 499.952941 0m189.741177 566.211765H334.305882C150.588235 566.211765 0 716.8 0 903.529412v21.082353C0 1024 147.576471 1024 334.305882 1024h352.376471c177.694118 0 334.305882 0 334.305882-96.376471v-21.082353c6.023529-189.741176-144.564706-340.329412-331.294117-340.329411" fill="#1296db" p-id="4352"></path></svg> -->
<!-- <image class="avatar"
:src="this.avatar_url"
mode=""
v-if="this.avatar_url"></image>
<image class="avatar"
src="https://env-00jxt5y29hrd.normal.cloudstatic.cn/static/center/avatar.png?expire_at=1741157497&er_sign=9b8381ae7875137d28c57d502762691b"
mode=""
v-else></image> -->
<cloud-image v-if="userInfo.avatar_file" class="avatar"
<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://env-00jxt5y29hrd.normal.cloudstatic.cn/static/center/avatar.png?expire_at=1741157497&er_sign=9b8381ae7875137d28c57d502762691b"
mode=""
v-else></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>
@@ -60,101 +43,98 @@
</template>
<script>
import cloudImage from "@/components/cloud-image.vue"
const uniIdCo = uniCloud.importObject("uni-id-co")
import {
store,
mutations
} from '@/uni_modules/uni-id-pages/common/store.js';
import {
store,
mutations
} from '@/pages3/uni_modules/uni-id-pages/common/store.js';
export default {
computed: {
userInfo() {
return store.userInfo
},
realNameStatus () {
if (!this.userInfo.realNameAuth) {
return 0
}
return this.userInfo.realNameAuth.authStatus
}
userInfo() {
return store.userInfo
},
realNameStatus() {
if (!this.userInfo.realNameAuth) {
return 0
}
return this.userInfo.realNameAuth.authStatus
}
},
components:{
cloudImage
},
data() {
return {
avatar_url:"",
avatar_url: "",
menus: [
[
{
name: '我的文章',
icon: '/static/center/book.png',
arrow: true,
type: 'my_article'
},
{
name: '我的主页',
icon: '/static/center/self.png',
name: '我的主页',
icon: '/static/center/self.png',
arrow: true,
type: 'my_account'
},
{
name: '提现',
icon: '/static/center/withdraw.png',
name: '我的关注',
icon: '/static/center/icon-follow.png',
arrow: true,
type: 'my_follow'
},
{
name: '提现',
icon: '/static/center/withdraw.png',
arrow: true,
type: 'withdraw'
},
{
name: '发布文章',
icon: '/static/center/release.png',
arrow: true,
type: 'publish_article'
},
{
name: '回复我的',
icon: '/static/center/reply.png',
name: '回复我的',
icon: '/static/center/reply.png',
arrow: false,
type: 'my_reply'
},
{
name: '我的喜欢',
icon: '/static/center/like.png',
name: '我的喜欢',
icon: '/static/center/like.png',
arrow: false,
type: 'my_like'
},
{
name: '浏览历史',
icon: '/static/center/history.png',
name: '浏览历史',
icon: '/static/center/history.png',
arrow: false,
type: 'history'
},
{
name: '我的收藏',
icon: '/static/center/collect.png',
name: '我的收藏',
icon: '/static/center/collect.png',
arrow: false,
type: 'my_collect'
},
{
name: '充值记录',
icon: '/static/center/recharge.png',
name: '充值记录',
icon: '/static/center/recharge.png',
arrow: false,
type: 'recharge'
},
],
[
{
name: '联系客服',
icon: '/static/center/kefu.png',
[{
name: '联系客服',
icon: '/static/center/kefu.png',
arrow: true,
type: 'customer_service'
},
{
name: '分享应用',
icon: '/static/center/share.png',
name: '分享应用',
icon: '/static/center/share.png',
arrow: false,
type: 'sharing_app'
},
{
name: '退出登录',
icon: '/static/center/out.png',
name: '退出登录',
icon: '/static/center/out.png',
arrow: false,
type: 'logout'
},
@@ -165,29 +145,31 @@
onLoad() {
console.log(this.userInfo);
},
async created() {
async created() {
if (this.userInfo) {
this.avatar_url = await this.getFileUrl();
console.log(this.avatar_url);
}
},
},
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://env-00jxt5y29hrd.normal.cloudstatic.cn/static/center/avatar.png?expire_at=1741157497&er_sign=9b8381ae7875137d28c57d502762691b'; // 兜底默认图
}
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'; // 兜底默认图
}
},
dialogConfirm() {
console.log('点击确认')
@@ -198,53 +180,11 @@
dialogClose() {
console.log('点击关闭')
},
menuClick(e){
if (e.type === "my_article") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
}
else {
uni.navigateTo({
// url: "/pages/editor/editor"
url:'/uni_modules/uni-cms/pages/article/list/list'
})
}
}
else if (e.type === "my_account") {
menuClick(e) {
if (e.type === "my_account") {
this.toPersonalpage();
} 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 === "publish_article") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
}
else {
uni.navigateTo({
url:'/uni_modules/uni-cms/pages/article/add/add'
})
}
}
else if (e.type === "my_reply") {
else if (e.type === "my_follow") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
@@ -252,78 +192,92 @@
this.toLogin();
} else {
uni.navigateTo({
url:"/pages2/replyCommentList/replyCommentList"
url: "/pages2/follow/follow"
})
}
}
else if (e.type === "my_collect") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
}
else {
uni.navigateTo({
url:"/pages2/arctcleCollectList/arctcleCollectList"
})
}
}
else if (e.type === "my_like") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
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") {
mutations.logout()
} else if (e.type === "history" ) {
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 {
} else if (e.type === "my_reply") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
} else {
uni.navigateTo({
url: "/pages2/replyCommentList/replyCommentList"
})
}
} else if (e.type === "my_collect") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
if (!token) {
this.toLogin();
} else {
uni.navigateTo({
url: "/pages2/arctcleCollectList/arctcleCollectList"
})
}
} else if (e.type === "my_like") {
let token = uni.getStorageSync("uni_id_token");
console.log(token);
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") {
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:"/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 {
} else {
uni.navigateTo({
url: "/uni_modules/uni-id-pages/pages/userinfo/userinfo?showLoginManage=true"
url: "../../pages3/uni_modules/uni-id-pages/pages/userinfo/userinfo?showLoginManage=true"
})
}
@@ -333,11 +287,12 @@
console.log(token);
if (!token) {
uni.navigateTo({
url:"/uni_modules/uni-id-pages/pages/login/login-withoutpwd?type=weixin"
url: "../../pages3/uni_modules/uni-id-pages/pages/login/login-withoutpwd?type=weixin"
})
} else {
uni.navigateTo({
url: "/uni_modules/zetank-personalpage/pages/personalpage/personalpage?uid=" + this.userInfo._id
url: "/uni_modules/zetank-personalpage/pages/personalpage/personalpage?uid=" + this
.userInfo._id
})
}
},
@@ -346,10 +301,10 @@
},
toSetting() {
uni.navigateTo({
url:"/pages2/setting/setting"
url: "/pages2/setting/setting"
})
},
},
}