| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564 |
- <template>
- <div class="certification">
- <div class="container">
- <div class="content" v-show="goNextStep">
- <div class="content-top">
- <h3>账号申诉</h3>
- </div>
- <div>
- <el-form :model="account" :rules="rules" ref="account" label-width="100px" class="demo-ruleForm">
- <el-form-item prop="mobile">
- <el-input v-model="account.mobile"
- v-bind:class="{active: mobileExit}"
- placeholder="新手机号码"></el-input>
- <span class="tip tip-mobile" v-show="mobileExit">该手机已被注册</span>
- </el-form-item>
- <el-form-item prop="code">
- <el-input type="text" v-model="account.code"
- v-bind:class="{ active: codeErrorChecked }"
- auto-complete="off" class="msg"
- placeholder="短信验证码"></el-input>
- <el-button type="primary" class="code"
- v-show="sendAccountCode"
- @click="getCheckCode"
- :disabled="getCodeBtnIsDisabled">获取验证码</el-button>
- <el-button type="primary" v-show="!sendAccountCode" class="code code-send">已发送({{account_time}}s)</el-button>
- <span v-show="codeErrorChecked" class="tip codeError-tip" >{{codeErrorMsg}}</span>
- </el-form-item>
- <el-form-item prop="password">
- <el-input type="password" v-model="account.password" auto-complete="new-password" placeholder="登录密码"></el-input>
- </el-form-item>
- <el-form-item prop="description">
- <el-input type="textarea" v-model="account.description" placeholder="申诉说明"></el-input>
- <span class="tip description" v-show="descriptionTip">请描述您申诉的原因,并尽可能多地列举出证明此账号为您所有的证据</span>
- </el-form-item>
- <el-form-item prop="contactName">
- <el-input type="text" v-model="account.contactName" auto-complete="off" placeholder="姓名"></el-input>
- </el-form-item>
- <el-form-item prop="contactTel">
- <el-input type="text" v-model="account.contactTel" auto-complete="off" placeholder="联系电话"></el-input>
- </el-form-item>
- <el-form-item prop="contactEmail">
- <el-input type="text" v-model="account.contactEmail" auto-complete="off" placeholder="电子邮箱"></el-input>
- </el-form-item>
- <el-form-item>
- <a class="btn finish"
- @click="submit"
- :disabled="!checked || !mobileChecked || !codeChecked || !passwordChecked || !descriptionChecked || !contactNameChecked || !contactTelChecked || !contactEmailChecked">提交</a>
- </el-form-item>
- <el-form-item>
- <el-checkbox name="type" v-model="checked" @click="checkboxChecked"></el-checkbox>
- <span class="agree">我已阅读并同意 <a href="/common/agreement">《优软云服务条款》</a></span>
- </el-form-item>
- </el-form>
- </div>
- </div>
- <div class="content" v-show="!goNextStep">
- <div class="content-top">
- <h3>账号申诉</h3>
- </div>
- <div class="content-bottom">
- <p class="passed"><img src="/images/all/pass.png" alt=""/>申诉已提交</p>
- <span>申诉内容已提交,请耐心等待审核</span>
- <div class="close-btn" @click="goCloudCenter">关闭</div>
- </div>
- </div>
- <loading v-show="isShowLoading"/>
- </div>
- </div>
- </template>
- <script>
- import Loading from '~components/common/loading/Loading.vue'
- export default {
- name: 'AccountAppeal',
- components: {
- Loading
- },
- data () {
- var validateMobile = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请填写正确的手机号'))
- this.getCodeBtnIsDisabled = true
- this.mobileChecked = false
- this.mobileExit = false
- } else {
- if (this.account.mobile !== '') {
- var reg = /^1[0-9]{10}$/
- if (!reg.test(value)) {
- callback(new Error('请填写正确的手机号'))
- this.getCodeBtnIsDisabled = true
- this.mobileChecked = false
- this.mobileExit = false
- } else {
- this.$http.get(`/update/user/mobile/hasRegister`, {params: {mobile: this.account.mobile}})
- .then(response => {
- if (response.data.content.hasRegister) {
- this.getCodeBtnIsDisabled = true
- this.mobileChecked = false
- this.mobileExit = true
- } else {
- this.getCodeBtnIsDisabled = false
- this.mobileChecked = true
- this.mobileExit = false
- }
- })
- }
- }
- callback()
- }
- }
- var validateCode = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请填写正确的验证码'))
- this.codeErrorChecked = false
- this.codeChecked = false
- } else {
- if (this.account.code !== '') {
- if (this.account.mobile === '') {
- callback(new Error('请先填写正确的验证码'))
- } else {
- if (this.token) {
- let param = new FormData()
- param.append('mobile', this.account.mobile)
- param.append('code', this.account.code)
- param.append('token', this.token)
- let config = {
- headers: {'Content-Type': 'multipart/form-data'}
- }
- this.$http.post(`/appeal/check/mobile`, param, config)
- .then(response => {
- if (response.data.success) {
- this.codeChecked = true
- this.codeErrorChecked = false
- } else {
- this.codeErrorChecked = true
- this.codeChecked = false
- return Promise.reject(response.data)
- }
- }).catch(err => {
- this.codeErrorMsg = err.errMsg
- // this.$message.error(err.errMsg)
- })
- } else {
- callback(new Error('请先获取验证码'))
- this.codeChecked = false
- this.codeErrorChecked = false
- }
- }
- }
- callback()
- }
- }
- var validatePassword = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请填写正确的密码'))
- this.passwordChecked = false
- } else {
- if (this.account.password !== '') {
- this.passwordChecked = true
- }
- callback()
- }
- }
- var validateDescription = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请填写申诉说明'))
- this.descriptionChecked = false
- this.descriptionTip = false
- } else {
- if (this.account.description !== '') {
- if (value.length >= 100) {
- callback(new Error('输入长度过长,100个字符以内'))
- this.descriptionChecked = false
- this.descriptionTip = false
- } else {
- this.descriptionChecked = true
- this.descriptionTip = false
- }
- }
- callback()
- }
- }
- var validateContactName = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请填写您的姓名'))
- this.contactNameChecked = false
- } else {
- if (this.account.contactName !== '') {
- if (value.length >= 20) {
- callback(new Error('输入长度过长,20个字符以内'))
- this.contactNameChecked = false
- } else {
- this.contactNameChecked = true
- }
- }
- callback()
- }
- }
- var validateContactTel = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请填写正确的联系电话'))
- this.contactTelChecked = false
- } else {
- if (this.account.contactTel !== '') {
- var reg = /^1[0-9]{10}$/
- if (!reg.test(value)) {
- callback(new Error('请填写正确的联系电话'))
- this.contactTelChecked = false
- } else {
- this.contactTelChecked = true
- }
- }
- callback()
- }
- }
- var validateContactEmail = (rule, value, callback) => {
- if (value === '') {
- callback(new Error('请填写正确的电子邮箱'))
- this.contactEmailChecked = false
- } else {
- if (this.account.contactEmail !== '') {
- var reg = /@/
- if (!reg.test(value)) {
- callback(new Error('请输入正确的邮箱地址格式'))
- this.contactEmailChecked = false
- } else {
- this.contactEmailChecked = true
- }
- }
- callback()
- }
- }
- return {
- goNextStep: true,
- account: {
- mobile: '',
- code: '',
- password: '',
- description: '',
- contactName: '',
- contactTel: '',
- contactEmail: ''
- },
- isShowLoading: false,
- codeErrorMsg: '',
- checked: true,
- sendAccountCode: true,
- account_time: 0,
- getCodeBtnIsDisabled: true,
- codeErrorChecked: false,
- descriptionTip: true,
- mobileChecked: false,
- codeChecked: false,
- passwordChecked: false,
- descriptionChecked: false,
- contactNameChecked: false,
- contactTelChecked: false,
- contactEmailChecked: false,
- mobileExit: false,
- rules: {
- mobile: [
- {validator: validateMobile, trigger: 'blur'}
- ],
- code: [
- {validator: validateCode, trigger: 'blur'}
- ],
- password: [
- {validator: validatePassword, trigger: 'blur'}
- ],
- description: [
- {validator: validateDescription, trigger: 'blur'}
- ],
- contactName: [
- {validator: validateContactName, trigger: 'blur'}
- ],
- contactTel: [
- {validator: validateContactTel, trigger: 'blur'}
- ],
- contactEmail: [
- {validator: validateContactEmail, trigger: 'blur'}
- ]
- }
- }
- },
- computed: {
- logged () {
- return this.$store.state.option.isLogin.data.content
- }
- },
- mounted () {
- // 验证是否登录
- this.$nextTick(() => {
- this.isLogin()
- // 刷新统计信息
- setInterval(() => {
- this.isLogin()
- }, 10000)
- })
- },
- methods: {
- // 判断我同意是否被选中
- checkboxChecked () {
- this.checked = !this.checked
- },
- // 判断用户是否登录
- isLogin () {
- if (this.logged && !this.logged.isLogin) {
- // 未登录跳到登录页面
- window.location.href = '/'
- }
- },
- // 获取校验码
- getCheckCode () {
- this.isShowLoading = true
- this.$http.get(`/appeal/check/mobile`, {params: {mobile: this.account.mobile, _operate: 'account'}})
- .then(response => {
- this.isShowLoading = false
- if (response.data.success) {
- this.token = response.data.content.token
- if (this.token !== '') {
- this.$message({
- message: '验证码已经发送到您的手机,请注意查收',
- type: 'success'
- })
- this.sendAccountCode = false
- this.account_time = 60
- var accountTime = setInterval(() => {
- this.account_time--
- if (this.account_time <= 0) {
- this.sendAccountCode = true
- clearInterval(accountTime)
- }
- }, 1000)
- }
- } else {
- return Promise.reject(response.data)
- }
- }).catch(err => {
- this.isShowLoading = false
- this.$message.error(err.errMsg)
- })
- },
- // 提交表单
- submit () {
- if (this.mobileChecked && this.codeChecked && this.passwordChecked && this.descriptionChecked && this.contactNameChecked && this.contactTelChecked && this.contactEmailChecked && this.checked) {
- this.isShowLoading = true
- let param = new FormData()
- param.append('mobile', this.account.mobile)
- param.append('code', this.account.code)
- param.append('password', this.account.password)
- param.append('description', this.account.description)
- param.append('contactName', this.account.contactName)
- param.append('contactTel', this.account.contactTel)
- param.append('contactEmail', this.account.contactEmail)
- param.append('token', this.token)
- param.append('appId', this.$store.state.option.appId)
- let config = {
- headers: {'Content-Type': 'multipart/form-data'}
- }
- this.$http.post('/appeal/account', param, config)
- .then(response => {
- this.isShowLoading = false
- if (response.data.success) {
- this.goNextStep = false
- } else {
- this.goNextStep = true
- return Promise.reject(response.data)
- }
- }).catch(err => {
- this.$message.error(err.errMsg)
- this.isShowLoading = false
- // this.codeErrorChecked = true
- // this.codeChecked = false
- this.account_time = 0
- })
- }
- },
- // 跳转至个人中心页面
- goCloudCenter () {
- if (this.$route.query.returnURL) {
- window.location.href = decodeURIComponent(this.$route.query.returnURL)
- } else {
- this.$router.push('/cloudcenter')
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .certification {
- margin: 0 auto;
- width: 100%;
- background: #eee;
- .container{
- padding-top: 50px;
- margin: 0 auto;
- width: 980px;
- text-align: center;
- .content{
- padding: 0 50px;
- margin: 50px auto 0;
- width: 100%;
- text-align: center;
- background: #fff;
- .content-top{
- height: 80px;
- line-height: 80px;
- h3{
- margin-bottom: 0;
- font-size: 24px;
- color: #000;
- border-bottom: 1px solid #dcdcdc;
- }
- .step{
- position: relative;
- margin-top: 10px;
- img{
- width: 315px;
- height: 46px;
- }
- .step-item{
- position: absolute;
- top: 45px;
- left: 265px;
- span{
- margin-right: 85px;
- font-size: 14px;
- color: #b4b4b4;
- }
- span.active {
- color: #0076ad;
- }
- }
- }
- }
- form {
- padding-bottom: 44px;
- margin-top: 36px;
- input{
- padding: 0 0 0 18px;
- width: 360px;
- height: 44px;
- line-height: 44px;
- font-size: 14px;
- color: #000;
- border-radius: 0;
- }
- span.tip{
- position: absolute;
- top: 0;
- right: -238px;
- font-size: 13px;
- color: #8c8c8c;
- a{
- font-size: 13px;
- color: #0076ad;
- }
- }
- span.tip.tip-mobile{
- top: 3px;
- right: -105px;
- color: #ff4949;
- font-size: 12px;
- }
- span.tip.description {
- top: 10px;
- right: -266px;
- width: 245px;
- line-height: 18px;
- text-align: left;
- }
- span.tip.codeError-tip {
- position: absolute;
- top: 3px;
- left: 378px;
- width: 200px;
- text-align: left;
- color: #ff4949;
- font-size: 12px;
- }
- i{
- position: absolute;
- top: 13px;
- left: 20px;
- font-size: 20px;
- color: #a0a0a0;
- }
- input[type='checkbox']{
- margin: 0 14px 0 55px;
- float: left;
- width: 16px;
- height: 16px;
- }
- span.agree{
- float: left;
- margin: 1px 0 0 10px;
- font-size: 14px;
- color: #8b8b8b;
- a{
- color: #0076ad;
- }
- }
- .form-group.agree{
- margin: 20px auto 0 !important;
- }
- .btn {
- margin: 34px 0 16px 0;
- width: 360px;
- height: 44px;
- line-height: 44px;
- font-size: 16px;
- color: #fff;
- background: #0076AD;
- border-radius: 3px;
- }
- }
- .content-bottom{
- margin-top: 35px;
- padding-bottom: 50px;
- p{
- font-size: 24px;
- color: #323232;
- img{
- margin-right: 20px;
- width: 30px;
- height: 28px;
- }
- }
- p.pass{
- font-size: 24px;
- color: #e77405;
- img{
- height: 30px;
- }
- }
- p.passed {
- color: #2ab300;
- img{
- height: 30px;
- }
- }
- span{
- display: inline-block;
- margin: 15px 0 140px 0;
- font-size: 14px;
- color: #8b8b8b;
- }
- .close-btn{
- margin: 0 auto;
- width: 200px;
- height: 36px;
- line-height: 36px;
- font-size: 14px;
- text-align: center;
- color: #323232;
- border: 1px solid #d2d2d2;
- border-radius: 3px;
- cursor: pointer ;
- }
- }
- }
- }
- }
- </style>
|