diff --git a/app.js b/app.js index a65f7c1..93e56f4 100644 --- a/app.js +++ b/app.js @@ -10,7 +10,7 @@ App({ wx.login({ success: res => { // 发送 res.code 到后台换取 openId, sessionKey, unionId - api("/user/code2session?js_code=" + res.code).then(res => { + api("/auth/miniLogin?code=" + res.code).then(res => { if (res.code === 200) { wx.setStorageSync('openid', res.data.openid) wx.setStorageSync('sessionKey', res.data.sessionKey) @@ -34,6 +34,10 @@ App({ wx.removeStorageSync('user') } publisher.emit("login"); + } else { + wx.navigateTo({ + url: '../login/index', + }) } }) }, diff --git a/app.json b/app.json index 5b55dda..a611078 100644 --- a/app.json +++ b/app.json @@ -1,10 +1,13 @@ { "pages": [ - "pages/index/index" + "pages/index/index", + "pages/add/index", + "pages/add/edit", + "pages/login/index" ], "window": { "navigationBarTextStyle": "black", - "navigationBarTitleText": "Weixin", + "navigationBarTitleText": "植趣", "navigationBarBackgroundColor": "#ffffff" }, "darkmode": false, @@ -23,4 +26,4 @@ "t-fab": "tdesign-miniprogram/fab/fab", "t-search": "tdesign-miniprogram/search/search" } -} +} \ No newline at end of file diff --git a/app.wxss b/app.wxss index 3c05035..5352222 100644 --- a/app.wxss +++ b/app.wxss @@ -1,9 +1,9 @@ /**app.wxss**/ page { - --td-brand-color: #1755EC; - --td-brand-color-active: #0d4ef3; + --td-brand-color: #4FAB5F; + --td-brand-color-active: #4FAB5F; color: #373737; - background: #F7F7F7; + background: white } .container { @@ -24,11 +24,11 @@ page { color */ .primary { - color: #1755EC; + color: #4FAB5F; } .primary-bg { - background-color: #1755EC; + background-color: #4FAB5F; } .white { diff --git a/config/config.js b/config/config.js index a64cc18..da12b9f 100644 --- a/config/config.js +++ b/config/config.js @@ -1,5 +1,5 @@ const config = { - baseUrl: 'https://prod.wutongshucloud.com/api', + baseUrl: 'https://prod.sundynix.cn/api', // baseUrl: "http://127.0.0.1:3000", minio: 'https://res.wutongshucloud.com', baseHeader: { diff --git a/pages/add/edit.js b/pages/add/edit.js new file mode 100644 index 0000000..7fdd326 --- /dev/null +++ b/pages/add/edit.js @@ -0,0 +1,66 @@ +// pages/add/edit.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/add/edit.json b/pages/add/edit.json new file mode 100644 index 0000000..ba4925e --- /dev/null +++ b/pages/add/edit.json @@ -0,0 +1,7 @@ +{ + + "usingComponents": { + "t-textarea": "tdesign-miniprogram/textarea/textarea", + "t-upload": "tdesign-miniprogram/upload/upload" + } +} \ No newline at end of file diff --git a/pages/add/edit.wxml b/pages/add/edit.wxml new file mode 100644 index 0000000..8ba20a2 --- /dev/null +++ b/pages/add/edit.wxml @@ -0,0 +1,15 @@ + + + + + + + 上传一张花盆的照片(可选) + + + + + + + + \ No newline at end of file diff --git a/pages/add/edit.wxss b/pages/add/edit.wxss new file mode 100644 index 0000000..a47e6a3 --- /dev/null +++ b/pages/add/edit.wxss @@ -0,0 +1,17 @@ +/* pages/add/edit.wxss */ +.t-input { + --td-input-bg-color: #F2F2F7; + margin: 32rpx; + border-radius: 48rpx; /* 关键:加圆角 */ + overflow: hidden; /* 防止子元素溢出圆角 */ +} + +.external-class { + --td-textarea-background-color: #F2F2F7; + margin: 32rpx; + border-radius: 48rpx; /* 关键:加圆角 */ + overflow: hidden; + height: 256rpx; + background-color: wheat; + +} \ No newline at end of file diff --git a/pages/add/index.js b/pages/add/index.js new file mode 100644 index 0000000..9a8da31 --- /dev/null +++ b/pages/add/index.js @@ -0,0 +1,23 @@ +// pages/add/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + goEdit(){ + wx.navigateTo({ + url: '../add/edit', + }) + } +}) \ No newline at end of file diff --git a/pages/add/index.json b/pages/add/index.json new file mode 100644 index 0000000..5e91e98 --- /dev/null +++ b/pages/add/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "添加", + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/add/index.wxml b/pages/add/index.wxml new file mode 100644 index 0000000..1a4ca72 --- /dev/null +++ b/pages/add/index.wxml @@ -0,0 +1,22 @@ + + + + + + + + 花盆 + 添加新的花盆 + + + + + + + + + 植物 + 添加新植物,科学的进行种植! + + + \ No newline at end of file diff --git a/pages/add/index.wxss b/pages/add/index.wxss new file mode 100644 index 0000000..45fd381 --- /dev/null +++ b/pages/add/index.wxss @@ -0,0 +1,16 @@ +/* pages/add/index.wxss */ +.card { + width: 95vw; + height: 50vw; + margin: 16rpx; + border: #DAE2FD 1rpx solid; + border-radius: 16rpx; + background-color: #F6F8FE; +} + +.bg { + width: 100rpx; + height: 100rpx; + background-color:#A4B7FA ; + border-radius: 100rpx; +} \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index a8d6aa5..242a55a 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,49 +1,11 @@ // index.js -const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0' - Page({ data: { - motto: 'Hello World', - userInfo: { - avatarUrl: defaultAvatarUrl, - nickName: '', - }, - hasUserInfo: false, - canIUseGetUserProfile: wx.canIUse('getUserProfile'), - canIUseNicknameComp: wx.canIUse('input.type.nickname'), + list:[] }, - bindViewTap() { + goAdd(){ wx.navigateTo({ - url: '../logs/logs' + url: '../add/index', }) - }, - onChooseAvatar(e) { - const { avatarUrl } = e.detail - const { nickName } = this.data.userInfo - this.setData({ - "userInfo.avatarUrl": avatarUrl, - hasUserInfo: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl, - }) - }, - onInputChange(e) { - const nickName = e.detail.value - const { avatarUrl } = this.data.userInfo - this.setData({ - "userInfo.nickName": nickName, - hasUserInfo: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl, - }) - }, - getUserProfile(e) { - // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 - wx.getUserProfile({ - desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 - success: (res) => { - console.log(res) - this.setData({ - userInfo: res.userInfo, - hasUserInfo: true - }) - } - }) - }, + } }) diff --git a/pages/index/index.wxml b/pages/index/index.wxml index eaeecb1..3a2dbf1 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,4 +1,12 @@ - - 333 + + + + + + + 添加花盆 + 您还没有添加任何花盆 + + diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 1ebed4b..c37b0ed 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -1,62 +1,8 @@ /**index.wxss**/ -page { - height: 100vh; - display: flex; - flex-direction: column; -} -.scrollarea { - flex: 1; - overflow-y: hidden; -} -.userinfo { - display: flex; - flex-direction: column; - align-items: center; - color: #aaa; - width: 80%; -} - -.userinfo-avatar { - overflow: hidden; - width: 128rpx; - height: 128rpx; - margin: 20rpx; - border-radius: 50%; -} - -.usermotto { - margin-top: 200px; -} - -.avatar-wrapper { - padding: 0; - width: 56px !important; - border-radius: 8px; - margin-top: 40px; - margin-bottom: 40px; -} - -.avatar { - display: block; - width: 56px; - height: 56px; -} - -.nickname-wrapper { - display: flex; - width: 100%; - padding: 16px; - box-sizing: border-box; - border-top: .5px solid rgba(0, 0, 0, 0.1); - border-bottom: .5px solid rgba(0, 0, 0, 0.1); - color: black; -} - -.nickname-label { - width: 105px; -} - -.nickname-input { - flex: 1; -} +.empty { + width: 140rpx; + height: 140rpx; + background-color:#F6F6F6 ; + border-radius: 140rpx; +} \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js new file mode 100644 index 0000000..040b13a --- /dev/null +++ b/pages/login/index.js @@ -0,0 +1,38 @@ +// pages/login/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + checked:false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + read(){ + if (this.data.checked === false){ + wx.showModal({ + content: '请先勾选我已经阅读并同意《植趣用户协议》和《植趣隐私政策》', + }) + } + }, + + getPhoneNumber(e){ + + if (e.detail.errMsg != 'getPhoneNumber:ok') { + return + } + console.log(e); + }, + change(e){ + const tmp = this.data.checked === false + console.log(tmp); + this.setData({checked:tmp}) + } +}) \ No newline at end of file diff --git a/pages/login/index.json b/pages/login/index.json new file mode 100644 index 0000000..10a8d6c --- /dev/null +++ b/pages/login/index.json @@ -0,0 +1,6 @@ +{ + "navigationBarTitleText": "账号登录", + "usingComponents": { + "t-radio": "tdesign-miniprogram/radio/radio" + } +} \ No newline at end of file diff --git a/pages/login/index.wxml b/pages/login/index.wxml new file mode 100644 index 0000000..975d9e2 --- /dev/null +++ b/pages/login/index.wxml @@ -0,0 +1,19 @@ + + + + + + 一键登录 + 一键登录 + + + + + + + 我已经阅读并同意

《植趣用户协议》

《植趣隐私政策》

+
+
+ +
+
\ No newline at end of file diff --git a/pages/login/index.wxss b/pages/login/index.wxss new file mode 100644 index 0000000..5301e22 --- /dev/null +++ b/pages/login/index.wxss @@ -0,0 +1,17 @@ +/* pages/login/index.wxss */ +.bg { + height: 60vh; + width: 90vw; + border-radius: 16rpx; + background-image: url("https://res.catter.cn/pub/2025/09/25/202509251104161.svg"); + background-position: center center; + background-size: contain; + background-repeat: no-repeat; +} + +.bottom { + position: fixed; + bottom: 100rpx; + left: 0; + right: 0; +} \ No newline at end of file diff --git a/project.config.json b/project.config.json index 30d0136..f97455b 100644 --- a/project.config.json +++ b/project.config.json @@ -17,12 +17,25 @@ "ignore": [], "disablePlugins": [], "outputPath": "" - } + }, + "compileWorklet": false, + "uglifyFileName": false, + "uploadWithSourceMap": true, + "packNpmManually": false, + "minifyWXSS": true, + "minifyWXML": true, + "localPlugins": false, + "disableUseStrict": false, + "useCompilerPlugins": false, + "condition": false, + "swc": false, + "disableSWC": true }, "condition": {}, "editorSetting": { "tabIndent": "auto", "tabSize": 2 }, - "appid": "wx0f8c13371584dda4" + "appid": "wxb463820bf36dd5d6", + "simulatorPluginLibVersion": {} } \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index 6625bd0..097d059 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,7 +1,36 @@ { "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "projectname": "plane-mp", + "projectname": "flow-mp", "setting": { - "compileHotReLoad": true + "compileHotReLoad": true, + "urlCheck": true, + "coverView": true, + "lazyloadPlaceholderEnable": false, + "skylineRenderEnable": false, + "preloadBackgroundData": false, + "autoAudits": false, + "useApiHook": true, + "useApiHostProcess": true, + "showShadowRootInWxmlPanel": true, + "useStaticServer": false, + "useLanDebug": false, + "showES6CompileOption": false, + "checkInvalidKey": true, + "ignoreDevUnusedFiles": true, + "bigPackageSizeSupport": false + }, + "libVersion": "3.10.1", + "condition": { + "miniprogram": { + "list": [ + { + "name": "pages/add/edit", + "pathName": "pages/add/edit", + "query": "", + "scene": null, + "launchMode": "default" + } + ] + } } } \ No newline at end of file