You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< template >
<!-- 背景 -- >
< view class = "background" >
<!-- 人物 -- >
< image class = "human" src = "/static/information/girl_height/pictures/human.png" > < / image >
<!-- 滚动条 -- >
< image class = "roll" @click ="go_to_roll()" src = "/static/information/girl_height/pictures/roll.png" > < / image >
<!-- 按钮 -- >
< image class = "button" @click ="go_to_purpose()" src = "/static/information/girl_height/pictures/button.png" > < / image >
<!-- 进度条 -- >
< image class = "progress" src = "/static/information/girl_height/pictures/progress.png" > < / image >
<!-- 文本 -- >
< text class = "text" @click ="go_to_roll()" > {{ height }} < / text >
< / view >
< / template >
< script >
export default {
data ( ) {
return {
height : ''
} ;
} ,
onLoad ( options ) {
this . height = options . height ;
} ,
methods : {
navigateTo ( page ) {
uni . navigateTo ( {
url : page
} ) ;
} ,
go _to _purpose ( ) {
const app = getApp ( ) ;
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 ( ) ) ;
// 向后端发送请求
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 // TODO: 暂时写为临时的token 后期替换
} ,
data : {
height : numericHeight , // 发送数字类型
} ,
success : ( res ) => {
console . log ( "请求成功!请求数据是" , res ) ;
// 如果成功则跳转到使用的目的界面
uni . navigateTo ( {
url : '/pages/information/purpose/purpose'
} ) ;
} ,
error : ( res ) => {
console . log ( "请求失败!请求数据是" , res ) ;
}
} ) ;
} ,
go _to _roll ( ) {
uni . navigateTo ( {
url : '/pages/information/girl_height_roll/girl_height_roll'
} )
} ,
}
}
< / script >
< style lang = "scss" >
@ import "@/static/information/girl_height/css/girl_height_end.scss" ;
< / style >