@ -103,22 +103,62 @@ struct SocialInputView: View {
. fill ( Color . blue . opacity ( 0.1 ) )
)
// 用 户 名 / 链 接 ( 必 填 )
VStack ( alignment : . leading , spacing : 8 ) {
HStack {
// 根 据 平 台 显 示 不 同 的 提 示
Text ( getInputLabel ( ) )
. font ( . subheadline )
. foregroundColor ( . primary )
Text ( " * " )
. foregroundColor ( . red )
Spacer ( )
// 输 入 框 部 分
if platform = = . spotify {
// S p o t i f y 专 用 : A r t i s t 和 S o n g 两 个 输 入 框
VStack ( alignment : . leading , spacing : 12 ) {
// A r t i s t 输 入 框
VStack ( alignment : . leading , spacing : 8 ) {
HStack {
Text ( " 艺术家 " )
. font ( . subheadline )
. foregroundColor ( . primary )
Text ( " * " )
. foregroundColor ( . red )
Spacer ( )
}
TextField ( " 输入艺术家名称 " , text : $ username )
. textFieldStyle ( RoundedBorderTextFieldStyle ( ) )
. autocapitalization ( . none )
. focused ( $ focusedField , equals : . username )
}
// S o n g 输 入 框
VStack ( alignment : . leading , spacing : 8 ) {
HStack {
Text ( " 歌曲名称 " )
. font ( . subheadline )
. foregroundColor ( . primary )
Text ( " * " )
. foregroundColor ( . red )
Spacer ( )
}
TextField ( " 输入歌曲名称 " , text : $ message )
. textFieldStyle ( RoundedBorderTextFieldStyle ( ) )
. autocapitalization ( . none )
. focused ( $ focusedField , equals : . message )
}
}
} else {
// 其 他 平 台 的 单 输 入 框
VStack ( alignment : . leading , spacing : 8 ) {
HStack {
// 根 据 平 台 显 示 不 同 的 提 示
Text ( getInputLabel ( ) )
. font ( . subheadline )
. foregroundColor ( . primary )
Text ( " * " )
. foregroundColor ( . red )
Spacer ( )
}
TextField ( platform . placeholder , text : $ username )
. textFieldStyle ( RoundedBorderTextFieldStyle ( ) )
. autocapitalization ( . none )
. focused ( $ focusedField , equals : . username )
}
TextField ( platform . placeholder , text : $ username )
. textFieldStyle ( RoundedBorderTextFieldStyle ( ) )
. autocapitalization ( . none )
. focused ( $ focusedField , equals : . username )
}
@ -200,7 +240,7 @@ struct SocialInputView: View {
case . viber :
return " • 输入Viber电话号码( 如: +1234567890) \n • 将生成viber://add?number=格式 \n • 用户扫描后可直接添加Viber联系人 "
case . spotify :
return " • 输入 歌曲或播放列表链接\n • 或输入Spotify ID "
return " • 输入 艺术家名称和歌曲名称\n • 将生成spotify:search:艺术家;歌曲格式 \n • 用户扫描后可直接在Spotify中搜索 "
}
}
}