duanshenglang пре 6 месеци
родитељ
комит
fb8bbe64d1
2 измењених фајлова са 123 додато и 84 уклоњено
  1. 54 45
      lottery/carOwnerScreening.html
  2. 69 39
      lottery/lightUpWl.html

+ 54 - 45
lottery/carOwnerScreening.html

@@ -4,7 +4,8 @@
 <head>
   <meta charset="UTF-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
-  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
+  <meta name="viewport"
+    content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
   <title>点亮五菱</title>
   <!--引入 element-ui 的样式,-->
   <link rel="stylesheet"
@@ -145,12 +146,7 @@
     line-height: 30px;
     padding-top: 140px;
     text-align: center;
-  }
-
-  .qw_name {
-    font-weight: bold;
-    font-size: 16px;
-    color: #FFF96E;
+    white-space: pre-line;
   }
 
   .isWlCar_title {
@@ -199,9 +195,11 @@
     font-weight: 400;
     font-size: 14px;
     color: #FFFFFF;
+    line-height: 30px;
     padding-top: 10px;
     padding-left: 30px;
     padding-bottom: 40px;
+    white-space: pre-line;
   }
 
   .noTestDrive_tip {
@@ -228,14 +226,12 @@
       <div class="qrcode_tip">扫码添加服务官</div>
     </div>
     <div class="page6" v-else-if="noTestDrive">
-      <div class="no_testDrive">
-        <div>扫码添加<span class="qw_name"> 服务官</span></div>
-        <div>0元抽睛雨伞、量子香薰机等好礼</div>
-      </div>
+      <div class="no_testDrive">{{lightData.wxcpLighten.livecodeGuide}}</div>
       <div class="qrcode_box">
-        <img class="qrcode_img" src="./img/noDrive-qrcode.png" alt="">
+        <!-- <img class="qrcode_img" src="./img/noDrive-qrcode.png" alt=""> -->
+        <img class="qrcode_img" :src="lightData.livecode1Qrcode" alt="">
       </div>
-      <div class="noTestDrive_tip">扫码添加服务官</div>
+      <div class="noTestDrive_tip">{{lightData.wxcpLighten.livecodeGuide2}}</div>
     </div>
     <div class="page6" v-else>
       <div v-if="filter==1 || filter==2">
@@ -270,7 +266,8 @@
         <el-form ref="form" class="prize_form" label-position="left" label-width="90px">
           <el-form-item v-for="(item, index) in lightData.formProList" :key="index" :label="item.name"
             :required="Boolean(item.isNeed)">
-            <el-cascader v-if="item.type === 10" v-model="item.value" :options="transformedData" @change="handleInfoCity">
+            <el-cascader v-if="item.type === 10" v-model="item.value" :options="transformedData"
+              @change="handleInfoCity">
             </el-cascader>
             <el-select v-if="item.type === 11" v-model="item.value" placeholder="请选择" @change="handlechange">
               <el-option v-for="(sto, sindex) in storeList" :key="sindex" :label="sto.name" :value="sto.name">
@@ -280,7 +277,8 @@
             <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-select v-if="item.type === 3" v-model="item.value" placeholder="请选择">
-              <el-option v-for="sto in item.formProTagReqs" :key="sto.proValue" :label="sto.proValue" :value="sto.proValue">
+              <el-option v-for="sto in item.formProTagReqs" :key="sto.proValue" :label="sto.proValue"
+                :value="sto.proValue">
               </el-option>
             </el-select>
             <el-col :span="22" v-if="item.type === 5">
@@ -290,13 +288,14 @@
               <el-time-picker v-model="item.value" placeholder="请选择"></el-time-picker>
             </el-col>
             <el-col :span="22" v-if="item.type === 7">
-              <el-date-picker v-if="item.type === 7" v-model="item.value" type="datetime" placeholder="选择日期时间"></el-date-picker>
+              <el-date-picker v-if="item.type === 7" v-model="item.value" type="datetime"
+                placeholder="选择日期时间"></el-date-picker>
             </el-col>
           </el-form-item>
         </el-form>
       </div>
       <div class="page_foot">
-        <div class="foot_btn" @click="handleFormOk" v-if="filter==3">确认预约,马上抽奖</div>
+        <div class="foot_btn" @click="handleFormOk" v-if="filter==3">确认预约</div>
         <div class="foot_btn" @click="handleOk" v-else>确认</div>
       </div>
     </div>
@@ -305,7 +304,7 @@
 <script>
   new Vue({
     el: '#box',
-    data () {
+    data() {
       return {
         httpUrl: '',
         bId: null,
@@ -313,6 +312,11 @@
         lightData: {
           raffle1BizId: null,
           formProList: [],
+          livecode1Qrcode: null,
+          wxcpLighten: {
+            livecodeGuide: '',
+            livecodeGuide2: '',
+          }
         },
         province: '',
         city: '',
@@ -320,11 +324,11 @@
         storeList: [],
         selectData: 'one',
         isWlCar: false,
-        filter: 1,
+        filter: 3,
         noTestDrive: false,
       }
     },
-    created () {
+    created() {
       var hrt = document.documentElement.clientHeight; //获取当前可视区域的高度存到hrt变量
       document.getElementById('box').style.height = hrt + 'px'//把获取到的高度赋值给根div
       this.bId = this.getQueryParam('bId')
@@ -339,7 +343,7 @@
       this.ifH5Type()
     },
     methods: {
-      ifH5Type () {
+      ifH5Type() {
         if (this.getQueryParam('openId') || localStorage.getItem('openId')) {
           if (!this.getQueryParam('externalUserid')) {
             this.gerQwAuth(this.bId);
@@ -352,7 +356,7 @@
           this.getAuth();
         }
       },
-      getAuth () {
+      getAuth() {
         // 获取url上的code
         let code = this.getQueryParam('code')
         if (code) {
@@ -389,7 +393,7 @@
           })
       },
       // 企微授权
-      gerQwAuth (bId) {
+      gerQwAuth(bId) {
         let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
         fetch(this.httpUrl + `/p/insuite/p/getOAUrl?openId=${openId}&bId=${bId}`)
           .then(res => {
@@ -406,7 +410,7 @@
             }
           })
       },
-      lightenOwner () {
+      lightenOwner() {
         let externalUserid = this.getQueryParam('externalUserid')
         let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
         const headers = new Headers();
@@ -421,13 +425,17 @@
             let { data, code, msg } = result
             if (code === 1) {
               if (data.client.state === 2) {
-                let url = ''
-                if (!this.env || this.env === 'prod') {
-                  url = `https://lottery2.camlook.cn/?bId=${data.raffle1BizId}&h5Type=30`
-                } else {
-                  url = `https://lottery2.camlook.cn/?bId=${data.raffle1BizId}&env=dev&h5Type=30`
-                }
-                window.location.replace(url)
+                // let url = ''
+                // if (!this.env || this.env === 'prod') {
+                //   url = `https://lottery2.camlook.cn/?bId=${data.raffle1BizId}&h5Type=30`
+                // } else {
+                //   url = `https://lottery2.camlook.cn/?bId=${data.raffle1BizId}&env=dev&h5Type=30`
+                // }
+                // window.location.replace(url)
+                this.lightData.livecode1Qrcode = data.livecode1Qrcode
+                this.lightData.wxcpLighten.livecodeGuide = data.wxcpLighten.livecodeGuide
+                this.lightData.wxcpLighten.livecodeGuide2 = data.wxcpLighten.livecodeGuide2
+                this.noTestDrive = true
               } else {
                 this.lightData = data
               }
@@ -439,7 +447,7 @@
           })
       },
       // 获取城市数据
-      getCityLevel () {
+      getCityLevel() {
         fetch('https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/1000/1720161853377/pc-code.json')
           .then(res => {
             return res.json()
@@ -447,7 +455,7 @@
             this.transformedData = this.transformData(result)
           })
       },
-      handleInfoCity (value) {
+      handleInfoCity(value) {
         this.province = value[0]
         this.city = value[1]
         // 清空经销商类型的数据
@@ -484,7 +492,7 @@
         })
       },
       // 省市数据做转换
-      transformData (data) {
+      transformData(data) {
         return data.map(item => {
           // 创建一个新对象,避免直接修改原始对象
           const newItem = { ...item };
@@ -504,10 +512,10 @@
           return newItem;
         })
       },
-      selectItem (type) {
+      selectItem(type) {
         this.selectData = type
       },
-      handleOk () {
+      handleOk() {
         if (this.selectData === 'one') {
           this.isWlCar = true
         } else if (this.selectData === 'two') {
@@ -519,7 +527,7 @@
           this.noTestDrive = true
         }
       },
-      handleFormOk () {
+      handleFormOk() {
         // 填写了试驾表单
         const isValid = this.lightData.formProList.some(item => {
           if (item.isNeed && !item.value) {
@@ -563,13 +571,14 @@
         }).then(result => {
           let { data, code, msg } = result
           if (code === 1) {
-            let url = ''
-            if (!this.env || this.env === 'prod') {
-              url = `https://lottery2.camlook.cn/?bId=${this.lightData.raffle1BizId}&h5Type=30`
-            } else {
-              url = `https://lottery2.camlook.cn/?bId=${this.lightData.raffle1BizId}&env=dev&h5Type=30`
-            }
-            window.location.replace(url)
+            // let url = ''
+            // if (!this.env || this.env === 'prod') {
+            //   url = `https://lottery2.camlook.cn/?bId=${this.lightData.raffle1BizId}&h5Type=30`
+            // } else {
+            //   url = `https://lottery2.camlook.cn/?bId=${this.lightData.raffle1BizId}&env=dev&h5Type=30`
+            // }
+            // window.location.replace(url)
+            this.noTestDrive = true
           } else {
             this.$message({
               message: msg,
@@ -593,7 +602,7 @@
         return true
       },
       // 截取url中的数据
-      getQueryParam (paramName) {
+      getQueryParam(paramName) {
         // 获取当前URL的查询字符串部分  
         const queryString = window.location.search;
         // 创建一个URLSearchParams对象  

+ 69 - 39
lottery/lightUpWl.html

@@ -4,7 +4,8 @@
 <head>
   <meta charset="UTF-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
-  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
+  <meta name="viewport"
+    content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
   <title>点亮五菱</title>
   <!--引入 element-ui 的样式,-->
   <link rel="stylesheet"
@@ -114,9 +115,11 @@
     margin-right: 10px;
     border-radius: 50%;
   }
+
   .ask_btn img:last-child {
     margin-right: 0;
   }
+
   .activity_box {
     width: 100%;
     background: #FEE8D0;
@@ -236,11 +239,12 @@
     font-size: 14px;
     color: #CB4E35;
   }
+
   .activity_msg p {
     margin: 0;
     line-height: 24px;
   }
-  
+
   .el-dialog {
     width: 335px;
     border-radius: 20px;
@@ -258,12 +262,17 @@
 
   .prize_form .el-form-item {
     padding: 0;
+    margin-bottom: 10px;
   }
 
   .prize_form .el-input__inner {
     text-align: left;
   }
 
+  .prize_form .el-form-item__label {
+    line-height: 20px;
+  }
+
   .dialog-footer {
     text-align: center;
   }
@@ -292,7 +301,7 @@
       <div class="wl_btn" @click="handleAsk">
         <div class="image_wrapper">
           <img class="btn_img" src="./img/wl_btn.png" />
-          <div class="btn_text">{{lightData.raffle2.leftNum ? '点亮成功,解锁终极大奖' : '邀请好友点亮'}}</div>
+          <div class="btn_text">{{lightData.raffle2.leftNum ? '成功点亮' : '邀请好友点亮'}}</div>
         </div>
       </div>
     </div>
@@ -305,38 +314,43 @@
         <span>3.完成任务</span>
       </div>
       <div class="ask_btn">
-        <img v-for="item in lightData.wxcpLightenClientList.slice(0, 5)" :key="item.head.id" :src="item.head || require('img/ask_btn.png')" />
+        <img v-for="item in lightData.wxcpLightenClientList.slice(0, 5)" :key="item.head.id"
+          :src="item.head || require('img/ask_btn.png')" />
         <div v-if="lightData.wxcpLightenClientList.length < 5">
           <img v-for="i in (5-lightData.wxcpLightenClientList.length)" :key="i" src="img/ask_btn.png" />
         </div>
       </div>
       <div class="activity_box">
-        <div class="lottery">
-          <div class="award">
-            <img class="award_ac" src="img/lottery1.png" />
-            <div class="award_tip">
-              <div class="award_title">好运抽奖</div>
-              <div>每邀{{lightData.wxcpLighten.raffle1ClientNum}}人抽1次奖,最多{{lightData.wxcpLighten.raffle1NumMax}}次</div>
+        <div v-if="lightData.wxcpLighten.raffeSwitch">
+          <div class="lottery">
+            <div class="award">
+              <img class="award_ac" src="img/lottery1.png" />
+              <div class="award_tip">
+                <div class="award_title">好运抽奖</div>
+                <div>每邀{{lightData.wxcpLighten.raffle1ClientNum}}人抽1次奖,最多{{lightData.wxcpLighten.raffle1NumMax}}次</div>
+              </div>
             </div>
-          </div>
-          <div v-if="lightData.wxcpLighten.raffle1NumMax === lightData.raffle1.useNum" class="award_btn">已完成</div>
-          <div v-else>
-            <div v-if="lightData.raffle1.leftNum" class="award_btn_ac" @click="handleLottery(lightData.raffle1BizId)">去抽奖</div>
-            <div v-else class="award_btn">未完成</div>
-          </div>
-        </div>
-        <div class="lottery">
-          <div class="award">
-            <img class="award_ac" src="img/lottery2.png" />
-            <div class="award_tip">
-              <div class="award_title">终极大奖</div>
-              <div>完全点亮即可抽取终极大奖!</div>
+            <div v-if="lightData.wxcpLighten.raffle1NumMax === lightData.raffle1.useNum" class="award_btn">已完成</div>
+            <div v-else>
+              <div v-if="lightData.raffle1.leftNum" class="award_btn_ac" @click="handleLottery(lightData.raffle1BizId)">
+                去抽奖</div>
+              <div v-else class="award_btn">未完成</div>
             </div>
           </div>
-          <div v-if="lightData.wxcpLighten.raffle2NumMax === lightData.raffle2.useNum" class="award_btn">已完成</div>
-          <div v-else>
-            <div v-if="lightData.raffle2.leftNum" class="award_btn_ac" @click="handleLottery(lightData.raffle2BizId)">去抽奖</div>
-            <div v-else class="award_btn">未完成</div>
+          <div class="lottery">
+            <div class="award">
+              <img class="award_ac" src="img/lottery2.png" />
+              <div class="award_tip">
+                <div class="award_title">终极大奖</div>
+                <div>完全点亮即可抽取终极大奖!</div>
+              </div>
+            </div>
+            <div v-if="lightData.wxcpLighten.raffle2NumMax === lightData.raffle2.useNum" class="award_btn">已完成</div>
+            <div v-else>
+              <div v-if="lightData.raffle2.leftNum" class="award_btn_ac" @click="handleLottery(lightData.raffle2BizId)">
+                去抽奖</div>
+              <div v-else class="award_btn">未完成</div>
+            </div>
           </div>
         </div>
         <div class="activity_title">活动信息</div>
@@ -350,7 +364,8 @@
         <div class="save_btn" @click="showAskDialog = false">长按图片保存</div>
       </div>
     </div>
-    <el-dialog title="填写信息" :visible.sync="showDialog" :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false">
+    <el-dialog title="填写信息" :visible.sync="showDialog" :show-close="false" :close-on-click-modal="false"
+      :close-on-press-escape="false">
       <el-form :model="lightData" class="prize_form" label-position="top">
         <el-form-item label="门店">
           <el-input v-model="lightData.store"></el-input>
@@ -358,6 +373,10 @@
         <el-form-item label="顾问名称" required>
           <el-input v-model="lightData.referrer"></el-input>
         </el-form-item>
+        <el-form-item label="领取奖励手机号" required>
+          <el-input type="number" v-model="lightData.referrerPhone"></el-input>
+        </el-form-item>
+        <div>注意:请您及时前往五菱汽车小程序/App,使用登记的手机号登录/注册,以免影响后续奖励无法发放。</div>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="warning" :loading="loading" @click="handleSaveRefer">确 定</el-button>
@@ -368,7 +387,7 @@
 <script>
   new Vue({
     el: '#box',
-    data () {
+    data() {
       return {
         httpUrl: '',
         bId: null,
@@ -379,9 +398,11 @@
           wxcpLightenClientList: [],
           wxcpLighten: {
             activityInfo: '',
+            raffeSwitch: 0,
             raffle1ClientNum: null,
             raffle1NumMax: null, // 抽奖1总次数
             raffle2NumMax: null, // 抽奖2总次数
+            type: null,
           },
           raffle1: {
             leftNum: null, // 抽奖1剩余次数
@@ -395,12 +416,13 @@
           raffle2BizId: null,
           referrer: '', // 顾问名称
           store: '', // 门店 
+          referrerPhone: '', // 领取奖励手机号
         },
         showDialog: false, // 填写顾问名称信息弹窗
         loading: false, // 提交按钮loading
       }
     },
-    created () {
+    created() {
       this.bId = this.getQueryParam('bId')
       this.env = this.getQueryParam('env')
       if (!this.env || this.env === 'prod') {
@@ -413,7 +435,7 @@
       this.ifH5Type()
     },
     methods: {
-      ifH5Type () {
+      ifH5Type() {
         if (this.getQueryParam('openId') || localStorage.getItem('openId')) {
           if (!this.getQueryParam('externalUserid')) {
             this.gerQwAuth(this.bId);
@@ -425,7 +447,7 @@
           this.getAuth();
         }
       },
-      getAuth () {
+      getAuth() {
         // 获取url上的code
         let code = this.getQueryParam('code')
         if (code) {
@@ -462,7 +484,7 @@
           })
       },
       // 企微授权
-      gerQwAuth (bId) {
+      gerQwAuth(bId) {
         let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
         fetch(this.httpUrl + `/p/insuite/p/getOAUrl?openId=${openId}&bId=${bId}`)
           .then(res => {
@@ -479,7 +501,7 @@
             }
           })
       },
-      lightenShare () {
+      lightenShare() {
         let externalUserid = this.getQueryParam('externalUserid')
         let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
         const headers = new Headers();
@@ -494,7 +516,7 @@
             let { data, code, msg } = result
             if (code === 1) {
               this.lightData = data
-              if (!data.referrer) {
+              if (data.wxcpLighten.type === 2 && (!data.referrer || !data.referrerPhone)) {
                 this.showDialog = true
               }
             } else {
@@ -504,10 +526,10 @@
             }
           })
       },
-      handleAsk () {
+      handleAsk() {
         this.showAskDialog = true
       },
-      handleLottery (bizId) {
+      handleLottery(bizId) {
         let url = ''
         if (!this.env || this.env === 'prod') {
           url = `https://lottery2.camlook.cn/?bId=${bizId}&h5Type=30`
@@ -516,7 +538,7 @@
         }
         window.location.replace(url)
       },
-      handleSaveRefer () {
+      handleSaveRefer() {
         if (!this.lightData.referrer) {
           this.$message({
             message: '请填写顾问名称',
@@ -524,6 +546,13 @@
           })
           return
         }
+        if (!this.lightData.referrerPhone) {
+          this.$message({
+            message: '请填写领取奖励手机号',
+            type: 'warning'
+          })
+          return
+        }
         this.loading = true
         let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
         fetch(this.httpUrl + `/scrm/v1/wxcp-lighten-owner/p/updateReferrer?openId=${openId}&bId=${this.bId}`, {
@@ -531,6 +560,7 @@
           body: JSON.stringify({
             referrer: this.lightData.referrer, // 顾问名称
             store: this.lightData.store, // 门店
+            referrerPhone: this.lightData.referrerPhone, // 领取奖励手机号
           }),
           headers: {
             'Content-Type': 'application/json'
@@ -552,7 +582,7 @@
         })
       },
       // 截取url中的数据
-      getQueryParam (paramName) {
+      getQueryParam(paramName) {
         // 获取当前URL的查询字符串部分  
         const queryString = window.location.search;
         // 创建一个URLSearchParams对象