pray静态第三版

This commit is contained in:
minimaxagent1 2025-08-05 11:29:47 +08:00
parent 4cd03a3f35
commit ebddc7168d

View File

@ -97,8 +97,8 @@ export default {
forOthers: false, // forOthers: false, //
wish: '' wish: ''
}, },
prayerTypes: ['个人祈福', '为他人祈福', '家庭祈福', '事业祈福', '学业祈福', '健康祈福', '财运祈福', '姻缘祈福', '其他祈福'], prayerTypes: ['学业', '健康', '姻缘', '财运', '消灾'],
selectedPrayerType: '个人祈福', selectedPrayerType: '学业',
showPicker: false showPicker: false
} }
}, },
@ -189,23 +189,42 @@ export default {
resetForm() { resetForm() {
this.formData = { this.formData = {
name: '', name: '',
prayerType: '个人祈福', prayerType: '学业',
forOthers: false, forOthers: false,
wish: '' wish: ''
} }
this.selectedPrayerType = '个人祈福' this.selectedPrayerType = '学业'
}, },
// //
showPrayerTypePicker() { showPrayerTypePicker() {
console.log('开始显示祈福类型选择器');
console.log('可选项:', this.prayerTypes);
uni.showActionSheet({ uni.showActionSheet({
itemList: this.prayerTypes, itemList: this.prayerTypes,
success: (res) => { success: (res) => {
this.selectedPrayerType = this.prayerTypes[res.index]; console.log('选择器回调参数:', res);
this.formData.prayerType = this.selectedPrayerType; console.log('选择的索引:', res.tapIndex);
if (res.tapIndex !== undefined && res.tapIndex >= 0 && res.tapIndex < this.prayerTypes.length) {
const selectedType = this.prayerTypes[res.tapIndex];
console.log('选择的祈福类型:', selectedType);
//
this.selectedPrayerType = selectedType;
//
this.formData.prayerType = selectedType;
console.log('更新后的selectedPrayerType:', this.selectedPrayerType);
console.log('更新后的formData.prayerType:', this.formData.prayerType);
} else {
console.error('无效的选择索引:', res.tapIndex);
}
}, },
fail: (res) => { fail: (res) => {
console.error('用户取消选择'); console.log('用户取消选择或选择失败:', res);
} }
}); });
} }
@ -332,7 +351,7 @@ page {
} }
.input-field{ .input-field{
padding-left: 20rpx; padding-left: 40rpx;
} }
} }
@ -344,7 +363,7 @@ page {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding:0 30rpx 0 30rpx; padding:0 30rpx 0 66rpx;
width: 100%; width: 100%;
@ -414,7 +433,7 @@ page {
height: 140rpx; height: 140rpx;
//border: 1rpx solid #e10c0c; //border: 1rpx solid #e10c0c;
border-radius: 12rpx; border-radius: 12rpx;
padding: 0 20rpx 0 20rpx; padding: 0 20rpx 0 66rpx;
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
box-sizing: border-box; box-sizing: border-box;