点灯
This commit is contained in:
parent
54c71e4e14
commit
e6b33e9d7e
|
|
@ -2,10 +2,10 @@
|
||||||
<view class="enshrined-list">
|
<view class="enshrined-list">
|
||||||
<!-- 表格头部 -->
|
<!-- 表格头部 -->
|
||||||
<view class="table-header">
|
<view class="table-header">
|
||||||
<view class="header-cell worshiper-col">供奉人</view>
|
<view class="header-cell worshiper-col">点灯人</view>
|
||||||
<view class="header-cell time-col">供奉时间</view>
|
<view class="header-cell time-col">点灯时间</view>
|
||||||
<view class="header-cell time-col">结束时间</view>
|
<view class="header-cell time-col">结束时间</view>
|
||||||
<view class="header-cell type-col">供奉类型</view>
|
<view class="header-cell type-col">点灯类型</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 表格内容 -->
|
<!-- 表格内容 -->
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
<!-- 空状态 -->
|
<!-- 空状态 -->
|
||||||
<view v-if="!loading && enshrinedList.length === 0" class="empty-state">
|
<view v-if="!loading && enshrinedList.length === 0" class="empty-state">
|
||||||
<view class="empty-icon">📝</view>
|
<view class="empty-icon">📝</view>
|
||||||
<view class="empty-text">暂无供奉记录</view>
|
<view class="empty-text">暂无点灯记录</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 加载更多 -->
|
<!-- 加载更多 -->
|
||||||
|
|
@ -132,7 +132,7 @@ export default {
|
||||||
|
|
||||||
this.hasMore = this.enshrinedList.length < total;
|
this.hasMore = this.enshrinedList.length < total;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("加载供奉列表失败:", error);
|
console.error("加载点灯列表失败:", error);
|
||||||
// 错误时使用模拟数据(仅用于测试)
|
// 错误时使用模拟数据(仅用于测试)
|
||||||
console.log("API 调用失败,使用模拟数据");
|
console.log("API 调用失败,使用模拟数据");
|
||||||
const mockData = this.getMockData();
|
const mockData = this.getMockData();
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
<view class="enshrined-list">
|
<view class="enshrined-list">
|
||||||
<!-- 表格头部 -->
|
<!-- 表格头部 -->
|
||||||
<view class="table-header">
|
<view class="table-header">
|
||||||
<view class="header-cell worshiper-col">供奉人</view>
|
<view class="header-cell worshiper-col">点灯人</view>
|
||||||
<view class="header-cell time-col">供奉时间</view>
|
<view class="header-cell time-col">点灯时间</view>
|
||||||
<view class="header-cell time-col">结束时间</view>
|
<view class="header-cell time-col">结束时间</view>
|
||||||
<view class="header-cell type-col">供奉类型</view>
|
<view class="header-cell type-col">点灯类型</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 表格内容 -->
|
<!-- 表格内容 -->
|
||||||
|
|
@ -16,23 +16,23 @@
|
||||||
class="table-row"
|
class="table-row"
|
||||||
@click="handleItemClick(item)"
|
@click="handleItemClick(item)"
|
||||||
>
|
>
|
||||||
<view class="table-cell worshiper-col">{{
|
<view class="table-cell worshiper-col"
|
||||||
item.worshiperName || "未知"
|
>{{ item.worshiperName || "未知" }}
|
||||||
}}</view>
|
</view>
|
||||||
<view class="table-cell time-col">{{
|
<view class="table-cell time-col"
|
||||||
formatDate(item.startDate)
|
>{{ formatDate(item.startDate) }}
|
||||||
}}</view>
|
</view>
|
||||||
<view class="table-cell time-col">{{ formatDate(item.endDate) }}</view>
|
<view class="table-cell time-col">{{ formatDate(item.endDate) }}</view>
|
||||||
<view class="table-cell type-col">{{
|
<view class="table-cell type-col"
|
||||||
item.thaliName || "未知类型"
|
>{{ item.thaliName || "未知类型" }}
|
||||||
}}</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 空状态 -->
|
<!-- 空状态 -->
|
||||||
<view v-if="!loading && enshrinedList.length === 0" class="empty-state">
|
<view v-if="!loading && enshrinedList.length === 0" class="empty-state">
|
||||||
<view class="empty-icon">📝</view>
|
<view class="empty-icon">📝</view>
|
||||||
<view class="empty-text">暂无供奉记录</view>
|
<view class="empty-text">暂无点灯记录</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 加载更多 -->
|
<!-- 加载更多 -->
|
||||||
|
|
@ -132,7 +132,7 @@ export default {
|
||||||
|
|
||||||
this.hasMore = this.enshrinedList.length < total;
|
this.hasMore = this.enshrinedList.length < total;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("加载供奉列表失败:", error);
|
console.error("加载点灯列表失败:", error);
|
||||||
// 错误时使用模拟数据(仅用于测试)
|
// 错误时使用模拟数据(仅用于测试)
|
||||||
console.log("API 调用失败,使用模拟数据");
|
console.log("API 调用失败,使用模拟数据");
|
||||||
const mockData = this.getMockData();
|
const mockData = this.getMockData();
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<view class="modal-title">牌位供奉</view>
|
<view class="modal-title">牌位点灯</view>
|
||||||
|
|
||||||
<!-- 供奉时长选择 -->
|
<!-- 点灯时长选择 -->
|
||||||
<view class="duration-section">
|
<view class="duration-section">
|
||||||
<view class="duration-grid">
|
<view class="duration-grid">
|
||||||
<view
|
<view
|
||||||
|
|
@ -26,17 +26,17 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 供奉人信息 -->
|
<!-- 点灯人信息 -->
|
||||||
<view class="offerer-section">
|
<view class="offerer-section">
|
||||||
<view class="section-label">供奉人</view>
|
<view class="section-label">点灯人</view>
|
||||||
<input
|
<input
|
||||||
v-model="offererName"
|
v-model="offererName"
|
||||||
class="offerer-input"
|
class="offerer-input"
|
||||||
maxlength="20"
|
maxlength="20"
|
||||||
placeholder="请填写供奉人姓名"
|
placeholder="请填写点灯人姓名"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="input-tip">将在供奉名单上展现供奉人的姓名,此为必填</view>
|
<view class="input-tip">将在点灯名单上展现点灯人的姓名,此为必填</view>
|
||||||
|
|
||||||
<!-- 确认按钮 -->
|
<!-- 确认按钮 -->
|
||||||
<view class="confirm-section">
|
<view class="confirm-section">
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
<text class="total-price">¥{{ totalPrice }}</text>
|
<text class="total-price">¥{{ totalPrice }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="confirm-btn" @click="handleConfirm">
|
<view class="confirm-btn" @click="handleConfirm">
|
||||||
<text class="btn-text">立即供奉</text>
|
<text class="btn-text">立即点灯</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -91,17 +91,17 @@ export default {
|
||||||
this.$emit("close");
|
this.$emit("close");
|
||||||
},
|
},
|
||||||
|
|
||||||
// 选择供奉时长
|
// 选择点灯时长
|
||||||
selectDuration(value) {
|
selectDuration(value) {
|
||||||
this.selectedDuration = value;
|
this.selectedDuration = value;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 确认供奉
|
// 确认点灯
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
// 验证供奉人姓名
|
// 验证点灯人姓名
|
||||||
if (!this.offererName.trim()) {
|
if (!this.offererName.trim()) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请填写供奉人姓名",
|
title: "请填写点灯人姓名",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
@view-details="handleViewDetails"
|
@view-details="handleViewDetails"
|
||||||
/>
|
/>
|
||||||
<view class="placeholder"></view>
|
<view class="placeholder"></view>
|
||||||
<!-- 供奉列表 -->
|
<!-- 点灯列表 -->
|
||||||
<enshrined-list
|
<enshrined-list
|
||||||
v-if="!loading"
|
v-if="!loading"
|
||||||
ref="enshrinedList"
|
ref="enshrinedList"
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
<bottom-button title="立即点灯" type="primary" @click="submitPrayer" />
|
<bottom-button title="立即点灯" type="primary" @click="submitPrayer" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 供奉弹窗 -->
|
<!-- 点灯弹窗 -->
|
||||||
<OfferingModal
|
<OfferingModal
|
||||||
:durationOptions="PackageList"
|
:durationOptions="PackageList"
|
||||||
:visible="showOfferingModal"
|
:visible="showOfferingModal"
|
||||||
|
|
@ -178,7 +178,7 @@ export default {
|
||||||
memorialDetail: null,
|
memorialDetail: null,
|
||||||
// 滚动相关
|
// 滚动相关
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
// 供奉弹窗显示状态
|
// 点灯弹窗显示状态
|
||||||
showOfferingModal: false,
|
showOfferingModal: false,
|
||||||
// 收藏状态
|
// 收藏状态
|
||||||
isCollected: false,
|
isCollected: false,
|
||||||
|
|
@ -417,39 +417,39 @@ export default {
|
||||||
console.log("查看单元详情:", unitData);
|
console.log("查看单元详情:", unitData);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 提交供奉
|
// 提交点灯
|
||||||
submitPrayer() {
|
submitPrayer() {
|
||||||
if (!checkLogin()) {
|
if (!checkLogin()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("显示供奉弹窗");
|
console.log("显示点灯弹窗");
|
||||||
this.showOfferingModal = true;
|
this.showOfferingModal = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 关闭供奉弹窗
|
// 关闭点灯弹窗
|
||||||
closeOfferingModal() {
|
closeOfferingModal() {
|
||||||
this.showOfferingModal = false;
|
this.showOfferingModal = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 确认供奉
|
// 确认点灯
|
||||||
async handleOfferingConfirm(offeringData) {
|
async handleOfferingConfirm(offeringData) {
|
||||||
offeringData = { ...offeringData, memorialId: this.selectedUnitId };
|
offeringData = { ...offeringData, memorialId: this.selectedUnitId };
|
||||||
console.log("确认供奉:", offeringData);
|
console.log("确认点灯:", offeringData);
|
||||||
|
|
||||||
// 这里可以调用供奉API
|
// 这里可以调用点灯API
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "正在提交供奉...",
|
title: "正在提交点灯...",
|
||||||
});
|
});
|
||||||
|
|
||||||
let res = await ordersEnshrined(offeringData);
|
let res = await ordersEnshrined(offeringData);
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "供奉成功!",
|
title: "点灯成功!",
|
||||||
icon: "success",
|
icon: "success",
|
||||||
});
|
});
|
||||||
// 供奉成功后刷新状态栏数据
|
// 点灯成功后刷新状态栏数据
|
||||||
if (
|
if (
|
||||||
this.$refs.statusBar &&
|
this.$refs.statusBar &&
|
||||||
typeof this.$refs.statusBar.loadUnitData === "function"
|
typeof this.$refs.statusBar.loadUnitData === "function"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user