完成AI模块和后端的对接操作,信息填写界面和登录界面的对接全部完成

master
Gary 4 days ago
parent 5a1e37bc96
commit d8d79bacc6

@ -28,10 +28,10 @@ import ai_recongize_recipe from './components/ai_recongize_recipe/ai_recongize_r
export default {
globalData: {
//
fit_journey_basic_address: 'http://47.122.61.54:8086',//TODO:
fit_journey_basic_address: 'http://127.0.0.1:8086',//TODO:
fit_journey_community_address: 'http://47.122.61.54:8082',//TODO:
fit_journey_ai_address: 'http://47.122.61.54:8081',//TODO
fit_journey_login_address: 'http://127.0.0.1:8084',//TODO:
fit_journey_ai_address: 'http://127.0.0.1:8081',//TODO
fit_journey_login_address: 'http://47.122.61.54:8084',//TODO:
fit_journey_recipe_address: 'http://47.122.61.54:8087',//TODO:
fit_journey_exercise_address: 'http://47.122.61.54:8080',//TODO:
fit_journey_admin_address: 'http://47.122.61.54:8085',//TODO:

@ -26,9 +26,14 @@ export default {
methods:{
go_to_page() {
uni.navigateTo({
url: '/pages/homepages/homes/ai_recongize_fruit/ai_recongize_fruit'
url: '/pages/homepages/homes/ai_recognize_fruit/ai_recognize_fruit'
})
}
uni.showToast({
title: '跳转成功',
icon: 'success',
})
},
}
}

@ -26,7 +26,11 @@ export default {
methods:{
go_to_page() {
uni.navigateTo({
url: '/pages/homepages/homes/ai_recongize_hot/ai_recongize_hot'
url: '/pages/homepages/homes/ai_recognize_hot/ai_recognize_hot'
})
uni.showToast({
title: '跳转成功',
icon: 'success',
})
}

@ -26,7 +26,11 @@ export default {
methods:{
go_to_page() {
uni.navigateTo({
url: '/pages/homepages/homes/ai_recongize_plan/ai_recongize_plan'
url: '/pages/homepages/homes/ai_recognize_plan/ai_recognize_plan'
})
uni.showToast({
title: '跳转成功',
icon: 'success',
})
}

@ -26,7 +26,11 @@ export default {
methods:{
go_to_page() {
uni.navigateTo({
url: '/pages/homepages/homes/ai_recongize_recipe/ai_recongize_recipe'
url: '/pages/homepages/homes/ai_recognize_recipe/ai_recognize_recipe'
})
uni.showToast({
title: '跳转成功',
icon: 'success',
})
}

@ -26,7 +26,7 @@ export default {
methods: {
go_to_page() {
uni.navigateTo({
url: '/pages/homepages/homes/ai_recongize_fruit/ai_recongize_fruit'
url: '/pages/homepages/homes/knowledge_dictionary/knowledge_dictionary'
})
}

@ -26,10 +26,15 @@ export default {
methods: {
go_to_page() {
uni.navigateTo({
url: '/pages/homepages/homes/ai_recongize_fruit/ai_recongize_fruit'
url: '/pages/homepages/homes/my_exercise_plan/my_exercise_plan'
}) ;
uni.showToast({
title: '跳转成功',
icon: 'success',
})
}
}
}
</script>

@ -26,7 +26,11 @@ export default {
methods: {
go_to_page() {
uni.navigateTo({
url: '/pages/homepages/homes/ai_recongize_fruit/ai_recongize_fruit'
url: '/pages/homepages/homes/my_exercise_plan/my_exercise_plan'
})
uni.showToast({
title: '跳转成功',
icon: 'success',
})
}

@ -26,7 +26,10 @@ export default {
methods: {
go_to_page() {
uni.navigateTo({
url: '/pages/homepages/homes/ai_recongize_fruit/ai_recongize_fruit'
url: '/pages/homepages/homes/choice_book/choice_book'
})
uni.showToast({
title: '跳转成功',
})
}

@ -1,7 +1,7 @@
<template>
<view :class="['container', extend_class]">
<image class="background" src="@/static/components/swiper/exercise/background.png"></image>
<image class="button" @click="go_to_exercise" src="@/static/components/swiper/exercise/button.png"></image>
<image class="button" @click="go_to_my_exercise_plan" src="@/static/components/swiper/exercise/button.png"></image>
</view>
</template>
@ -19,6 +19,10 @@ export default {
uni.navigateTo({
url: '/pages/homepages/homes/my_exercise_plan/my_exercise_plan'
})
uni.showToast({
title: '跳转',
icon: 'success',
})
}
}
}

@ -20,6 +20,10 @@ export default {
uni.navigateTo({
url: '/pages/homepages/puppy_chat/puppy_chat'
})
uni.showToast({
title: '跳转成功',
icon: 'success',
})
}
}
}

@ -17,7 +17,11 @@ export default {
methods:{
go_to_choice_book() {
uni.navigateTo({
url: '/pages/homepages/homes/choice_book/choice_book'
url: '/pages/homepages/homes/knowledge_dictionary/knowledge_dictionary'
})
uni.showToast({
title: '跳转成功',
icon: 'success',
})
}

@ -112,7 +112,7 @@ export default {
left: 2.5%; /* 左侧2.5% */
background-color: khaki; /* 初始颜色 */
border-radius: 37px; /* 圆角半径,可以根据需要调整 */
z-index: -1; /* 使背景框在其他元素后面 */
z-index: 100; /* 使背景框在其他元素后面 */
animation: colorTransition 2s ease forwards; /* 添加颜色渐变动画 */
}
@ -121,6 +121,7 @@ export default {
width: 15%;
height: 6%;
bottom: 2%;
z-index: 100; /* 使背景框在其他元素后面 */
transition: opacity 1s ease; /* 添加渐变过渡 */
}
.pick_up_home, .pick_up_community, .pick_up_assistant, .pick_up_user {
@ -129,6 +130,7 @@ export default {
height: 10%;
bottom: 2%;
transition: opacity 1s ease; /* 添加渐变过渡 */
z-index: 100; /* 使背景框在其他元素后面 */
}
/* 图标位置调整 */

@ -175,37 +175,76 @@
}
},
/*--------------------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------------*/
{
"path": "pages/homepages/homes/home/home",
"style": {
"navigationStyle": "custom"
}
},
/* {
"path": "pages/homepages/homes/my_recipe_plan/my_recipe_plan",
{
"path" : "pages/homepages/homes/ai_recognize_recipe/ai_recognize_recipe",
"style" :
{
"navigationStyle": "custom"
}
},//
{
"path": "pages/homepages/homes/ai_recognize_fruit/ai_recognize_fruit",
"style": {
"navigationStyle": "custom"
}
},*/
/* {
"path": "pages/homepages/temp/temp",
},//
{
"path": "pages/homepages/homes/ai_recognize_hot/ai_recognize_hot",
"style": {
"navigationStyle": "custom"
}
}*/
/*{
"path": "pages/homepages/homes/ai_recognize_fruit/ai_recognize_fruit",
},//
{
"path": "pages/homepages/homes/my_recipe_plan/my_recipe_plan",
"style": {
"navigationStyle": "custom"
}
}*/
},//
{
"path" : "pages/homepages/homes/ai_recognize_plan/ai_recognize_plan",
"style" :
{
"navigationStyle": "custom"
}
},//
{
"path": "pages/homepages/homes/my_exercise_plan/my_exercise_plan",
"style" :
{
"navigationStyle": "custom"
}
},//
{
"path": "pages/homepages/homes/choice_book/choice_book",
"style" :
{
"navigationStyle": "custom"
}
},//
{
"path": "pages/homepages/homes/knowledge_dictionary/knowledge_dictionary",
"style" :
{
"navigationStyle": "custom"
}
},//
/* {
"path": "pages/homepages/homes/ai_recognize_hot/ai_recognize_hot
",
"path": "pages/homepages/temp/temp",
"style": {
"navigationStyle": "custom"
}
@ -271,13 +310,7 @@
"navigationStyle": "custom"
}
},
{
"path" : "pages/homepages/homes/ai_recognize_recipe/ai_recognize_recipe",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/homepages/homes/ai_recognize_plan/ai_recognize_plan",
"style" :
@ -472,27 +505,8 @@
/*------------------------------------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------------------------*/
{
"path": "pages/homepages/homes/my_exercise_plan/my_exercise_plan",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path": "pages/homepages/homes/choice_book/choice_book",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path": "pages/homepages/homes/knowlege_dictionary/knowlege_dictionary",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path": "pages/homepages/community/community/community",
"style" :

@ -24,6 +24,7 @@ export default {
return {
calorie: 0,
name: '',
token:uni.getStorageSync("access_token")
};
},
methods: {
@ -52,19 +53,28 @@ export default {
//
uni.uploadFile({
header: {
'Authorization': app.globalData.token // token
'Authorization':this.token
},
url: app.globalData.fit_journey_ai_address + `/ai/fruit`, //
filePath: filePath,
name: 'file', //
success: (uploadFileRes) => {
console.log('上传结果:', uploadFileRes);
const response = JSON.parse(uploadFileRes.data); //
if (response && response.data) {
//
this.calorie = response.data.calorie || 0;
this.name = response.data.name || '识别失败,请重新上传图片';
let result = response.data; //
console.log("识别到的果蔬信息:", result);
//
for (let [name, calorie] of Object.entries(result)) {
this.name = name; //
this.calorie = calorie; //
console.log(`水果: ${name}, 卡路里: ${calorie} kcal/100g`);
}
uni.showToast({
title: '恭喜你AI识别成功了呢~',
icon: 'none',
});
} else {
uni.showToast({
title: '识别失败,请重新上传图片',

@ -24,6 +24,7 @@ export default {
return {
calorie: 0,
name: '',
token :uni.getStorageSync("access_token")
};
},
methods: {
@ -47,15 +48,13 @@ export default {
success: (chooseImageRes) => {
const filePath = chooseImageRes.tempFilePaths[0]; //
console.log('选择的图片路径:', filePath);
console.log("图片上传成功!");
//
uni.uploadFile({
header: {
'Authorization': app.globalData.token // token
'Authorization': this.token
},
url: app.globalData.fit_journey_ai_address+`/ai/hot`, //
url: app.globalData.fit_journey_ai_address+`/ai/recipe`, //
filePath: filePath,
name: 'file', //
success: (uploadFileRes) => {
@ -65,7 +64,14 @@ export default {
//
this.calorie = response.data.calorie || 0;
this.name = response.data.name || '识别失败,请重新上传图片';
uni.showToast({
title: '恭喜您AI识别成功啦~',
icon: 'none',
duration :2000,//2
});
} else {
uni.showToast({
title: '识别失败,请重新上传图片',
icon: 'none',

@ -1,90 +1,142 @@
<template>
<view>
<image class="background" src="/static/homepages/homes/ai_recognize_plan/pictures/background.png"></image>
<image class="back_button" src="/static/homepages/homes/ai_recognize_plan/pictures/button.png"></image>
<image class="background" src="@/static/homepages/homes/ai_recognize_plan/pictures/background.png"></image>
<image class="back_button" @click="go_back_to_home" src="@/static/homepages/homes/ai_recognize_plan/pictures/button.png"></image>
<image v-if="planImage" class="plan-image" :src="planImage"></image>
<image class="generate_button" @click="generate()" src="/static/homepages/homes/ai_recognize_plan/pictures/generate.png"></image>
<image class="generate_button" @click="generate()" src="@/static/homepages/homes/ai_recognize_plan/pictures/generate.png"></image>
</view>
<!-- 生成成功的弹窗 -->
<view class="create_fail" v-if="is_create_success===1">
<text class="ai_create_text">AI生成的结果是</text>
<view class="result_area">
<text class="result">{{ result }}</text>
</view>
<image class="go_back" @click="go_back" src="@/static/homepages/homes/ai_recognize_recipe/pictures/go_back_button.png"></image>
</view>
</template>
<script>
export default {
data() {
return {
planImage: null //
planImage: null ,//
is_create_success : -1,//-1
token: uni.getStorageSync("access_token"),
result:""
};
},
methods: {
go_back_to_home() {
uni.navigateTo({
url: '/pages/homepages/homes/home/home'
});
},
generate() {
uni.showToast({
title: '正在生成...',
icon: 'loading',
duration: 15000, // Toast 2
});
//
const app= getApp();
uni.request({
url: app.globalData.fit_journey_ai_address+`/ai/plan`, // URL
method: 'GET',
url: app.globalData.fit_journey_ai_address + '/exercise_plan/ai/recipe/generate',
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Authorization':this.token
},
data: {
},
success: (res) => {
if (res.data && res.data.base64) {
this.saveBase64Image(res.data.base64);
if(res.data.code===200){
console.log("请求成功!请求数据是", res);
this.result = res.data.data;
}else {
uni.showToast({
title:"AI生成失败",
icon: 'none',
duration: 2000
})
this.result = res.data.msg;
}
}
});
},
saveBase64Image(base64Data) {
//
plus.io.resolveLocalFileSystemURL(plus.io.convertLocalFileSystemURL('_doc/'), (entry) => {
//
const fileName = `_doc/${new Date().getTime()}.png`;
//
entry.getFile(fileName, {create: true}, (fileEntry) => {
// base64Blob
const arr = base64Data.split(',');
const mime = arr[0].match(/:(.*?);/)[1];
const bstr = atob(arr[1]);
let n = bstr.length;
const u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
error: (res) => {
console.log("请求失败!请求数据是", res);
}
const blob = new Blob([u8arr], {type: mime});
//
fileEntry.createWriter((fileWriter) => {
fileWriter.write(blob);
//
this.planImage = plus.io.convertLocalFileSystemURL(fileName);
}, (e) => {
console.log("Write file failed: " + e.message);
});
}, (e) => {
console.log("Get file failed: " + e.message);
});
}, (e) => {
console.log("Resolve file system failed: " + e.message);
});
//
setTimeout(() => {
this.is_create_success = 1;
}, 15000);
},
go_back(){
this.is_create_success = -1;
}
}
}
</script>
<style lang="scss">
.background {
.background {
position: absolute;
width: 100%;
height: 100%;
top: 0%;
left: 0%;
}
.back_button {
width: 102%;
height: 102%;
left: -1%;
}
.back_button {
position: absolute;
width: 3%;
height: 3%;
top: 4%;
left: 7%;
}
.generate_button {
}
.generate_button {
position: absolute;
width: 70%;
width: 90%;
height: 12%;
top: 85%;
left: 14%;
}
.plan-image {
top: 87%;
left: 5%;
}
.plan-image {
position: absolute;
width: 80%; //
height: auto; //
@ -92,5 +144,55 @@
left: 50%; //
transform: translate(-50%, -50%); // 使transform
z-index: 10; //
}
.create_fail{
position: absolute;
height: 80%;
width: 90%;
top: 7%;
left: 5%;
border-radius: 20px;
background-color: #b694d1;
z-index: 1;
.ai_create_text{
position: absolute;
width: 100%;
height: 10%;
top: 5%;
left: 0;
font-weight: bold;
font-size: 20px;
text-align: center;
color: #ffffff;
}
.go_back{
position: absolute;
width: 80%;
height: 13%;
top: 88.5%;
left: 10%;
}
.result_area{
position: absolute;
width: 80%;
height: 75%;
top: 12%;
left: 10%;
border-radius: 20px;
background-color: #cec1e4;
color: #000000;
.result{
position: relative;
left: 2%;
font-size: 16px; /* 设置文字大小 */
font-weight: bold; /* 文字加粗 */
line-height: 1.5; /* 行间距 */
padding: 10px; /* 添加内边距,使文字不贴边 */
word-break: break-word; /* 长单词换行 */
}
}
}
</style>

@ -1,9 +1,35 @@
<template>
<view>
<image class="background" src="/static/homepages/homes/ai_recognize_recipe/pictures/background.png"></image>
<image class="back_button" src="/static/homepages/homes/ai_recognize_recipe/pictures/button.png"></image>
<image class="back_button" @click="go_back_to_home" src="/static/homepages/homes/ai_recognize_recipe/pictures/button.png" ></image>
<image v-if="recipeImage" class="recipe-image" :src="recipeImage"></image>
<image class="generate_button" @click="generate()" src="/static/homepages/homes/ai_recognize_recipe/pictures/generate.png"></image>
<image class="generate_button" @click="generate" src="/static/homepages/homes/ai_recognize_recipe/pictures/generate.png"></image>
<!--
&lt;!&ndash; 生成成功的弹窗 &ndash;&gt;
<view class="create_success" v-if="is_create_success===true">
<text class="ai_create_text">AI生成的结果是</text>
&lt;!&ndash; 取消弹窗的按钮 &ndash;&gt;
<image class="go_back" src="@/static/homepages/homes/ai_recognize_recipe/pictures/go_back_button.png"></image>
<view class="result" v-text="result"></view>
</view>
-->
<!-- 生成成功的弹窗 -->
<view class="create_fail" v-if="is_create_success===0">
<text class="ai_create_text">AI生成的结果是</text>
<view class="result_area">
<text class="result">{{ result }}</text>
</view>
<image class="go_back" @click="go_back" src="@/static/homepages/homes/ai_recognize_recipe/pictures/go_back_button.png"></image>
</view>
</view>
</template>
@ -11,80 +37,184 @@
export default {
data() {
return {
recipeImage: null //
is_create_success: -1,//01-1
can_generate_button_click: true, //
recipeImage: null, //
result: '这个',
token:uni.getStorageSync("access_token"),
};
},
methods: {
go_back_to_home() {
uni.navigateTo({
url: '/pages/homepages/homes/home/home'
});
},
generate() {
uni.showToast({
title: '正在生成...',
icon: 'loading',
duration: 12000, // Toast 2
});
//
const app= getApp();
uni.request({
url: app.globalData.fit_journey_ai_address+`/ai/recipe`, // URL
method: 'GET',
url: app.globalData.fit_journey_ai_address + '/ai/recipe/generate',
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Authorization':this.token
},
data: {
},
success: (res) => {
if (res.data && res.data.base64) {
this.saveBase64Image(res.data.base64);
if(res.data.code===200){
console.log("请求成功!请求数据是", res);
this.result = res.data.data;
}else {
uni.showToast({
title:"AI生成失败",
icon: 'none',
duration: 2000
})
this.result = res.data.msg;
}
}
});
},
saveBase64Image(base64Data) {
//
plus.io.resolveLocalFileSystemURL(plus.io.convertLocalFileSystemURL('_doc/'), (entry) => {
//
const fileName = `_doc/${new Date().getTime()}.png`;
//
entry.getFile(fileName, {create: true}, (fileEntry) => {
// base64Blob
const arr = base64Data.split(',');
const mime = arr[0].match(/:(.*?);/)[1];
const bstr = atob(arr[1]);
let n = bstr.length;
const u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
error: (res) => {
console.log("请求失败!请求数据是", res);
}
const blob = new Blob([u8arr], {type: mime});
//
fileEntry.createWriter((fileWriter) => {
fileWriter.write(blob);
//
this.recipeImage = plus.io.convertLocalFileSystemURL(fileName);
}, (e) => {
console.log("Write file failed: " + e.message);
});
}, (e) => {
console.log("Get file failed: " + e.message);
});
}, (e) => {
console.log("Resolve file system failed: " + e.message);
});
//
setTimeout(() => {
this.can_generate_button_click= false;
this.is_create_success = 0;
}, 12000);
/* //在20秒的时候清空result
setTimeout(() => {
this.result="";
}, 20000);*/
},
go_back(){
this.is_create_success = -1;
this.can_generate_button_click=true;
}
}
}
</script>
<style lang="scss">
.background {
<style scoped lang="scss">
.background {
position: absolute;
width: 100%;
height: 100%;
top: 0%;
left: 0%;
}
.back_button {
width: 102%;
height: 102%;
top: 0;
left: -1%;
z-index: -1;
}
.back_button {
position: absolute;
width: 3%;
height: 3%;
top: 4%;
left: 7%;
}
.generate_button {
}
.generate_button {
position: absolute;
width: 70%;
width: 90%;
height: 12%;
top: 85%;
left: 14%;
top: 87%;
left: 5%;
}
.create_fail{
position: absolute;
height: 80%;
width: 90%;
top: 7%;
left: 5%;
border-radius: 20px;
background-color: #92a9c6;
z-index: 1;
.ai_create_text{
position: absolute;
width: 100%;
height: 10%;
top: 5%;
left: 0;
font-weight: bold;
font-size: 20px;
text-align: center;
color: #ffffff;
}
.go_back{
position: absolute;
width: 80%;
height: 13%;
top: 88.5%;
left: 10%;
}
.recipe-image {
.result_area{
position: absolute;
width: 80%;
height: 75%;
top: 12%;
left: 10%;
border-radius: 20px;
background-color: #e4dfdf;
color: #000000;
.result{
position: relative;
left: 2%;
font-size: 16px; /* 设置文字大小 */
font-weight: bold; /* 文字加粗 */
line-height: 1.5; /* 行间距 */
padding: 10px; /* 添加内边距,使文字不贴边 */
word-break: break-word; /* 长单词换行 */
}
}
}
/*
.create_success{
position: absolute;
height: 80%;
width: 80%;
top: 10%;
left: 10%;
border-radius: 20px;
background-color: #2C405A;
z-index: 10;
border: 2px solid #ffffff;
!* .go_back{
position: absolute;
width: 10%;
height: 10%;
top: 5%;
left: 85%;
}
.ai_create_text{
z-index: 100;
color: #ffffff;
}*!
}
*/
.recipe-image {
position: absolute;
width: 80%; //
height: auto; //
@ -92,5 +222,5 @@
left: 50%; //
transform: translate(-50%, -50%); // 使transform
z-index: 10; //
}
}
</style>

@ -40,10 +40,10 @@
<view class="read_area">
<!-- 知识图谱-->
<image class="dictionary_background" src="@/static/components/dictionary/pictures/background.png"></image>
<image class="dictionary_button" src="@/static/components/dictionary/pictures/button.png"></image>
<image class="dictionary_button" @click="go_to_knowledge_dictionary" src="@/static/components/dictionary/pictures/button.png"></image>
<!-- 书籍阅读-->
<image class="read_background" src="@/static/components/read/pictures/background.png"></image>
<image class="read_button" src="/static/components/read/pictures/button.png"></image>
<image class="read_button" @click="go_to_choice_book" src="/static/components/read/pictures/button.png"></image>
</view>
<!--空白区域 -->
<view class="block_area"></view>
@ -71,6 +71,22 @@ export default {
};
},
methods:{
go_to_choice_book(){
uni.navigateTo({
url: '/pages/homepages/homes/choice_book/choice_book'
});
uni.showToast({
title: '跳转成功',
})
},
go_to_knowledge_dictionary(){
uni.navigateTo({
url: '/pages/homepages/homes/knowledge_dictionary/knowledge_dictionary'
});
uni.showToast({
title: '跳转成功',
})
},
onSwiperChange(e){
this.current = e.detail.current;
}

@ -38,10 +38,11 @@
export default {
data() {
return {
token:uni.getStorageSync("access_token"),
input_message: '',
send_message:'',
send_messages: [], //
conversation_id: 'e97ec0f2-2a94-42e7-b6db-b04883d349e8',
conversation_id: 'e97ec0f2-2a94-42e7-b6db-b04883d349e8',//id
answer: '', // AI
};
},
@ -57,7 +58,7 @@ export default {
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Authorization': app.globalData.token // TODOtoken
'Authorization': this.token
},
data: {
@ -70,6 +71,14 @@ export default {
console.log("请求失败!请求数据是", res);
}
});
this.send_messages.push({
sender: 'ai', //
message: ":" +"我是fit journey的专属AI小助手有什么问题都可以问我哦~"
});
},
methods: {
handleSendMessage() {
@ -116,11 +125,11 @@ export default {
//
uni.request({
url: 'http://localhost:8081' + '/ai/chat-with-no-stream',//TODO:
url: app.globalData.fit_journey_ai_address + '/ai/chat-with-no-stream',//TODO:
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Authorization': app.globalData.token // TODOtoken
'Authorization': this.token
},
data: {
conversationId: this.conversation_id,

@ -19,7 +19,8 @@
export default {
data(){
return{
height:''
height:'',
token: uni.getStorageSync('access_token'),
};
},
onLoad(options){
@ -33,22 +34,25 @@ export default {
console.log(app.globalData.token);
console.log(app.globalData.fit_journey_basic_address);
console.log("当前的身高是" + this.height);
// height "cm"
const numericHeight = parseFloat(this.height.replace('cm', '').trim());
console.log("本地存储的token是"+this.token)
//
uni.request({
url: app.globalData.fit_journey_basic_address + '/height/write_user_height',
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Authorization': app.globalData.token // TODOtoken
'Authorization': this.token
},
data: {
height: numericHeight, //
},
success: (res) => {
uni.showToast({
title: '提交成功',
icon: 'success',
})
console.log("请求成功!请求数据是", res);
// 使
uni.navigateTo({

@ -17,6 +17,11 @@
<script>
export default {
data() {
return {
token: uni.getStorageSync("access_token"),
};
},
methods: {
navigateTo(page) {
uni.navigateTo({
@ -33,7 +38,7 @@ export default {
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Authorization': app.globalData.token // TODOtoken
'Authorization':this.token
},
data: {
height: 175, //

@ -19,7 +19,8 @@
export default {
data() {
return {
weight: ''
weight: '',
token : uni.getStorageSync("access_token")
};
},
onLoad(options) {
@ -47,13 +48,18 @@ export default {
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Authorization': app.globalData.token // TODOtoken
'Authorization': this.token
},
data: {
weight: numericWeight, //
},
success: (res) => {
console.log("请求成功!请求数据是", res);
uni.showToast({
title: '提交成功',
icon: 'success',
})
//
this.navigateTo('/pages/information/boy_height_start/boy_height_start');
},

@ -17,6 +17,11 @@
<script>
export default {
data() {
return {
token :uni.getStorageSync("access_token")
}
},
methods: {
go_to_height() {
//
@ -30,12 +35,16 @@ export default {
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Authorization': app.globalData.token // TODOtoken
'Authorization': this.token
},
data: {
weight: 65, //
},
success: (res) => {
uni.showToast({
title: '提交成功',
icon: 'success'
})
console.log("请求成功!请求数据是", res);
//
uni.navigateTo({

@ -19,7 +19,8 @@
export default {
data() {
return {
weight: ''
weight: '',
token :uni.getStorageSync("access_token")
};
},
onLoad(options) {
@ -48,12 +49,16 @@ export default {
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Authorization': app.globalData.token // TODOtoken
'Authorization': this.token
},
data: {
weight: numericWeight, //
},
success: (res) => {
uni.showToast({
title: '提交成功',
icon: 'success',
})
console.log("请求成功!请求数据是", res);
//
this.navigateTo('/pages/information/girl_height_start/girl_height_start');

@ -17,6 +17,11 @@
<script>
export default {
data() {
return {
token :uni.getStorageSync("access_token"),
};
},
methods: {
navigateTo(page) {
uni.navigateTo({
@ -36,12 +41,16 @@ export default {
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Authorization': app.globalData.token // TODOtoken
'Authorization': this.token
},
data: {
weight: 65, //
},
success: (res) => {
uni.showToast({
title: '提交成功',
icon: 'success',
})
console.log("请求成功!请求数据是", res);
//
this.navigateTo('/pages/information/girl_height_start/girl_height_start');

@ -56,6 +56,7 @@ export default {
isGirlSelected: false,
isHumanVisible: false, // human
sex:-1,// 1 0
token:uni.getStorageSync("access_token")
};
},
@ -74,7 +75,7 @@ export default {
console.log('调用函数成功!'); //
//
const app = getApp();
console.log('传递的token是:', app.globalData.token); // Token
console.log('传递的token是:',this.token); // Token
console.log('后端的地址是', app.globalData.fit_journey_basic_address); //
uni.request({
@ -82,17 +83,18 @@ export default {
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Authorization': app.globalData.token // TODOtoken
'Authorization': this.token
},
data: {
sex: this.sex
},
success: (res) => {
console.log('Response:', res.data); //
uni.showToast({
title: '提交成功',
icon: 'success',
})
console.log("开始跳转页面");
//
const targetPage = this.isBoySelected

@ -240,7 +240,7 @@ function login() {
});
}
});
} else if (which_way_to_login.value === 1) { //
} else { //
console.log("验证码登录部分开始运行了");
//
const serverAddress = app.globalData.fit_journey_login_address + '/PhoneLogin/phoneLogin';

@ -11,7 +11,7 @@ export default {
methods: {
click() {
uni.navigateTo({
url: '/pages/homepages/home/home' //
url: '/pages/homepages/homes/home/home' //
});
}
}

@ -1,6 +1,6 @@
.background {
background-image: url("@/static/homepages/homes/ai_recognize_recipe/pictures/background.png");
background-image: url("@/static/homepages/homes/ai_recognize_hot/pictures/background.png");
background-size: cover;
background-position: center;
height: 100vh;
@ -27,7 +27,7 @@
transform: translateX(-50%); /* 通过 translateX 使其居中 */
}
.calorie_container {
background-image: url("@/static/homepages/homes/ai_recognize_recipe/pictures/calorie.png");
background-image: url("@/static/homepages/homes/ai_recognize_hot/pictures/calorie.png");
background-size: cover;
background-position: center;
display: flex; /* 使用 flex 布局 */
@ -47,7 +47,7 @@
margin-top: 100%; /* 向下移动 100% */
}
.name_container{
background-image: url("@/static/homepages/homes/ai_recognize_recipe/pictures/name.png");
background-image: url("@/static/homepages/homes/ai_recognize_hot/pictures/name.png");
background-size: cover;
background-position: center;
display: flex; /* 使用 flex 布局 */

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

@ -1,6 +1,5 @@
.background {
position: absolute;
position: fixed;
width: 100%;
height: 75%;
top: 4%;
@ -10,7 +9,7 @@
.chat {
position: absolute;
width: 100%;
top: 10%;
top: 12%;
height: 79%;
z-index: -1;
padding: 10px;

Loading…
Cancel
Save