Skip to content

Commit

Permalink
微调大量UI、重新设计关于页、支持英文、移除了FirstUsingView.swift (#97)
Browse files Browse the repository at this point in the history
* 微调大量UI、重新设计关于页、支持英文、移除了FirstUsingView.swift

* 依照指示解决了5个问题,此外将Subscriber和Follower改成全部大写

* 依照指示解决了1个问题
  • Loading branch information
ThreeManager785 authored Jan 29, 2024
1 parent 09dc39b commit b46e004
Show file tree
Hide file tree
Showing 34 changed files with 5,199 additions and 852 deletions.
24 changes: 12 additions & 12 deletions DarockBili Watch App/Bangumi/BangumiDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ struct BangumiDetailView: View {
})
.sheet(isPresented: $isMoreMenuPresented, content: {
List {
// Button(action: {
// isDownloadPresented = true
// }, label: {
// Label("下载视频", systemImage: "arrow.down.doc")
// })
// .sheet(isPresented: $isDownloadPresented, content: {VideoDownloadView(bvid: videoDetails["BV"]!, videoDetails: videoDetails)})
/* Button(action: {
isDownloadPresented = true
}, label: {
Label("下载视频", systemImage: "arrow.down.doc")
})
.sheet(isPresented: $isDownloadPresented, content: {VideoDownloadView(bvid: videoDetails["BV"]!, videoDetails: videoDetails)}) */
}
})
}
Expand Down Expand Up @@ -121,7 +121,7 @@ struct BangumiDetailView: View {
}
.blur(radius: isLoading ? 14 : 0)
if isLoading {
Text("正在解析...")
Text("Video.analyzing")
.font(.title2)
.bold()
}
Expand All @@ -131,15 +131,15 @@ struct BangumiDetailView: View {
Group {
if #available(watchOS 10, *) {
NavigationSplitView {
Text("选择要查看评论的单集")
Text("Bangumi.comments.select")
List(epDatas, selection: $navigationSelectedEpdata) { data in
Text(data.longTitle).tag(data)
}
} detail: {
if let data = navigationSelectedEpdata, let aid = data.aid {
VideoCommentsView(oid: av2bv(avid: UInt64(aid)))
} else {
Text("选择一项")
Text("Bangumi.comments.select")
}
}
.navigationBarHidden(true)
Expand Down Expand Up @@ -172,7 +172,7 @@ struct BangumiDetailView: View {
} else {
if epDatas.count != 0 {
List {
Text("选择要查看评论的单集")
Text("Bangumi.comments.select")
.listRowBackground(Color.clear)
ForEach(0..<epDatas.count, id: \.self) { i in
if let aid = epDatas[i].aid {
Expand All @@ -186,7 +186,7 @@ struct BangumiDetailView: View {
}
}
.tag(2)
.navigationTitle("评论")
.navigationTitle("Bangumi.commnets")
}
.onAppear {
let headers: HTTPHeaders = [
Expand Down Expand Up @@ -284,7 +284,7 @@ struct BangumiDetailView: View {
Spacer()
}
HStack {
Text("\(score.userCount) 人参与了评分")
Text("Bangumi.score.joined-people.\(Int(score.userCount) ?? 0)")
.font(.footnote)
.opacity(0.65)
Spacer()
Expand Down
2 changes: 1 addition & 1 deletion DarockBili Watch App/Bangumi/BangumiPlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct BangumiPlayerView: View {
Button(action: {
player?.pause()
}, label: {
Text("Pause")
Text("Player.pause")
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion DarockBili Watch App/DarockBiliApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ struct DarockBili_Watch_AppApp: App {
VStack {
HStack {
Spacer()
Text("内存占用: \(String(format: "%.2f", memoryUsage)) MB / 300 MB")
Text("Memory.indicator.\(String(format: "%.2f", memoryUsage))")
.font(.system(size: 10, weight: .medium))
.offset(y: 26)
}
Expand Down
38 changes: 19 additions & 19 deletions DarockBili Watch App/Errors/DarockFeedback/FeedbackLoginView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ struct FeedbackLoginView: View {
ScrollView {
VStack {
Group {
Text("登录 Darock 通行证")
Text("DarockID.login.title")
.font(.system(size: 18, weight: .bold))
TextField("账号", text: $accountCache)
TextField("DarockID.account", text: $accountCache)
.autocorrectionDisabled()
.textInputAutocapitalization(.never)
SecureField("密码", text: $passwdCache)
SecureField("DarockID.password", text: $passwdCache)
Button(action: {
isLoading = true
DarockKit.Network.shared.requestString("https://api.darock.top/user/login/\(accountCache)/\(passwdCache)") { respStr, isSuccess in
Expand All @@ -33,16 +33,16 @@ struct FeedbackLoginView: View {
if respStr.apiFixed() == "Success" {
darockIdAccount = accountCache
} else {
tipText = "账号或密码错误"
tipText = String(localized: "DarockID.incorrect")
}
} else {
tipText = "错误:无法连接到 Darock"
tipText = String(localized: "DarockID.unable-to-connect")
}
isLoading = false
}
}, label: {
if !isLoading {
Text("登录")
Text("DarockID.login")
} else {
ProgressView()
}
Expand All @@ -51,7 +51,7 @@ struct FeedbackLoginView: View {
Button(action: {
isRegisterPresented = true
}, label: {
Text("注册")
Text("DarockID.register")
})
.sheet(isPresented: $isRegisterPresented, content: {RegisterView()})
Text(tipText)
Expand All @@ -60,7 +60,7 @@ struct FeedbackLoginView: View {
Spacer()
.frame(height: 20)
NavigationLink(destination: {FeedbackView()}, label: {
Text("不想登录?直接反馈 ->")
Text("DarockID.feedback-without-logging-in")
})
}
}
Expand All @@ -77,9 +77,9 @@ struct FeedbackLoginView: View {
var body: some View {
ScrollView {
VStack {
Text("注册 Darock 通行证")
Text("DarockID.register.title")
.font(.system(size: 18, weight: .bold))
TextField("邮箱", text: $mailCache)
TextField("DarockID.email", text: $mailCache)
.autocorrectionDisabled()
.textInputAutocapitalization(.never)
.onSubmit {
Expand All @@ -92,32 +92,32 @@ struct FeedbackLoginView: View {
}
}
}, label: {
Text("发送验证码")
Text("DarockID.verification-code.send")
})
.disabled(mailCache == "")
TextField("验证码", text: $mailCodeCache)
.disabled(mailCache.isEmpty)
TextField("DarockID.verification-code", text: $mailCodeCache)
.autocorrectionDisabled()
.textInputAutocapitalization(.never)
SecureField("密码", text: $passwdCache)
SecureField("确认密码", text: $passwdCache)
SecureField("DarockID.password", text: $passwdCache)
SecureField("DarockID.password.confirm", text: $passwdCache)
Button(action: {
if mailCodeCache == serverMailCode {
if passwdCache == passwd2Cache {
DarockKit.Network.shared.requestString("https://api.darock.top/user/reg/\(mailCache)/\(passwdCache)") { respStr, isSuccess in
if isSuccess {
if respStr.apiFixed() == "Success" {
tipText = "注册成功!"
tipText = String(localized: "DarockID.register.success")
}
}
}
} else {
tipText = "两次密码不匹配"
tipText = String(localized: "DarockID.password.unmatch")
}
} else {
tipText = "验证码错误"
tipText = String(localized: "DarockID.code.unmatch")
}
}, label: {
Text("注册")
Text("DarockID.register")
})
Text(tipText)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct FeedbackMainView: View {
ProgressView()
}
} else {
Text("无反馈")
Text("Feedback.nothing")
}
}
// .toolbar {
Expand Down
40 changes: 20 additions & 20 deletions DarockBili Watch App/Errors/ErrorGetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,70 +31,70 @@ struct ErrorGetView: View {
var body: some View {
ScrollView {
Group {
Text("出现问题!")
Text("Error.ran-into-a-problem")
.font(.system(size: 22, weight: .bold))
Spacer()
.frame(height: 15)
Text("非常抱歉,喵哩喵哩在 \(error.when) 时出现了问题。\(error.ignoreable ? "" : "应用程序无法正常运行")")
Text(String(localized: "Error.sorry.\(error.when)") + "\(error.ignoreable ? "" : String(localized: "Error.fatal"))")
if error.area == "网络请求" {
Spacer()
.frame(height: 15)
Button(action: {
isNetworkFixPresented = true
}, label: {
Text("错误与网络有关,您应当先点此尝试 网络疑难解答")
Text("Error.network-troubleshoot")
})
.sheet(isPresented: $isNetworkFixPresented, content: {NetworkFixView()})
}
Spacer()
.frame(height: 10)
Text("以下为错误详情:")
Text("范围:\(error.area)")
Text("位置:\(error.inAppArea)")
Text("详细信息:\(error.errDetail)")
Text("Error.information")
Text("Error.area.\(error.area)")
Text("Error.place.\(error.inAppArea)")
Text("Error.details.\(error.errDetail)")
Spacer()
.frame(height: 15)
}
Group {
if error.sendable {
Text("您可以将此信息发送至 Darock 以帮助我们改进喵哩喵哩")
Text("Error.send-to-Darock-advice")
Spacer()
.frame(height: 10)
Text("发送的信息中不含任何您的个人信息")
TextField("发生问题前...(选填)", text: $doing)
Text("Error")
TextField("Error.before-ranning-into-problem", text: $doing)
Spacer()
.frame(height: 15)
Button(action: {
isSendPresented = true
}, label: {
Text("发送")
Text("Error.send")
.bold()
})
.sheet(isPresented: $isSendPresented, content: {
VStack {
if !isSent {
ProgressView()
Text("正在发送...")
Text("Error.sending")
.bold()
Text("感谢您的支持!")
Text("Error.appriciate")
.bold()
} else {
Text("已发送")
Text("Error.sent")
.bold()
Text("案例编号为 \(Text(sentCode).font(.system(size: 18, design: .monospaced))) 后续可通过此编号跟进状态")
Text("Error.number.\(Text(sentCode))")
.font(.system(size: 18, weight: .bold))
if error.ignoreable {
Button(action: {
dismiss()
}, label: {
Text("返回")
Text("Error.leave")
.bold()
})
} else {
Button(action: {
exit(114514)
}, label: {
Text("退出程序")
Text("Error.exit")
.bold()
})
}
Expand All @@ -116,10 +116,10 @@ struct ErrorGetView: View {
isClosePresented = true
}
}, label: {
Text("不发送")
Text("Error.do-not-send")
})
.sheet(isPresented: $isClosePresented, content: {
Text("即将退出...")
Text("Error.exiting")
.onAppear {
Timer.scheduledTimer(withTimeInterval: 3.0, repeats: false) { timer in
timer.invalidate()
Expand All @@ -128,7 +128,7 @@ struct ErrorGetView: View {
}
})
} else {
Text("此错误无需或无法发送至 Darock")
Text("Error.no-need-to-send")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion DarockBili Watch App/Errors/FeedbackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct FeedbackView: View {
Image(uiImage: UIImage(cgImage: qrImage!))
.resizable()
.frame(width: 140, height: 140)
Text("在手机上继续")
Text("Feedback.continue-on-other-device")
.bold()
}
}
Expand Down
11 changes: 5 additions & 6 deletions DarockBili Watch App/Errors/MemoryWarningView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,20 @@ struct MemoryWarningView: View {
var body: some View {
ScrollView {
VStack {
Text("注意!")
Text("Memory.caution")
.font(.system(size: 18, weight: .bold))
Text("当前占用内存过高")
Text("喵哩喵哩可能会被系统终止")
Text("当前内存占用大于 240 MB\n内存占用超过 300 MB 后会被系统终止")
Text("Memory.too-much-occupied")
Text("Memory.limit")
Button(action: {
dismiss()
}, label: {
Text("了解!")
Text("Memory.understand")
})
Button(action: {
isShowMemoryInScreen = true
dismiss()
}, label: {
Text("在右上角显示占用(仅本次启动)")
Text("Memory.display-usage")
})
}
.multilineTextAlignment(.center)
Expand Down
Loading

0 comments on commit b46e004

Please sign in to comment.