|
@@ -1,19 +1,18 @@
|
|
|
<template>
|
|
|
<div class="binding-container">
|
|
|
- <div v-if="isMobile">
|
|
|
+ <div>
|
|
|
<el-alert title="您的微信号未绑定过系统,请先绑定一个账号" :closable="false" type="warning" center show-icon />
|
|
|
<el-form label-width="80px" size="mini" style="margin-top:10px" ref="formRef" :model="formData" :rules="rules">
|
|
|
<el-form-item label="账号:" prop="username">
|
|
|
<el-input v-model="formData.username" placeholder="账号" />
|
|
|
</el-form-item>
|
|
|
|
|
|
-
|
|
|
<el-form-item label="密码:" prop="password">
|
|
|
<el-input type="password" v-model="formData.password" placeholder="密码" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item style="display: flex;justify-content: flex-end;">
|
|
|
- <wx-open-subscribe :template="'2W6QA6ke0W9h17KbP__0fvijmoWAlCShaphBu6C3C4Q,05NTNhwfrx4iMwMQwMZD9cORVaJ8E4BEs0S8K988O54'" id="subscribe-btn" @success="handleSuccess" @error="handleError">
|
|
|
+ <wx-open-subscribe :template="template" id="subscribe-btn" @success="handleSuccess" @error="handleError">
|
|
|
<script type="text/wxtag-template">
|
|
|
<style>
|
|
|
.sub-btn{
|
|
@@ -32,8 +31,6 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
-
|
|
|
- <el-alert v-else title="请使用手机端绑定账号" :closable="false" type="error" center show-icon />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -94,9 +91,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- if (/Mobi|Android|iPhone/i.test(navigator.userAgent)) {
|
|
|
- this.isMobile = true
|
|
|
- }
|
|
|
document.title = "绑定采销账号"
|
|
|
},
|
|
|
beforeDestory() {
|
|
@@ -112,23 +106,9 @@ export default {
|
|
|
this.submit();
|
|
|
// this.$message.warning("订阅失败,请重试!")
|
|
|
},
|
|
|
- handleLastValue(value) {
|
|
|
- this.formData.lastCode = value.replace(/[^\d]/g, '');
|
|
|
- let { lastCode = "", phone } = this.formData
|
|
|
- let phoneLastCode = []
|
|
|
- for (let i = 0; i < 4; i++) { phoneLastCode[i] = lastCode[i] || "*" }
|
|
|
- const phonePreCode = phone.slice(0, 7)
|
|
|
- console.log(phonePreCode)
|
|
|
- this.formData.phone = phonePreCode + phoneLastCode.join("");
|
|
|
- },
|
|
|
handleChange(value) {
|
|
|
const item = this.accounts.find(({ value: oV }) => oV === value)
|
|
|
-
|
|
|
- this.formData = {
|
|
|
- id: item.value,
|
|
|
- phone: item.mobile,
|
|
|
- lastCode: ""
|
|
|
- }
|
|
|
+ this.formData = { id: item.value, phone: item.mobile, lastCode: "" }
|
|
|
},
|
|
|
async submit() {
|
|
|
try {
|