提交 49fb9cf4 编写于 作者: zhongyao.qiao's avatar zhongyao.qiao

feat 跳转小程序方式更换

上级 cd6b5d16
...@@ -19,13 +19,9 @@ ...@@ -19,13 +19,9 @@
<div <div
class="wx-btn" class="wx-btn"
@click="handleActivityRemind" @click="handleActivityRemind"
v-if="picaWechat !== 'wechat' || errorMsg" v-if="true"
> >
<span>预约权益</span> <span>预约权益</span>
<!-- <img
:src="insuranceInfo.descBottomList[0]"
alt=""
/> -->
</div> </div>
<wx-open-launch-weapp <wx-open-launch-weapp
v-else v-else
...@@ -89,6 +85,12 @@ export default { ...@@ -89,6 +85,12 @@ export default {
descBottomList: [], descBottomList: [],
}, },
errorMsg: null, errorMsg: null,
appletConfig: {
appid: 'wx180ede0978486102',
path: 'pagesInsurance/exclusively-activity/submit',
query: '',
env_version: 'trial',
},
}; };
}, },
created() { created() {
...@@ -99,23 +101,23 @@ export default { ...@@ -99,23 +101,23 @@ export default {
.alert({ .alert({
type: 'warning', type: 'warning',
title: '提示', title: '提示',
message: '请使用手机微信打开!', message: '请使用手机浏览器打开!',
confirmButtonText: '我知道了', confirmButtonText: '我知道了',
}) })
.then(() => { .then(() => {
// on close // on close
}); });
} else if (!isWeixin()) { } else if (!isWeixin()) {
this.$dialog // this.$dialog
.alert({ // .alert({
type: 'warning', // type: 'warning',
title: '提示', // title: '提示',
message: '请在微信中扫码打开!', // message: '请在微信中扫码打开!',
confirmButtonText: '我知道了', // confirmButtonText: '我知道了',
}) // })
.then(() => { // .then(() => {
// on close // // on close
}); // });
} }
}, },
async mounted() { async mounted() {
...@@ -130,6 +132,7 @@ export default { ...@@ -130,6 +132,7 @@ export default {
} }
this.openWebAppConfigPositive.path = `pagesInsurance/exclusively-activity/submit?rightsNo=${rightsNo}&channelId=${channelId}&source=h5&channel=hot_act`; this.openWebAppConfigPositive.path = `pagesInsurance/exclusively-activity/submit?rightsNo=${rightsNo}&channelId=${channelId}&source=h5&channel=hot_act`;
this.appletConfig.query = `rightsNo=${rightsNo}&channelId=${channelId}&source=h5&channel=hot_act`;
this.activityCheck(rightsNo); this.activityCheck(rightsNo);
this.$sendBuriedData( this.$sendBuriedData(
...@@ -144,6 +147,15 @@ export default { ...@@ -144,6 +147,15 @@ export default {
); );
}, },
methods: { methods: {
appletUrl() {
const { appid, path, query, env_version } = this.appletConfig;
let url = 'weixin://dl/business/?';
url += `appid=${appid}`;
url += `&path=${path}`;
url += `&query=${encodeURIComponent(query)}`;
url += `&env_version=${env_version}`;
return url;
},
activityCheck(rightsNo) { activityCheck(rightsNo) {
getActivityInfo({ unionId: '', rightsNo }).then((res) => { getActivityInfo({ unionId: '', rightsNo }).then((res) => {
if (res.code === '000000') { if (res.code === '000000') {
...@@ -156,9 +168,13 @@ export default { ...@@ -156,9 +168,13 @@ export default {
}); });
}, },
handleActivityRemind() { handleActivityRemind() {
if (!this.errorMsg) return; if (this.errorMsg) return this.$toast(this.errorMsg);
this.$toast(this.errorMsg); const isProd = process.env.NODE_ENV === 'production';
if (isProd) {
this.appletConfig.env_version = 'release';
}
location.href = this.appletUrl();
}, },
handleErrorFn(e) { handleErrorFn(e) {
console.log('handleErrorFn', e); console.log('handleErrorFn', e);
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div class="fixed-btn"> <div class="fixed-btn">
<div <div
class="wx-btn" class="wx-btn"
v-if="picaWechat !== 'wechat' || hideWeApp" v-if="true"
@click="handleClick" @click="handleClick"
> >
<span>领取权益</span> <span>领取权益</span>
...@@ -107,6 +107,12 @@ export default { ...@@ -107,6 +107,12 @@ export default {
descBottomList: [], descBottomList: [],
}, },
hideWeApp: false, hideWeApp: false,
appletConfig: {
appid: 'wx180ede0978486102',
path: 'pagesInsurance/my-right/index',
query: '',
env_version: 'trial',
},
}; };
}, },
created() { created() {
...@@ -117,23 +123,19 @@ export default { ...@@ -117,23 +123,19 @@ export default {
.alert({ .alert({
type: 'warning', type: 'warning',
title: '提示', title: '提示',
message: '请使用手机微信打开!', message: '请使用手机浏览器打开!',
confirmButtonText: '我知道了', confirmButtonText: '我知道了',
}) })
.then(() => { .then(() => {});
// on close
});
} else if (!isWeixin()) { } else if (!isWeixin()) {
this.$dialog // this.$dialog
.alert({ // .alert({
type: 'warning', // type: 'warning',
title: '提示', // title: '提示',
message: '请在微信中扫码打开!', // message: '请在微信中扫码打开!',
confirmButtonText: '我知道了', // confirmButtonText: '我知道了',
}) // })
.then(() => { // .then(() => {});
// on close
});
} }
}, },
async mounted() { async mounted() {
...@@ -178,7 +180,7 @@ export default { ...@@ -178,7 +180,7 @@ export default {
this.handleInsuranceStatusCheck(projectEquityNo, rightsNo); this.handleInsuranceStatusCheck(projectEquityNo, rightsNo);
// this.openWebAppConfigPositive.path = `pagesInsurance/health-card/index?channelCode=${channelCode}&projectEquityNo=${projectEquityNo}&externalOrderNo=${externalOrderNo}&rightsNo=${rightsNo}&userInfo=${userInfo}&identity=${identity}&token=${token}&cardNo=${cardNo}`; // this.openWebAppConfigPositive.path = `pagesInsurance/health-card/index?channelCode=${channelCode}&projectEquityNo=${projectEquityNo}&externalOrderNo=${externalOrderNo}&rightsNo=${rightsNo}&userInfo=${userInfo}&identity=${identity}&token=${token}&cardNo=${cardNo}`;
this.openWebAppConfigPositive.path = `/pagesInsurance/my-right/index?channelCode=${channelCode}&projectEquityNo=${projectEquityNo}&externalOrderNo=${externalOrderNo}&rightsNo=${rightsNo}&userInfo=${userInfo}&identity=${identity}&token=${token}&cardNo=${cardNo}`; this.openWebAppConfigPositive.path = `/pagesInsurance/my-right/index?channelCode=${channelCode}&projectEquityNo=${projectEquityNo}&externalOrderNo=${externalOrderNo}&rightsNo=${rightsNo}&userInfo=${userInfo}&identity=${identity}&token=${token}&cardNo=${cardNo}`;
this.appletConfig.query = `channelCode=${channelCode}&projectEquityNo=${projectEquityNo}&externalOrderNo=${externalOrderNo}&rightsNo=${rightsNo}&userInfo=${userInfo}&identity=${identity}&token=${token}&cardNo=${cardNo}`;
if (channelCode) uploadPointData({ channelCode }); if (channelCode) uploadPointData({ channelCode });
this.$sendBuriedData( this.$sendBuriedData(
{ {
...@@ -199,6 +201,15 @@ export default { ...@@ -199,6 +201,15 @@ export default {
); );
}, },
methods: { methods: {
appletUrl() {
const { appid, path, query, env_version } = this.appletConfig;
let url = 'weixin://dl/business/?';
url += `appid=${appid}`;
url += `&path=${path}`;
url += `&query=${encodeURIComponent(query)}`;
url += `&env_version=${env_version}`;
return url;
},
handleInsuranceStatusCheck(projectEquityNo, rightsNo) { handleInsuranceStatusCheck(projectEquityNo, rightsNo) {
insuranceStatusCheck({ projectEquityNo, rightsNo }).then((res) => { insuranceStatusCheck({ projectEquityNo, rightsNo }).then((res) => {
if (res.code === '000000') { if (res.code === '000000') {
...@@ -241,6 +252,12 @@ export default { ...@@ -241,6 +252,12 @@ export default {
handleClick() { handleClick() {
if (this.hideWeApp) { if (this.hideWeApp) {
this.$toast('活动已结束'); this.$toast('活动已结束');
} else {
const isProd = process.env.NODE_ENV === 'production';
if (isProd) {
this.appletConfig.env_version = 'release';
}
location.href = this.appletUrl();
} }
}, },
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册