upload project
This commit is contained in:
commit
06961cae04
422 changed files with 110626 additions and 0 deletions
108
subpackages/settings/feedback/feedback.js
Normal file
108
subpackages/settings/feedback/feedback.js
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
// 反馈页面逻辑
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
feedbackTypes: ['功能建议', 'Bug反馈', '内容纠错', '其他问题'],
|
||||
selectedType: 0,
|
||||
content: '',
|
||||
contact: '',
|
||||
navbarHeight: 0, // 导航栏高度
|
||||
statusBarHeight: 0, // 状态栏高度
|
||||
menuButtonInfo: {} // 胶囊按钮信息
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
|
||||
// 获取系统信息,用于导航栏定位
|
||||
const systemInfo = wx.getSystemInfoSync();
|
||||
const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
|
||||
|
||||
this.setData({
|
||||
statusBarHeight: systemInfo.statusBarHeight,
|
||||
menuButtonInfo: menuButtonInfo,
|
||||
// 计算导航栏高度 = 胶囊按钮底部距离 - 状态栏高度
|
||||
navbarHeight: menuButtonInfo.bottom - systemInfo.statusBarHeight
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 返回上一页
|
||||
*/
|
||||
navigateBack: function() {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 选择反馈类型
|
||||
*/
|
||||
onTypeChange: function(e) {
|
||||
this.setData({
|
||||
selectedType: e.detail.value
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 输入反馈内容
|
||||
*/
|
||||
onContentChange: function(e) {
|
||||
this.setData({
|
||||
content: e.detail.value
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 输入联系方式
|
||||
*/
|
||||
onContactChange: function(e) {
|
||||
this.setData({
|
||||
contact: e.detail.value
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 提交反馈
|
||||
*/
|
||||
submitFeedback: function() {
|
||||
const { selectedType, content, contact } = this.data;
|
||||
const selectedTypeText = this.data.feedbackTypes[selectedType];
|
||||
|
||||
// 验证反馈内容
|
||||
if (!content.trim()) {
|
||||
wx.showToast({
|
||||
title: '请输入反馈内容',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 显示加载提示
|
||||
wx.showLoading({
|
||||
title: '提交中...',
|
||||
});
|
||||
|
||||
// 模拟提交反馈
|
||||
setTimeout(() => {
|
||||
wx.hideLoading();
|
||||
|
||||
// 显示成功提示
|
||||
wx.showToast({
|
||||
title: '反馈提交成功',
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
success: () => {
|
||||
// 延迟返回上一页
|
||||
setTimeout(() => {
|
||||
this.navigateBack();
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
8
subpackages/settings/feedback/feedback.json
Normal file
8
subpackages/settings/feedback/feedback.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"navigationBarTitleText": "意见反馈",
|
||||
"navigationBarBackgroundColor": "#000000",
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#000000",
|
||||
"disableScroll": false
|
||||
}
|
||||
56
subpackages/settings/feedback/feedback.wxml
Normal file
56
subpackages/settings/feedback/feedback.wxml
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<!-- 反馈页面 -->
|
||||
<view class="container">
|
||||
<!-- 顶部导航栏 - 使用动态高度 -->
|
||||
<view class="navbar" style="height: {{navbarHeight}}px; padding-top: {{statusBarHeight}}px;">
|
||||
<view class="back-btn" bindtap="navigateBack" style="height: {{menuButtonInfo.height}}px; line-height: {{menuButtonInfo.height}}px;">
|
||||
<text class="icon">↩</text>
|
||||
</view>
|
||||
<view class="title" style="line-height: {{menuButtonInfo.height}}px;">意见反馈</view>
|
||||
<view class="back-btn" style="line-height: {{menuButtonInfo.height}}px;"></view>
|
||||
</view>
|
||||
|
||||
<!-- 主内容区 - 根据导航栏总高度调整顶部距离 -->
|
||||
<view class="content" style="padding-top: {{navbarHeight + statusBarHeight}}px;">
|
||||
<!-- 反馈表单 -->
|
||||
<view class="form-section">
|
||||
<view class="form-item">
|
||||
<text class="label">反馈类型</text>
|
||||
<picker mode="selector" range="{{feedbackTypes}}" value="{{selectedType}}" bindchange="onTypeChange">
|
||||
<view class="picker-view">
|
||||
{{feedbackTypes[selectedType] || '请选择反馈类型'}}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<text class="label">反馈内容</text>
|
||||
<textarea
|
||||
placeholder="请输入您的反馈内容..."
|
||||
value="{{content}}"
|
||||
bindinput="onContentChange"
|
||||
class="textarea"
|
||||
></textarea>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<text class="label">联系方式</text>
|
||||
<input
|
||||
placeholder="请输入您的联系方式(选填)"
|
||||
value="{{contact}}"
|
||||
bindinput="onContactChange"
|
||||
class="input"
|
||||
></input>
|
||||
</view>
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<view class="submit-container">
|
||||
<view class="submit-button gradient" bindtap="submitFeedback" wx:if="{{!isSubmitting}}">
|
||||
<text class="submit-text">提交</text>
|
||||
</view>
|
||||
<view class="submit-button submitting" wx:else>
|
||||
<text class="submit-text">提交中...</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
169
subpackages/settings/feedback/feedback.wxss
Normal file
169
subpackages/settings/feedback/feedback.wxss
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
/* 深色主题反馈页面样式 */
|
||||
.container {
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
background: linear-gradient(to bottom, #23013a, #000000);
|
||||
/* color: #ffffff; */
|
||||
}
|
||||
|
||||
/* 导航栏样式 - 移除固定高度设置,由JS动态控制 */
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* background-color: #1a1a1a; */
|
||||
/* border-bottom: 1px solid #333333; */
|
||||
z-index: 10;
|
||||
box-sizing: content-box; /* 确保padding不会影响总高度计算 */
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
width: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: 20px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 34rpx;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* 主内容区 - 移除固定padding-top,由JS动态控制 */
|
||||
.content {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 表单区域 */
|
||||
.form-section {
|
||||
padding: 20px 16px;
|
||||
background-color: #1a1a1a;
|
||||
margin: 10px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
font-size: 15px;
|
||||
color: #cccccc;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 选择器样式 */
|
||||
.picker-view {
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid #444444;
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
color: #ffffff;
|
||||
background-color: #2a2a2a;
|
||||
}
|
||||
|
||||
/* 输入框样式 */
|
||||
.textarea {
|
||||
width: 100%;
|
||||
min-height: 150px;
|
||||
padding: 12px;
|
||||
border: 1px solid #444444;
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
color: #ffffff;
|
||||
background-color: #2a2a2a;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.textarea::placeholder {
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid #444444;
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
background-color: #2a2a2a;
|
||||
}
|
||||
|
||||
.input::placeholder {
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
/* 提交按钮样式 */
|
||||
/* 提交按钮容器 */
|
||||
.submit-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 0 30rpx;
|
||||
margin-top: 60rpx;
|
||||
}
|
||||
|
||||
/* 提交按钮 - 渐变效果更贴近设计图 */
|
||||
.submit-button {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
border-radius: 45rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.submit-text {
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 渐变效果 - 更接近设计图的粉蓝渐变 */
|
||||
.gradient {
|
||||
background: linear-gradient(90deg, #FF55C9 0%, #00B8FF 100%);
|
||||
background-size: 200% 200%;
|
||||
animation: gradientFlow 3s ease infinite;
|
||||
}
|
||||
|
||||
@keyframes gradientFlow {
|
||||
0% { background-position: 0% 50%; }
|
||||
50% { background-position: 100% 50%; }
|
||||
100% { background-position: 0% 50%; }
|
||||
}
|
||||
|
||||
/* 提交中状态 */
|
||||
.submitting {
|
||||
background-color: #333333;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
/* 触摸效果 */
|
||||
.submit-button:active:not(.submitting) {
|
||||
transform: scale(0.98);
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue