diff --git a/api/card.js b/api/card.js new file mode 100644 index 0000000..cbddc9c --- /dev/null +++ b/api/card.js @@ -0,0 +1,16 @@ +import { request } from "@/utils/request.js"; + +export const getCardDetail = async (shareToken) => { + return request({ + url: "/api/blessing/card?shareToken=" + shareToken, + method: "GET", + }); +}; + +export const createCardShareToken = async (data) => { + return request({ + url: "/api/blessing/card/share", + method: "POST", + data, + }); +}; diff --git a/api/make.js b/api/make.js new file mode 100644 index 0000000..2e86d21 --- /dev/null +++ b/api/make.js @@ -0,0 +1,17 @@ +import { request } from "@/utils/request.js"; + +export const createCardTmp = async (data) => { + return request({ + url: "/api/blessing/card/template", + method: "POST", + data, + }); +}; + +export const updateCard = async (data) => { + return request({ + url: "/api/blessing/card", + method: "PUT", + data, + }); +}; diff --git a/components/LoginPopup/LoginPopup.vue b/components/LoginPopup/LoginPopup.vue index b6e1b00..c455ac2 100644 --- a/components/LoginPopup/LoginPopup.vue +++ b/components/LoginPopup/LoginPopup.vue @@ -30,8 +30,6 @@ import { getPlatformProvider } from '@/utils/system' import { apiLogin } from '@/api/auth.js' import { wxLogin } from '@/utils/login.js' -// import { connectSocket, sendSocketMessage } from '@/utils/socket.js' - const popupRef = ref(null) const avatarUrl = ref('') const nickname = ref('') @@ -61,17 +59,17 @@ const confirmLogin = async () => { // console.log('准备登录:', { code, nickname: nickname.value, avatarUrl: 'http://tmp/HXhtcEwQ5A3B58476c91ba545ab67c6bf9c67d9c2559.jpeg' }) const fileKeyRes = await uni.uploadFile({ - url: 'https://apis.lihailezzc.com/api/common/upload', + url: 'https://api.ai-meng.com/api/common/upload', filePath: avatarUrl.value, name: 'file', // 和后端接收文件字段名一致 header: { - 'x-app-id': '6846f093fdf841f6189ef0b5', + 'x-app-id': '69665538a49b8ae3be50fe5d', }, }) if(fileKeyRes.statusCode < 400) { const keyJson = JSON.parse(fileKeyRes.data) const url = `https://file.lihailezzc.com/${keyJson?.data.key}` - const loginRes = await apiLogin({ code, nickname: nickname.value, avatarUrl: url }) + const loginRes = await apiLogin({ code, nickname: nickname.value, avatarUrl: url, platform: 'wx' }) // 保存用户信息到store userStore.setUserInfo({ nickName: loginRes?.user?.nickname || nickname.value, @@ -85,8 +83,6 @@ const confirmLogin = async () => { emit('logind') popupRef.value.close() - // connectSocket() - // 重置临时变量 avatarUrl.value = '' nickname.value = '' diff --git a/manifest.json b/manifest.json index 9d2e008..5d2d5be 100644 --- a/manifest.json +++ b/manifest.json @@ -50,7 +50,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "wx397b136a586c5667", + "appid" : "wx3fcc07a061af049a", "setting" : { "urlCheck" : false }, diff --git a/pages.json b/pages.json index a256bb4..1eba65b 100644 --- a/pages.json +++ b/pages.json @@ -6,7 +6,8 @@ "navigationBarTitleText": "新春祝福", "enablePullDownRefresh": true, "navigationStyle": "custom", - "backgroundColor": "#FFFFFF" + "backgroundColor": "#FFFFFF", + "enableShareAppMessage": true } }, { @@ -24,6 +25,14 @@ "enablePullDownRefresh": false, "navigationStyle": "custom" } + }, + { + "path": "pages/detail/index", + "style": { + "navigationBarTitleText": "新春祝福详情", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } } ], "globalStyle": { @@ -45,7 +54,7 @@ "selectedIconPath": "static/images/tabBar/home_s.png" }, { - "text": "讨论", + "text": "制作", "pagePath": "pages/make/index", "iconPath": "static/images/tabBar/message.png", "selectedIconPath": "static/images/tabBar/message_s.png" diff --git a/pages/detail/index.vue b/pages/detail/index.vue new file mode 100644 index 0000000..f6e78f1 --- /dev/null +++ b/pages/detail/index.vue @@ -0,0 +1,524 @@ + + + + + diff --git a/pages/index/index.vue b/pages/index/index.vue index d450d78..c0a9156 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -4,14 +4,14 @@ - 距春节还有 25 天 + 距春节还有 30 天 2026 新春祝福 新年快乐,万事如意! - + @@ -22,9 +22,14 @@ class="feature-item" @tap="onFeatureTap(item)" > - + {{ item.title }} {{ item.subtitle }} @@ -53,10 +58,17 @@ {{ card.title }} - {{ card.tag }} + {{ card.tag }} {{ card.desc }} - {{ card.cta }} > + {{ card.cta }} > @@ -65,75 +77,112 @@ \ No newline at end of file +.use-desc { + margin-top: 6rpx; + font-size: 24rpx; + color: #777; + line-height: 1.5; +} +.use-cta { + margin-top: 10rpx; + font-size: 24rpx; + color: #ff3b30; +} + diff --git a/pages/make/index.vue b/pages/make/index.vue index 8faae1c..9b5d83a 100644 --- a/pages/make/index.vue +++ b/pages/make/index.vue @@ -8,13 +8,15 @@ 新春快乐 2026 YEAR OF THE HORSE - - {{ blessingText }} + + {{ + targetName + "\n " + blessingText + }} - + @@ -60,23 +62,80 @@ > {{ tpl.name }} - + - - 编辑祝福语 -