Merge remote-tracking branch 'fitjourney前端代码仓库/master'

# Conflicts:
#	pages.json
#	pages/homepages/user/bmi_information/bmi_information.vue
master^2
Gary 2 weeks ago
commit ff93bccef4

@ -24,7 +24,6 @@ import ai_recongize_plan from './components/ai_recongize_plan/ai_recongize_plan.
import ai_recongize_hot from './components/ai_recongize_hot/ai_recongize_hot.vue';
import ai_recongize_recipe from './components/ai_recongize_recipe/ai_recongize_recipe.vue';
export default {
globalData: {
//

@ -0,0 +1,141 @@
<template>
<view class="myimgDV">
<view v-if="imgPicList.length>0" class='receiveimage flex justify'>
<block v-for="(item,ind) in imgPicList" :key="ind">
<image class="imgitem" :style="{width:imgwidth,height:imgheight}" :class="imgboxtype==0?'onepic':imgboxtype==1?'doublepic':imgboxtype==2?'triplepic':''"
:src="item" :mode="imgboxtype==0?'widthFix':imgboxtype==1?'aspectFill':imgboxtype==2?'aspectFill':''" @click="previewpic(item,imgPicList)"></image>
<!-- {width:(imgboxtype==0?'':imgwidth),height:(imgboxtype==0?'':imgwidth),padding:(imgboxtype==0?'':imgpad)} -->
</block>
</view>
</view>
</template>
<script>
export default {
name:"community_image_box",
data() {
return {
imgPicList: [],
imgboxtype: 0,
imgwidth: 0,
imgpad: 0,
imgheight: ''
}
},
props: {
imgList: {
type: Array
},
num: {
type: Number,
default: 0
},
pad: {
type: Number,
default: 0
}
},
methods: {
//
previewpic(cind, clist) {
console.log(cind, clist);
uni.previewImage({
urls: clist,
current: cind,
indicator: 'default'
});
},
getheight() {
console.log('imgboxtype:',this.imgboxtype)
let that = this;
const query = uni.createSelectorQuery().in(that)
query.select('.imgitem').boundingClientRect()
query.exec((res)=>{
console.log(res[0].width)
if (that.num == 1) {
that.imgheight = '100%';
} else if (that.num == 2 || that.num == 4) {
that.imgheight = (res[0].width).toFixed(2) + 'px';
} else {
that.imgheight = (res[0].width).toFixed(2) + 'px';
}
})
// const query = uni.createSelectorQuery().in(this).select('.imgitem');
// uni.createSelectorQuery().select('.imgitem').boundingClientRect(res => {
// console.log('reac', res)
// if (this.num == 1) {
// this.imgheight = '100%';
// } else if (this.num == 2 || this.num == 4) {
// this.imgheight = (res.width).toFixed(2) + 'px';
// } else {
// this.imgheight = (res.width).toFixed(2) + 'px';
// }
// }).exec()
}
},
mounted() {
// let this = this;
this.imgPicList = this.imgList;
console.log('num:'+this.num)
if (this.num == 1) {
this.imgboxtype = 0;
this.imgwidth = 100 + '%';
} else if (this.num == 2 || this.num == 4) {
this.imgboxtype = 1;
this.imgwidth = 49 + '%';
} else if (this.num == 3 || this.num > 4) {
this.imgboxtype = 2;
this.imgwidth = 32 + '%';
}
this.$nextTick(function() {
this.getheight();
})
}
}
</script>
<style lang="scss">
.myimgDV {
.flex {
display: flex;
}
.justify {
justify-content: space-between;
}
.receiveimage {
margin-top: 28rpx;
display: flex;
flex-wrap: wrap;
width: 100%;
.onepic {
width: 100%;
// height: 188rpx;
// height: auto;
margin-bottom: 28rpx;
&:nth-child(3n) {
margin-right: 0;
}
}
.doublepic {
// width: 340rpx;
// height: 340rpx;
margin-right: 12rpx;
margin-bottom: 12rpx;
&:nth-child(2n) {
margin-right: 0;
}
}
.triplepic {
// width: 222rpx;
// height: 222rpx;
margin-right: 12rpx;
margin-bottom: 12rpx;
&:nth-child(3n) {
margin-right: 0;
}
}
}
}
</style>

@ -1,20 +1,175 @@
<template>
<view>
<tarbar_community></tarbar_community>
<view class="community_box">
<!-- 头部信息 -->
<view class="top_box">
<!-- 头像 -->
<view class="dog_image_box">
<image class="dog_image" src="../../../../static/homepages/community/community/pictures/dog_image.png" mode="widthFix"></image>
</view>
<view class="words_box">
<!-- 标题 -->
<view class="title_box">fit journey社区</view>
<view class="tip_word_box">搜索他人的健康秘诀</view>
</view>
<view class="add_image_box">
<image
class="add_image"
src="../../../../static/homepages/community/community/pictures/add_image.png"
mode="widthFix"
@click="toAddPostPage"
></image>
</view>
</view>
<view class="line_box"></view>
<!-- 帖子 -->
<view class="post_body">
<scroll-view class="post_scroll_box" scroll-y="true">
<view class="post_box" v-for="(item, index) in posts" :key="index">
<view class="post_top_box">
<view class="post_avatar_box">
<image class="post_avatar" :src=item.avatar mode="widthFix"></image>
</view>
<view class="post_info">
<view class="post_name">{{item.name}}</view>
<view class="post_date">{{item.date}}</view>
</view>
</view>
<view class="post_word_box">{{item.word}}</view>
<view class="post_images_box">
<community_image_box class="post_images" :imgList='item.imgList' :num='item.imgList.length'></community_image_box>
</view>
<view class="post_bottom_box">
<view class="comments_box">
<image class="chat_icon" src="../../../../static/homepages/community/community/pictures/chat_icon.png" mode="widthFix"></image>
<view class="comments_num">{{item.comments_num}}</view>
</view>
<view class="like_box">
<image
class="love_icon"
:src=getLikeImage(index)
mode="widthFix"
@click="likeClick(index)"
></image>
<view class="like_num">{{item.like_num}}</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
<!-- 底部导航栏 -->
<tarbar_community class="tarbar_box"></tarbar_community>
</template>
<script>
import Community from "@/components/swiper/community.vue";
import community_image_box from "../../../../components/community_image_box/community_image_box.vue";
export default {
components: {Community},
components: {Community, community_image_box},
data() {
return {};
return {
posts:[
{
avatar:'../../../../static/homepages/community/community/pictures/dog_image.png',
name:'cat',
date:'2024年9月31日',
word:'今天去海边锻炼看见的,真是太美了啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊',
imgList:[
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
],
comments_num:1,
like_num:100,
islike:false,
},
{
avatar:'../../../../static/homepages/community/community/pictures/dog_image.png',
name:'puppy',
date:'2024年11月13日',
word:'今天去海边锻炼看见的,真是太美了',
imgList:[
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
],
comments_num:12,
like_num:17,
islike:false,
},
{
avatar:'../../../../static/homepages/community/community/pictures/dog_image.png',
name:'cat',
date:'2024年10月13日',
word:'今天去海边锻炼看见的',
imgList:[
'../../../../static/homepages/community/community/pictures/dog_image.png',
'../../../../static/homepages/community/community/pictures/dog_image.png',
],
comments_num:10,
like_num:100,
islike:false,
},
{
avatar:'../../../../static/homepages/community/community/pictures/dog_image.png',
name:'cat',
date:'2024年1月13日',
word:'今天去锻炼',
imgList:[
'../../../../static/homepages/community/community/pictures/dog_image.png',
],
comments_num:10,
like_num:100,
islike:false,
},
],
};
},
mounted(){
this.getAllPost()
},
computed:{
likeImages() {
return this.posts.map((post, index) => ({
index,
image: post.islike ? '../../../../static/homepages/community/community/pictures/red_love_image.png' : '../../../../static/homepages/community/community/pictures/love_image.png'
}));
}
},
methods:{
getLikeImage(index) {
//TODO:
const item = this.likeImages.find(item => item.index === index);
return item ? item.image : '';
},
getAllPost(){
//TODO:
const app = getApp()
uni.request({
url:app.globalData.fit_journey_community_address + '/post/getAll',
method:"GET",
success:(res) => {
console.log('getAllPost')
console.log(res)
},
fail: (err) => {
console.log('getAllPost fail')
console.log(err.log)
},
})
},
likeClick(index){
//TODO:
this.posts[index].islike = this.posts[index].islike ? false:true
},
toAddPostPage(){
//TODO:
}
}
}
</script>
<style lang="scss">
@import "@/static/homepages/community/community/scss/community.scss"
</style>

@ -3,18 +3,20 @@
<view class="user_head">
<image class="head" src="/static/homepages/user/basic_information/head.png"></image>
<image class="head_pic" src="/static/homepages/user/basic_information/head_pic.png"></image>
<image class="head_but" @click="" src="/static/homepages/user/basic_information/but.png"></image>
<image class="head_but" @click="change_head()" src="/static/homepages/user/basic_information/but.png"></image>
</view>
<view class="self_back">
<view class="name">
<image class="user_name_but" @click="" src="/static/homepages/user/basic_information/but.png"></image>
<text class="name_text">puppy</text>
<image class="user_name_but" @click="change_name()" src="/static/homepages/user/basic_information/but.png"></image>
<input v-if="n_writeable===true" class="name_text" v-model="name"></input>
<view v-else class="w_name">{{name}}</view>
</view>
<view class="self">
<image class="self_but" @click="" src="/static/homepages/user/basic_information/but.png"></image>
<text class="self_write"></text>
<image class="self_but" @click="change_self()" src="/static/homepages/user/basic_information/but.png"></image>
<textarea v-if="s_writeable===true" v-model="selftext" class="self_write"></textarea>
<view v-else class="self_read">{{selftext}}</view>
</view>
<image class="button" src="/static/homepages/user/basic_information/button.png"></image>
<image class="button" @click="save_change()" src="/static/homepages/user/basic_information/button.png"></image>
</view>
</view>
</template>
@ -22,14 +24,37 @@
<script>
export default {
data() {
return {};
return {
name:'puppy',
selftext:'您的个人简介',
n_writeable:false,
s_writeable:false,
};
},
methods:{
change_self(){
console.log('selftext:', this.selftext);
this.s_writeable=true;
},
change_name(){
console.log('name:', this.name);
this.n_writeable=true;
},
navigateTo(page) {
uni.navigateTo({
url: page
});
},
save_change()
{
console.log('name:', this.name);
console.log('selftext:', this.selftext);
const NAME=this.name;
this.n_writeable=false;
this.s_writeable=false;
this.navigateTo(`/pages/homepages/user/user/user?user_name=${NAME}`);
},
}
}
</script>
@ -128,11 +153,21 @@ export default {
position: absolute;
font-size: 1.4em;
text-align: center;
width: 100%;
height: 20%;
top: 17%;
width: 65%;
height: 40%;
top: 24%;
left: 20%;
color:#000000;
}
.w_name{
position: absolute;
font-size: 1.4em;
text-align: center;
width: 65%;
height: 40%;
top: 26%;
left: 20%;
color:#000000;
font-weight: bold;
}
.self_but{
position: absolute;
@ -144,11 +179,20 @@ export default {
}
.self_write{
position: absolute;
font-size: 1em;
text-align: center;
width: 100%;
height: 20%;
font-size: 1.4em;
width: 70%;
height: 80%;
top: 4%;
right: 10%;
color:#000000;
}
.self_read{
position: absolute;
font-size: 1.4em;
width: 70%;
height: 80%;
top: 4%;
right: 10%;
color:#000000;
}
.button{

@ -1,8 +1,7 @@
<template>
<view>
<image class="background" src="/static/homepages/user/bmi_information/pictures/background.png"></image>
<image class="back_button" src="/static/homepages/user/bmi_information/pictures/button.png"></image>
<image class="back_button" @click="goto_user()" src="/static/homepages/user/bmi_information/pictures/button.png"></image>
<image class="text_background_one" src="/static/homepages/user/bmi_information/pictures/text_background.png"></image>
<image class="text_background_two" src="/static/homepages/user/bmi_information/pictures/text_background.png"></image>
<image class="text_background_three" src="/static/homepages/user/bmi_information/pictures/text_background.png"></image>
@ -38,6 +37,16 @@
};
},
methods:{
navigateTo(page) {
uni.navigateTo({
url: page
});
},
goto_user(){
this.navigateTo(`/pages/homepages/user/user/user`);
},
submit(){
// API
const url = app.globalData.fit_journey_ai_address+`/bmi`;

@ -1,27 +1,29 @@
<template>
<view class="background">
<image class="head_pic" src="@/static/homepages/user/user/head_pic.png"></image>
<image class="head_button" src="../../../../static/homepages/user/user/head_button.png"></image>
<image class="bmi_button" src="../../../../static/homepages/user/user/bmi_button.png"></image>
<image class="eat_button" src="../../../../static/homepages/user/user/eat_button.png"></image>
<image class="ad_button" src="../../../../static/homepages/user/user/ad_button.png"></image>
<image class="button" src="../../../../static/homepages/user/user/button.png"></image>
<image class="point" src="../../../../static/homepages/user/user/point.png"></image>
<image class="head_pic" src="@/static/homepages/user/user/pictures/head_pic.png"></image>
<image class="head_button" @click="goto_user()" src="@/static/homepages/user/user/pictures/head_button.png"></image>
<image class="bmi_button" @click="goto_bmi()" src="@/static/homepages/user/user/pictures/bmi_button.png"></image>
<image class="eat_button" @click="goto_eat()" src="@/static/homepages/user/user/pictures/eat_button.png"></image>
<image class="ad_button" @click="goto_exer()" src="@/static/homepages/user/user/pictures/ad_button.png"></image>
<image class="button" @click="goto_login()" src="@/static/homepages/user/user/pictures/button.png"></image>
<image class="point" src="@/static/homepages/user/user/pictures/point.png"></image>
<image class="pie" src="@/static/homepages/user/user/pictures/pie.png"></image>
<image v-if="sex===0" class="user" src="../../../../static/homepages/user/user/female.png"></image>
<image v-if="sex===1" class="user" src="../../../../static/homepages/user/user/male.png"></image>
<image v-if="sex===0" class="user" src="@/static/homepages/user/user/pictures/female.png"></image>
<image v-if="sex===1" class="user" src="@/static/homepages/user/user/pictures/male.png"></image>
<text class="id">aaaaaaaaa</text>
<text class="id">{{user_name}}</text>
<text class="hot_in">20000J</text>
<text class="hot_out">17000J</text>
<text class="height">180cm</text>
<text class="weight">75kg</text>
<text class="bmi">24.9</text>
<text class="xw">44.5</text>
<text class="yw">34.0</text>
<text class="tw">42.5</text>
<text class="height">{{user_height}}cm</text>
<text class="weight">{{user_weight}}kg</text>
<text class="bmi">{{user_bmi}}</text>
<text class="xw">{{user_xw}}</text>
<text class="yw">{{user_yw}}</text>
<text class="tw">{{user_tw}}</text>
<text class="bmi_state">很健康</text>
</view>
<tarbar_user></tarbar_user>
@ -31,15 +33,46 @@
export default {
data() {
return {
sex : 1//10
sex : 1,//10
user_name:'puppy',
user_height:'180',
user_weight:'75',
user_xw:'44.5',
user_yw:'34.0',
user_tw:'42.5',
user_bmi:'23.1'
};
},
onLoad(options){
if (options.user_name) {
this.user_name = options.user_name;
};
},
methods:{
navigateTo(page) {
uni.navigateTo({
url: page
});
},
goto_user(){
this.navigateTo(`/pages/homepages/user/basic_information/basic_information`);
},
goto_bmi(){
this.navigateTo(`/pages/homepages/user/bmi_information/bmi_information`);
},
goto_eat(){
this.navigateTo(`/pages/homepages/user/recipe_and_calorie/recipe_and_calorie`);
},
goto_exer(){
this.navigateTo(`/pages/homepages/user/exercise_plans/exercise_plans`);
},
goto_login(){
this.navigateTo(`/pages/login/account_login/account_login`);
},
}
}
</script>
@ -116,46 +149,48 @@ export default {
width: 2%;
opacity: 1;
right: 50%;
bottom: 48.5%;
border: 2px solid #0c0b0b ;
bottom: 48.4%;
}
.button{
position: absolute;
height: 4%;
width: 90%;
left: 5%;
top: 90.5%;
top: 90.5%;
}
.pie{
position: absolute;
height: 18%;
width: 85%;
left: 5%;
top: 18%;
}
.id{
position: absolute;
height: 5%;
opacity: 1;
right: 13%; /* 距右边 10% */
bottom: 90.2%;
border: 2px solid #0c0b0b ;
left: 37%; /* 距右边 10% */
top: 4.7%;
font-size: 1.5rem;
}
.hot_in{
position: absolute;
height: 0.2%;
width: 5%;
opacity: 1;
right: 77%; /* 距右边 10% */
bottom: 87%;
left: 20%; /* 距右边 10% */
top: 12.7%;
font-size: 0.5rem;
color: #ffffff;
border: 2px solid #b14141;
}
.hot_out{
position: absolute;
height: 0.2%;
width: 5%;
opacity: 1;
right: 27%; /* 距右边 10% */
bottom: 87%;
left: 71%; /* 距右边 10% */
top: 12.7%;
font-size: 0.5rem;
color: #ffffff;
border: 2px solid #0c0b0b ;
}
.height{
position: absolute;
@ -214,4 +249,13 @@ export default {
bottom: 29.3%;
font-size: 1.2rem;
}
.bmi_state{
position: absolute;
text-align: center;
opacity: 1;
left: 68%;
top: 49.4%;
font-size: 0.2em;
color: #000000;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -0,0 +1,196 @@
.community_box{
padding: 5vh 5vw;
display: flex;
flex-direction: column;
position: relative;
.top_box{
display: flex;
justify-content: space-between;
align-items: center;
height: 10vh;
// border-bottom: 1.48205px solid #000000;
.dog_image_box{
// height: 8vh;
// width: 8vh;
height: 110rpx;
width: 110rpx;
border-radius: 50%;
background-color: #D9D9D9;
display: flex;
justify-content: center;
align-items: center;
.dog_image{
width: 85rpx;
}
}
.words_box{
height: 100%;
width: 60%;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
.title_box{
width: fit-content;
font-family: 'Poppins';
font-style: normal;
font-weight: 600;
font-size: 3vh;
line-height: 33px;
text-align: center;
letter-spacing: -0.604677px;
color: #000000;
}
.tip_word_box{
font-family: 'Poppins';
font-style: normal;
font-weight: 600;
font-size: 2vh;
line-height: 33px;
text-align: center;
letter-spacing: -0.604677px;
color: #CCB8B8;
}
}
.add_image_box{
// height: 8vh;
// width: 8vh;
height: 110rpx;
width: 110rpx;
border-radius: 50%;
background-color: #D9D9D9;
display: flex;
justify-content: center;
align-items: center;
.add_image{
width: 50rpx;
}
}
}
// 线
.line_box{
width: 70%;
border-bottom: 1.48205px solid #000000;
position: absolute;
top: 17vh;
left: 50%;
transform: translateX(-50%);
}
.post_body{
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 20vh;
width: 90%;
.post_scroll_box{
height: 69vh;
}
.post_box{
background-color: #E6EEFA;
border-radius: 30px;
padding: 2vh 2vh;
box-sizing: border-box;
margin-bottom: 5vh;
width: 100%;
// height: 55vh;
display: flex;
flex-direction: column;
// height:900rpx;
position: relative;
.post_top_box{
display: flex;
.post_avatar_box{
width: 5vh;
height: 5vh;
border-radius: 50%;
background-color: #fff;
display: flex;
justify-content: center;
align-items: center;
margin-right: 2vh;
.post_avatar{
width: 80%;
}
}
.post_info{
font-family: 'Poppins';
font-style: normal;
font-weight: 700;
font-size: 2vh;
color: #000000;
display: flex;
flex-direction: column;
justify-content: center;
}
}
.post_word_box{
font-family: 'Poppins';
font-style: normal;
font-weight: 700;
font-size: 2vh;
color: #000000;
margin-top: 2.5vh;
}
.post_images_box{
width: 100%;
height:70%;
.post_images{
width: 100%;
height: 100%;
}
}
.post_bottom_box{
position: absolute;
bottom: 0%;
width: 100%;
height: 10%;
padding: 0% 6%;
box-sizing: border-box;
display: flex;
background: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(2px);
/* Note: backdrop-filter has minimal browser support */
border-radius: 0px 0px 30px 30px;
left: 50%;
transform: translateX(-50%);
.comments_box{
display: flex;
align-items: center;
height: 100%;
// width: 10%;
.chat_icon{
width: 3.2vh;
}
.comments_num{
font-family: 'Poppins';
font-style: normal;
font-weight: 600;
font-size: 2vh;
text-align: center;
letter-spacing: -0.604677px;
color: rgba(255, 255, 255, 0.8);
}
}
.like_box{
display: flex;
align-items: center;
height: 100%;
margin-left: 4%;
// width: 10%;
.love_icon{
width: 3.2vh;
}
.like_num{
font-family: 'Poppins';
font-style: normal;
font-weight: 600;
font-size: 2vh;
text-align: center;
letter-spacing: -0.604677px;
color: rgba(255, 255, 255, 0.8);
}
}
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 208 KiB

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 187 KiB

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Before

Width:  |  Height:  |  Size: 496 KiB

After

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Before

Width:  |  Height:  |  Size: 837 B

After

Width:  |  Height:  |  Size: 837 B

@ -1,8 +1,8 @@
{
"hash": "0aaf698d",
"configHash": "cc60d382",
"lockfileHash": "22a0e42d",
"browserHash": "89d9bfb2",
"hash": "70943268",
"configHash": "c265b382",
"lockfileHash": "e3b0c442",
"browserHash": "d782de90",
"optimized": {},
"chunks": {}
}
Loading…
Cancel
Save