| @@ -12,6 +12,7 @@ | |||||
| "axios": "^0.19.0", | "axios": "^0.19.0", | ||||
| "element-ui": "^2.15.8", | "element-ui": "^2.15.8", | ||||
| "moment": "^2.29.3", | "moment": "^2.29.3", | ||||
| "vant": "^2.12.53", | |||||
| "vue": "^2.6.12", | "vue": "^2.6.12", | ||||
| "vue-clipboard2": "^0.3.1", | "vue-clipboard2": "^0.3.1", | ||||
| "vue-cookie": "^1.1.4", | "vue-cookie": "^1.1.4", | ||||
| @@ -1653,7 +1654,6 @@ | |||||
| "version": "7.17.9", | "version": "7.17.9", | ||||
| "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.17.9.tgz", | "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.17.9.tgz", | ||||
| "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==", | "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==", | ||||
| "dev": true, | |||||
| "dependencies": { | "dependencies": { | ||||
| "regenerator-runtime": "^0.13.4" | "regenerator-runtime": "^0.13.4" | ||||
| }, | }, | ||||
| @@ -2189,11 +2189,20 @@ | |||||
| "node": ">=0.10.0" | "node": ">=0.10.0" | ||||
| } | } | ||||
| }, | }, | ||||
| "node_modules/@vant/icons": { | |||||
| "version": "1.8.0", | |||||
| "resolved": "https://registry.npmjs.org/@vant/icons/-/icons-1.8.0.tgz", | |||||
| "integrity": "sha512-sKfEUo2/CkQFuERxvkuF6mGQZDKu3IQdj5rV9Fm0weJXtchDSSQ+zt8qPCNUEhh9Y8shy5PzxbvAfOOkCwlCXg==" | |||||
| }, | |||||
| "node_modules/@vant/popperjs": { | |||||
| "version": "1.3.0", | |||||
| "resolved": "https://registry.npmjs.org/@vant/popperjs/-/popperjs-1.3.0.tgz", | |||||
| "integrity": "sha512-hB+czUG+aHtjhaEmCJDuXOep0YTZjdlRR+4MSmIFnkCQIxJaXLQdSsR90XWvAI2yvKUI7TCGqR8pQg2RtvkMHw==" | |||||
| }, | |||||
| "node_modules/@vue/babel-helper-vue-jsx-merge-props": { | "node_modules/@vue/babel-helper-vue-jsx-merge-props": { | ||||
| "version": "1.2.1", | "version": "1.2.1", | ||||
| "resolved": "https://registry.npmmirror.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.2.1.tgz", | "resolved": "https://registry.npmmirror.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.2.1.tgz", | ||||
| "integrity": "sha512-QOi5OW45e2R20VygMSNhyQHvpdUwQZqGPc748JLGCYEy+yp8fNFNdbNIGAgZmi9e+2JHPd6i6idRuqivyicIkA==", | |||||
| "dev": true | |||||
| "integrity": "sha512-QOi5OW45e2R20VygMSNhyQHvpdUwQZqGPc748JLGCYEy+yp8fNFNdbNIGAgZmi9e+2JHPd6i6idRuqivyicIkA==" | |||||
| }, | }, | ||||
| "node_modules/@vue/babel-helper-vue-transform-on": { | "node_modules/@vue/babel-helper-vue-transform-on": { | ||||
| "version": "1.0.2", | "version": "1.0.2", | ||||
| @@ -10754,8 +10763,7 @@ | |||||
| "node_modules/regenerator-runtime": { | "node_modules/regenerator-runtime": { | ||||
| "version": "0.13.9", | "version": "0.13.9", | ||||
| "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", | "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", | ||||
| "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", | |||||
| "dev": true | |||||
| "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" | |||||
| }, | }, | ||||
| "node_modules/regenerator-transform": { | "node_modules/regenerator-transform": { | ||||
| "version": "0.15.0", | "version": "0.15.0", | ||||
| @@ -13134,6 +13142,21 @@ | |||||
| "spdx-expression-parse": "^3.0.0" | "spdx-expression-parse": "^3.0.0" | ||||
| } | } | ||||
| }, | }, | ||||
| "node_modules/vant": { | |||||
| "version": "2.12.53", | |||||
| "resolved": "https://registry.npmjs.org/vant/-/vant-2.12.53.tgz", | |||||
| "integrity": "sha512-f/wSWMCm/fd8bvm2QfPkpPqYUn8gwmBGw3DxAUPSTd/5prc1cRn23HEak8LDMJ5FmfW9mp7G5vdGlnEYCtww8Q==", | |||||
| "dependencies": { | |||||
| "@babel/runtime": "7.x", | |||||
| "@vant/icons": "^1.7.1", | |||||
| "@vant/popperjs": "^1.1.0", | |||||
| "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0", | |||||
| "vue-lazyload": "1.2.3" | |||||
| }, | |||||
| "peerDependencies": { | |||||
| "vue": ">= 2.6.0" | |||||
| } | |||||
| }, | |||||
| "node_modules/vary": { | "node_modules/vary": { | ||||
| "version": "1.1.2", | "version": "1.1.2", | ||||
| "resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz", | "resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz", | ||||
| @@ -13196,6 +13219,11 @@ | |||||
| "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", | "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", | ||||
| "dev": true | "dev": true | ||||
| }, | }, | ||||
| "node_modules/vue-lazyload": { | |||||
| "version": "1.2.3", | |||||
| "resolved": "https://registry.npmjs.org/vue-lazyload/-/vue-lazyload-1.2.3.tgz", | |||||
| "integrity": "sha512-DC0ZwxanbRhx79tlA3zY5OYJkH8FYp3WBAnAJbrcuoS8eye1P73rcgAZhyxFSPUluJUTelMB+i/+VkNU/qVm7g==" | |||||
| }, | |||||
| "node_modules/vue-loader": { | "node_modules/vue-loader": { | ||||
| "version": "15.9.8", | "version": "15.9.8", | ||||
| "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.9.8.tgz", | "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.9.8.tgz", | ||||
| @@ -15527,7 +15555,6 @@ | |||||
| "version": "7.17.9", | "version": "7.17.9", | ||||
| "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.17.9.tgz", | "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.17.9.tgz", | ||||
| "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==", | "integrity": "sha512-lSiBBvodq29uShpWGNbgFdKYNiFDo5/HIYsaCEY9ff4sb10x9jizo2+pRrSyF4jKZCXqgzuqBOQKbUm90gQwJg==", | ||||
| "dev": true, | |||||
| "requires": { | "requires": { | ||||
| "regenerator-runtime": "^0.13.4" | "regenerator-runtime": "^0.13.4" | ||||
| } | } | ||||
| @@ -15994,11 +16021,20 @@ | |||||
| } | } | ||||
| } | } | ||||
| }, | }, | ||||
| "@vant/icons": { | |||||
| "version": "1.8.0", | |||||
| "resolved": "https://registry.npmjs.org/@vant/icons/-/icons-1.8.0.tgz", | |||||
| "integrity": "sha512-sKfEUo2/CkQFuERxvkuF6mGQZDKu3IQdj5rV9Fm0weJXtchDSSQ+zt8qPCNUEhh9Y8shy5PzxbvAfOOkCwlCXg==" | |||||
| }, | |||||
| "@vant/popperjs": { | |||||
| "version": "1.3.0", | |||||
| "resolved": "https://registry.npmjs.org/@vant/popperjs/-/popperjs-1.3.0.tgz", | |||||
| "integrity": "sha512-hB+czUG+aHtjhaEmCJDuXOep0YTZjdlRR+4MSmIFnkCQIxJaXLQdSsR90XWvAI2yvKUI7TCGqR8pQg2RtvkMHw==" | |||||
| }, | |||||
| "@vue/babel-helper-vue-jsx-merge-props": { | "@vue/babel-helper-vue-jsx-merge-props": { | ||||
| "version": "1.2.1", | "version": "1.2.1", | ||||
| "resolved": "https://registry.npmmirror.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.2.1.tgz", | "resolved": "https://registry.npmmirror.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.2.1.tgz", | ||||
| "integrity": "sha512-QOi5OW45e2R20VygMSNhyQHvpdUwQZqGPc748JLGCYEy+yp8fNFNdbNIGAgZmi9e+2JHPd6i6idRuqivyicIkA==", | |||||
| "dev": true | |||||
| "integrity": "sha512-QOi5OW45e2R20VygMSNhyQHvpdUwQZqGPc748JLGCYEy+yp8fNFNdbNIGAgZmi9e+2JHPd6i6idRuqivyicIkA==" | |||||
| }, | }, | ||||
| "@vue/babel-helper-vue-transform-on": { | "@vue/babel-helper-vue-transform-on": { | ||||
| "version": "1.0.2", | "version": "1.0.2", | ||||
| @@ -23189,8 +23225,7 @@ | |||||
| "regenerator-runtime": { | "regenerator-runtime": { | ||||
| "version": "0.13.9", | "version": "0.13.9", | ||||
| "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", | "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", | ||||
| "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", | |||||
| "dev": true | |||||
| "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" | |||||
| }, | }, | ||||
| "regenerator-transform": { | "regenerator-transform": { | ||||
| "version": "0.15.0", | "version": "0.15.0", | ||||
| @@ -25167,6 +25202,18 @@ | |||||
| "spdx-expression-parse": "^3.0.0" | "spdx-expression-parse": "^3.0.0" | ||||
| } | } | ||||
| }, | }, | ||||
| "vant": { | |||||
| "version": "2.12.53", | |||||
| "resolved": "https://registry.npmjs.org/vant/-/vant-2.12.53.tgz", | |||||
| "integrity": "sha512-f/wSWMCm/fd8bvm2QfPkpPqYUn8gwmBGw3DxAUPSTd/5prc1cRn23HEak8LDMJ5FmfW9mp7G5vdGlnEYCtww8Q==", | |||||
| "requires": { | |||||
| "@babel/runtime": "7.x", | |||||
| "@vant/icons": "^1.7.1", | |||||
| "@vant/popperjs": "^1.1.0", | |||||
| "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0", | |||||
| "vue-lazyload": "1.2.3" | |||||
| } | |||||
| }, | |||||
| "vary": { | "vary": { | ||||
| "version": "1.1.2", | "version": "1.1.2", | ||||
| "resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz", | "resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz", | ||||
| @@ -25223,6 +25270,11 @@ | |||||
| "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", | "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==", | ||||
| "dev": true | "dev": true | ||||
| }, | }, | ||||
| "vue-lazyload": { | |||||
| "version": "1.2.3", | |||||
| "resolved": "https://registry.npmjs.org/vue-lazyload/-/vue-lazyload-1.2.3.tgz", | |||||
| "integrity": "sha512-DC0ZwxanbRhx79tlA3zY5OYJkH8FYp3WBAnAJbrcuoS8eye1P73rcgAZhyxFSPUluJUTelMB+i/+VkNU/qVm7g==" | |||||
| }, | |||||
| "vue-loader": { | "vue-loader": { | ||||
| "version": "15.9.8", | "version": "15.9.8", | ||||
| "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.9.8.tgz", | "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.9.8.tgz", | ||||
| @@ -11,6 +11,7 @@ | |||||
| "axios": "^0.19.0", | "axios": "^0.19.0", | ||||
| "element-ui": "^2.15.8", | "element-ui": "^2.15.8", | ||||
| "moment": "^2.29.3", | "moment": "^2.29.3", | ||||
| "vant": "^2.12.53", | |||||
| "vue": "^2.6.12", | "vue": "^2.6.12", | ||||
| "vue-clipboard2": "^0.3.1", | "vue-clipboard2": "^0.3.1", | ||||
| "vue-cookie": "^1.1.4", | "vue-cookie": "^1.1.4", | ||||
| @@ -5,7 +5,6 @@ | |||||
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||||
| <meta name="referrer" content="never"> | <meta name="referrer" content="never"> | ||||
| <meta name="viewport" content="width=device-width,initial-scale=1.0"> | <meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||||
| <title>微信后台管理系统</title> | |||||
| <!-- tinymce编辑器 --> | <!-- tinymce编辑器 --> | ||||
| <script src="https://cdn.bootcdn.net/ajax/libs/tinymce/5.10.4/tinymce.min.js"></script> | <script src="https://cdn.bootcdn.net/ajax/libs/tinymce/5.10.4/tinymce.min.js"></script> | ||||
| </head> | </head> | ||||
| @@ -5,17 +5,20 @@ import store from './store' | |||||
| import VueCookie from 'vue-cookie' | import VueCookie from 'vue-cookie' | ||||
| import ElementUI from 'element-ui'; | import ElementUI from 'element-ui'; | ||||
| import moment from 'moment' | import moment from 'moment' | ||||
| import Vant from 'vant'; | |||||
| import 'vant/lib/index.css'; | |||||
| import 'element-ui/lib/theme-chalk/index.css'; | import 'element-ui/lib/theme-chalk/index.css'; | ||||
| import './assets/css/common.css' | import './assets/css/common.css' | ||||
| import './assets/scss/index.scss' | import './assets/scss/index.scss' | ||||
| import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios | import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios | ||||
| import { isAuth } from '@/utils' | |||||
| import {isAuth} from '@/utils' | |||||
| import VueClipboard from 'vue-clipboard2' | import VueClipboard from 'vue-clipboard2' | ||||
| Vue.use(ElementUI); | Vue.use(ElementUI); | ||||
| Vue.use(VueClipboard) | Vue.use(VueClipboard) | ||||
| Vue.use(VueCookie) | Vue.use(VueCookie) | ||||
| Vue.use(Vant); | |||||
| Vue.config.productionTip = false | Vue.config.productionTip = false | ||||
| // 挂载全局 | // 挂载全局 | ||||
| @@ -30,3 +33,9 @@ new Vue({ | |||||
| store, | store, | ||||
| render: h => h(App) | render: h => h(App) | ||||
| }).$mount('#app') | }).$mount('#app') | ||||
| // 设置导航守卫 | |||||
| router.beforeEach((to, form, next) => { | |||||
| window.document.title = to.meta.title == undefined ? '默认标题' : to.meta.title | |||||
| next() | |||||
| }) | |||||
| @@ -1,243 +1,289 @@ | |||||
| <template> | <template> | ||||
| <div class="app-container"> | |||||
| <div class="title"> | |||||
| <!-- <img style="display: block; | |||||
| margin: 0 auto;" src="../../static/images/onlineHome/yinnongLogo.jpg" alt=""> --> | |||||
| <div class="app-container"> | |||||
| <!-- <van-tabs :swipeable="true" style="margin-top:0.5rem;padding:0 10px;">--> | |||||
| <van-form style="margin:50px 0;"> | |||||
| <!-- <van-field--> | |||||
| <!-- v-model="formData.memberName"--> | |||||
| <!-- name="请输入姓名"--> | |||||
| <!-- placeholder="请输入姓名"--> | |||||
| <!-- :rules="[{ required: true, message: '' }]"--> | |||||
| <!-- />--> | |||||
| <!-- <van-field--> | |||||
| <!-- v-model="formData.idcard"--> | |||||
| <!-- name="请输入身份证号"--> | |||||
| <!-- style="margin-top: 20px"--> | |||||
| <!-- placeholder="请输入身份证号"--> | |||||
| <!-- :rules="[{ required: true, message: '' }]"--> | |||||
| <!-- />--> | |||||
| <van-field | |||||
| v-model="formData.mobile" | |||||
| name="请输入手机号" | |||||
| style="margin-top: 20px" | |||||
| placeholder="请输入手机号" | |||||
| :rules="[{ required: true, message: '' }]" | |||||
| /> | |||||
| <!-- <van-field--> | |||||
| <!-- v-model="formData.code"--> | |||||
| <!-- center--> | |||||
| <!-- clearable--> | |||||
| <!-- label="验证码"--> | |||||
| <!-- placeholder="图形验证码"--> | |||||
| <!-- >--> | |||||
| <!-- <template #button>--> | |||||
| <!-- <img style="width: 100px" :src="codeUrl" @click="getCode"/>--> | |||||
| <!-- </template>--> | |||||
| <!-- </van-field>--> | |||||
| <van-field | |||||
| v-model="formData.smsCode" | |||||
| style="margin-top: 20px" | |||||
| placeholder="请输入验证码" | |||||
| :rules="[{ required: true, message: '' }]" | |||||
| > | |||||
| <template #button> | |||||
| <!-- <van-button size="mini" type="info" @click="getRegisterSmsCode" >获取验证码</van-button> --> | |||||
| <div class="registerSmsBtn" @click="getRegisterSmsCode">{{ | |||||
| computeTime > 0 ? `(${computeTime}s)已发送` : "获取短信码" | |||||
| }} | |||||
| </div> | |||||
| </template> | |||||
| </van-field> | |||||
| <div style="margin: 50px 16px 16px;"> | |||||
| <van-button block type="info" native-type="submit" @click="registerSubmit">绑定</van-button> | |||||
| </div> | |||||
| </van-form> | |||||
| <!-- </van-tabs>--> | |||||
| </div> | </div> | ||||
| <!-- <van-tabs v-model="active" :swipeable="true" style="margin-top:0.5rem;padding:0 10px;"> --> | |||||
| <van-form style="margin:50px 0;"> | |||||
| <van-field | |||||
| v-model="formData.memberName" | |||||
| name="请输入姓名" | |||||
| placeholder="请输入姓名" | |||||
| :rules="[{ required: true, message: '' }]" | |||||
| /> | |||||
| <van-field | |||||
| v-model="formData.idcard" | |||||
| name="请输入身份证号" | |||||
| style="margin-top: 20px" | |||||
| placeholder="请输入身份证号" | |||||
| :rules="[{ required: true, message: '' }]" | |||||
| /> | |||||
| <van-field | |||||
| v-model="formData.mobile" | |||||
| name="请输入手机号" | |||||
| style="margin-top: 20px" | |||||
| placeholder="请输入手机号" | |||||
| :rules="[{ required: true, message: '' }]" | |||||
| /> | |||||
| <van-field | |||||
| v-model="formData.code" | |||||
| center | |||||
| clearable | |||||
| label="验证码" | |||||
| placeholder="图形验证码" | |||||
| > | |||||
| <template #button> | |||||
| <img style="width: 100px" :src="codeUrl" @click="getCode" /> | |||||
| </template> | |||||
| </van-field> | |||||
| <van-field | |||||
| v-model="formData.smsCode" | |||||
| style="margin-top: 20px" | |||||
| placeholder="请输入验证码" | |||||
| :rules="[{ required: true, message: '' }]" | |||||
| > | |||||
| <template #button> | |||||
| <!-- <van-button size="mini" type="info" @click="getRegisterSmsCode" >获取验证码</van-button> --> | |||||
| <div class="registerSmsBtn" @click="getRegisterSmsCode">{{ | |||||
| computeTime > 0 ? `(${computeTime}s)已发送` : "获取短信码" | |||||
| }}</div> | |||||
| </template> | |||||
| </van-field> | |||||
| <div style="margin: 50px 16px 16px;"> | |||||
| <van-button block type="info" native-type="submit" @click="registerSubmit">绑定</van-button> | |||||
| </div> | |||||
| </van-form> | |||||
| </div> | |||||
| </template> | </template> | ||||
| <style scoped> | <style scoped> | ||||
| .app-container{ | |||||
| background: #fff; | |||||
| height: 100vh; | |||||
| } | |||||
| .title{ | |||||
| padding-top: 20%; | |||||
| width: 88%; | |||||
| margin: 0 auto; | |||||
| } | |||||
| .van-tab--active{ | |||||
| font-size: .6rem; | |||||
| font-weight: bold; | |||||
| } | |||||
| .van-tabs__line{ | |||||
| background:#1D6FE9; | |||||
| width: 0.15rem; | |||||
| height: 0.15rem; | |||||
| border-radius: 0.07rem; | |||||
| bottom: 0.3rem; | |||||
| } | |||||
| .van-tabs__nav{ | |||||
| padding:0 | |||||
| } | |||||
| .van-tab{ | |||||
| display: inline-block; | |||||
| flex: inherit; | |||||
| margin-left: 30px; | |||||
| line-height: .8rem; | |||||
| } | |||||
| .van-tab__text--ellipsis { | |||||
| overflow: auto; | |||||
| } | |||||
| .van-password-input{ | |||||
| width: 50%; | |||||
| margin: 0 auto; | |||||
| } | |||||
| [class*=van-hairline]::after{ | |||||
| border:none; | |||||
| } | |||||
| .van-password-input__security li{ | |||||
| margin: 0 10px; | |||||
| border-bottom: 3px solid black; | |||||
| } | |||||
| .registerSmsBtn{ | |||||
| color: rgb(29, 111, 233); | |||||
| font-size: 0.34rem; | |||||
| .app-container { | |||||
| background: #fff; | |||||
| height: 100vh; | |||||
| } | |||||
| .title { | |||||
| padding-top: 20%; | |||||
| width: 88%; | |||||
| margin: 0 auto; | |||||
| } | |||||
| .van-tab--active { | |||||
| font-size: .6rem; | |||||
| font-weight: bold; | |||||
| } | |||||
| } | |||||
| .van-tabs__line { | |||||
| background: #1D6FE9; | |||||
| width: 0.15rem; | |||||
| height: 0.15rem; | |||||
| border-radius: 0.07rem; | |||||
| bottom: 0.3rem; | |||||
| } | |||||
| .van-tabs__nav { | |||||
| padding: 0 | |||||
| } | |||||
| .van-tab { | |||||
| display: inline-block; | |||||
| flex: inherit; | |||||
| margin-left: 30px; | |||||
| line-height: .8rem; | |||||
| } | |||||
| .van-tab__text--ellipsis { | |||||
| overflow: auto; | |||||
| } | |||||
| .van-password-input { | |||||
| width: 50%; | |||||
| margin: 0 auto; | |||||
| } | |||||
| [class*=van-hairline]::after { | |||||
| border: none; | |||||
| } | |||||
| .van-password-input__security li { | |||||
| margin: 0 10px; | |||||
| border-bottom: 3px solid black; | |||||
| } | |||||
| .registerSmsBtn { | |||||
| color: rgb(29, 111, 233); | |||||
| font-size: 1rem; | |||||
| } | |||||
| </style> | </style> | ||||
| <script> | <script> | ||||
| import { getUUID } from '@/utils' | |||||
| export default { | |||||
| data() { | |||||
| return { | |||||
| showMessage:false, | |||||
| smsCodeValue:"", | |||||
| showKeyboard:false, | |||||
| formData: { | |||||
| username: "", //账号 | |||||
| password: "", //密码 | |||||
| code: null, //图片验证码 | |||||
| uuid: null, //识别uuid | |||||
| mobile: null, //手机号 | |||||
| smsCode: null, //短信验证码 | |||||
| memberName:null, //身份信息 | |||||
| idcard:null, //身份号码 | |||||
| rememberMe:false | |||||
| }, | |||||
| loading: false, | |||||
| codeUrl: "", //验证码 | |||||
| isSmsLogin: false, //是否手机验证码 | |||||
| computeTime: 0, | |||||
| active:1 | |||||
| }; | |||||
| }, | |||||
| created() { | |||||
| this.getCode(); | |||||
| this.reset(); | |||||
| }, | |||||
| methods: { | |||||
| reset(){ | |||||
| import {getUUID} from '@/utils' | |||||
| }, | |||||
| showPopup(){ | |||||
| this.showKeyboard = !this.showKeyboard | |||||
| }, | |||||
| showMessagePop(){ | |||||
| this.showMessage = !this.showMessage | |||||
| }, | |||||
| getCode() { | |||||
| this.formData.uuid = getUUID() | |||||
| this.codeUrl = this.$http.adornUrl(`/captcha?uuid=${this.formData.uuid}`) | |||||
| }, | |||||
| getRegisterSmsCode(){ | |||||
| if (!this.computeTime) { | |||||
| let myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/; | |||||
| if (!myreg.test(this.formData.mobile)) { | |||||
| this.$dialog.alert({ | |||||
| message: '手机号格式不正确', | |||||
| }); | |||||
| return false; | |||||
| }else if (this.formData.code == "") { | |||||
| this.$dialog.alert({ | |||||
| message: '图片验证码不能为空', | |||||
| }); | |||||
| return false; | |||||
| } | |||||
| if (this.active==2) { | |||||
| let formObj = { | |||||
| code :this.formData.code, | |||||
| mobile:this.formData.mobile, | |||||
| uuid:this.formData.uuid | |||||
| } | |||||
| getRegisterSmsCode(formObj).then((res) => { | |||||
| console.log(res) | |||||
| console.log(res.code == 200) | |||||
| if(res.code == 200) { | |||||
| this.$dialog.alert({ | |||||
| message: '验证码已发送', | |||||
| }); | |||||
| this.formData.uuid = res.uuid; | |||||
| this.computeTime = 60; | |||||
| this.timer = setInterval(() => { | |||||
| this.computeTime--; | |||||
| if (this.computeTime <= 0) { | |||||
| clearInterval(this.timer); | |||||
| } | |||||
| }, 1000); | |||||
| } | |||||
| }).catch((res)=>{ | |||||
| if(res=='Error: 验证码已失效'){ | |||||
| this.getCode() | |||||
| } | |||||
| }); | |||||
| } | |||||
| } | |||||
| }, | |||||
| registerSubmit(){ | |||||
| const APPID = "wx7135dd84735bc392"; | |||||
| const WX_AUTH_URL = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + APPID | |||||
| + '&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_base&state=0#wechat_redirect'; | |||||
| //注册 | |||||
| if (this.formData.memberName == "") { | |||||
| this.$dialog.alert({ | |||||
| message: '姓名不能为空', | |||||
| }); | |||||
| return false; | |||||
| } else if (this.formData.idcard == "") { | |||||
| this.$dialog.alert({ | |||||
| message: '身份证号不能为空', | |||||
| }); | |||||
| return false; | |||||
| } else if (this.formData.mobile == "") { | |||||
| this.$dialog.alert({ | |||||
| message: '手机号码不能为空', | |||||
| }); | |||||
| return false; | |||||
| }else if (this.formData.smsCode == "") { | |||||
| this.$dialog.alert({ | |||||
| message: '短信验证码不能为空', | |||||
| }); | |||||
| return false; | |||||
| } | |||||
| //registerCheck,registerOn | |||||
| console.log(this.formData) | |||||
| registerCheck(this.formData).then((res)=>{ | |||||
| if(res.code == 200){ | |||||
| registerOn(this.formData).then((res)=>{ | |||||
| if(res.code == 200){ | |||||
| // | |||||
| this.$dialog.alert({ | |||||
| message: '您的初始密码:'+res.password, | |||||
| }).then(() => { | |||||
| this.$router.push({ path: "/yinnong/workbench" }).catch(() => {}); | |||||
| }); | |||||
| export default { | |||||
| data() { | |||||
| return { | |||||
| showMessage: false, | |||||
| smsCodeValue: "", | |||||
| showKeyboard: false, | |||||
| formData: { | |||||
| // username: "", //账号 | |||||
| // password: "", //密码 | |||||
| code: null, //图片验证码 | |||||
| uuid: null, //识别uuid | |||||
| mobile: null, //手机号 | |||||
| smsCode: null, //短信验证码 | |||||
| codeTime: null, //短信验证码发送时间 | |||||
| openId: null, // openId | |||||
| // memberName: null, //身份信息 | |||||
| // idcard: null, //身份号码 | |||||
| // rememberMe: false | |||||
| }, | |||||
| loading: false, | |||||
| codeUrl: "", //验证码 | |||||
| isSmsLogin: false, //是否手机验证码 | |||||
| computeTime: 0, | |||||
| }; | |||||
| }, | |||||
| created() { | |||||
| // this.getCode(); | |||||
| this.wxAuth(); | |||||
| }, | |||||
| methods: { | |||||
| showPopup() { | |||||
| this.showKeyboard = !this.showKeyboard | |||||
| }, | |||||
| showMessagePop() { | |||||
| this.showMessage = !this.showMessage | |||||
| }, | |||||
| wxAuth() { | |||||
| // let code = this.getUrlParam('code');//获取URL中的code参数 | |||||
| // if (code) return code; | |||||
| // let currentUrl = encodeURIComponent(window.location.href); | |||||
| // window.location.replace(WX_AUTH_URL.replace('REDIRECT_URI', currentUrl)); | |||||
| return new Promise((resolve, reject) => { | |||||
| let openid = this.$cookie.get('openid'); | |||||
| if (openid) { | |||||
| resolve(openid); | |||||
| return; | |||||
| } | |||||
| let code = this.getUrlParam('code'); | |||||
| if (!code) {//未经过微信授权 | |||||
| let currentUrl = encodeURIComponent(window.location.href); | |||||
| window.location.replace(WX_AUTH_URL.replace('REDIRECT_URI', currentUrl)); | |||||
| } else { | |||||
| this.$cookie.set('appid', APPID); //接口服务端从cookie中读取openid | |||||
| this.$http({ | |||||
| url: this.$http.adornUrl('/wxAuth/codeToOpenid'), | |||||
| method: 'post', | |||||
| data: this.$http.adornParams({ | |||||
| 'code': code | |||||
| }) | |||||
| }).then(res => { | |||||
| if (res.code == 200) { | |||||
| console.log("微信授权完成" + res.data); | |||||
| resolve(res.data); | |||||
| } else { | |||||
| console.log("换取openid失败"); | |||||
| } | |||||
| }); | |||||
| } | |||||
| }); | |||||
| }, | |||||
| getUrlParam(key) {//获取当前页面url中的参数 | |||||
| var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)"); | |||||
| var result = window.location.search.substr(1).match(reg); | |||||
| return result ? decodeURIComponent(result[2]) : ''; | |||||
| }, | |||||
| getCode() { | |||||
| this.formData.uuid = getUUID() | |||||
| this.codeUrl = this.$http.adornUrl(`/captcha?uuid=${this.formData.uuid}`) | |||||
| }, | |||||
| getRegisterSmsCode() { | |||||
| if (!this.computeTime) { | |||||
| let myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/; | |||||
| if (!myreg.test(this.formData.mobile)) { | |||||
| this.$dialog.alert({ | |||||
| message: '手机号格式不正确', | |||||
| }); | |||||
| return false; | |||||
| } | |||||
| // else if (this.formData.code == "") { | |||||
| // this.$dialog.alert({ | |||||
| // message: '图片验证码不能为空', | |||||
| // }); | |||||
| // return false; | |||||
| // } | |||||
| this.$http({ | |||||
| url: this.$http.adornUrl('/sms/code'), | |||||
| method: 'post', | |||||
| data: this.$http.adornParams({ | |||||
| 'mobile': this.formData.mobile | |||||
| }) | |||||
| }).then((res) => { | |||||
| if (res.data.code == 200) { | |||||
| this.$dialog.alert({ | |||||
| message: '验证码已发送', | |||||
| }); | |||||
| this.formData.codeTime = res.data.smsCode; | |||||
| this.computeTime = 60; | |||||
| this.timer = setInterval(() => { | |||||
| this.computeTime--; | |||||
| if (this.computeTime <= 0) { | |||||
| clearInterval(this.timer); | |||||
| } | |||||
| }, 1000); | |||||
| } else { | |||||
| this.$dialog.alert({ | |||||
| message: res.data.msg, | |||||
| }); | |||||
| } | |||||
| }).catch((res) => { | |||||
| this.$dialog.alert({ | |||||
| message: '验证码发送失败' + res.data.msg, | |||||
| }); | |||||
| }); | |||||
| } | |||||
| }, | |||||
| registerSubmit() { | |||||
| //绑定 | |||||
| if (this.formData.mobile == "") { | |||||
| this.$dialog.alert({ | |||||
| message: '手机号码不能为空', | |||||
| }); | |||||
| return false; | |||||
| } else if (this.formData.smsCode == "") { | |||||
| this.$dialog.alert({ | |||||
| message: '短信验证码不能为空', | |||||
| }); | |||||
| return false; | |||||
| } | |||||
| this.$http({ | |||||
| url: this.$http.adornUrl('/sms/verifyCode'), | |||||
| method: 'post', | |||||
| data: this.$http.adornParams({ | |||||
| 'openId': this.$cookie.get('openid'), | |||||
| 'mobile': this.formData.mobile, | |||||
| 'code': this.formData.smsCode, | |||||
| 'codeTime': this.formData.codeTime | |||||
| }) | |||||
| }).then((res) => { | |||||
| if (res.data.code == 200) { | |||||
| this.$dialog.alert({ | |||||
| message: '手机号绑定成功', | |||||
| }); | |||||
| } else { | |||||
| this.$dialog.alert({ | |||||
| message: res.data.msg, | |||||
| }); | |||||
| } | |||||
| }).catch((res) => { | |||||
| this.$dialog.alert({ | |||||
| message: '手机号绑定失败' + res.data.msg, | |||||
| }); | |||||
| }); | |||||
| } | } | ||||
| }) | |||||
| } | |||||
| }) | |||||
| } | |||||
| }, | |||||
| }; | |||||
| }, | |||||
| }; | |||||
| </script> | </script> | ||||