Browse Source

点亮五菱

duanshenglang 8 tháng trước cách đây
mục cha
commit
d6d04c7d0e

BIN
lottery.zip


+ 32 - 13
lottery/carOwnerScreening.html

@@ -43,9 +43,9 @@
 
   .page6s {
     width: 100vw;
-    height: 100vh;
+    height: 630px;
     background: url('./img/wl_bg.png') no-repeat center;
-    background-size: 100vw 100vh;
+    background-size: 100vw 630px;
     background-repeat: no-repeat;
   }
 
@@ -111,6 +111,8 @@
     border-radius: 15px;
     padding: 20px;
     margin: 0 15px;
+    max-height: 300px;
+    overflow-y: auto;
   }
 
   .prize_form .el-form-item {
@@ -151,7 +153,7 @@
     font-weight: 400;
     font-size: 18px;
     color: #744620;
-    line-height: 36px;
+    line-height: 30px;
     padding-top: 323px;
     text-align: center;
   }
@@ -177,6 +179,8 @@
     color: #744620;
     text-align: center;
     background: #FEC99D;
+    padding-top: 5px;
+    box-sizing: border-box;
   }
 
   .testDrive_title {
@@ -242,7 +246,7 @@
         </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" />
+          <img class="option_img" src="./img/wl_per.png" />
           <div class="option_text">还没有购入五菱汽车</div>
         </div>
       </div>
@@ -259,7 +263,7 @@
       <div v-else-if="filter==3">
         <div class="testDrive_title">预约试驾</div>
         <div class="testDrive_tip">预约试驾即可帮助好友点亮五菱</div>
-        <el-form ref="form" class="prize_form" label-width="90px">
+        <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">
@@ -326,7 +330,6 @@
         // this.httpUrl = 'http://192.168.1.147:18993'
       }
       this.ifH5Type()
-      this.getCityLevel()
     },
     methods: {
       ifH5Type () {
@@ -334,6 +337,7 @@
           if (!this.getQueryParam('externalUserid')) {
             this.gerQwAuth(this.bId);
           } else {
+            this.getCityLevel()
             this.lightenOwner()
           }
         } else {
@@ -345,15 +349,18 @@
         // 获取url上的code
         let code = this.getQueryParam('code')
         if (code) {
-          fetch(this.httpUrl + `/scrm/v1/mp-client/p/getInfoByh5Code?code=${code}&bId=${this.bId}`)
+          // 判断业务id是否生产环境业务id
+          fetch(this.httpUrl + `/p/insuite/p/isProdId?id=${this.bId}`)
             .then(res => {
               return res.json()
             }).then(result => {
-              let { data, code, msg } = result
-              if (code === 1) {
-                localStorage.setItem('openId', data.openId)
-                this.ifH5Type()
+              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
@@ -362,6 +369,18 @@
           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) {
+              localStorage.setItem('openId', data.openId)
+              this.ifH5Type()
+            }
+          })
+      },
       // 企微授权
       gerQwAuth (bId) {
         let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
@@ -529,9 +548,9 @@
           if (code === 1) {
             let url = ''
             if (!this.env || this.env === 'prod') {
-              url = `https://lottery.camlook.cn/?bId=${this.lightData.raffle1BizId}&env=dev&h5Type=30`
-            } else {
               url = `https://lottery.camlook.cn/?bId=${this.lightData.raffle1BizId}&h5Type=30`
+            } else {
+              url = `https://lottery.camlook.cn/?bId=${this.lightData.raffle1BizId}&env=dev&h5Type=30`
             }
             window.location.replace(url)
           } else {

BIN
lottery/img/lottery1.png


BIN
lottery/img/lottery2.png


BIN
lottery/img/wl_per.png


+ 35 - 29
lottery/lightUpWl.html

@@ -142,7 +142,6 @@
   .award_ac {
     width: 58px;
     height: 58px;
-    background: #F5E3D4;
     border-radius: 10px;
   }
 
@@ -242,11 +241,11 @@
   <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" />
+      <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" />
@@ -263,16 +262,16 @@
         <span>3.完成任务</span>
       </div>
       <div class="ask_btn">
-        <img v-for="(item, index) in lightData.wxcpLightenClientList" :key="index" :src="item.head || require('img/ask_btn.png')" />
+        <img v-for="item in lightData.wxcpLightenClientList" :key="item.head.id" :src="item.head || require('img/ask_btn.png')" />
         <img v-for="i in (5-lightData.wxcpLightenClientList.length)" :key="i" src="img/ask_btn.png" />
       </div>
       <div class="activity_box">
         <div class="lottery">
           <div class="award">
-            <div class="award_ac"></div>
+            <img class="award_ac" src="img/lottery1.png" />
             <div class="award_tip">
               <div class="award_title">好运抽奖</div>
-              <div>每邀请1人点亮即可抽奖1次</div>
+              <div>每邀请{{lightData.wxcpLighten.raffle1ClientNum}}人点亮即可抽奖{{lightData.wxcpLighten.raffle1NumMax}}次</div>
             </div>
           </div>
           <div :class="lightData.raffle1Num ? 'award_btn_ac' : 'award_btn'" @click="handleLottery(lightData.raffle1BizId, lightData.raffle1Num)">{{lightData.raffle1Num ? '去抽奖' : '未完成'}}
@@ -280,7 +279,7 @@
         </div>
         <div class="lottery">
           <div class="award">
-            <div class="award_ac"></div>
+            <img class="award_ac" src="img/lottery2.png" />
             <div class="award_tip">
               <div class="award_title">终极大奖</div>
               <div>完全点亮即可抽取终极大奖!</div>
@@ -297,7 +296,7 @@
     <div class="prize_dialog" v-if="showAskDialog">
       <div class="dialog_body">
         <img class="dialog_bg" :src="lightData.urlPost" />
-        <div class="save_btn" @click="saveImage">保存图片</div>
+        <div class="save_btn" @click="showAskDialog = false">长按图片保存</div>
       </div>
     </div>
   </div>
@@ -316,6 +315,8 @@
           wxcpLightenClientList: [],
           wxcpLighten: {
             activityInfo: '',
+            raffle1ClientNum: null,
+            raffle1NumMax: null,
           },
           raffle1Num: 0,
           raffle2Num: 0,
@@ -352,15 +353,18 @@
         // 获取url上的code
         let code = this.getQueryParam('code')
         if (code) {
-          fetch(this.httpUrl + `/scrm/v1/mp-client/p/getInfoByh5Code?code=${code}&bId=${this.bId}`)
+          // 判断业务id是否生产环境业务id
+          fetch(this.httpUrl + `/p/insuite/p/isProdId?id=${this.bId}`)
             .then(res => {
               return res.json()
             }).then(result => {
-              let { data, code, msg } = result
-              if (code === 1) {
-                localStorage.setItem('openId', data.openId)
-                this.ifH5Type()
+              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
@@ -369,6 +373,18 @@
           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) {
+              localStorage.setItem('openId', data.openId)
+              this.ifH5Type()
+            }
+          })
+      },
       // 企微授权
       gerQwAuth (bId) {
         let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
@@ -401,7 +417,7 @@
           }).then(result => {
             let { data, code, msg } = result
             if (code === 1) {
-              this.lightData = data
+              this.lightData = data  
             } else {
               this.$message({
                 message: msg,
@@ -418,23 +434,13 @@
           })
         }
       },
-      // 保存图片
-      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
-      },
       handleLottery (bizId, status) {
         if (status) {
           let url = ''
           if (!this.env || this.env === 'prod') {
-            url = `https://lottery.camlook.cn/?bId=${bizId}&env=dev&h5Type=30`
-          } else {
             url = `https://lottery.camlook.cn/?bId=${bizId}&h5Type=30`
+          } else {
+            url = `https://lottery.camlook.cn/?bId=${bizId}&env=dev&h5Type=30`
           }
           window.location.replace(url)
         } else {