Explorar o código

点亮五菱update

duanshenglang hai 6 meses
pai
achega
9875c8ff3d
Modificáronse 2 ficheiros con 115 adicións e 5 borrados
  1. 111 1
      lottery/lightUpWl.html
  2. 4 4
      lottery/onePersonOneCode.html

+ 111 - 1
lottery/lightUpWl.html

@@ -240,6 +240,54 @@
     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;
+  }
+
+  .prize_form .el-form-item__label {
+    line-height: 20px;
+  }
+
+  .prize_form .el-input {
+    border: 1px solid #CCCCCC;
+    border-radius: 5px;
+    width: 295px;
+  }
+
+  .prize_form .el-input__inner {
+    text-align: left;
+  }
+
+  .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;
+  }
 </style>
 
 <body>
@@ -312,6 +360,19 @@
         <div class="save_btn" @click="showAskDialog = false">长按图片保存</div>
       </div>
     </div>
+    <el-dialog title="填写推荐人信息" :visible.sync="showDialog">
+      <el-form :model="lightData" class="prize_form" label-position="top">
+        <el-form-item label="推荐人">
+          <el-input v-model="lightData.referrer"></el-input>
+        </el-form-item>
+        <el-form-item label="门店">
+          <el-input v-model="lightData.store"></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>
@@ -342,7 +403,11 @@
           },
           raffle1BizId: null,
           raffle2BizId: null,
+          referrer: '', // 推荐人
+          store: '', // 门店 
         },
+        showDialog: false, // 填写推荐人信息弹窗
+        loading: false, // 提交按钮loading
       }
     },
     created () {
@@ -438,7 +503,10 @@
           }).then(result => {
             let { data, code, msg } = result
             if (code === 1) {
-              this.lightData = data  
+              this.lightData = data
+              if (!data.referrer || !data.store) {
+                this.showDialog = true
+              }
             } else {
               this.$message({
                 message: msg,
@@ -458,6 +526,48 @@
         }
         window.location.replace(url)
       },
+      handleSaveRefer () {
+        if (!this.lightData.referrer) {
+          this.$message({
+            message: '请填写推荐人',
+            type: 'warning'
+          })
+          return 
+        }
+        if (!this.lightData.store) {
+          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, // 门店
+          }),
+          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的查询字符串部分  

+ 4 - 4
lottery/onePersonOneCode.html

@@ -210,10 +210,10 @@
       <div class="page_tip page1 page_tip_page2">邀请我的好友添加,领取拉新奖金!</div>
       <div class="form_list">
         <el-form ref="form" :model="form" label-position="left" label-width="100px">
-          <el-form-item label="顾问姓名:">
+          <el-form-item label="企微姓名:">
             <el-input v-model="form.salesMan" placeholder="请输入"></el-input>
           </el-form-item>
-          <el-form-item label="合伙人姓名:">
+          <el-form-item label="朋友姓名:">
             <el-input v-model="form.partner" placeholder="请输入"></el-input>
           </el-form-item>
         </el-form>
@@ -343,11 +343,11 @@
       // 创建活码
       handleQrcode() {
         if (!this.form.salesMan) {
-          this.$message.error('请输入顾问姓名')
+          this.$message.error('请输入企微姓名')
           return 
         }
         if (!this.form.partner) {
-          this.$message.error('请输入合伙人姓名')
+          this.$message.error('请输入朋友姓名')
           return 
         }
         this.loading = true