This commit is contained in:
zzc
2026-02-02 14:59:34 +08:00
parent 1ce775436d
commit 526e2aad70
12 changed files with 89 additions and 80 deletions

View File

@@ -12,7 +12,7 @@
class="avatar-selector custom-button" class="avatar-selector custom-button"
> >
<image v-if="avatarUrl" :src="avatarUrl" class="avatar-preview" /> <image v-if="avatarUrl" :src="avatarUrl" class="avatar-preview" />
<text v-else>获取头像</text> <text v-else>点击获取头像</text>
</button> </button>
<input <input
class="nickname-input" class="nickname-input"
@@ -45,6 +45,19 @@ const userStore = useUserStore();
const emit = defineEmits(["logind"]); const emit = defineEmits(["logind"]);
const festivalNames = [
'春意','福星','小福','新禧','瑞雪','花灯','喜乐','元宝','春芽','年年',
'花灯','月圆','灯影','小灯','星灯','彩灯',
'清风','微风','小晴','碧波','流泉',
'月光','玉轮','桂香','秋叶','星河','小月','露华','秋水',
'雪落','冰晶','暖阳','小雪','冬影','雪花','松影'
];
const getFestivalName = () => {
const idx = Math.floor(Math.random() * festivalNames.length);
return festivalNames[idx];
}
const open = () => { const open = () => {
popupRef.value.open(); popupRef.value.open();
}; };
@@ -62,11 +75,11 @@ const confirmLogin = async () => {
const platform = getPlatformProvider(); const platform = getPlatformProvider();
if (platform === "mp-weixin") { if (platform === "mp-weixin") {
const code = await wxLogin(); const code = await wxLogin();
const imageUrl = await uploadImage(avatarUrl.value); const imageUrl = avatarUrl.value ? await uploadImage(avatarUrl.value) : "";
const loginRes = await apiLogin({ const loginRes = await apiLogin({
code, code,
nickname: nickname.value, nickname: nickname.value || getFestivalName(),
avatarUrl: imageUrl, avatarUrl: imageUrl,
platform: "wx", platform: "wx",
}); });

View File

@@ -1,28 +1,28 @@
{ {
"name" : "tpl-mini", "name": "tpl-mini",
"appid" : "", "appid": "",
"description" : "", "description": "",
"versionName" : "1.0.0", "versionName": "1.0.0",
"versionCode" : "100", "versionCode": "100",
"transformPx" : false, "transformPx": false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus": {
"usingComponents" : true, "usingComponents": true,
"nvueStyleCompiler" : "uni-app", "nvueStyleCompiler": "uni-app",
"compilerVersion" : 3, "compilerVersion": 3,
"splashscreen" : { "splashscreen": {
"alwaysShowBeforeRender" : true, "alwaysShowBeforeRender": true,
"waiting" : true, "waiting": true,
"autoclose" : true, "autoclose": true,
"delay" : 0 "delay": 0
}, },
/* */ /* */
"modules" : {}, "modules": {},
/* */ /* */
"distribute" : { "distribute": {
/* android */ /* android */
"android" : { "android": {
"permissions" : [ "permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
@@ -41,33 +41,34 @@
] ]
}, },
/* ios */ /* ios */
"ios" : {}, "ios": {},
/* SDK */ /* SDK */
"sdkConfigs" : {} "sdkConfigs": {}
} }
}, },
/* */ /* */
"quickapp" : {}, "quickapp": {},
/* */ /* */
"mp-weixin" : { "mp-weixin": {
"appid" : "wx3fcc07a061af049a", "appid": "wx3fcc07a061af049a",
"setting" : { "setting": {
"urlCheck" : false "urlCheck": false
}, },
"usingComponents" : true "usingComponents": true,
"lazyCodeLoading": "requiredComponents"
}, },
"mp-alipay" : { "mp-alipay": {
"usingComponents" : true, "usingComponents": true,
"appid" : "2021006125616610" "appid": "2021006125616610"
}, },
"mp-baidu" : { "mp-baidu": {
"usingComponents" : true "usingComponents": true
}, },
"mp-toutiao" : { "mp-toutiao": {
"usingComponents" : true "usingComponents": true
}, },
"uniStatistics" : { "uniStatistics": {
"enable" : false "enable": false
}, },
"vueVersion" : "3" "vueVersion": "3"
} }

View File

@@ -178,10 +178,5 @@
} }
] ]
}, },
"uniIdRouter": {}, "uniIdRouter": {}
"permission": {
"scope.userLocation": {
"desc": "用于获取您的当前位置,以显示附近景点和打卡功能"
}
}
} }

View File

@@ -517,7 +517,7 @@ const targetName = ref("祝您");
const signatureName = ref(userStore?.userInfo?.nickName || "xxx"); const signatureName = ref(userStore?.userInfo?.nickName || "xxx");
const userAvatar = ref( const userAvatar = ref(
userStore?.userInfo?.avatarUrl || userStore?.userInfo?.avatarUrl ||
"https://file.lihailezzc.com/resource/b48c41054c2633c478463ac1b1f1ca23.png", "https://file.lihailezzc.com/resource/96023631c6ab9c3496b7620097af3d6f.png",
); );
const blessingText = ref({}); const blessingText = ref({});

View File

@@ -18,7 +18,7 @@
<view class="user-card" @tap="handleUserClick"> <view class="user-card" @tap="handleUserClick">
<view class="avatar-box"> <view class="avatar-box">
<image :src="userInfo.avatarUrl" class="avatar" mode="aspectFill" /> <image :src="userInfo.avatarUrl" class="avatar" mode="aspectFill" />
<view class="red-badge"><text class="fire">🔥</text></view> <!-- <view class="red-badge"><text class="fire">🔥</text></view> -->
</view> </view>
<view class="user-info"> <view class="user-info">
<view class="row-1"> <view class="row-1">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB