duanshenglang пре 8 месеци
родитељ
комит
e3ff7fe3bb

+ 434 - 0
lottery/carOwnerScreening.html

@@ -0,0 +1,434 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+  <meta charset="UTF-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>点亮五菱</title>
+  <!--引入 element-ui 的样式,-->
+  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
+  <!-- 必须先引入vue,  后使用element-ui -->
+  <script src="./js/vue.js"></script>
+  <!-- 引入element 的组件库-->
+  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
+  <script src="https://unpkg.com/vconsole/dist/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;
+    background: #FAFAFA;
+  }
+
+  .page6 {
+    width: 100vw;
+    height: 100vh;
+    background: url('./img/wl_carOwner.png') no-repeat center;
+    background-size: 100vw 100vh;
+    background-repeat: no-repeat;
+  }
+  .page6s {
+    width: 100vw;
+    height: 100vh;
+    background: url('./img/wl_bg.png') no-repeat center;
+    background-size: 100vw 100vh;
+    background-repeat: no-repeat;
+  }
+  .page_title {
+    font-weight: bold;
+    font-size: 16px;
+    color: #FFFFFF;
+    padding-top: 98px;
+    padding-left: 30px;
+  }
+  .page_tip {
+    font-weight: bold;
+    font-size: 24px;
+    color: #FFFFFF;
+    padding: 20px 0 20px 30px;
+  }
+  .select_box {
+    display: flex;
+    align-items: center;
+    margin: 20px 25px 0;
+    background: #FFFFFF;
+    border-radius: 20px;
+    opacity: 0.5;
+  }
+  .show_active {
+    opacity: 1;
+  }
+  .option_img {
+    width: 60px;
+    height: 60px;
+  }
+  .option_text {
+    font-weight: 500;
+    font-size: 16px;
+    color: #222222;
+    padding-left: 20px;
+  }
+  .page_foot {
+    position: fixed;
+    bottom: 20px;
+    width: 100%;
+  }
+ .foot_btn {
+    font-weight: 500;
+    font-size: 16px;
+    color: #222222;
+    padding: 15px 0;
+    margin: 0 35px;
+    background: #FFFFFF;
+    text-align: center;
+    border-radius: 20px;
+ }
+  .prize_form {
+    background: #FFFFFF;
+    border-radius: 15px;
+    padding: 20px;
+    margin: 0 15px;
+  }
+ 	.prize_form .el-form-item{
+    margin-bottom: 0;
+    padding: 10px 0;
+  }
+  .prize_form .el-input {
+    width: 220px;
+  }
+  .prize_form .el-input__inner {
+    border: none;
+    text-align: end;
+  }
+  .no_testDrive {
+    font-size: 16px;
+    color: #FFFFFF;
+    line-height: 30px;
+    padding-top: 140px;
+    text-align: center;
+  }
+  .qw_name {
+    font-weight: bold;
+    font-size: 16px;
+    color: #FFF96E; 
+  }
+  .isWlCar_title {
+    font-weight: 400;
+    font-size: 18px;
+    color: #744620;
+    line-height: 36px;
+    padding-top: 323px;
+    text-align: center;
+  }
+  .qrcode_box {
+    width: 201px;
+    height: 201px;
+    margin: 0 auto;
+    padding: 15px;
+    background: #FFFFFF;
+    border-radius: 20px;
+    box-sizing: border-box;
+    margin-top: 40px;
+  }
+  .qrcode_img {
+    width: 100%;
+  }
+  .qrcode_tip {
+    height: 60px;
+    font-size: 14px;
+    color: #744620;
+    text-align: center;
+    background: #FEC99D;
+  }
+  .testDrive_title {
+    font-weight: bold;
+    font-size: 24px;
+    color: #FFFFFF;
+    padding-top: 100px;
+    padding-left: 30px;
+  }
+  .testDrive_tip {
+    font-weight: 400;
+    font-size: 14px;
+    color: #FFFFFF;
+    padding-top: 10px;
+    padding-left: 30px;
+    padding-bottom: 40px;
+  }
+  .noTestDrive_tip {
+    font-weight: 400;
+    font-size: 14px;
+    color: #744620;
+    padding-top: 10px;
+    text-align: center;
+  }
+</style>
+<body>
+  <div id="box" class="box">
+    <div v-if="isWlCar">
+      <div class="page6s">
+        <div class="isWlCar_title">
+          <div>您是车主暂不能给朋友点亮哦~</div>
+          <div>请添加菱骏服务官发起点亮活动</div>
+        </div>
+        <div class="qrcode_box">
+          <img class="qrcode_img" src="./img/down.png" alt="">
+        </div>
+      </div>
+      <div class="qrcode_tip">扫码添加菱骏服务官</div>
+    </div>
+    <div class="page6" v-else-if="noTestDrive">
+      <div class="no_testDrive">
+        <div>扫码添加<span class="qw_name"> Ling号玩家企微</span></div>
+        <div>0元抽睛雨伞、量子香薰机等好礼</div>
+      </div>
+      <div class="qrcode_box">
+        <img class="qrcode_img" src="./img/down.png" alt="">
+      </div>
+      <div class="noTestDrive_tip">扫码添加Ling号玩家</div>
+    </div>
+    <div class="page6" v-else>
+      <div v-if="filter==1 || filter==2">
+        <div class="page_title">帮助好友点亮五菱,即可参与现金抽奖</div>
+        <div class="page_tip">{{filter==1 ? '请问您是五菱车主吗?' : '五菱汽车诚邀您参与试驾'}}</div>
+      </div>
+      <div v-if="filter==1">
+        <div class="select_box" style="padding: 19px;" :class="selectData === 'one' ? 'show_active' : ''" @click="selectItem('one')">
+          <img class="option_img" src="./img/wl_car.png" />
+          <div class="option_text">我是五菱车主</div>
+        </div>
+        <div class="select_box" style="padding: 19px;" :class="selectData === 'two' ? 'show_active' : ''" @click="selectItem('two')">
+          <img class="option_img" src="./img/wl_car.png" />
+          <div class="option_text">还没有购入五菱汽车</div>
+        </div>
+      </div>
+      <div v-else-if="filter==2">
+        <div class="select_box" style="padding: 38px 35px;" :class="selectData === 'three' ? 'show_active' : ''" @click="selectItem('three')">
+          <div class="option_text">预约试驾,帮好友点亮五菱</div>
+        </div>
+        <div class="select_box" style="padding: 38px 35px;" :class="selectData === 'four' ? 'show_active' : ''" @click="selectItem('four')">
+          <div class="option_text">暂不预约</div>
+        </div>
+      </div>
+      <div v-else-if="filter==3">
+        <div class="testDrive_title">预约试驾</div>
+        <div class="testDrive_tip">预约试驾即可帮助好友点亮五菱</div>
+        <el-form :model="getInfoForm" class="prize_form">
+          <el-form-item label="意向车型:">
+            <el-select v-model="getInfoForm.intenModel" placeholder="请选择车型">
+              <el-option v-for="item in allCarList" :key="item" :label="item" :value="item">
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="所在城市:">
+            <el-cascader v-model="cityData" placeholder="请选择您所在的城市" :options="transformedData" @change="handleInfoCity">
+            </el-cascader>
+          </el-form-item>
+          <el-form-item label="联系方式:">
+            <el-input v-model="getInfoForm.phone" placeholder="请输入您的手机号" autocomplete="off" maxlength="11" oninput="value=value.replace(/[^\d]/g,'')"
+              @blur="$event => {getInfoForm.phone = Number($event.target.value) || '';}"></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div class="page_foot">
+        <div class="foot_btn" @click="handleOk" v-if="filter==3">确认预约,马上抽奖</div>
+        <div class="foot_btn" @click="handleOk" v-else>确认</div>
+      </div>
+    </div>
+  </div>
+</body>
+<script>
+  new Vue({
+    el: '#box',
+    data() {
+      return {
+        httpUrl: '',
+        bId: null,
+        env: '',
+        allCarList: [],
+        getInfoForm: {
+          intenModel: '',
+          province: '',
+          city: '',
+          phone: '' 
+        },
+        cityData: '',
+        transformedData: [],
+        selectData: 'one',
+        isWlCar: false,
+        filter: 1,
+        noTestDrive: false
+      }
+    },
+    created() {
+      this.bId = this.getQueryParam('bId')
+      this.env = this.getQueryParam('env')
+      if (!this.env || this.env === 'prod') {
+        this.httpUrl = 'https://wlapi.wefanbot.com'
+      } else {
+        // this.httpUrl = 'http://test.wefanbot.com:18993'
+        this.httpUrl = 'http://192.168.1.147:18993'
+      }
+      this.ifH5Type()
+      // this.getAllCar()
+      // this.getCityLevel()
+    },
+    methods: {
+      ifH5Type() {
+        if (this.getQueryParam('openId') || localStorage.getItem('openId')) {
+          if (!this.getQueryParam('externalUserid')) {
+            this.gerQwAuth(this.bId);
+          } else {
+            this.lightenOwner()
+          }
+        } else {
+          // 走授权操作
+          this.getAuth();
+        }
+      },
+      getAuth() {
+        // 获取url上的code
+        let code = this.getQueryParam('code')
+        if (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) {
+                localStorage.setItem('openId', data.openId)
+                this.ifH5Type()
+              }
+            })
+        } 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)
+        }
+      },
+      // 企微授权
+      gerQwAuth(bId) {
+        let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
+        fetch(this.httpUrl + `/p/insuite/p/getOAUrl?openId=${openId}&bId=${bId}`)
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              window.location.replace(data)
+            } else {
+              this.$message({
+                message: msg,
+                type: 'warning'
+              })
+            }
+          })
+      },
+      lightenOwner() {
+        let externalUserid = this.getQueryParam('externalUserid')
+        let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
+        const headers = new Headers();
+        headers.append('police', 110);
+        fetch(this.httpUrl + `/scrm/v1/wxcp-lighten-owner/p/lottery?externalUserid=${externalUserid}&openId=${openId}&bId=${this.bId}`, {
+          method: 'GET',
+          headers: headers
+        })
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              this.lightData = data
+            } else {
+              this.$message({
+                message: msg,
+              })
+            }
+          })
+      },
+      // 获取全部车型
+      getAllCar() {
+        fetch(this.httpUrl + `/scrm/v1/wxcp-raffle/p/getCarList?bId=${this.bId}`)
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              this.allCarList = data
+            }
+          })
+      },
+      // 获取城市数据
+      getCityLevel() {
+        fetch('https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/1000/1720161853377/pc-code.json')
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            this.transformedData = this.transformData(result)
+          })
+      },
+      handleInfoCity(value) {
+        this.getInfoForm.province = value[0]
+        this.getInfoForm.city = value[1]
+      },
+      // 省市数据做转换
+      transformData(data) {
+        return data.map(item => {
+          // 创建一个新对象,避免直接修改原始对象
+          const newItem = { ...item };
+
+          // 重命名 text 为 label
+          if (newItem.text) {
+            newItem.label = newItem.text;
+            newItem.value = newItem.text;
+            delete newItem.text;
+          }
+
+          // 如果存在 children 数组,则递归处理每个子项
+          if (newItem.children && Array.isArray(newItem.children)) {
+            newItem.children = this.transformData(newItem.children);
+          }
+
+          return newItem;
+        })
+      },
+      selectItem(type) {
+        this.selectData = type 
+      },
+      handleOk() {
+        if (this.selectData === 'one') {
+          this.isWlCar = true 
+        } else if (this.selectData === 'two') {
+          this.filter = 2
+          this.selectData = 'three'
+        } else if (this.selectData === 'three') {
+          this.filter = 3
+        } else if (this.selectData === 'four') {
+          this.noTestDrive = true
+        }
+      },
+      // 截取url中的数据
+      getQueryParam(paramName) {
+        // 获取当前URL的查询字符串部分  
+        const queryString = window.location.search;
+        // 创建一个URLSearchParams对象  
+        const urlParams = new URLSearchParams(queryString);
+        // 返回指定参数的值,如果不存在则返回null  
+        return urlParams.get(paramName);
+      },
+    }
+  })
+</script>
+
+</html>

BIN
lottery/img/ask_bg.png


BIN
lottery/img/ask_btn.png


BIN
lottery/img/copy_icon.png


BIN
lottery/img/down.png


BIN
lottery/img/fail_img.png


BIN
lottery/img/light_five.png


BIN
lottery/img/light_four.png


BIN
lottery/img/light_one.png


BIN
lottery/img/light_three.png


BIN
lottery/img/light_two.png


BIN
lottery/img/sign_up.png


BIN
lottery/img/signup_bg.png


BIN
lottery/img/signup_success.png


BIN
lottery/img/wl_bg.png


BIN
lottery/img/wl_btn.png


BIN
lottery/img/wl_car.png


BIN
lottery/img/wl_carOwner.png


BIN
lottery/img/wl_no.png


+ 21 - 5
lottery/index.html

@@ -14,9 +14,9 @@
 	<script src="https://unpkg.com/element-ui/lib/index.js"></script>
 	<script src="https://unpkg.com/vconsole/dist/vconsole.min.js"></script>
 	<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
-	<script>
+	<!-- <script>
 		var vConsole = new window.VConsole();
-	</script>
+	</script> -->
 </head>
 <style>
   body {
@@ -383,13 +383,13 @@
 <body>
 	<div id="box">
 		<!-- 二维码 -->
-		<div class="qrcode" v-if="qrCodeData.qrCode">
+		<div class="qrcode" v-if="qrCodeData.qrCode || qrCodeData.msg">
 			<img class="qrcode-img" :src="qrCodeData.qrCode" />
 			<div class="qrcode-msg">{{qrCodeData.msg}}</div>
 		</div>
 		<el-alert v-if="showError" class="alert_dialog" :title="errorMsg" :closable="false" type="error" show-icon>
 		</el-alert>
-		<div v-if="h5Type == 19 && !qrCodeData.qrCode">
+		<div v-if="h5Type == 19 && h5Type == 30 && !qrCodeData.qrCode">
 			<div class="lotteryPage">
 				<div class="event_notice" @click="handleRule">
 					<span>活动须知</span>
@@ -660,7 +660,7 @@
 							})
 					},
 					ifH5Type () {
-						if (this.h5Type == 19) {
+						if (this.h5Type == 19 || this.h5Type == 30) {
 							if (this.getQueryParam('openId') || localStorage.getItem('openId')) {
 								if (!this.getQueryParam('externalUserid')) {
 									this.gerQwAuth(this.bId);
@@ -711,6 +711,22 @@
 							// 群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) {
 							this.getAuth()
 						}	

+ 410 - 0
lottery/lightUpWl.html

@@ -0,0 +1,410 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+  <meta charset="UTF-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>点亮五菱</title>
+  <!--引入 element-ui 的样式,-->
+  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
+  <!-- 必须先引入vue,  后使用element-ui -->
+  <script src="./js/vue.js"></script>
+  <!-- 引入element 的组件库-->
+  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
+  <script src="https://unpkg.com/vconsole/dist/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;
+    background: #FAFAFA;
+  }
+
+  .page6 {
+    width: 100vw;
+    height: 100vh;
+    background: url('./img/wl_bg.png') no-repeat center;
+    background-size: 100vw 100vh;
+    background-repeat: no-repeat;
+  }
+  .wl_no {
+    width: 100%;
+    margin-top: 260px;
+  }
+  .wl_btn {
+    width: 100%;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    position: relative;
+    margin-top: 150px;
+  }
+  .image_wrapper {
+    position: relative;
+    display: inline-block;
+  }
+
+  .image_wrapper img {
+    height: 68px;
+    display: block; /* 移除图片底部间隙 */
+  }
+  .btn_text {
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    font-weight: 500;
+    font-size: 20px;
+    color: #FFFFFF;
+  }
+  .ask {
+    background: #FEC99D;
+  }
+  .step {
+    display: flex;  
+    justify-content: center; 
+    align-items: center;
+    padding-top: 27px;
+  }
+  .step span {
+    font-size: 14px;
+    color: #BC7E4B;
+  }
+  .step_line {
+    width: 30px;
+    height: 1px;
+    background: #BC7E4B;
+    margin: 0 5px;
+  }
+  .ask_btn {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    gap: 10px;
+    margin-top: 20px;
+  }
+  .ask_btn img {
+    width: 50px;
+    height: 50px;
+  }
+  .activity_box {
+    width: 100%;
+    background: #FEE8D0;
+    border-radius: 20px 20px 0 0;
+    padding: 20px 15px;
+    box-sizing: border-box;
+    margin-top: 20px;
+  }
+  .lottery {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 10px;
+    box-sizing: border-box;
+    background: #FFFFFF;
+    border-radius: 15px;
+    margin-bottom: 15px;
+  }
+  .award {
+    display: flex;
+    align-items: center;
+    gap: 10px;
+  }
+  .award_ac {
+    width: 58px;
+    height: 58px;
+    background: #F5E3D4;
+    border-radius: 10px;
+  }
+  .award_tip {
+    font-size: 14px;
+    color: #999999; 
+  }
+  .award_title {
+    font-weight: 500;
+    font-size: 16px;
+    color: #FF765B;
+    padding-bottom: 5px;
+  }
+  .award_btn {
+    font-weight: 500;
+    font-size: 14px;
+    color: #FFFFFF;
+    padding: 3px 8px;
+    background: #CCCCCC;
+    border-radius: 13px;
+  }
+  .award_btn_ac {
+    font-weight: 500;
+    font-size: 14px;
+    color: #FFFFFF;
+    padding: 3px 8px;
+    background: #FF7979;
+    border-radius: 13px;
+  }
+  .prize_dialog {
+		position: fixed;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 100%;
+		background-color: rgba(0, 0, 0, 0.5);
+		/* 半透明黑色 */
+		z-index: 1000;
+		/* 确保遮罩层在顶部 */
+		transition: opacity 0.5s ease;
+		/* 可选:添加透明度过渡效果 */
+	}
+	.dialog_body {
+		width: 100%;
+		height: 100%;
+		z-index: 1001;
+		/* 确保遮罩层在顶部 */
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+	}
+  .dialog_bg {
+		width: 275px;
+		height: 370px;
+		position: relative;
+	}
+  .qrcode {
+    width: 125px;
+    height: 125px;
+    position: absolute;
+    bottom: 260px;
+  }
+  .save_btn {
+    padding: 15px 77px;
+    background: #FFFFFF;
+    border-radius: 29px;
+    font-weight: 500;
+    font-size: 14px;
+    color: #222222;
+    margin-top: 20px;
+  }
+  .activity_title {
+    font-weight: bold;
+    font-size: 14px;
+    color: #CB4E35;
+    padding-top: 5px;
+  }
+  .activity_msg {
+    font-size: 14px;
+    color: #CB4E35; 
+  }
+</style>
+
+<body>
+  <div id="box" class="box">
+    <div class="page6">
+      <img class="wl_no" v-if="!lightData.wxcpLightenClientList.length" src="./img/wl_no.png" />
+      <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length = 1" src="./img/light_one.png" />
+      <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length = 2" src="./img/light_two.png" />
+      <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length = 3" src="./img/light_three.png" />
+      <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length = 4" src="./img/light_four.png" />
+      <img class="wl_no" v-else-if="lightData.wxcpLightenClientList.length = 5" src="./img/light_five.png" />
+      <div class="wl_btn" @click="handleAsk">
+        <div class="image_wrapper">
+          <img class="btn_img" src="./img/wl_btn.png" />
+          <div class="btn_text">{{lightData.wxcpLightenClientList.length == 5 ? '点亮成功,解锁终极大奖' : '邀请好友点亮'}}</div>
+        </div>
+      </div>
+    </div>
+    <div class="ask">
+      <div class="step">
+        <span>1.生成海报</span>
+        <span class="step_line"></span>
+        <span>2.邀请好友</span>
+        <span class="step_line"></span>
+        <span>3.完成任务</span>
+      </div>
+      <div class="ask_btn">
+        <img src="./img/ask_btn.png" />
+        <img src="./img/ask_btn.png" />
+        <img src="./img/ask_btn.png" />
+        <img src="./img/ask_btn.png" />
+        <img src="./img/ask_btn.png" />
+      </div>
+      <div class="activity_box">
+        <div class="lottery">
+          <div class="award">
+            <div class="award_ac"></div>
+            <div class="award_tip">
+              <div class="award_title">好运抽奖</div>
+              <div>每邀请1人点亮即可抽奖1次</div>
+            </div>
+          </div>
+          <div :class="lightData.raffle1Num ? 'award_btn_ac' : 'award_btn'">{{lightData.raffle1Num ? '去抽奖' : '未完成'}}</div>
+        </div>
+        <div class="lottery">
+          <div class="award">
+            <div class="award_ac"></div>
+            <div class="award_tip">
+              <div class="award_title">终极大奖</div>
+              <div>完全点亮即可抽取终极大奖!</div>
+            </div>
+          </div>
+          <div :class="lightData.raffle2Num ? 'award_btn_ac' : 'award_btn'">{{lightData.raffle2Num ? '去抽奖' : '未完成'}}</div>
+        </div>
+        <div class="activity_title">活动信息</div>
+        <div class="activity_msg" v-html="lightData.wxcpLighten.activityInfo"></div>
+      </div>
+    </div>
+    <!-- 邀请弹窗 -->
+    <div class="prize_dialog" v-if="showAskDialog">
+      <div class="dialog_body">
+        <img class="dialog_bg" :src="lightData.urlPost" />
+        <!-- <img class="dialog_bg" src="./img/ask_bg.png" />
+        <img class="qrcode" src="./img/prize-bg.png" /> -->
+        <div class="save_btn" @click="saveImage">保存图片</div>
+      </div>
+    </div>
+  </div>
+</body>
+<script>
+  new Vue({
+    el: '#box',
+    data() {
+      return {
+        httpUrl: '',
+        bId: null,
+        env: '',
+        showAskDialog: false,
+        lightData: {
+          wxcpLightenClientList: []
+        },
+      }
+    },
+    created() {
+      this.bId = this.getQueryParam('bId')
+      this.env = this.getQueryParam('env')
+      if (!this.env || this.env === 'prod') {
+        this.httpUrl = 'https://wlapi.wefanbot.com'
+      } else {
+        // this.httpUrl = 'http://test.wefanbot.com:18993'
+        this.httpUrl = 'http://192.168.1.147:18993'
+      }
+      this.ifH5Type()
+    },
+    methods: {
+      ifH5Type() {
+        if (this.getQueryParam('openId') || localStorage.getItem('openId')) {
+          if (!this.getQueryParam('externalUserid')) {
+            this.gerQwAuth(this.bId);
+          } else {
+            this.lightenShare()
+          }
+        } else {
+          // 走授权操作
+          this.getAuth();
+        }
+      },
+      getAuth() {
+        // 获取url上的code
+        let code = this.getQueryParam('code')
+        if (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) {
+								localStorage.setItem('openId', data.openId)
+                this.ifH5Type()
+              }
+            })
+        } 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)
+        }
+      },
+      // 企微授权
+      gerQwAuth(bId) {
+        let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
+        fetch(this.httpUrl + `/p/insuite/p/getOAUrl?openId=${openId}&bId=${bId}`)
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              window.location.replace(data)
+            } else {
+              this.$message({
+                message: msg,
+                type: 'warning'
+              })
+            }
+          })
+      },
+      lightenShare() {
+        let externalUserid = this.getQueryParam('externalUserid')
+        let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
+        const headers = new Headers();
+        headers.append('police', 110);
+        fetch(this.httpUrl + `/scrm/v1/wxcp-lighten-share/p/lottery?externalUserid=${externalUserid}&openId=${openId}&bId=${this.bId}`, {
+          method: 'GET',
+          headers: headers
+        })
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              this.lightData = data
+              console.log('dd', this.lightData.wxcpLightenClientList);
+              
+            } else {
+              this.$message({
+                message: msg,
+              })
+            }
+          })
+      },
+      handleAsk() {
+        if (this.lightData.wxcpLightenClientList.length < 5) {
+          this.showAskDialog = true
+        } else {
+          this.$message({
+            message: '解锁终极大奖',
+          })
+        }
+      },
+      // 保存图片
+      saveImage() {
+        const link = document.createElement('a')
+        link.href = this.lightData.urlPost
+        link.download = 'urlPost.jpg'
+        document.body.appendChild(link);
+        link.click();
+        document.body.removeChild(link);
+        this.showAskDialog = false
+      },
+      // 截取url中的数据
+      getQueryParam(paramName) {
+        // 获取当前URL的查询字符串部分  
+        const queryString = window.location.search;
+        // 创建一个URLSearchParams对象  
+        const urlParams = new URLSearchParams(queryString);
+        // 返回指定参数的值,如果不存在则返回null  
+        return urlParams.get(paramName);
+      },
+    }
+  })   
+</script>
+
+</html>

+ 533 - 0
lottery/registrationActivity.html

@@ -0,0 +1,533 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+  <meta charset="UTF-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>活动</title>
+  <!--引入 element-ui 的样式,-->
+  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
+  <!-- 必须先引入vue,  后使用element-ui -->
+  <script src="./js/vue.js"></script>
+  <!-- 引入element 的组件库-->
+  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
+  <script src="https://unpkg.com/vconsole/dist/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;
+    background: #FAFAFA;
+  }
+
+  .page6 {
+    width: 100vw;
+    height: 100vh;
+    background: #FFD0D0;
+    background-size: 100vw 100vh;
+    background-repeat: no-repeat;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+  }
+  .activity_content {
+    width: 100%;
+    height: calc(100vh - 180px);
+    margin-top: 180px;
+    background: #FFFFFF;
+    border-radius: 20px 20px 0px 0px;
+    padding: 30px 20px 66px;
+    overflow-y: auto;
+    box-sizing: border-box;
+  }
+  .activity_item {
+    display: flex;
+    align-items: flex-start;
+    margin-bottom: 30px;
+  }
+  .item_title {
+    font-weight: 500;
+    font-size: 14px;
+    color: #222222;
+    min-width: 70px;
+  }
+  .item_content {
+    font-weight: 400;
+    font-size: 14px;
+    color: #222222; 
+  }
+  .foot_btn {
+    position: fixed;
+    bottom: 14px;
+    padding: 0 35px;
+    width: 100%;
+    box-sizing: border-box;
+  }
+  .signUp_btn {
+    height: 52px;
+    line-height: 52px;
+    background: #1677FF;
+    border-radius: 20px;
+    font-weight: 500;
+    font-size: 16px;
+    color: #FFFFFF;
+    text-align: center;
+  }
+  .form_content {
+    width: 100%;
+    height: calc(100vh - 180px);
+    margin-top: 180px;
+    background: #FFFFFF;
+    border-radius: 20px 20px 0px 0px;
+    padding: 20px 20px 66px;
+    overflow-y: auto;
+    box-sizing: border-box;
+  }
+  .form_title {
+    font-weight: 500;
+    font-size: 16px;
+    color: #222222;
+    text-align: center;
+  }
+  .el-form-item__label {
+    padding-right: 0;
+    font-weight: 500;
+    font-size: 14px;
+    color: #666666;
+  }
+  .el-input__inner {
+    border: none;
+    font-weight: 500;
+    font-size: 14px;
+    color: #222222;
+    text-align: right;
+  }
+  .el-input--prefix .el-input__inner {
+    padding-left: 0;
+    padding-right: 0;
+  }
+  .el-form-item {
+    margin-bottom: 0;
+    border-bottom: 1px solid #F9F9F9;
+    padding: 10px 0;
+  }
+  .el-textarea__inner {
+    border: none;
+    font-weight: 500;
+    font-size: 14px;
+    color: #222222;
+    text-align: right;
+  }
+  .signup_page {
+    width: 100vw;
+    height: 100vh;
+    background: url('./img/sign_up.png') no-repeat center;
+    background-size: 100vw 100vh;
+		background-repeat: no-repeat;
+  }
+  .signupSucc_page {
+    width: 100vw;
+    height: 100vh;
+    background: url('./img/signup_success.png') no-repeat center;
+    background-size: 100vw 100vh;
+		background-repeat: no-repeat;
+  }
+  .succ_tip {
+    padding-top: 240px;
+    font-weight: bold;
+    font-size: 24px;
+    color: #222222;
+    line-height: 40px;
+    text-align: center;
+  }
+  .signup_title {
+    font-weight: bold;
+    font-size: 24px;
+    color: #FFFFFF;
+    padding-top: 80px;
+    text-align: center;
+    line-height: 41px;
+  }
+  .signup_box {
+    margin: 30px 20px 0;
+    height: 390px;
+    background: linear-gradient(#D5E6FF 50%, #FFFFFF 100%);
+    border-radius: 20px;
+    box-sizing: border-box;
+  }
+  .signup_tip {
+    font-weight: 400;
+    font-size: 16px;
+    color: #222222;
+    padding: 50px 31px 40px 32px;
+    text-align: center;
+    line-height: 30px;
+  }
+  .signup_code {
+    font-weight: 500;
+    font-size: 30px;
+    color: #222222;
+    padding: 15px 36px;
+    background: #D3E0F5;
+    border-radius: 20px;
+    margin: 0 20px;
+  }
+  .copy_text {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding-top: 10px;
+    font-weight: 400;
+    font-size: 12px;
+    color: #9FB3C7;
+  }
+  .copy_icon {
+    width: 11px;
+    height: 11px;
+    margin-right: 3px;
+  }
+  .attention {
+    font-weight: 400;
+    font-size: 12px;
+    color: #999999;
+    line-height: 24px;
+    text-align: start;
+    padding-top: 50px;
+    padding-left: 20px;
+  }
+  .fail_box {
+    margin: 80px 20px 0;
+    height: 287px;
+    background: linear-gradient(#D5E6FF 50%, #FFFFFF 100%);
+    border-radius: 20px;
+    box-sizing: border-box;
+    text-align: center;
+  }
+  .fail_img {
+    width: 246px;
+    height: 144px;
+    margin-top: -20px;
+  }
+  .fail_title {
+    font-weight: 500;
+    font-size: 20px;
+    color: #222222;
+    line-height: 30px;
+    padding: 20px 0;
+  }
+  .fail_tip {
+    font-weight: 400;
+    font-size: 16px;
+    color: #666666;
+    line-height: 30px;
+  }
+</style>
+
+<body>
+  <div id="box" class="box">
+    <div class="signup_page" v-if="step === 3">
+      <div class="signup_title">
+        <div>恭喜您已经报名</div>
+        <div>{{toshopData.name}}</div>
+      </div>
+      <div class="signup_box">
+        <div class="signup_tip">请您于活动结束前,凭以下核销码前往预约到店门店领取礼品</div>
+        <div class="signup_code">{{verificationCode}}</div>
+        <div class="copy_text" @click="handleCopy(verificationCode)">
+          <img class="copy_icon" src="./img/copy_icon.png" />
+          <span>点击复制核销码</span>
+        </div>
+        <div class="attention">
+          <div>注意:</div>
+          <div>1.凭证码仅可核销一次,请注意保管</div>
+          <div>2.不记名,不挂失</div>
+        </div>
+      </div>
+    </div>
+    <div class="signupSucc_page" v-else-if="step === 4">
+      <div class="succ_tip">
+        <div>感谢参与{{toshopData.name}}活动</div>
+        <div>请联系门店顾问领取礼品</div>
+      </div>
+    </div>
+    <div class="signup_page" v-else-if="step === 5">
+      <div class="signup_title">{{toshopData.name}}</div>
+      <div class="fail_box">
+        <img class="fail_img" src="./img/fail_img.png" />
+        <div class="fail_title">很遗憾,您不在此次活动范围内</div>
+        <div class="fail_tip">
+          <div>后续有活动我们将第一时间通知您</div>
+          <div>敬请关注</div>
+        </div>
+      </div>
+    </div>
+    <div class="page6" v-else>
+      <div class="activity_content" v-if="step === 1">
+        <div class="activity_item">
+          <div class="item_title">活动主题:</div>
+          <div class="item_content">{{toshopData.name}}</div>
+        </div>
+        <div class="activity_item">
+          <div class="item_title">活动对象:</div>
+          <div class="item_content">{{toshopData.target}}</div>
+        </div>
+        <div class="activity_item">
+          <div class="item_title">活动时间:</div>
+          <div class="item_content">{{toshopData.startTime.slice(0, 10) + '~' + toshopData.endTime.slice(0, 10)}}</div>
+        </div>
+        <div class="activity_item">
+          <div class="item_title">活动规则:</div>
+          <div class="item_content" v-html="toshopData.activityInfo"></div>
+        </div>
+      </div>
+      <div class="form_content" v-else-if="step === 2">
+        <div class="form_title">报名表单</div>
+        <el-form ref="form" label-position="left" label-width="100px">
+          <el-form-item v-for="(item, index) in toshopData.formProList" :key="index" :label="item.name + ':'" :required="Boolean(item.isNeed)">
+            <el-input v-if="item.type === 0" v-model="item.value" placeholder="请输入"></el-input>
+            <el-input v-if="item.type === 1" type="textarea" autosize v-model="item.value" placeholder="请输入"></el-input>
+            <el-input v-if="item.type === 2" type="number" v-model="item.value" placeholder="请输入"></el-input>
+            <el-date-picker v-if="item.type === 5" v-model="item.value" type="date" placeholder="选择日期">
+            <el-time-picker v-if="item.type === 6" v-model="item.value" placeholder="请选择"></el-time-picker>
+            <el-date-picker v-if="item.type === 7" v-model="item.value" type="datetime" placeholder="选择日期时间"></el-date-picker>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div class="foot_btn">
+        <div class="signUp_btn" @click="toSignUp">{{step === 1 ? '去报名' : '确定'}}</div>
+      </div>
+    </div>
+  </div>
+</body>
+<script>
+  new Vue({
+    el: '#box',
+    data() {
+      return {
+        httpUrl: '',
+        bId: null,
+        env: '',
+        openId: '',
+        toshopData: {
+          name: '',
+          target: '',
+          startTime: '',
+          endTime: '',
+          activityInfo: '',
+          formProList: [],
+        },
+        step: 2,
+        verificationCode: '',
+      }
+    },
+    created() {
+      this.bId = this.getQueryParam('bId')
+      this.env = this.getQueryParam('env')
+      if (!this.env || this.env === 'prod') {
+        this.httpUrl = 'https://wlapi.wefanbot.com'
+      } else {
+        this.httpUrl = 'http://test.wefanbot.com:18993'
+      }
+      this.ifH5Type()
+    },
+    methods: {
+      ifH5Type() {
+        if (this.getQueryParam('openId') || localStorage.getItem('openId')) {
+          if (!this.getQueryParam('externalUserid')) {
+            this.gerQwAuth(this.bId);
+          } else {
+            this.lightenShare()
+          }
+        } else {
+          // 走授权操作
+          this.getAuth();
+        }
+      },
+      getAuth() {
+        // 获取url上的code
+        let code = this.getQueryParam('code')
+        if (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.openId = data.openId
+                localStorage.setItem('openId', data.openId)
+                this.ifH5Type()
+              }
+            })
+        } 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)
+        }
+      },
+      // 企微授权
+      gerQwAuth(bId) {
+        let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
+        fetch(this.httpUrl + `/p/insuite/p/getOAUrl?openId=${openId}&bId=${bId}`)
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              window.location.replace(data)
+            } else {
+              this.$message({
+                message: msg,
+                type: 'warning'
+              })
+            }
+          })
+      },
+      lightenShare() {
+        let externalUserid = this.getQueryParam('externalUserid')
+        let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
+        const headers = new Headers();
+        headers.append('police', 110);
+        fetch(this.httpUrl + `/scrm/v1/wxcp-toshop-share/p/lottery?externalUserid=${externalUserid}&openId=${openId}&bId=${this.bId}`, {
+          method: 'GET',
+          headers: headers
+        })
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              this.toshopData = data
+              if (data.client.state === 1) {
+                // 未提交表单
+                this.step = 1
+              } else if (data.client.state === 2) {
+                // 已提交表单
+                this.verificationCode = data.client.verificationCode
+                this.step = 3
+              } else if (data.client.state === 3) {
+                // 已核销
+                this.step = 4
+              } else if (data.client.state === -1) {
+                // 不符合资格
+                this.step = 5
+              }
+            } else {
+              this.$message({
+                message: msg,
+              })
+            }
+          })
+      },
+      toSignUp () {
+        if (this.step === 1) {
+          this.step = 2 
+        } else {
+          let cols = []
+          cols = this.toshopData.formProList.map(item => {
+            return {
+              name: item.name,
+              type: item.type,
+              value: [item.value]
+            } 
+          })
+          fetch(this.httpUrl + `/scrm/v1/wxcp-toshop-share/p/formData?openId=${this.openId}`, {
+            method: 'post',
+            body: JSON.stringify({
+              bid: this.bId,
+              cols: cols,
+            }),
+            headers: {
+              'Content-Type': 'application/json'
+            }
+          }).then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (data) {
+              this.verificationCode = data.client.verificationCode
+              if (data.client.state === 2) {
+                // 已提交表单
+                this.step = 3 
+              } else if (data.client.state === 3) {
+                // 已核销
+                this.step = 4
+              } else if (data.client.state === -1) {
+                // 不符合资格
+                this.step = 5
+              }
+            } else {
+              this.$message({
+                message: msg,
+                type: 'warning'
+              })
+            }
+          })
+        }
+      },
+      // 检测是否iOS端
+      iosAgent() {
+        return navigator.userAgent.match(/(iPhone|iPod|iPad);?/i);
+      },
+      // 复制文本函数,微信端,需要在用户触发 Click 事件里面才能执行成功
+      handleCopy(message) {
+        if (this.iosAgent()) {
+          let inputObj = document.createElement("input");
+          inputObj.value = message;
+          document.body.appendChild(inputObj);
+          inputObj.select();
+          inputObj.setSelectionRange(0, inputObj.value.length);
+          this.execCommand('Copy');
+          document.body.removeChild(inputObj);
+        } else {
+          let domObj = document.createElement("span");
+          domObj.innerHTML = message;
+          document.body.appendChild(domObj);
+          let selection = window.getSelection();
+          let range = document.createRange();
+          range.selectNodeContents(domObj);
+          selection.removeAllRanges();
+          selection.addRange(range);
+          this.execCommand('Copy');
+          document.body.removeChild(domObj);
+        }
+      },
+      // 执行浏览器命令 Copy 顺便输出一下日志,如果在移动端推荐写个方法展示日志或者用alert(msg)也行。
+      execCommand(action) {
+        let is = document.execCommand(action);
+        if (is) {
+          this.$message({
+            message: '复制成功',
+            type: 'success'
+          })
+        } else {
+          this.$message({
+            message: '复制失败',
+            type: 'error'
+          })
+        }
+      },
+      // 截取url中的数据
+      getQueryParam(paramName) {
+        // 获取当前URL的查询字符串部分  
+        const queryString = window.location.search;
+        // 创建一个URLSearchParams对象  
+        const urlParams = new URLSearchParams(queryString);
+        // 返回指定参数的值,如果不存在则返回null  
+        return urlParams.get(paramName);
+      },
+    }
+  })   
+</script>
+
+</html>

+ 355 - 0
lottery/signUp.html

@@ -0,0 +1,355 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+  <meta charset="UTF-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>活动</title>
+  <!--引入 element-ui 的样式,-->
+  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
+  <!-- 必须先引入vue,  后使用element-ui -->
+  <script src="./js/vue.js"></script>
+  <!-- 引入element 的组件库-->
+  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
+  <script src="https://unpkg.com/vconsole/dist/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;
+    background: #FAFAFA;
+  }
+
+  .page6 {
+    width: 100vw;
+    height: 100vh;
+    background: url('./img/signup_bg.png') no-repeat top;
+    background-size: 100vw 210px;
+    background-repeat: no-repeat;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+  }
+  .page_title {
+    font-weight: 800;
+    font-size: 40px;
+    color: #FFFFFF;
+    position: fixed;
+    top: 40px;
+    left: 20px;
+  }
+  .form_content {
+    width: 100%;
+    height: calc(100vh - 180px);
+    margin-top: 180px;
+    background: #FFFFFF;
+    border-radius: 20px 20px 0px 0px;
+    padding: 20px 20px 66px;
+    overflow-y: auto;
+    box-sizing: border-box;
+  }
+  .foot_btn {
+    position: fixed;
+    bottom: 14px;
+    padding: 0 35px;
+    width: 100%;
+    box-sizing: border-box;
+  }
+  .signUp_btn {
+    height: 52px;
+    line-height: 52px;
+    background: #1677FF;
+    border-radius: 20px;
+    font-weight: 500;
+    font-size: 16px;
+    color: #FFFFFF;
+    text-align: center;
+  }
+  .el-form-item__label {
+    padding-right: 0;
+    font-weight: 500;
+    font-size: 14px;
+    color: #666666;
+  }
+  .el-input__inner{
+    border: none;
+    font-weight: 500;
+    font-size: 14px;
+    color: #222222;
+    text-align: right;
+  }
+  .el-form-item {
+    margin-bottom: 0;
+    border-bottom: 1px solid #F9F9F9;
+    padding: 10px 0;
+  }
+  .page6s {
+    width: 100vw;
+    height: 100vh;
+    background: url('./img/signup_success.png') no-repeat center;
+    background-size: 100vw 100vh;
+		background-repeat: no-repeat;
+  }
+  .succ_tip {
+    padding-top: 240px;
+    font-weight: bold;
+    font-size: 24px;
+    color: #222222;
+    line-height: 40px;
+    text-align: center;
+  }
+  .signup_page {
+    width: 100vw;
+    height: 100vh;
+    background: url('./img/sign_up.png') no-repeat center;
+    background-size: 100vw 100vh;
+		background-repeat: no-repeat;
+  }
+  .signup_title {
+    font-weight: bold;
+    font-size: 24px;
+    color: #FFFFFF;
+    padding-top: 80px;
+    text-align: center;
+    line-height: 41px;
+  }
+  .fail_box {
+    margin: 80px 20px 0;
+    height: 287px;
+    background: linear-gradient(#D5E6FF 50%, #FFFFFF 100%);
+    border-radius: 20px;
+    box-sizing: border-box;
+    text-align: center;
+  }
+  .fail_img {
+    width: 246px;
+    height: 144px;
+    margin-top: -20px;
+  }
+  .fail_title {
+    font-weight: 500;
+    font-size: 20px;
+    color: #222222;
+    line-height: 30px;
+    padding: 20px 0;
+  }
+  .fail_tip {
+    font-weight: 400;
+    font-size: 16px;
+    color: #666666;
+    line-height: 30px;
+  }
+</style>
+<body>
+  <div id="box" class="box">
+    <div class="page6" v-if="step === 1">
+      <div class="page_title">核销领取礼品</div>
+      <div class="form_content">
+        <el-form ref="form" label-position="left" label-width="100px">
+          <el-form-item label="核销码:" required>
+            <el-input v-model="verificationCode" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item v-for="(item, index) in toshopData.formProList" :key="index" :label="item.name + ':'"
+            :required="Boolean(item.isNeed)">
+            <el-input v-if="item.type === 0" v-model="item.value" placeholder="请输入"></el-input>
+            <el-input v-if="item.type === 1" type="textarea" autosize v-model="item.value" placeholder="请输入"></el-input>
+            <el-input v-if="item.type === 2" type="number" v-model="item.value" placeholder="请输入"></el-input>
+            <el-date-picker v-if="item.type === 5" v-model="item.value" type="date" placeholder="选择日期">
+              <el-time-picker v-if="item.type === 6" v-model="item.value" placeholder="请选择"></el-time-picker>
+              <el-date-picker v-if="item.type === 7" v-model="item.value" type="datetime" placeholder="选择日期时间"></el-date-picker>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div class="foot_btn">
+        <div class="signUp_btn" @click="toSignUp">核销</div>
+      </div>
+    </div>
+    <div class="page6s" v-else-if="step === 2">
+      <div class="succ_tip">
+        <div>感谢参与{{toshopData.name}}活动</div>
+        <div>请联系门店顾问领取礼品</div>
+      </div>
+    </div>
+    <div class="signup_page" v-else-if="step === 3">
+      <div class="signup_title">{{toshopData.name}}</div>
+      <div class="fail_box">
+        <img class="fail_img" src="./img/fail_img.png" />
+        <div class="fail_title">很遗憾,您不在此次活动范围内</div>
+        <div class="fail_tip">
+          <div>后续有活动我们将第一时间通知您</div>
+          <div>敬请关注</div>
+        </div>
+      </div>
+    </div>
+  </div>
+</body>
+<script>
+  new Vue({
+    el: '#box',
+    data() {
+      return {
+        httpUrl: '',
+        bId: null,
+        env: '',
+        openId: '',
+        toshopData: {
+          name: '',
+          formProList: [],
+        },
+        step: 1,
+        verificationCode: '',
+      }
+    },
+    created() {
+      this.bId = this.getQueryParam('bId')
+      this.env = this.getQueryParam('env')
+      if (!this.env || this.env === 'prod') {
+        this.httpUrl = 'https://wlapi.wefanbot.com'
+      } else {
+        this.httpUrl = 'http://test.wefanbot.com:18993'
+      }
+      this.ifH5Type()
+    },
+    methods: {
+      ifH5Type() {
+        if (this.getQueryParam('openId') || localStorage.getItem('openId')) {
+          if (!this.getQueryParam('externalUserid')) {
+            this.gerQwAuth(this.bId);
+          } else {
+            this.lightenShare()
+          }
+        } else {
+          // 走授权操作
+          this.getAuth();
+        }
+      },
+      getAuth() {
+        // 获取url上的code
+        let code = this.getQueryParam('code')
+        if (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.openId = data.openId
+                localStorage.setItem('openId', data.openId)
+                this.ifH5Type()
+              }
+            })
+        } 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)
+        }
+      },
+      // 企微授权
+      gerQwAuth(bId) {
+        let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
+        fetch(this.httpUrl + `/p/insuite/p/getOAUrl?openId=${openId}&bId=${bId}`)
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              window.location.replace(data)
+            } else {
+              this.$message({
+                message: msg,
+                type: 'warning'
+              })
+            }
+          })
+      },
+      lightenShare() {
+        let externalUserid = this.getQueryParam('externalUserid')
+        let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
+        const headers = new Headers();
+        headers.append('police', 110);
+        fetch(this.httpUrl + `/scrm/v1/wxcp-toshop-verification/p/lottery?externalUserid=${externalUserid}&openId=${openId}&bId=${this.bId}`, {
+          method: 'GET',
+          headers: headers
+        })
+          .then(res => {
+            return res.json()
+          }).then(result => {
+            let { data, code, msg } = result
+            if (code === 1) {
+              this.toshopData = data
+            } else {
+              this.$message({
+                message: msg,
+              })
+            }
+          })
+      },
+      toSignUp() {
+        let cols = []
+        cols = this.toshopData.formProList.map(item => {
+          return {
+            name: item.name,
+            type: item.type,
+            value: [item.value]
+          }
+        })
+        fetch(this.httpUrl + `/scrm/v1/wxcp-toshop-verification/p/formData?openId=${this.openId}`, {
+          method: 'post',
+          body: JSON.stringify({
+            bid: this.bId,
+            cols: cols,
+            verificationCode: this.verificationCode
+          }),
+          headers: {
+            'Content-Type': 'application/json'
+          }
+        }).then(res => {
+          return res.json()
+        }).then(result => {
+          let { data, code, msg } = result
+          if (code === 1) {
+            if (data.client.state === 3) {
+              // 已核销(已提交核销表单)
+              this.step = 2
+            } else if (data.client.state === -1) {
+              // 不符合资格
+              this.step = 3
+            }
+          } else if (code === 2) {
+            this.$message({
+              message: '核销码无效',
+              type: 'warning' 
+            })
+          } else {
+            this.$message({
+              message: msg,
+              type: 'warning'
+            })
+          }
+        })
+      },
+      // 截取url中的数据
+      getQueryParam(paramName) {
+        // 获取当前URL的查询字符串部分  
+        const queryString = window.location.search;
+        // 创建一个URLSearchParams对象  
+        const urlParams = new URLSearchParams(queryString);
+        // 返回指定参数的值,如果不存在则返回null  
+        return urlParams.get(paramName);
+      },
+    }
+  })   
+</script>
+
+</html>