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

master
Gary 4 days ago
commit e3d4cba2ba

@ -15,3 +15,194 @@ export default {
<style lang="scss">
</style>
<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="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>
<image class="text_background_four" src="/static/homepages/user/bmi_information/pictures/text_background.png"></image>
<image class="text_background_five" src="/static/homepages/user/bmi_information/pictures/text_background.png"></image>
<image class="write_one" src="/static/homepages/user/bmi_information/pictures/write.png"></image>
<image class="write_two" src="/static/homepages/user/bmi_information/pictures/write.png"></image>
<image class="write_three" src="/static/homepages/user/bmi_information/pictures/write.png"></image>
<image class="write_four" src="/static/homepages/user/bmi_information/pictures/write.png"></image>
<image class="write_five" src="/static/homepages/user/bmi_information/pictures/write.png"></image>
<form class="bmi_form">
<input class="hight_input" name="hight" type="text" placeholder="身高" v-model="formData.height"/>
<input class="weight_input" name="weight" type="text" placeholder="体重" v-model="formData.weight"/>
<input class="chest_input" name="chest" type="text" placeholder="胸围" v-model="formData.chest"/>
<input class="waist_input" name="waist" type="text" placeholder="腰围" v-model="formData.waist"/>
<input class="buttock_input" name="buttock" type="text" placeholder="臀围" v-model="formData.buttock"/>
</form>
<image class="submit_button" @click="submit()" src="/static/homepages/user/bmi_information/pictures/submit_button.png"></image>
</view>
</template>
<script>
export default {
data() {
return {
formData: {
height: '',
weight: '',
chest: '',
waist: '',
buttock: ''
}
};
},
methods:{
submit(){
// API
const url = app.globalData.fit_journey_ai_address+`/bmi`;
uni.request({
url: url,
method: 'POST',
data: this.formData,
success: (res) => {
//
console.log('Data sent successfully:', res.data);
},
fail: (err) => {
//
console.error('Failed to send data:', err);
}
});
}
}
}
</script>
<style lang="scss">
.background {
position: absolute;
width: 100%;
height: 100%;
top: 0%;
left: 0%;
}
.back_button {
position: absolute;
width:8%;
height: 5%;
top: 6%;
left: 7%;
}
.text_background_one{
position: absolute;
width: 80%;
height: 7%;
top: 32%;
left: 10%;
}
.text_background_two{
position: absolute;
width: 80%;
height: 7%;
top: 40%;
left: 10%;
}
.text_background_three{
position: absolute;
width: 80%;
height: 7%;
top: 48%;
left: 10%;
}
.text_background_four{
position: absolute;
width: 80%;
height: 7%;
top: 56%;
left: 10%;
}
.text_background_five{
position: absolute;
width: 80%;
height: 7%;
top: 64%;
left: 10%;
}
.write_one{
position: absolute;
width: 4%;
height: 2%;
top: 34.5%;
left: 13%;
}
.write_two{
position: absolute;
width: 4%;
height: 2%;
top: 42.5%;
left: 13%;
}
.write_three{
position: absolute;
width: 4%;
height: 2%;
top: 50.5%;
left: 13%;
}
.write_four{
position: absolute;
width: 4%;
height: 2%;
top: 58.5%;
left: 13%;
}
.write_five{
position: absolute;
width: 4%;
height: 2%;
top: 66.5%;
left: 13%;
}
.bmi_form{
.hight_input{
position: absolute;
width: 70%;
height: 6%;
top: 32.5%;
left: 18%;
}
.weight_input{
position: absolute;
width: 70%;
height: 6%;
top: 40.5%;
left: 18%;
}
.chest_input{
position: absolute;
width: 70%;
height: 6%;
top: 48.5%;
left: 18%;
}
.waist_input{
position: absolute;
width: 70%;
height: 6%;
top: 56.5%;
left: 18%;
}
.buttock_input{
position: absolute;
width: 70%;
height: 6%;
top: 64.5%;
left: 18%;
}
}
.submit_button{
position: absolute;
width: 50%;
height: 12%;
top: 75%;
left: 25%;
}
</style>

@ -1,17 +1,165 @@
<template>
<view>
<image class="background" src="/static/homepages/user/exercise_plans/pictures/background.png"></image>
<image class="back_button" src="/static/homepages/user/exercise_plans/pictures/button.png"></image>
<text class="date" style="color: black;">{{todayDate}}</text>
<image class="text_background_one" src="/static/homepages/user/exercise_plans/pictures/text_background.png"></image>
<image class="text_background_two" src="/static/homepages/user/exercise_plans/pictures/text_background.png"></image>
<image class="text_background_three" src="/static/homepages/user/exercise_plans/pictures/text_background.png"></image>
<image class="write_one" src="/static/homepages/user/exercise_plans/pictures/write.png"></image>
<image class="write_two" src="/static/homepages/user/exercise_plans/pictures/write.png"></image>
<image class="write_three" src="/static/homepages/user/exercise_plans/pictures/write.png"></image>
<form class="bmi_form">
<input class="sport_input" v-model="formData.sport" type="text" placeholder="运动项目"/>
<input class="location_input" v-model="formData.location" type="text" placeholder="运动地点"/>
<input class="time_input" v-model="formData.time" type="text" placeholder="运动时间"/>
</form>
<image class="submit_button" @click="submit()" src="/static/homepages/user/exercise_plans/pictures/submit_button.png"></image>
</view>
</template>
<script>
export default {
data() {
return {};
}
}
return {
todayDate:'',//
formData: {
sport: '',
location: '',
time: ''
}
};
},
methods:{
submit(){
// API
const url = app.globalData.fit_journey_ai_address+`/exercise`;
uni.request({
url: url,
method: 'POST',
data: this.formData,
success: (res) => {
//
console.log('Data sent successfully:', res.data);
},
fail: (err) => {
//
console.error('Failed to send data:', err);
}
});
},
//todo
getTodayDateString() {
const today = new Date();
const year = today.getFullYear();
const month = today.getMonth() + 1;
const day = today.getDate();
const monthString = month < 10 ? '0' + month : month;
const dayString = day < 10 ? '0' + day : day;
return `${year}-${monthString}-${dayString}`;
},
created(){
this.todayDate = this.getTodayDateString(); //
console.log('Today\'s date:', this.todayDate); //
}
},
}
</script>
<style lang="scss">
</style>
.background {
position: absolute;
width: 100%;
height: 100%;
top: 0%;
left: 0%;
}
.back_button {
position: absolute;
width:9%;
height: 5%;
top: 6%;
left: 7%;
}
.date{
position: absolute;
width:40%;
height: 5%;
top: 20%;
left: 20%;
display: block; /* 确保是块级元素 */
visibility: visible; /* 确保可见 */
}
.text_background_one{
position: absolute;
width: 80%;
height: 7%;
top: 32%;
left: 10%;
}
.text_background_two{
position: absolute;
width: 80%;
height: 7%;
top: 42%;
left: 10%;
}
.text_background_three{
position: absolute;
width: 80%;
height: 7%;
top: 52%;
left: 10%;
}
.write_one{
position: absolute;
width: 7%;
height: 3%;
top: 34.5%;
left: 12%;
}
.write_two{
position: absolute;
width: 7%;
height: 3%;
top: 44.5%;
left: 12%;
}
.write_three{
position: absolute;
width: 7%;
height: 3%;
top: 54.5%;
left: 12%;
}
.sport_input{
position: absolute;
width: 80%;
height: 3%;
top: 34.2%;
left: 19%;
}
.location_input{
position: absolute;
width: 80%;
height: 3%;
top: 44.2%;
left: 19%;
}
.time_input{
position: absolute;
width: 80%;
height: 3%;
top: 54.2%;
left: 19%;
}
.submit_button{
position: absolute;
width: 50%;
height: 12%;
top: 64%;
left: 24%;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Loading…
Cancel
Save