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

fix: add activity check

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