Browse Source

Merge branch 'milestone0718-2025周年庆后台' of http://39.101.133.168:8807/lihuilin/AnniversaryBackstage into milestone0718-2025周年庆后台

milestone0718-2025周年庆后台
lihuilin 3 weeks ago
parent
commit
4ef0dfec62
  1. 18
      activitylink/src/stone/activityStone.js
  2. 5
      activitylink/src/views/zhongchou/activity/detail/index.vue
  3. 1
      activitylink/src/views/zhongchou/activity/index.vue
  4. 100
      activitylink/src/views/zhongchou/activity/set/index.vue
  5. 7
      activitylink/src/views/zhongchou/winning/index.vue

18
activitylink/src/stone/activityStone.js

@ -37,6 +37,16 @@ export const useactivityStone = defineStore('activityStone', () => {
});
};
// 新增:持久化活动名称
const activityName = ref(localStorage.getItem('activityName') || '');
const setActivityName = (value) => {
activityName.value = value;
localStorage.setItem('activityName', value);
activityStorage.setItem('activityName', value).catch((err) => {
console.error('保存 activityName 到 localforage 失败:', err);
});
};
// 初始化恢复
const initialize = async () => {
try {
@ -48,11 +58,15 @@ export const useactivityStone = defineStore('activityStone', () => {
const storedId = await activityStorage.getItem('selectactivityId');
if (storedId !== null) selectactivityId.value = storedId;
const storedName = await activityStorage.getItem('activityName');
if (storedName !== null) activityName.value = storedName;
} catch (error) {
console.warn('从 localforage 恢复失败,尝试从 localStorage 恢复');
searchUsername.value = localStorage.getItem('searchUsername') || '';
searchJwcode.value = localStorage.getItem('searchJwcode') || '';
selectactivityId.value = localStorage.getItem('selectactivityId') || '';
activityName.value = localStorage.getItem('activityName') || '';
}
};
@ -62,8 +76,10 @@ export const useactivityStone = defineStore('activityStone', () => {
selectactivityId,
searchUsername,
searchJwcode,
activityName,
setselectedactivityId,
setSearchUsername,
setSearchJwcode
setSearchJwcode,
setActivityName
};
});

5
activitylink/src/views/zhongchou/activity/detail/index.vue

@ -10,7 +10,7 @@
当前总参与人数{{ totalParticipants }}         
参与{{marketOneLabel}}总人数{{ usParticipants }}      {{marketOneLabel}}助力总次数{{ usAssists }}         
参与{{marketTwoLabel}}总人数{{ hkParticipants }}      {{marketTwoLabel}}助力总次数{{ hkAssists }}         
当前活动id{{ activityStone.selectactivityId }}
当前活动名称为{{ activityStone.activityName }}
</div>
<!-- 搜索栏 -->
@ -51,8 +51,9 @@
</template>
</el-table-column>
<!-- <el-table-column prop="id" label="ID" width="100" align="center"></el-table-column> -->
<el-table-column prop="username" label="姓名" width="300" align="center"></el-table-column>
<el-table-column prop="username" label="姓名" width="200" align="center"></el-table-column>
<el-table-column prop="jwcode" label="精网号" width="300" align="center"></el-table-column>
<el-table-column prop="locMarket" label="用户地区" width="300" align="center"></el-table-column>
<el-table-column prop="text" label="参与市场" width="300" align="center"></el-table-column>
<el-table-column prop="joinTime" label="参与时间" align="center" :formatter="formatJoinTime"></el-table-column>
</el-table>

1
activitylink/src/views/zhongchou/activity/index.vue

@ -398,6 +398,7 @@ const handleCurrentChange = (val) => {
//
const goToDetail = (row) => {
activityStone.setselectedactivityId(row.id);
activityStone.setActivityName(row.activityName);
router.push({ name: 'activityDetail' });
};

100
activitylink/src/views/zhongchou/activity/set/index.vue

@ -262,50 +262,63 @@ const cancelset = () => {
//
//
const confirmInitialData = async () => {
try {
const id = activityStone.selectactivityId
const time = setinitiaData.value
if (!id) {
ElMessage.warning('未获取到活动ID')
return
}
if (time === null || time <= 0) {
ElMessage.warning('请输入有效的分钟数')
return
}
const response = await setTime(
{
activityId: id,
time: time
}
)
if (response.code === 200) {
await fetchData()
showInitialConfirmDialog.value = false
setinitiaData.value=0
ElMessage.success('设置成功')
ifshow();
} else {
ElMessage.error(response.message || '设置失败')
}
} catch (error) {
console.error('设置初始数据失败:', error)
ElMessage.error('请求失败,请重试')
}
}
// const confirmInitialData = async () => {
// try {
// const id = activityStone.selectactivityId
// const time = setinitiaData.value
// if (!id) {
// ElMessage.warning('ID')
// return
// }
// if (time === null || time <= 0) {
// ElMessage.warning('')
// return
// }
// const response = await setTime(
// {
// activityId: id,
// time: time
// }
// )
// if (response.code === 200) {
// await fetchData()
// showInitialConfirmDialog.value = false
// setinitiaData.value=0
// ElMessage.success('')
// ifshow();
// } else {
// ElMessage.error(response.message || '')
// }
// } catch (error) {
// console.error(':', error)
// ElMessage.error('')
// }
// }
//
//
const isAdding = ref(false);
const addCooldown = 1500; // 1.5
const confirmAdd = async () => {
//
if (isAdding.value) {
ElMessage.warning('操作过于频繁,请稍后再试');
return;
}
const type = pendingAction.value;
// > 0
if (type === 'one' && addCountOne.value !== null && addCountOne.value !== 0) {
//
isAdding.value = true;
markerOneTotal.value += parseInt(addCountOne.value);
showOne.value = markerOneTotal.value;
@ -334,12 +347,20 @@ const confirmAdd = async () => {
//
markerOneTotal.value -= parseInt(addCountOne.value);
showOne.value = markerOneTotal.value;
} finally {
// 1.5
setTimeout(() => {
isAdding.value = false;
}, addCooldown);
}
addCountOne.value = null;
// > 0
} else if (type === 'two' && addCountTwo.value !== null && addCountTwo.value !== 0) {
//
isAdding.value = true;
markerTwoTotal.value += parseInt(addCountTwo.value);
showTwo.value = markerTwoTotal.value;
@ -367,6 +388,11 @@ const confirmAdd = async () => {
//
markerTwoTotal.value -= parseInt(addCountTwo.value);
showTwo.value = markerTwoTotal.value;
} finally {
// 1.5
setTimeout(() => {
isAdding.value = false;
}, addCooldown);
}
addCountTwo.value = null;

7
activitylink/src/views/zhongchou/winning/index.vue

@ -4,7 +4,7 @@
<div class="gray-container">
<h2>中奖管理</h2>
<el-form :inline="true" class="search-bar">
<el-form-item label="姓名">
<el-form-item label="姓名" >
<el-input v-model="searchParams.username" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item label="精网号">
@ -45,10 +45,11 @@
<!-- 表格 -->
<div class="table-container">
<el-table :data="tableData" style="width: 100%" :row-style="{ height: '55px' }">
<el-table-column prop="username" label="姓名" width="180" align="center"></el-table-column>
<el-table-column prop="username" label="姓名" width="180" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="jwcode" label="精网号" width="250" align="center"></el-table-column>
<el-table-column prop="locMarket" label="用户地区" width="250" align="center"></el-table-column>
<el-table-column prop="gradeName" label="中奖等级" width="200" align="center"></el-table-column>
<el-table-column prop="prizeName" label="所中礼品" width="300" align="center"></el-table-column>
<el-table-column prop="prizeName" label="所中礼品" width="200" align="center"></el-table-column>
<el-table-column prop="winTime" label="中奖时间" align="center"></el-table-column>
</el-table>
</div>

Loading…
Cancel
Save