diff --git a/src/cloudfunctions/recommend/config.json b/src/cloudfunctions/recommend/config.json new file mode 100644 index 0000000..5ecc33e --- /dev/null +++ b/src/cloudfunctions/recommend/config.json @@ -0,0 +1,6 @@ +{ + "permissions": { + "openapi": [ + ] + } +} \ No newline at end of file diff --git a/src/cloudfunctions/recommend/index.js b/src/cloudfunctions/recommend/index.js new file mode 100644 index 0000000..55d8152 --- /dev/null +++ b/src/cloudfunctions/recommend/index.js @@ -0,0 +1,19 @@ +// 云函数入口文件 +const cloud = require('wx-server-sdk') + +cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) // 使用当前云环境 + +//获取老师集合 +const teacher = cloud.database().collection("teacher_Data") + +// 云函数入口函数 +exports.main = async (event, context) => { + const wxContext = cloud.getWXContext() + + return { + event, + openid: wxContext.OPENID, + appid: wxContext.APPID, + unionid: wxContext.UNIONID, + } +} \ No newline at end of file diff --git a/src/cloudfunctions/recommend/package.json b/src/cloudfunctions/recommend/package.json new file mode 100644 index 0000000..0edfae6 --- /dev/null +++ b/src/cloudfunctions/recommend/package.json @@ -0,0 +1,14 @@ +{ + "name": "recommend", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~2.6.3" + } +} \ No newline at end of file diff --git a/src/miniprogram/pages/profile/profile.js b/src/miniprogram/pages/profile/profile.js index d6e632c..91250ad 100644 --- a/src/miniprogram/pages/profile/profile.js +++ b/src/miniprogram/pages/profile/profile.js @@ -3,6 +3,7 @@ const db = wx.cloud.database().collection("user_Data"); Page({ //页面数据 data:{ + avatarUrl: "cloud://cloud1-7gyjwcyfbdf819da.636c-cloud1-7gyjwcyfbdf819da-1321167991/1678762683308.png", birthday: "", region:"", }, diff --git a/src/miniprogram/pages/profile/profile.wxml b/src/miniprogram/pages/profile/profile.wxml index f9c2257..f83d5cd 100644 --- a/src/miniprogram/pages/profile/profile.wxml +++ b/src/miniprogram/pages/profile/profile.wxml @@ -1,27 +1,32 @@ -
- - - + + + + + + + - - 昵称: - - + + + + 昵称: + + - - 性别: - - - - - + + 性别: + + + + + 年龄: diff --git a/src/miniprogram/pages/profile/profile.wxss b/src/miniprogram/pages/profile/profile.wxss index c3e6595..ae1e463 100644 --- a/src/miniprogram/pages/profile/profile.wxss +++ b/src/miniprogram/pages/profile/profile.wxss @@ -6,6 +6,19 @@ height: 200px; /* 适当调整容器的高度 */ } +/* 头像 */ +.user-avatar { + display: flex; + justify-content: center; +} + +/* 子元素选择器 */ +.user-avatar > image { + height: 100px; + width: 100px; + border-radius: 50%; +} + .user-image { max-width: 10%; max-height: 10%; @@ -15,7 +28,7 @@ position: relative; display: flex; justify-content: flex-end; - align-items: flex-start; + align-items: flex-end; } .small-button {