| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>活动</title>
- <meta name="viewport"
- content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <!--引入 element-ui 的样式,-->
- <link rel="stylesheet"
- href="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742018383195/element-ui.css">
- <!-- 必须先引入vue, 后使用element-ui -->
- <script
- src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017957144/vue.js"></script>
- <!-- 引入element 的组件库-->
- <script
- src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017747738/element-ui.js"></script>
- <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
- <!-- <script src="js/vconsole.min.js"></script>
- <script>
- var vConsole = new window.VConsole();
- </script> -->
- </head>
- <style>
- body {
- margin: 0;
- padding: 0;
- }
- #box {
- width: 100vw;
- height: 100vh;
- box-sizing: border-box;
- }
- </style>
- <body>
- <div id="box">
- </div>
- <script>
- new Vue({
- el: '#box',
- data () {
- return {
- env: '',
- httpUrl: '',
- h5Type: null,
- bId: null,
- }
- },
- created () {
- this.bId = this.getQueryParam('bId')
- this.env = this.getQueryParam('env')
- this.h5Type = this.getQueryParam('h5Type')
- if (!this.env || this.env === 'prod') {
- this.httpUrl = 'https://wlapi.wefanbot.com'
- } else {
- this.httpUrl = 'http://test.wefanbot.com:18993'
- }
- localStorage.removeItem('openId')
- this.ifH5Type()
- },
- methods: {
- // 公众号授权,获取code
- getAuth () {
- // 获取url上的code
- let code = this.getQueryParam('code')
- if (code) {
- // 判断业务id是否生产环境业务id
- fetch(this.httpUrl + `/p/insuite/p/isProdId?id=${this.bId}`)
- .then(res => {
- return res.json()
- }).then(result => {
- let { data, msg } = result
- if (typeof data === 'boolean' && data) {
- this.httpUrl = 'https://wlapi.wefanbot.com'
- } else {
- this.httpUrl = 'http://test.wefanbot.com:18993'
- }
- this.getInfoByh5Code(this.getQueryParam('code'))
- })
- } else {
- let redirect_uri = window.location.href
- // code 不存在,走微信网页授权逻辑
- let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appId=wx99ec0d0828a4d2d3&redirect_uri=${redirect_uri}&scope=snsapi_userinfo&state=STATE#wechat_redirect`
- window.location.replace(url)
- }
- },
- getInfoByh5Code (code) {
- fetch(this.httpUrl + `/scrm/v1/mp-client/p/getInfoByh5Code?code=${code}&bId=${this.bId}`)
- .then(res => {
- return res.json()
- }).then(result => {
- let { data, code, msg } = result
- if (code === 1) {
- this.h5Type = data.h5Type
- localStorage.setItem('openId', data.openId)
- this.ifH5Type();
- }
- })
- },
- ifH5Type () {
- if (this.h5Type == 19 || this.h5Type == 30) {
- // 抽奖
- var currentQueryParams = window.location.search;
- window.location.replace('lottery.html' + currentQueryParams)
- } else if (this.h5Type == 20) {
- // 宝骏云海送祝福
- var currentQueryParams = window.location.search;
- window.location.replace('h5Type-20.html' + currentQueryParams)
- } else if (this.h5Type == 21) {
- // 活码
- var currentQueryParams = window.location.search;
- window.location.replace('live_code.html' + currentQueryParams)
- } else if (this.h5Type == 22) {
- // 红包兑换
- var currentQueryParams = window.location.search;
- window.location.replace('receiveMoney.html' + currentQueryParams)
- } else if (this.h5Type == 23) {
- // 会话列表
- var currentQueryParams = window.location.search;
- window.location.replace('sessionList.html' + currentQueryParams)
- } else if (this.h5Type == 24) {
- // 客户SOP提醒
- var currentQueryParams = window.location.search;
- window.location.replace('clientSopTip.html' + currentQueryParams)
- } else if (this.h5Type == 25) {
- // 客户SOP内容
- var currentQueryParams = window.location.search;
- window.location.replace('clientSop.html' + currentQueryParams)
- } else if (this.h5Type == 26) {
- // 群SOP提醒
- var currentQueryParams = window.location.search;
- window.location.replace('groupSopTip.html' + currentQueryParams)
- } else if (this.h5Type == 27) {
- // 群SOP内容
- var currentQueryParams = window.location.search;
- window.location.replace('groupSop.html' + currentQueryParams)
- } else if (this.h5Type == 28) {
- // 点亮五菱
- var currentQueryParams = window.location.search;
- window.location.replace('lightUpWl.html' + currentQueryParams)
- } else if (this.h5Type == 29) {
- // 车主筛选,试驾筛选,预约试驾
- var currentQueryParams = window.location.search;
- window.location.replace('carOwnerScreening.html' + currentQueryParams)
- } else if (this.h5Type == 31) {
- // 活动报名
- var currentQueryParams = window.location.search;
- window.location.replace('registrationActivity.html' + currentQueryParams)
- } else if (this.h5Type == 32) {
- // 核销
- var currentQueryParams = window.location.search;
- window.location.replace('signUp.html' + currentQueryParams)
- } else if (this.h5Type == 33) {
- // 跟进列表
- var currentQueryParams = window.location.search;
- window.location.replace('followUpList.html' + currentQueryParams)
- } else if (this.h5Type == 34) {
- // 客户画像
- var currentQueryParams = window.location.search;
- window.location.replace('userProfile.html' + currentQueryParams)
- } else if (this.h5Type == 35) {
- // 客户画像
- var currentQueryParams = window.location.search;
- window.location.replace('onePersonOneCode.html' + currentQueryParams)
- } else if (!this.h5Type) {
- this.getAuth()
- }
- },
- // 截取url中的数据
- getQueryParam (paramName) {
- // 获取当前URL的查询字符串部分
- const queryString = window.location.search;
- // 创建一个URLSearchParams对象
- const urlParams = new URLSearchParams(queryString);
- // 返回指定参数的值,如果不存在则返回null
- return urlParams.get(paramName);
- },
- }
- })
- </script>
- </body>
- </html>
|