From 4b8498203d1f3a08f42702967ac8cb70c5da579c Mon Sep 17 00:00:00 2001 From: Tivibra Date: Sat, 27 Sep 2025 16:28:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + project.config.json | 28 + project.private.config.json | 7 + src/App.vue | 20 +- src/components/UserAgreement.vue | 137 +++- src/manifest.json | 17 +- src/pages.json | 22 +- src/pages/agreement/agreement.vue | 14 +- src/pages/chat/chat.vue | 1056 +++++++++++++++++++++++++++++ src/pages/index/index.vue | 857 ++++++++++++++++++----- src/pages/mine/mine.vue | 374 +++++++--- src/pages/splash/splash.vue | 783 +++++++++++++++++++++ src/static/bailing.jpg | Bin 0 -> 78790 bytes src/static/haomen.jpg | Bin 0 -> 78644 bytes src/static/tunvlang.jpg | Bin 0 -> 106054 bytes src/static/waimai.jpg | Bin 0 -> 83446 bytes src/stores/user.js | 159 +++-- src/utils/aiCharacters.js | 192 ++++++ src/utils/api.js | 554 +++++++++++++++ src/utils/debug.js | 119 ++++ test.md | 0 21 files changed, 3997 insertions(+), 343 deletions(-) create mode 100644 project.config.json create mode 100644 project.private.config.json create mode 100644 src/pages/chat/chat.vue create mode 100644 src/pages/splash/splash.vue create mode 100644 src/static/bailing.jpg create mode 100644 src/static/haomen.jpg create mode 100644 src/static/tunvlang.jpg create mode 100644 src/static/waimai.jpg create mode 100644 src/utils/aiCharacters.js create mode 100644 src/utils/api.js create mode 100644 src/utils/debug.js create mode 100644 test.md diff --git a/package.json b/package.json index 727e25d..50ccd4d 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "vue-i18n": "^9.1.9" }, "devDependencies": { + "@babel/plugin-transform-private-property-in-object": "^7.23.4", "@dcloudio/types": "^3.4.8", "@dcloudio/uni-automator": "3.0.0-4060420250429001", "@dcloudio/uni-cli-shared": "3.0.0-4060420250429001", diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..12aa3a6 --- /dev/null +++ b/project.config.json @@ -0,0 +1,28 @@ +{ + "appid": "wxff56c34ef9aceb62", + "compileType": "miniprogram", + "libVersion": "3.8.10", + "packOptions": { + "ignore": [], + "include": [] + }, + "setting": { + "coverView": true, + "es6": true, + "postcss": true, + "minified": true, + "enhance": true, + "showShadowRootInWxmlPanel": true, + "packNpmRelationList": [], + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + } + }, + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 4 + } +} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json new file mode 100644 index 0000000..76ecff9 --- /dev/null +++ b/project.private.config.json @@ -0,0 +1,7 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "webUI", + "setting": { + "compileHotReLoad": true + } +} \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 3279daf..8b90be5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,21 +3,11 @@ export default { onLaunch: function () { console.log('App Launch'); - // 检查本地存储中是否有同意协议的记录 - try { - const hasAgreed = uni.getStorageSync('hasAgreedToTerms'); - // 如果没有同意过,显示协议页面 - if (hasAgreed !== 'true') { - // 使用setTimeout避免可能的导航冲突 - setTimeout(() => { - uni.navigateTo({ - url: '/pages/agreement/agreement' - }); - }, 500); - } - } catch (e) { - console.error('Check agreement status error:', e); - } + // 应用启动时的全局初始化逻辑 + // 启动页会自动处理倒计时和页面跳转 + + // 可以在这里添加其他全局初始化逻辑 + // 例如:设置全局变量、注册事件监听器等 }, onShow: function () { diff --git a/src/components/UserAgreement.vue b/src/components/UserAgreement.vue index bc34659..3d9136a 100644 --- a/src/components/UserAgreement.vue +++ b/src/components/UserAgreement.vue @@ -4,7 +4,9 @@ 用户须知 - + + + 1 年龄与身份 @@ -29,17 +31,32 @@ 3.3 若不同意本须知,请立即退出并停止使用本平台及相关产品。 - + + - - + + {{ isProcessing ? '处理中...' : '暂不进入' }} + + + {{ isProcessing ? '处理中...' : '确定' }} + \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index 309b9ec..983bc05 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -12,7 +12,7 @@ "compilerVersion" : 3, "splashscreen" : { "alwaysShowBeforeRender" : true, - "waiting" : true, + "waiting" : false, "autoclose" : true, "delay" : 0 }, @@ -50,11 +50,20 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "", + "appid" : "wxff56c34ef9aceb62", "setting" : { - "urlCheck" : false + "urlCheck" : false, + "es6": true, + "postcss": true, + "minified": true }, - "usingComponents" : true + "usingComponents" : true, + "permission": { + "scope.userLocation": { + "desc": "您的位置信息将用于小程序位置接口的效果展示" + } + }, + "requiredPrivateInfos": [] }, "mp-alipay" : { "usingComponents" : true diff --git a/src/pages.json b/src/pages.json index dbb8896..99ebd05 100644 --- a/src/pages.json +++ b/src/pages.json @@ -1,5 +1,16 @@ { + "lazyCodeLoading": "requiredComponents", "pages": [ + { + "path": "pages/splash/splash", + "style": { + "navigationStyle": "custom", + "disableScroll": true, + "app-plus": { + "popGesture": "none" + } + } + }, { "path": "pages/index/index", "style": { @@ -39,6 +50,12 @@ "popGesture": "none" } } + }, + { + "path": "pages/chat/chat", + "style": { + "navigationStyle": "custom" + } } ], "globalStyle": { @@ -55,14 +72,11 @@ "list": [ { "pagePath": "pages/index/index", - "iconPath": "static/tabbar/home.png", - "selectedIconPath": "static/tabbar/home_selected.png", + "text": "首页" }, { "pagePath": "pages/mine/mine", - "iconPath": "static/tabbar/mine.png", - "selectedIconPath": "static/tabbar/mine_selected.png", "text": "我的" } ] diff --git a/src/pages/agreement/agreement.vue b/src/pages/agreement/agreement.vue index a156205..4f4fcac 100644 --- a/src/pages/agreement/agreement.vue +++ b/src/pages/agreement/agreement.vue @@ -17,19 +17,15 @@ const handleAgree = () => { // 保存到本地存储 uni.setStorageSync('hasAgreedToTerms', 'true'); - // 返回上一页或首页 - uni.navigateBack({ - fail: () => { - uni.switchTab({ - url: '/pages/index/index' - }); - } + // 跳转到"我的"页面 + uni.switchTab({ + url: '/pages/mine/mine' }); } catch (e) { console.error('Save agreement status error:', e); - // 发生错误时也返回首页 + // 发生错误时也跳转到"我的"页面 uni.switchTab({ - url: '/pages/index/index' + url: '/pages/mine/mine' }); } }; diff --git a/src/pages/chat/chat.vue b/src/pages/chat/chat.vue new file mode 100644 index 0000000..704bf16 --- /dev/null +++ b/src/pages/chat/chat.vue @@ -0,0 +1,1056 @@ + + + + + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index ff15b65..8e285a3 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -1,54 +1,114 @@