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

feat 跳转小程序方式更换

上级 cd6b5d16
......@@ -19,13 +19,9 @@
<div
class="wx-btn"
@click="handleActivityRemind"
v-if="picaWechat !== 'wechat' || errorMsg"
v-if="true"
>
<span>预约权益</span>
<!-- <img
:src="insuranceInfo.descBottomList[0]"
alt=""
/> -->
</div>
<wx-open-launch-weapp
v-else
......@@ -89,6 +85,12 @@ export default {
descBottomList: [],
},
errorMsg: null,
appletConfig: {
appid: 'wx180ede0978486102',
path: 'pagesInsurance/exclusively-activity/submit',
query: '',
env_version: 'trial',
},
};
},
created() {
......@@ -99,23 +101,23 @@ export default {
.alert({
type: 'warning',
title: '提示',
message: '请使用手机微信打开!',
message: '请使用手机浏览器打开!',
confirmButtonText: '我知道了',
})
.then(() => {
// on close
});
} else if (!isWeixin()) {
this.$dialog
.alert({
type: 'warning',
title: '提示',
message: '请在微信中扫码打开!',
confirmButtonText: '我知道了',
})
.then(() => {
// on close
});
// this.$dialog
// .alert({
// type: 'warning',
// title: '提示',
// message: '请在微信中扫码打开!',
// confirmButtonText: '我知道了',
// })
// .then(() => {
// // on close
// });
}
},
async mounted() {
......@@ -130,6 +132,7 @@ export default {
}
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.$sendBuriedData(
......@@ -144,6 +147,15 @@ export default {
);
},
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) {
getActivityInfo({ unionId: '', rightsNo }).then((res) => {
if (res.code === '000000') {
......@@ -156,9 +168,13 @@ export default {
});
},
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) {
console.log('handleErrorFn', e);
......
......@@ -32,7 +32,7 @@
<div class="fixed-btn">
<div
class="wx-btn"
v-if="picaWechat !== 'wechat' || hideWeApp"
v-if="true"
@click="handleClick"
>
<span>领取权益</span>
......@@ -107,6 +107,12 @@ export default {
descBottomList: [],
},
hideWeApp: false,
appletConfig: {
appid: 'wx180ede0978486102',
path: 'pagesInsurance/my-right/index',
query: '',
env_version: 'trial',
},
};
},
created() {
......@@ -117,23 +123,19 @@ export default {
.alert({
type: 'warning',
title: '提示',
message: '请使用手机微信打开!',
message: '请使用手机浏览器打开!',
confirmButtonText: '我知道了',
})
.then(() => {
// on close
});
.then(() => {});
} else if (!isWeixin()) {
this.$dialog
.alert({
type: 'warning',
title: '提示',
message: '请在微信中扫码打开!',
confirmButtonText: '我知道了',
})
.then(() => {
// on close
});
// this.$dialog
// .alert({
// type: 'warning',
// title: '提示',
// message: '请在微信中扫码打开!',
// confirmButtonText: '我知道了',
// })
// .then(() => {});
}
},
async mounted() {
......@@ -178,7 +180,7 @@ export default {
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/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 });
this.$sendBuriedData(
{
......@@ -199,6 +201,15 @@ export default {
);
},
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) {
insuranceStatusCheck({ projectEquityNo, rightsNo }).then((res) => {
if (res.code === '000000') {
......@@ -241,6 +252,12 @@ export default {
handleClick() {
if (this.hideWeApp) {
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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册