Commit ea1474f9 by 无尘

fix: 修改服务市场账号

parent 4f8049d3
.input-line-cell[data-v-4b4be42a]{position:relative;display:inline-block}.w-92[data-v-4b4be42a]{width:92px}.el-input-group[data-v-4b4be42a] .el-input-group__prepend{background:#fff}.w-340[data-v-4b4be42a]{width:340px}.w-340[data-v-4b4be42a] .el-input__inner{font-size:14px;color:#fff;background-color:hsla(0,0%,100%,.1)}.el-input[data-v-4b4be42a] .el-input__inner{font-size:14px;color:#606266;background-color:hsla(0,0%,100%,.1)}.el-input.is-disabled[data-v-4b4be42a]{opacity:.5}.el-input .is-disabled[data-v-4b4be42a] .el-input__inner{font-size:14px;color:#fff;background-color:hsla(0,0%,100%,.1)}.m-b-20[data-v-1d596291]{margin-bottom:20px}.m-l-20[data-v-17b8ac02]{margin-left:20px}.common-bottom-border[data-v-17b8ac02]{cursor:pointer;padding-bottom:2px;border-bottom:1px dashed #2f54eb}.app-market-body[data-v-17b8ac02]{min-height:100%;background:#fff;padding:20px}.app-market-body .app-market-list[data-v-17b8ac02]{width:100%;min-height:119px;margin-top:22px;background:#f5f7fa;padding:18px 26px;-webkit-box-sizing:border-box;box-sizing:border-box}.app-market-body .app-market-list .el-form-item[data-v-17b8ac02]{margin-bottom:10px} .input-line-cell[data-v-4b4be42a]{position:relative;display:inline-block}.w-92[data-v-4b4be42a]{width:92px}.el-input-group[data-v-4b4be42a] .el-input-group__prepend{background:#fff}.w-340[data-v-4b4be42a]{width:340px}.w-340[data-v-4b4be42a] .el-input__inner{font-size:14px;color:#fff;background-color:hsla(0,0%,100%,.1)}.el-input[data-v-4b4be42a] .el-input__inner{font-size:14px;color:#606266;background-color:hsla(0,0%,100%,.1)}.el-input.is-disabled[data-v-4b4be42a]{opacity:.5}.el-input .is-disabled[data-v-4b4be42a] .el-input__inner{font-size:14px;color:#fff;background-color:hsla(0,0%,100%,.1)}.m-b-20[data-v-ffdc0596]{margin-bottom:20px}.m-l-20[data-v-55fdf20c]{margin-left:20px}.common-bottom-border[data-v-55fdf20c]{cursor:pointer;padding-bottom:2px;border-bottom:1px dashed #2f54eb}.app-market-body[data-v-55fdf20c]{min-height:100%;background:#fff;padding:20px}.app-market-body .app-market-list[data-v-55fdf20c]{width:100%;min-height:119px;margin-top:22px;background:#f5f7fa;padding:18px 26px;-webkit-box-sizing:border-box;box-sizing:border-box}.app-market-body .app-market-list .el-form-item[data-v-55fdf20c]{margin-bottom:10px}
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-fbc05400"],{"195c":function(t,e,a){"use strict";var n=a("54dd"),o=a.n(n);o.a},"45bca":function(t,e,a){},"53b1":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-market-body"},[a("div",{staticClass:"app-market-account"},[a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"绑定服务市场账号后可购买应用。购买信息在服务市场可查看。",placement:"top-start"}},[a("span",{staticClass:"font-16 color-303133 font-w-600 common-bottom-border"},[t._v("服务市场账号")])]),a("el-button",{staticClass:"m-l-20",attrs:{type:"primary"},on:{click:t.addAcount}},[t._v("添加")]),a("el-button",{staticClass:"m-l-20",attrs:{type:"text",loading:t.loadRefesh},on:{click:t.refreshData}},[t._v("同步刷新 ")]),a("span",{staticClass:"font-12 color-909399 p-l-15"},[t._v("更新时间:"+t._s(t._f("formatTimeStamp")(t.marketAccount.updateTime)))])],1),a("div",{staticClass:"app-market-list"},[a("el-form",{ref:"form",attrs:{model:t.form,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"账号"}},[t._v("\n "+t._s(t.marketAccount.id||"--")+"\n ")]),a("el-form-item",{attrs:{label:"绑定时间"}},[t._v("\n "+t._s(t._f("formatTimeStamp")(t.marketAccount.bindDate))+" "+t._s(t.marketAccount.bindDate?"":"--")+"\n ")]),a("el-form-item",{attrs:{label:"绑定人"}},[t._v("\n "+t._s(t.marketAccount.bindName||"--")+"\n ")])],1)],1),t.showDialog?a("add-market-dialog",{on:{closeMarket:t.closeMarket}}):t._e()],1)},o=[],i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{title:"绑定服务市场账号",visible:t.dialogVisible,width:"600px","before-close":t.handleClose},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("div",{},[a("el-form",{ref:"ruleForm",attrs:{model:t.marketForm,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"手机号"}},[a("country-mobile",{attrs:{"nation-code":t.marketForm.nationCode,"input-width":480,"limit-class":"limit-color",holder:"请输入"},on:{"update:nationCode":function(e){return t.$set(t.marketForm,"nationCode",e)},"update:nation-code":function(e){return t.$set(t.marketForm,"nationCode",e)}},model:{value:t.marketForm.phoneNumber,callback:function(e){t.$set(t.marketForm,"phoneNumber",e)},expression:"marketForm.phoneNumber"}})],1),a("el-form-item",{attrs:{label:"验证码"}},[a("el-input",{staticStyle:{width:"398px"},attrs:{placeholder:"请输入验证码"},model:{value:t.marketForm.code,callback:function(e){t.$set(t.marketForm,"code",e)},expression:"marketForm.code"}}),a("el-button",{staticClass:"m-l-10",attrs:{disabled:t.disableBtn,type:"text"},on:{click:function(e){return t.sendCode()}}},[t._v(t._s(t.disableBtn&&60==t.countNum||!t.disableBtn&&t.countNum?"获取验证码":t.countNum+"s"))])],1)],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:t.handleClose}},[t._v("取消")]),a("el-button",{attrs:{type:"primary",loading:t.loadBtn},on:{click:function(e){return t.submitForm("ruleForm")}}},[t._v("确认")])],1)])},r=[],s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{class:["input-line-cell",t.limitClass],style:{width:t.inputWidth+"px"}},[a("el-input",{style:{width:t.inputWidth+"px"},attrs:{disabled:t.disflag,placeholder:t.holder},on:{blur:function(e){return t.inputBlur()}},nativeOn:{keyup:function(e){return function(e){return t.toInput(e)}(e)}},model:{value:t.itemValue,callback:function(e){t.itemValue=e},expression:"itemValue"}},[a("el-select",{staticClass:"w-92",attrs:{slot:"prepend",disabled:t.disflag},on:{change:t.changeCode},slot:"prepend",model:{value:t.selCode,callback:function(e){t.selCode=e},expression:"selCode"}},t._l(t.nationCodeList,(function(e,n){return a("el-option",{key:n+"option",attrs:{label:"+"+e.dictCode,value:e.dictCode}},[t._v(t._s(e.dictName+" +"+e.dictCode))])})),1)],1)],1)},c=[],l=(a("ac6a"),a("a481"),a("c5f6"),a("e230")),u=l["a"].getNationCode,d={name:"CountryMobile",props:{value:{type:[String,Number],default:""},nationCode:{type:[String,Number],default:"86"},inputWidth:{type:Number,default:167},holder:{type:String,default:"请输入"},disflag:{type:Boolean,default:!1},limitClass:{type:String,default:""}},data:function(){return{itemValue:this.value,selCode:this.nationCode||"86",nationCodeList:[]}},mounted:function(){var t=this;t.getNationalData(),t.itemValue=t.value||"",t.selCode=t.nationCode||"86"},methods:{changeCode:function(){var t=this;t.$emit("update:nationCode",t.selCode),t.$emit("input",t.itemValue)},toInput:function(t){var e=this;e.itemValue=t.target.value.replace(/[^0-9]/gi,""),e.$emit("input",e.itemValue)},inputBlur:function(){var t=this;t.$emit("input",t.itemValue)},getNationalData:function(){var t=this;u({}).then((function(e){var a=[];e.result.forEach((function(t){a=a.concat(t.datas)})),t.nationCodeList=a||[]})).catch((function(t){}))}},watch:{value:function(t,e){var a=this;a.itemValue=t||""},nationCode:function(t,e){var a=this;a.selCode=t||"86"}}},m=d,f=(a("195c"),a("2877")),h=Object(f["a"])(m,s,c,!1,null,"4b4be42a",null),p=h.exports,b=a("d157"),v=a("8e83"),g=a("a689"),k=a.n(g),C=a("5b4e"),w=v["a"].addMarketAccount,_=v["a"].postPhoneCode,N=v["a"].checkCode,A={name:"AddMarketDialog",components:{countryMobile:p},data:function(){return{dialogVisible:!0,loadBtn:!1,marketForm:{nationCode:"86",phoneNumber:"",code:""},disableBtn:!0,countNum:60}},methods:{countDown:function(){var t=this,e=setInterval((function(){if(0===t.countNum)return clearInterval(e),t.countNum=60,t.disableBtn=!1,!1;t.countNum--}),1e3)},sendCode:Object(b["a"])((function(){var t=this,e=t.marketForm,a=e.phoneNumber,n=e.nationCode;if(""==a)return C["a"].showmsg("手机号不能为空","warning"),!1;var o=new k.a("+"+n+a);if(!o.isValid()||!o.isMobile())return C["a"].showmsg("手机号格式不正确","warning"),!1;var i={phoneNumber:a,nationCode:n,type:1};_(i).then((function(e){if("0000"==e.code){t.disableBtn=!0,t.countDown();var o=String(a),i=o.substr(0,3)+"****"+o.substr(7,o.length-1);return C["a"].showmsg("已发送验证码到".concat(n||"86","-").concat(i),"success"),!1}C["a"].showmsg(e.message||"未知错误","warning")})).catch((function(t){}))}),300),checkCode:function(){var t=this,e=t.marketForm,a=e.phoneNumber,n=e.nationCode,o=e.code,i={phoneNumber:a,nationCode:n,type:1,code:o};return new Promise((function(e,a){N(i).then((function(t){if("0000"==t.code)return e(!0),!1;C["a"].showmsg(t.message||"未知错误","warning"),e(!1)})).catch((function(a){e(!1),t.$message.error({duration:1e3,message:a.message})}))}))},submitForm:Object(b["a"])((function(t){var e=this;e.$refs[t].validate((function(t){t&&e.postSave()}))}),300),postSave:function(){var t=this;t.loadBtn=!0;var e={};w(e).then((function(e){t.loadBtn=!1,"0000"==e.code?(C["a"].showmsg("操作成功","success"),t.$refs["ruleForm"].resetFields(),t.$emit("closeMarket",!0)):(C["a"].showmsg(e.message||"未知错误","warning"),t.$emit("closeMarket",!0))})).catch((function(e){t.loadBtn=!1}))},handleClose:function(){var t=this;t.$emit("closeMarket")}},watch:{marketForm:{handler:function(t){var e=this;t.phoneNumber&&(e.disableBtn=!1)},deep:!0}}},y=A,F=(a("9a3d"),Object(f["a"])(y,i,r,!1,null,"1d596291",null)),M=F.exports,D=v["a"].getMarketAccount,x=v["a"].refreshMarketAccount,B={name:"",components:{AddMarketDialog:M},data:function(){return{wxEnterpriseId:localStorage.getItem("haoBanUser")?JSON.parse(localStorage.getItem("haoBanUser")).wxEnterpriseId:"",marketAccount:{id:"",bindDate:"",bindName:"",updateTime:""},loadRefesh:!1,showDialog:!1}},mounted:function(){var t=this;t.getMarket()},methods:{refreshData:function(){var t=this;t.refreshMarketData()},refreshMarketData:function(){var t=this;t.loadRefesh=!0;var e={wxEnterpriseId:t.wxEnterpriseId};x(e).then((function(e){t.loadRefesh=!1,C["a"].showmsg("刷新成功","success"),t.getMarket()})).catch((function(e){t.loadRefesh=!1}))},addAcount:function(){var t=this;t.showDialog=!0},closeMarket:function(t){var e=this;e.showDialog=!1,t&&e.getMarket()},getMarket:function(){var t=this,e={};D(e).then((function(e){e.result||(t.marketAccount=e.result||{})})).catch((function(t){}))}},watch:{}},$=B,I=(a("ec1f"),Object(f["a"])($,n,o,!1,null,"17b8ac02",null));e["default"]=I.exports},"54dd":function(t,e,a){},"7dff":function(t,e,a){},"8e83":function(t,e,a){"use strict";var n=a("71f6"),o={getAppList:"/application-list",getAppDetail:"/application-detail",getMarketAccount:"/get-account-info",refreshMarketAccount:"/refesh-account-info",addMarketAccount:{url:"/bind-service-account",method:"post",useFormData:!0,useIntercept:!1},getAuthAppDetail:"/get-application-info",getAppAuthInfo:"/right-list",postAuthRights:"/oauth/authorize",postPhoneCode:{url:"/send-code",method:"post",useFormData:!0,useIntercept:!1},checkCode:{url:"/validate-code",method:"post",useFormData:!0,useIntercept:!1}};e["a"]=Object(n["a"])(o,"/hb-manage-web")},"9a3d":function(t,e,a){"use strict";var n=a("7dff"),o=a.n(n);o.a},ec1f:function(t,e,a){"use strict";var n=a("45bca"),o=a.n(n);o.a}}]);
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-10-16 14:22:10 * @Date: 2020-10-16 14:22:10
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-10-19 15:43:32 * @LastEditTime: 2020-10-20 15:27:34
--> -->
<!-- <!--
使用帮助 使用帮助
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
<div class=""> <div class="">
<el-form ref="ruleForm" :model="marketForm" label-width="80px"> <el-form ref="ruleForm" :model="marketForm" label-width="80px">
<el-form-item label="手机号"> <el-form-item label="手机号">
<country-mobile :nation-code.sync="marketForm.nationCode" :input-width="480" :limit-class="'limit-color'" v-model="marketForm.phoneNumber" :holder="'请输入'"></country-mobile> <country-mobile :nation-code.sync="marketForm.nationCode" :input-width="400" :limit-class="'limit-color'" v-model="marketForm.phoneNumber" :holder="'请输入手机号'"></country-mobile>
</el-form-item> </el-form-item>
<el-form-item label="验证码"> <el-form-item label="码">
<el-input v-model="marketForm.code" placeholder="请输入验证码" style="width:398px"></el-input><el-button class="m-l-10" :disabled="disableBtn" type="text" @click="sendCode()">{{ (disableBtn && countNum == 60) || (!disableBtn && !!countNum) ? '获取验证码' : countNum + 's' }}</el-button> <el-input v-model="marketForm.password" placeholder="请输入密码" style="width:400px" maxlength="16"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -33,8 +33,7 @@ ...@@ -33,8 +33,7 @@
import countryMobile from '@/components/common/country-mobile.vue'; import countryMobile from '@/components/common/country-mobile.vue';
import { _debounce } from '@/common/js/public'; import { _debounce } from '@/common/js/public';
import fetch from '@/api/app-controls'; import fetch from '@/api/app-controls';
import PhoneNumber from 'awesome-phonenumber'; const { addMarketAccount } = fetch;
const { addMarketAccount, postPhoneCode, checkCode } = fetch;
import showMsg from '@/common/js/showmsg'; import showMsg from '@/common/js/showmsg';
export default { export default {
name: 'AddMarketDialog', name: 'AddMarketDialog',
...@@ -48,7 +47,7 @@ export default { ...@@ -48,7 +47,7 @@ export default {
marketForm: { marketForm: {
nationCode: '86', nationCode: '86',
phoneNumber: '', phoneNumber: '',
code: '' password: ''
}, },
disableBtn: true, // 发验证码.默认无手机号,不可点击 disableBtn: true, // 发验证码.默认无手机号,不可点击
countNum: 60, countNum: 60,
...@@ -56,94 +55,6 @@ export default { ...@@ -56,94 +55,6 @@ export default {
}, },
methods: { methods: {
/** /**
* @description: 倒计时
* @author: 无尘
*/
countDown() {
const that = this;
let time = setInterval(function() {
if (that.countNum === 0) {
clearInterval(time);
that.countNum = 60;
that.disableBtn = false;
return false;
}
that.countNum--;
}, 1000);
},
/**
* @description: 发送验证码
* @returns {Boolean}
* @author: 无尘
*/
sendCode: _debounce(function() {
const that = this;
let { phoneNumber, nationCode } = that.marketForm;
if (phoneNumber == '' ) {
showMsg.showmsg('手机号不能为空', 'warning');
return false;
}
const pn = new PhoneNumber('+' + nationCode + phoneNumber);
if (!pn.isValid() || !pn.isMobile()) {
showMsg.showmsg('手机号格式不正确', 'warning');
return false;
}
let params = {
phoneNumber,
nationCode,
type: 1
// isTest: 1 , // 测试时使用
};
postPhoneCode(params)
.then(res => {
if (res.code == '0000') {
that.disableBtn = true;
that.countDown();
const phone = String(phoneNumber);
let handle = phone.substr(0, 3) + '****' + phone.substr(7, phone.length - 1);
showMsg.showmsg(`已发送验证码到${nationCode || '86'}-${handle}`, 'success');
return false;
}
showMsg.showmsg(res.message || '未知错误', 'warning');
})
.catch(function(error) {
});
}, 300),
/**
* @description: 校验验证码
* @returns {Function}
* @author: 无尘
*/
checkCode() {
const that = this;
let { phoneNumber, nationCode, code } = that.marketForm;
let params = {
phoneNumber,
nationCode,
type: 1,
code
};
return new Promise((resolve, reject) => {
checkCode(params)
.then(res => {
if (res.code == '0000') {
resolve(true);
return false;
}
showMsg.showmsg(res.message || '未知错误', 'warning');
resolve(false);
})
.catch(function(error) {
resolve(false);
that.$message.error({
duration: 1000,
message: error.message
});
});
});
},
/**
* @description: 保存 * @description: 保存
* @param {String} formName * @param {String} formName
* @author: 无尘 * @author: 无尘
...@@ -159,13 +70,17 @@ export default { ...@@ -159,13 +70,17 @@ export default {
postSave() { postSave() {
const that = this; const that = this;
that.loadBtn = true; that.loadBtn = true;
let { phoneNumber, nationCode, password } = that.marketForm;
const data = { const data = {
phoneNumber,
nationCode,
password
}; };
addMarketAccount(data) addMarketAccount(data)
.then(res => { .then(res => {
that.loadBtn = false; that.loadBtn = false;
if (res.code == '0000') { if (res.code == '0000') {
showMsg.showmsg('操作成功', 'success'); showMsg.showmsg('绑定成功', 'success');
that.$refs['ruleForm'].resetFields(); that.$refs['ruleForm'].resetFields();
that.$emit('closeMarket', true); that.$emit('closeMarket', true);
}else { }else {
......
...@@ -4,18 +4,18 @@ ...@@ -4,18 +4,18 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-10-16 11:46:25 * @Date: 2020-10-16 11:46:25
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-10-20 10:39:32 * @LastEditTime: 2020-10-20 15:15:23
--> -->
<template> <template>
<div class="app-market-body"> <div class="app-market-body">
<div class="app-market-account"> <div class="app-market-account">
<el-tooltip class="item" effect="dark" content="绑定服务市场账号后可购买应用。购买信息在服务市场可查看。" placement="top-start"> <span class="font-16 color-303133 font-w-600 common-bottom-border">服务市场账号</span></el-tooltip> <el-tooltip class="item" effect="dark" content="绑定服务市场账号后可购买应用。购买信息在服务市场可查看。" placement="top-start"> <span class="font-16 color-303133 font-w-600 common-bottom-border">服务市场账号</span></el-tooltip>
<el-button class="m-l-20" type="primary" @click="addAcount">添加</el-button> <el-button v-if="!marketAccount.id" class="m-l-20" type="primary" @click="addAcount">添加</el-button>
<el-button class="m-l-20" type="text" :loading="loadRefesh" @click="refreshData">同步刷新 </el-button> <el-button v-if="!!marketAccount.id" class="m-l-20" type="text" :loading="loadRefesh" @click="refreshData">同步刷新 </el-button>
<span class="font-12 color-909399 p-l-15">更新时间:{{ marketAccount.updateTime | formatTimeStamp}}</span> <span v-if="!!marketAccount.id" class="font-12 color-909399 p-l-15">更新时间:{{ marketAccount.updateTime | formatTimeStamp}}</span>
</div> </div>
<div class="app-market-list"> <div v-if="!!marketAccount.id" class="app-market-list">
<el-form ref="form" :model="form" label-width="120px"> <el-form ref="form" label-width="120px">
<el-form-item label="账号"> <el-form-item label="账号">
{{marketAccount.id || '--'}} {{marketAccount.id || '--'}}
</el-form-item> </el-form-item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment