Commit b41d3bce by 李伟康

```

feat(api): 添加活动详情获取接口

添加getActivityDetail方法用于获取活动详情信息,
通过post请求调用'dj.pad.api.activity.assign.activity.find'接口

fix(ActivityPopup): 修复关闭方法语法并更新事件传递机制

修复close方法的语法格式,将uni.$emit替换为组件自身的$emit事件,
以更好的组件间通信方式传递活动中心跳转信息

feat(HomeFrame): 集成活动弹窗跳转功能和错误提示

新增JumpActivityCenter方法处理活动中心跳转逻辑,
添加uni-popup错误提示组件显示权限错误信息,
完善活动详情获取和权限验证流程
```
1 parent 15eb7c28
......@@ -37,4 +37,14 @@ module.exports = {
...data
})
},
/**
* 获取活动详情
*/
getActivityDetail(data) {
return http.post({
method: 'dj.pad.api.activity.assign.activity.find',
projectName: 'pad',
...data
})
},
}
......@@ -61,7 +61,7 @@ export default {
this.data = data
this.$refs.popup.open("center");
},
close(){
close () {
this.$refs.popup.close()
},
clickClose () {
......@@ -70,7 +70,7 @@ export default {
},
jump () {
this.clickClose()
uni.$emit('ActivityCenter')
this.$emit('JumpActivityCenter', this.data)
},
async updateActivity () {
const { msgId } = this.data
......
......@@ -217,7 +217,20 @@
@confirm="handleStudyPermissionConfirm"
/>
</StudyPopup>
<activity-popup ref="activityPopup"></activity-popup>
<activity-popup
ref="activityPopup"
@JumpActivityCenter="JumpActivityCenter"
></activity-popup>
<uni-popup
ref="errorRef"
type="message"
>
<uni-popup-message
type="error"
:message="errorMsg"
:duration="1500"
></uni-popup-message>
</uni-popup>
</view>
</template>
<script>
......@@ -328,6 +341,7 @@ export default {
title: ''
},
lockReason: 0,
errorMsg: ''
}
},
beforeDestroy () {
......@@ -374,8 +388,8 @@ export default {
watch: {
activityWindowPopStatus: {
handler (val) {
const { id , tabIndex } = this
if (val == 2 && !id && tabIndex == 0) this.getActivityMessage()
const { id, tabIndex } = this
if (val == 2 && !id && tabIndex == 0) this.getActivityMessage()
},
immediate: true,
deep: true
......@@ -764,6 +778,21 @@ export default {
},
closeActivityCenter () {
this.$refs.activityPopup.close()
},
async JumpActivityCenter (data) {
const { activityId } = data,
{ shopMerchantId } = uni.$storage.get('userInfo'),
{ sceneType } = this,
res = await uni.$api.activityApi.getActivityDetail({
sceneType,
id: activityId,
merchantId: shopMerchantId
})
if (!res){
this.errorMsg = '暂无该活动查看权限'
this.$refs.errorRef.open()
}
this.$refs.leftBox.handleActivityCenter()
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!