diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000000000000000000000000000000000000..3d900d939689a5691666878902723578225ade2a --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000000000000000000000000000000000..03d9549ea8e4ada36fb3ecbc30fef08175b7d728 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..28a804d8932aba40f168fd757a74cb718a955a1a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000000000000000000000000000000000..21391d8ca8925972d51eaed38ef8f34c73a0537c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..94a25f7f4cb416c083d265558da75d457237d671 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/webServers.xml b/.idea/webServers.xml new file mode 100644 index 0000000000000000000000000000000000000000..26626eecda2825e106169b92e38f529a94dd3cf6 --- /dev/null +++ b/.idea/webServers.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000000000000000000000000000000000..7e1fd50931172a3169d7412149819fec93d8ca31 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - 问:$ {{item.question}} + + + ({{currentUserInfo.nickName}}): + + + + ({{currentUserInfo.nickName}}):$ {{item.question}} + - - openai回答:$ {{item.answer}} + + + + (openai):$ {{item.answer}} + + - - + + diff --git a/miniprogram/pages/future/future.wxss b/miniprogram/pages/future/future.wxss index 165269417a5e8d6f5000be529e8de738e554eac3..a85d065e0bbecf51ab36192e2e868d372ed87b00 100644 --- a/miniprogram/pages/future/future.wxss +++ b/miniprogram/pages/future/future.wxss @@ -1,8 +1,8 @@ /* pages/homeContent/homeContent.wxss */ -.container-future{ +.container-future { position: relative; width: 100vw; - height:100vh; + height: 100vh; background: linear-gradient(to right, rgba(1, 41, 116, 0.1) 1px, transparent 1px), linear-gradient(to bottom, rgba(1, 41, 116, 0.1) 1px, transparent 1px); background-repeat: repeat; background-size: 10px 10px; @@ -11,112 +11,156 @@ box-sizing: border-box; } -.loading{ +.loading { position: absolute; width: 100px; height: 100px; perspective: 780px; position: relative; - top:25%; - left:50%; - transform: translate(-50%,-25%); + top: 25%; + left: 50%; + transform: translate(-50%, -25%); } -.container-box{ + +.container-box { position: relative; width: 100%; height: 100vh; overflow: auto; } -.header-container{ + +.header-container { position: absolute; - height:30px; + height: 30px; width: 100%; } -.content-container{ - margin-top:30px; + +.content-container { + margin-top: 30px; position: absolute; - height:100vh; + height: 100vh; width: 100%; overflow: auto; } -.flex-container{ + +.flex-container { display: flex; justify-content: center; align-items: center; line-height: 30px; } -.header-container{ + +.header-container { width: 100vw; } -.header-btn{ - color:#262626; - margin:0; - padding:0; + +.header-btn { + color: #262626; + margin: 0; + padding: 0; } -.title{ - color:#ffffff; - flex:1; + +.title { + color: #ffffff; + flex: 1; font-size: 12px; line-height: 30px; text-align: center; background: rgb(252, 37, 8); } -button{ + +button { border-radius: 0; outline: none; font-weight: normal; } -.btn-default{ - color:#262626; - flex:1; - width:300px; + +.btn-default { + color: #262626; + flex: 1; + width: 300px; text-align: center; background-color: #ffffff; } -.actived{ + +.actived { color: #ffffff; - flex:1; + flex: 1; text-align: center; background-color: rgb(8, 183, 252); } -.form-container-api{ +.form-container-api { display: block; - height:auto; + height: auto; width: 100%; } -.form-request{ +.form-request { display: block; width: 100%; - color:#07c160; + color: #07c160; background-color: rgb(37, 0, 97); + line-height: 50px; + padding: 5px; } -.form-response{ + +.form-response { position: relative; width: 100%; margin-top: 10px; display: block; margin-bottom: 10px; - color:#07c160; - background-color: rgb(0, 72, 94); + color: #07c160; + background-color: rgb(0, 72, 94); } -.form-class-submit{ + +.form-class-submit { margin-top: 10px; display: block; width: 100%; background-color: rgb(248, 70, 0); } -.form-submit-btn{ +.form-container-introduce { + position: relative; width: 100%; - display: block; + height: calc(100vh - 60px); } -.chat-container{ - margin-top:20px; +.container-box-article{ + position: relative; width: 100%; - height: 336px; + height: calc(100vh - 100px); overflow: auto; +} + +.chat-container { + margin-top: 10px; + width: 100%; + height: calc(100vh - 100px); + overflow: auto; + position: relative; +} + +.user-image-box { + width: 200px; + height: 140px; + text-align: center; + align-items: center; +} + +.user-image { + position: relative; + width: 15px; + height: 15px; + border-radius: 50%; +} + +.ai-image { + position: relative; + width: 20px; + height: 20px; + border-radius: 50%; } \ No newline at end of file diff --git a/miniprogram/pages/home/home.js b/miniprogram/pages/home/home.js index 9824152f5c066f5db24f10a4e444a65a1469dce0..3fc4b427d5289665b68b74acf662ccbaccf15d9a 100644 --- a/miniprogram/pages/home/home.js +++ b/miniprogram/pages/home/home.js @@ -8,7 +8,7 @@ Page({ */ data: { title: 'header', - userInfo: '', + userInfo: {}, content: '我是父组件的content', footContent: "bottomContent", headBackground: [ @@ -40,6 +40,15 @@ Page({ console.log('监听', newVal, oldVal) } }, + /** + * 用户信息配置 + */ + setCurrentUserInfo(userInfo){ + console.log('事件触发userInfo',userInfo) + this.setData({ + userInfo:userInfo + }) + }, /** * 获取文章 */ diff --git a/miniprogram/pages/home/home.wxml b/miniprogram/pages/home/home.wxml index ac5a25bb3682cbdc7211b920dc19d2a75ff42122..a14f4695afb4ad5aa08ff1bcbb930699a89e4b74 100644 --- a/miniprogram/pages/home/home.wxml +++ b/miniprogram/pages/home/home.wxml @@ -6,9 +6,9 @@ - + 记忆碎片 - + {{item.title}} @@ -34,13 +34,13 @@ - + 主页 博客 - 可视化 + api管理 关于 diff --git a/miniprogram/pages/home/home.wxss b/miniprogram/pages/home/home.wxss index bd73251ac28c0bed0e6cda02e2c89dc75127abd4..1dbaa8e846dab1eca9c5c67ab83985f87d1c61b7 100644 --- a/miniprogram/pages/home/home.wxss +++ b/miniprogram/pages/home/home.wxss @@ -152,6 +152,7 @@ page { position: relative; width: 100%; height:100%; + background: #262626; } .container-footer{ position: absolute; @@ -167,7 +168,7 @@ page { flex-wrap: nowrap; width:100vw; background-color: white; - /* border:1px solid rgb(255, 136, 0); */ + border-top:2px solid rgba(0, 183, 255,.5); bottom:0; } .default-btn{ diff --git a/miniprogram/pages/homeContent/homeContent.js b/miniprogram/pages/homeContent/homeContent.js index c14a10449343c03e028a97f9ceb419f0d3bbf523..cdf6bf36fe45ef6bad09c2efb26869a91390467a 100644 --- a/miniprogram/pages/homeContent/homeContent.js +++ b/miniprogram/pages/homeContent/homeContent.js @@ -93,6 +93,14 @@ Component({ } }); }, + /** + * 清空 + */ + clearArticle(){ + this.setData({ + article:null + }) + }, onMyButtonTap: function(){ this.setData({ // 更新属性和数据的方法与更新页面数据的方法类似 diff --git a/miniprogram/pages/homeContent/homeContent.wxml b/miniprogram/pages/homeContent/homeContent.wxml index 35de0a90f531a38e20bf049960564d1f21f45f4a..409c406a2f1dd38d5a1bca5aef3c1fddc7583dea 100644 --- a/miniprogram/pages/homeContent/homeContent.wxml +++ b/miniprogram/pages/homeContent/homeContent.wxml @@ -6,5 +6,7 @@ - + + + diff --git a/miniprogram/pages/homeContent/homeContent.wxss b/miniprogram/pages/homeContent/homeContent.wxss index 6bbabcbcc5ae6752337a16d4539525fa09ecd941..2a357efc58bb46f3138807d33f18613b38f83f53 100644 --- a/miniprogram/pages/homeContent/homeContent.wxss +++ b/miniprogram/pages/homeContent/homeContent.wxss @@ -4,7 +4,7 @@ width: 100vw; height:100vh; background: rgba(255,255,255,0.8); /* fallback for old browsers */ - overflow: auto; + overflow: hidden; } .loading{ @@ -18,6 +18,12 @@ transform: translate(-50%,-25%); } +.container-box{ + position: relative; + height: calc(100vh - 212px); + overflow: auto; +} + diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 27628ccdc41d80260a2151d8a1711eb934c3eb70..c03c49f7d1fdd90359d4364a018c55237cdecba6 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -4,16 +4,17 @@ Page({ data: { - detailInfo:'关于:前端程序员的生活博客', + detailInfo: '关于:前端程序员的生活博客', title: "yma16博客", userImageUrl: "https://yongma16.xyz/staticFile/common/img/logo.png", loginTitle: "点击授权", userName: '', userInfo: {}, hasUserInfo: false, - isloading:true, + isloading: true, }, - getUserInfoBtn: function (info) {fgetUserProfile + getUserInfoBtn: function (info) { + fgetUserProfile wx.showLoading({ title: '授权中', }); @@ -21,11 +22,11 @@ Page({ if (info && info.detail) { const rowData = info.detail.rawData ? JSON.parse(info.detail.rawData) : { nickName: '未授权用户', avatarUrl: '' } this.setData({ - userImageUrl: rowData.avatarUrl - }) - this.setData({ - userName: rowData.nickName + userImageUrl: rowData.avatarUrl, + userName: rowData.nickName, + userInfo:rowData }) + wx.setStorageSync('currentUserInfo',rowData) console.log('rowData', rowData) } wx.hideLoading(); @@ -36,17 +37,13 @@ Page({ wx.getUserProfile({ desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 success: (res) => { - console.log('信息',res) + console.log('信息', res) + console.log('信息', res.userInfo) + wx.setStorageSync('currentUserInfo',res.userInfo) this.setData({ userInfo: res.userInfo, hasUserInfo: true }) - // 全局变量 - try { - wx.setStorageSync('currentUserInfo', JSON.stringify(this.userInfo)) - } catch (e) { - console.warn('获取用户信息报错',this.userInfo) - } // 跳转到home this.jumpTohome() } @@ -54,8 +51,13 @@ Page({ }, // 跳转到home jumpTohome: function () { + const thisBack = this wx.navigateTo({ - url: '/pages/home/home' + url: '/pages/home/home', + success: function (res) { + // 通过 eventChannel 向被打开页面传送数据 + res.eventChannel.emit('setCurrentUserInfo', thisBack.data.userInfo) + } }) }, onLoad: function (options) { diff --git a/miniprogram/pages/index/index.wxml b/miniprogram/pages/index/index.wxml index 3c5c6bfc6cbd7d704fb3b6f27e2c8ec1964d421d..aa33a867921cb1a9bd0c89d83814edddb6f7052f 100644 --- a/miniprogram/pages/index/index.wxml +++ b/miniprogram/pages/index/index.wxml @@ -9,7 +9,6 @@ - diff --git a/miniprogram/pages/life/life.wxml b/miniprogram/pages/life/life.wxml index dff69510366c5f7092e14d6f47f008005782d552..bc6f78d08007348db0b9ad50af8d6bc7a0a12901 100644 --- a/miniprogram/pages/life/life.wxml +++ b/miniprogram/pages/life/life.wxml @@ -8,26 +8,4 @@ - - - diff --git a/miniprogram/pages/life/life.wxss b/miniprogram/pages/life/life.wxss index 1e9abf276501b131befb6596b66fc75a55352f37..464c9fc439aa82f854cf2a846c1535942884faee 100644 --- a/miniprogram/pages/life/life.wxss +++ b/miniprogram/pages/life/life.wxss @@ -2,18 +2,24 @@ .container-life{ position: relative; width: 100vw; - height:100vh; + height:calc(100vh - 60px); color:#ff00aa; background: #fff; /* fallback for old browsers */ overflow: hidden; animation-name:backdiv; animation-duration: 6s; animation-iteration-count: infinite; + box-sizing: border-box; } .container-box{ position: relative; width: 100vw; - height:100vh; + height: calc(100vh - 60px); + overflow: auto; +} +.blog-container{ + width: 100vw; + overflow: auto; } .loading{