提交 3631ec6d 编写于 作者: xinglee23's avatar xinglee23

fix: add activity check

上级 93b38936
...@@ -54,3 +54,12 @@ export const getInsProjectInfo = (params) => { ...@@ -54,3 +54,12 @@ export const getInsProjectInfo = (params) => {
withCredentials: true, withCredentials: true,
}); });
}; };
export const getActivityInfo = (params) => {
return request({
url: '/activity/act/check',
method: 'post',
params,
withCredentials: true,
});
};
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
<div class="fixed-btn"> <div class="fixed-btn">
<div <div
class="wx-btn" class="wx-btn"
v-if="picaWechat !== 'wechat'" @click="handleActivityRemind"
v-if="picaWechat !== 'wechat' || errorMsg"
> >
<span>预约权益</span> <span>预约权益</span>
<!-- <img <!-- <img
...@@ -76,7 +77,7 @@ ...@@ -76,7 +77,7 @@
</template> </template>
<script> <script>
import { getInsProjectInfo } from '@/api/entitlement'; import { getInsProjectInfo, getActivityInfo } from '@/api/entitlement';
import { isWeixin, isMobile } from '@/utils/index'; import { isWeixin, isMobile } from '@/utils/index';
export default { export default {
...@@ -101,6 +102,7 @@ export default { ...@@ -101,6 +102,7 @@ export default {
descList: [], descList: [],
descBottomList: [], descBottomList: [],
}, },
errorMsg: null,
}; };
}, },
created() { created() {
...@@ -132,6 +134,7 @@ export default { ...@@ -132,6 +134,7 @@ export default {
}, },
async mounted() { async mounted() {
document.title = this.headerInfo.title; document.title = this.headerInfo.title;
const { rightsNo } = this.$route.query; const { rightsNo } = this.$route.query;
const result = await getInsProjectInfo({ rightsNo }); const result = await getInsProjectInfo({ rightsNo });
...@@ -142,6 +145,7 @@ export default { ...@@ -142,6 +145,7 @@ export default {
this.openWebAppConfigPositive.path = `pagesInsurance/exclusively-activity/submit?rightsNo=${rightsNo}&source=h5`; this.openWebAppConfigPositive.path = `pagesInsurance/exclusively-activity/submit?rightsNo=${rightsNo}&source=h5`;
this.activityCheck(rightsNo);
this.$sendBuriedData( this.$sendBuriedData(
{ {
action: 'ACTION_WEB_ENTER', action: 'ACTION_WEB_ENTER',
...@@ -154,6 +158,21 @@ export default { ...@@ -154,6 +158,21 @@ export default {
); );
}, },
methods: { methods: {
activityCheck(rightsNo) {
const activity = getActivityInfo({ unionId: '', rightsNo });
if (activity.code === '000000') {
this.errorMsg = activity.data.errorMsg;
}
if (this.errorMsg) {
return this.$toast(this.errorMsg);
}
},
handleActivityRemind() {
if (!this.errorMsg) return;
this.$toast(this.errorMsg);
},
handleErrorFn(e) { handleErrorFn(e) {
console.log('handleErrorFn', e); console.log('handleErrorFn', e);
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册