| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878 |
- <!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,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
- <title>点亮五菱</title>
- <!--引入 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="js/vconsole.min.js"></script>
- <script>
- var vConsole = new window.VConsole();
- </script> -->
- </head>
- <style>
- body {
- margin: 0;
- padding: 0;
- }
- .box {
- width: 100vw;
- height: 100%;
- box-sizing: border-box;
- background: #FAFAFA;
- }
- .page6 {
- width: 100vw;
- height: 100%;
- background: url('./img/wl_bg.png') no-repeat;
- background-size: 100%;
- 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: 108px;
- }
- .image_wrapper {
- position: relative;
- display: inline-block;
- }
- .image_wrapper img {
- height: 68px;
- display: block;
- /* 移除图片底部间隙 */
- }
- .btn_text {
- position: absolute;
- top: 46%;
- left: 50%;
- transform: translate(-50%, -46%);
- font-weight: 500;
- font-size: 20px;
- color: #FFFFFF;
- width: 100%;
- text-align: center;
- }
- .ask {
- background: #FEC99D;
- margin-top: -22px;
- }
- .ask_rule {
- font-size: 12px;
- color: #E30628;
- text-align: center;
- padding-top: 30px;
- }
- .step {
- display: flex;
- justify-content: center;
- align-items: center;
- padding-top: 20px;
- }
- .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;
- margin-top: 20px;
- }
- .ask_btn img {
- width: 50px;
- height: 50px;
- margin-right: 10px;
- border-radius: 50%;
- }
- .ask_btn img:last-child {
- margin-right: 0;
- } */
- .person_module {
- display: flex;
- justify-content: space-between;
- align-items: center;
- background: rgba(254, 232, 208, 0.8);
- border-radius: 15px;
- margin: 20px 10px 0;
- padding: 15px 35px;
- }
- .person_box {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- font-weight: 400;
- font-size: 12px;
- color: #896F5A;
- }
- .person_num {
- font-weight: bold;
- font-size: 18px;
- color: #6A401D;
- line-height: 26px;
- padding-bottom: 5px;
- }
- .person_line {
- width: 1px;
- height: 48px;
- background: #6A401D;
- opacity: 0.2;
- }
- .ask_list {
- margin: 15px 10px;
- padding: 15px;
- background: rgba(254, 232, 208, 0.8);
- border-radius: 15px;
- }
- .ask_title {
- font-weight: bold;
- font-size: 16px;
- color: #6A401D;
- line-height: 24px;
- text-align: center;
- }
- .ask_user_box {
- max-height: 338px;
- overflow-y: auto;
- }
- .ask_user {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 10px 0;
- border-bottom: 1px solid rgba(106, 64, 29, 0.1);
- }
- .user_msg {
- display: flex;
- justify-content: center;
- align-items: center;
- font-weight: 400;
- font-size: 14px;
- color: #222222;
- white-space: nowrap;
- }
- .user_name {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- width: 124px;
- }
- .user_msg img {
- width: 40px;
- height: 40px;
- border-radius: 50%;
- margin-right: 10px;
- }
- .ask_status1 {
- font-weight: 400;
- font-size: 12px;
- color: #FF4646;
- max-width: 46%;
- text-align: right;
- }
- .ask_status2 {
- font-weight: 400;
- font-size: 12px;
- color: #C98146;
- }
- .ask_status3 {
- font-weight: 400;
- font-size: 12px;
- color: #2885FF;
- }
- .activity_box {
- background: #FEE8D0;
- border-radius: 20px 20px 0 0;
- padding: 20px 15px;
- box-sizing: border-box;
- }
- .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;
- border-radius: 10px;
- background: #F5E3D4;
- }
- .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 {
- max-width: 275px;
- height: 370px;
- border-radius: 20px;
- position: relative;
- object-fit: contain;
- }
- .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;
- padding-bottom: 15px;
- }
- .activity_msg {
- font-size: 14px;
- color: #CB4E35;
- }
- .activity_msg p {
- margin: 0;
- line-height: 24px;
- }
- .el-dialog {
- width: 335px;
- border-radius: 20px;
- }
- .el-dialog__header {
- text-align: center;
- }
- .el-dialog__title {
- font-weight: 500;
- font-size: 16px;
- color: #222222;
- }
- .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;
- }
- .el-select {
- width: 100%;
- }
- .dialog-footer {
- text-align: center;
- }
- .dialog-footer button {
- width: 119px;
- height: 46px;
- background: #FFB34B;
- border-radius: 20px;
- font-weight: 500;
- font-size: 16px;
- color: #FFFFFF;
- border: none;
- }
- .carousel-container {
- position: relative;
- width: 100vw;
- overflow: hidden;
- }
- .carousel-wrapper {
- display: flex;
- transition: transform 0.4s ease-out;
- height: 100%;
- }
- .carousel-item {
- min-width: 100%;
- height: 100%;
- display: flex
- }
- .arrow {
- position: absolute;
- top: 347px;
- transition: opacity 0.3s;
- user-select: none;
- z-index: 2;
- width: 30px;
- height: 26px;
- }
- .arrow-left {
- left: 15px;
- }
- .arrow-right {
- right: 15px;
- }
- .progress {
- font-weight: 400;
- font-size: 12px;
- color: #E83636;
- text-align: center;
- }
- </style>
- <body>
- <div id="box" class="box">
- <div class="page6">
- <div class="carousel-container">
- <div class="carousel-wrapper" :style="{ transform: `translateX(-${currentIndex * 100}%)` }">
- <div class="carousel-item" v-if="lightData.wxcpLightenClientList.length < 5">
- <img class="carousel wl_no" v-if="!lightData.wxcpLightenClientList.length" src="./img/wl_no.png" />
- <img class="carousel wl_no" v-if="lightData.wxcpLightenClientList.length === 1" src="./img/light_one.png" />
- <img class="carousel wl_no" v-else-if="lightData.wxcpLightenClientList.length === 2"
- src="./img/light_two.png" />
- <img class="carousel wl_no" v-else-if="lightData.wxcpLightenClientList.length === 3"
- src="./img/light_three.png" />
- <img class="carousel wl_no" v-else-if="lightData.wxcpLightenClientList.length === 4"
- src="./img/light_four.png" />
- </div>
- <div v-else class="carousel-item">
- <img class="carousel wl_no" v-for="i in parseInt(lightData.wxcpLightenClientList.length/5)" :key="i"
- src="./img/light_five.png" />
- <img class="carousel wl_no" v-if="parseInt(lightData.wxcpLightenClientList.length%5) === 1"
- src="./img/light_one.png" />
- <img class="carousel wl_no" v-else-if="parseInt(lightData.wxcpLightenClientList.length%5) === 2"
- src="./img/light_two.png" />
- <img class="carousel wl_no" v-else-if="parseInt(lightData.wxcpLightenClientList.length%5) === 3"
- src="./img/light_three.png" />
- <img class="carousel wl_no" v-else-if="parseInt(lightData.wxcpLightenClientList.length%5) === 4"
- src="./img/light_four.png" />
- </div>
- </div>
- <!-- 左箭头 -->
- <img v-show="lightData.wxcpLightenClientList.length>5 && currentIndex > 0" src="./img/wl-left.png" alt=""
- class="arrow arrow-left" @click="prevSlide">
- <!-- 右箭头 -->
- <img
- v-show="lightData.wxcpLightenClientList.length>5 && currentIndex < lightData.wxcpLightenClientList.length/5 - 1"
- src="./img/wl-right.png" alt="" class="arrow arrow-right" @click="nextSlide"></img>
- </div>
- <div class="progress">
- <span v-if="getChunkData.length < 5">点亮进度:{{getChunkData.length}}/5</span>
- <span v-if="lightData.wxcpLightenClientList.length>5 && getChunkData.length === 5">您已成功点亮,左右切换查看更多</span>
- </div>
- <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>
- </div>
- </div>
- <div class="ask">
- <div class="ask_rule">参与活动前请仔细阅读页面底部活动规则</div>
- <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 v-for="item in getChunkData.slice(0, 5)" :key="item.id"
- :src="item.head || './img/ask_btn.png'" />
- <div v-if="getChunkData.length < 5">
- <img v-for="i in (5-getChunkData.length)" :key="i" src="./img/ask_btn.png" />
- </div>
- </div> -->
- <div class="person_module">
- <div class="person_box">
- <div class="person_num">{{lightData.clientCount}}</div>
- <div>邀请人数</div>
- </div>
- <div class="person_line"></div>
- <div class="person_box">
- <div class="person_num">{{lightData.formCount}}</div>
- <div>报名人数</div>
- </div>
- <div class="person_line"></div>
- <div class="person_box">
- <div class="person_num">{{lightData.testDriveCount}}</div>
- <div>试驾人数</div>
- </div>
- </div>
- <div class="ask_list">
- <div class="ask_title">已邀请用户</div>
- <div class="ask_user_box">
- <div class="ask_user" v-for="item in lightData.wxcpLightenClientList" :key="item.id">
- <div class="user_msg">
- <img :src="item.head || './img/ask_btn.png'" />
- <div class="user_name">{{item.name}}</div>
- </div>
- <div v-if="item.auditStatus === 1" class="ask_status2">审核中</div>
- <div v-if="item.auditStatus === 2" class="ask_status1">
- <div>未通过</div>
- <div>{{item.rejectionReason}}</div>
- </div>
- <div v-if="item.auditStatus === 3" class="ask_status2">待下发</div>
- <div v-if="item.auditStatus === 4 || item.auditStatus === 6" class="ask_status2">下发中</div>
- <div v-if="item.auditStatus === 5" class="ask_status3">已下发</div>
- </div>
- </div>
- </div>
- <div class="activity_box">
- <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 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>
- </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>
- <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" />
- <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-form :model="lightData" class="prize_form" label-position="top">
- <el-form-item label="顾问所属门店" required>
- <el-select v-if="Number(lightData.lightenId) === 117466319110001" v-model="lightData.store" placeholder="请选择">
- <el-option v-for="item in storeList1" :key="item" :label="item" :value="item">
- </el-option>
- </el-select>
- <el-select v-else-if="Number(lightData.lightenId) === 117466527210041" v-model="lightData.store" placeholder="请选择">
- <el-option v-for="item in storeList2" :key="item" :label="item" :value="item">
- </el-option>
- </el-select>
- <el-select v-else-if="Number(lightData.lightenId) === 117481774010051" v-model="lightData.store" placeholder="请选择">
- <el-option v-for="item in storeList3" :key="item" :label="item" :value="item">
- </el-option>
- </el-select>
- <el-input v-else v-model="lightData.store"></el-input>
- </el-form-item>
- <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>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="warning" :loading="loading" @click="handleSaveRefer">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </body>
- <script>
- new Vue({
- el: '#box',
- data() {
- return {
- httpUrl: '',
- bId: null,
- env: '',
- showAskDialog: false,
- lightData: {
- urlPost: '',
- wxcpLightenClientList: [],
- wxcpLighten: {
- activityInfo: '',
- raffeSwitch: 0,
- raffle1ClientNum: null,
- raffle1NumMax: null, // 抽奖1总次数
- raffle2NumMax: null, // 抽奖2总次数
- type: null,
- },
- raffle1: {
- leftNum: null, // 抽奖1剩余次数
- useNum: null, // 抽奖1已使用次数
- },
- raffle2: {
- leftNum: null, // 抽奖2剩余次数
- useNum: null, // 抽奖2已使用次数
- },
- raffle1BizId: null,
- raffle2BizId: null,
- referrer: '', // 顾问姓名
- store: '', // 门店
- referrerPhone: '', // 领取奖励手机号
- lightenId: null, // 点亮id
- },
- showDialog: false, // 填写顾问姓名信息弹窗
- loading: false, // 提交按钮loading
- currentIndex: 0, // 当前显示的图片索引
- getChunkData: [], // 分割数据
- clientCount: null, // 邀请人数
- formCount: null, // 报名人数
- testDriveCount: null, // 试驾人数
- storeList1: ['广州华贵', '海珠五菱', '广州菱森', '广州菱邦', '广州富骋'],
- storeList2: ['茂物机电', '高州分公司', '化州分公司', '电白分公司', '信宜分公司', '茂名菱利'],
- storeList3: ['长沈路店', '东环店', '军华店'],
- }
- },
- 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 = 'https://test.wefanbot.com:28993'
- // this.httpUrl = 'http://192.168.1.147:18993'
- }
- localStorage.removeItem('openId')
- 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) {
- // 判断业务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) {
- localStorage.setItem('openId', data.openId)
- this.ifH5Type()
- }
- })
- },
- // 企微授权
- 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
- this.currentIndex = Math.ceil(this.lightData.wxcpLightenClientList.length / 5) ? Math.ceil(this.lightData.wxcpLightenClientList.length / 5) - 1 : 0
- this.getChunkData = this.getChunk(this.lightData.wxcpLightenClientList, this.currentIndex)
- if (data.wxcpLighten.type === 2 && (!data.referrer || !data.referrerPhone)) {
- this.showDialog = true
- }
- if (!data.raffle1) {
- this.lightData.raffle1 = {
- leftNum: 0,
- useNum: 0,
- }
- }
- if (!data.raffle2) {
- this.lightData.raffle2 = {
- leftNum: 0,
- useNum: 0,
- }
- }
- } else {
- this.$message({
- message: msg,
- })
- }
- })
- },
- handleAsk() {
- this.showAskDialog = true
- },
- handleLottery(bizId) {
- let url = ''
- if (!this.env || this.env === 'prod') {
- url = `https://lottery2.camlook.cn/?bId=${bizId}&h5Type=30`
- } else {
- url = `https://lottery2.camlook.cn/?bId=${bizId}&env=dev&h5Type=30`
- }
- window.location.replace(url)
- },
- handleSaveRefer() {
- if (!this.lightData.store) {
- this.$message({
- message: '请填写顾问所属门店',
- type: 'warning'
- })
- return
- }
- if (!this.lightData.referrer) {
- this.$message({
- message: '请填写顾问姓名',
- type: 'warning'
- })
- 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}`, {
- method: 'post',
- body: JSON.stringify({
- referrer: this.lightData.referrer, // 顾问姓名
- store: this.lightData.store, // 门店
- referrerPhone: this.lightData.referrerPhone, // 领取奖励手机号
- }),
- headers: {
- 'Content-Type': 'application/json'
- }
- }).then(res => {
- return res.json()
- }).then(result => {
- let { data, code, msg } = result
- if (code === 1) {
- this.$message({
- message: '提交成功!',
- type: 'success'
- })
- this.showDialog = false
- this.lightenShare()
- }
- }).finally(() => {
- this.loading = false
- })
- },
- // 截取url中的数据
- getQueryParam(paramName) {
- // 获取当前URL的查询字符串部分
- const queryString = window.location.search;
- // 创建一个URLSearchParams对象
- const urlParams = new URLSearchParams(queryString);
- // 返回指定参数的值,如果不存在则返回null
- return urlParams.get(paramName);
- },
- prevSlide() {
- if (this.currentIndex > 0) {
- this.currentIndex--
- this.getChunkData = this.getChunk(this.lightData.wxcpLightenClientList, this.currentIndex)
- }
- },
- nextSlide() {
- if (this.currentIndex >= this.lightData.wxcpLightenClientList.length - 1) {
- return
- }
- if (this.currentIndex < this.lightData.wxcpLightenClientList.length - 1) {
- this.currentIndex++
- this.getChunkData = this.getChunk(this.lightData.wxcpLightenClientList, this.currentIndex)
- }
- },
- getChunk(arr, chunkIndex) {
- const chunkSize = 5
- const start = chunkIndex * chunkSize
- const end = start + chunkSize
- return arr.slice(start, end)
- }
- }
- })
- </script>
- </html>
|