修改部分样式问题,新增解析转义,修改buyer端没有第三方登录问题
parent
aaadc90b09
commit
8c864c207a
|
@ -3,10 +3,7 @@
|
||||||
<!-- 顶部logo -->
|
<!-- 顶部logo -->
|
||||||
<div class="top-content" @click='$refs.verify.show = false'>
|
<div class="top-content" @click='$refs.verify.show = false'>
|
||||||
<div class="logo-box">
|
<div class="logo-box">
|
||||||
<img
|
<img :src="$store.state.logoImg" @click="$router.push('/')" />
|
||||||
:src="$store.state.logoImg"
|
|
||||||
@click="$router.push('/')"
|
|
||||||
/>
|
|
||||||
<div>欢迎登录</div>
|
<div>欢迎登录</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,9 +13,7 @@
|
||||||
<Carousel loop :autoplay-speed="5000" class="login-carousel" arrow="never">
|
<Carousel loop :autoplay-speed="5000" class="login-carousel" arrow="never">
|
||||||
<CarouselItem>
|
<CarouselItem>
|
||||||
<div class="demo-carousel" @click='$refs.verify.show = false'>
|
<div class="demo-carousel" @click='$refs.verify.show = false'>
|
||||||
<img
|
<img src="https://wanmi-b2b.oss-cn-shanghai.aliyuncs.com/201811141632252680" />
|
||||||
src="https://wanmi-b2b.oss-cn-shanghai.aliyuncs.com/201811141632252680"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</CarouselItem>
|
</CarouselItem>
|
||||||
</Carousel>
|
</Carousel>
|
||||||
|
@ -32,99 +27,65 @@
|
||||||
<div @click="$router.push('signUp')">立即注册</div>
|
<div @click="$router.push('signUp')">立即注册</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 账号密码登录 -->
|
<!-- 账号密码登录 -->
|
||||||
<Form
|
<Form ref="formInline" :model="formData" :rules="ruleInline" v-show="type === true"
|
||||||
ref="formInline"
|
@click.self='$refs.verify.show = false'>
|
||||||
:model="formData"
|
|
||||||
:rules="ruleInline"
|
|
||||||
v-show="type === true"
|
|
||||||
@click.self='$refs.verify.show = false'
|
|
||||||
>
|
|
||||||
<FormItem prop="username">
|
<FormItem prop="username">
|
||||||
<i-input
|
<i-input type="text" v-model="formData.username" clearable placeholder="用户名">
|
||||||
type="text"
|
|
||||||
v-model="formData.username"
|
|
||||||
clearable
|
|
||||||
placeholder="用户名"
|
|
||||||
>
|
|
||||||
<Icon type="md-person" slot="prepend"></Icon>
|
<Icon type="md-person" slot="prepend"></Icon>
|
||||||
</i-input>
|
</i-input>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem prop="password">
|
<FormItem prop="password">
|
||||||
<i-input
|
<i-input type="password" v-model="formData.password" clearable placeholder="密码">
|
||||||
type="password"
|
|
||||||
v-model="formData.password"
|
|
||||||
clearable
|
|
||||||
placeholder="密码"
|
|
||||||
>
|
|
||||||
<Icon type="md-lock" slot="prepend"> </Icon>
|
<Icon type="md-lock" slot="prepend"> </Icon>
|
||||||
</i-input>
|
</i-input>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<Button
|
<Button type="error" @click.stop="handleSubmit('formInline')" long>登录</Button>
|
||||||
type="error"
|
|
||||||
@click.stop="handleSubmit('formInline')"
|
|
||||||
long
|
|
||||||
>登录</Button>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
<!-- 验证码登录 -->
|
<!-- 验证码登录 -->
|
||||||
<Form
|
<Form ref="formSms" :model="formSms" :rules="ruleInline" v-show="type === false"
|
||||||
ref="formSms"
|
@click.self='$refs.verify.show = false'>
|
||||||
:model="formSms"
|
|
||||||
:rules="ruleInline"
|
|
||||||
v-show="type === false"
|
|
||||||
@click.self='$refs.verify.show = false'
|
|
||||||
>
|
|
||||||
<FormItem prop="mobile">
|
<FormItem prop="mobile">
|
||||||
<i-input
|
<i-input type="text" v-model="formSms.mobile" clearable placeholder="手机号">
|
||||||
type="text"
|
|
||||||
v-model="formSms.mobile"
|
|
||||||
clearable
|
|
||||||
placeholder="手机号"
|
|
||||||
>
|
|
||||||
<Icon type="md-lock" slot="prepend"></Icon>
|
<Icon type="md-lock" slot="prepend"></Icon>
|
||||||
</i-input>
|
</i-input>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem prop="code">
|
<FormItem prop="code">
|
||||||
<i-input
|
<i-input type="text" v-model="formSms.code" placeholder="手机验证码">
|
||||||
type="text"
|
<Icon type="ios-text-outline" style="font-weight: bold" slot="prepend" />
|
||||||
v-model="formSms.code"
|
|
||||||
placeholder="手机验证码"
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
type="ios-text-outline"
|
|
||||||
style="font-weight: bold"
|
|
||||||
slot="prepend"
|
|
||||||
/>
|
|
||||||
<Button slot="append" @click="sendCode">{{ codeMsg }}</Button>
|
<Button slot="append" @click="sendCode">{{ codeMsg }}</Button>
|
||||||
</i-input>
|
</i-input>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<Button @click.stop="verifyBtnClick" long :type="verifyStatus?'success':'default'">{{verifyStatus?'验证通过':'点击完成安全验证'}}</Button>
|
<Button @click.stop="verifyBtnClick" long
|
||||||
|
:type="verifyStatus?'success':'default'">{{verifyStatus?'验证通过':'点击完成安全验证'}}</Button>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<Button
|
<Button type="error" @click="handleSubmit('formSms')" long>登录</Button>
|
||||||
type="error"
|
|
||||||
@click="handleSubmit('formSms')"
|
|
||||||
long
|
|
||||||
>登录</Button>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
<div class="regist">
|
<div class="regist">
|
||||||
<span @click="$router.push('forgetPassword')">忘记密码</span>
|
<span @click="$router.push('forgetPassword')">忘记密码</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="other-login">
|
<div class="other-login">
|
||||||
<Icon custom="icomoon icon-qq" color="" class="icon-hover" @click="handleWebLogin('QQ')"/>
|
<svg t="1631154795933" class="icon" @click="handleWebLogin('QQ')" viewBox="0 0 1024 1024" version="1.1"
|
||||||
<Icon custom="icomoon icon-wechat" color="" class="icon-hover" @click="handleWebLogin('WECHAT_PC')"/>
|
xmlns="http://www.w3.org/2000/svg" p-id="4969" width="32" height="32">
|
||||||
|
<path
|
||||||
|
d="M824.8 613.2c-16-51.4-34.4-94.6-62.7-165.3C766.5 262.2 689.3 112 511.5 112 331.7 112 256.2 265.2 261 447.9c-28.4 70.8-46.7 113.7-62.7 165.3-34 109.5-23 154.8-14.6 155.8 18 2.2 70.1-82.4 70.1-82.4 0 49 25.2 112.9 79.8 159-26.4 8.1-85.7 29.9-71.6 53.8 11.4 19.3 196.2 12.3 249.5 6.3 53.3 6 238.1 13 249.5-6.3 14.1-23.8-45.3-45.7-71.6-53.8 54.6-46.2 79.8-110.1 79.8-159 0 0 52.1 84.6 70.1 82.4 8.5-1.1 19.5-46.4-14.5-155.8z"
|
||||||
|
p-id="4970" fill="#1296db"></path>
|
||||||
|
</svg>
|
||||||
|
<svg t="1631154766336" class="icon" @click="handleWebLogin('WECHAT_PC')" viewBox="0 0 1024 1024" version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" p-id="3844" width="32" height="32">
|
||||||
|
<path
|
||||||
|
d="M683.058 364.695c11 0 22 1.016 32.943 1.976C686.564 230.064 538.896 128 370.681 128c-188.104 0.66-342.237 127.793-342.237 289.226 0 93.068 51.379 169.827 136.725 229.256L130.72 748.43l119.796-59.368c42.918 8.395 77.37 16.79 119.742 16.79 11 0 21.46-0.48 31.914-1.442a259.168 259.168 0 0 1-10.455-71.358c0.485-148.002 128.744-268.297 291.403-268.297l-0.06-0.06z m-184.113-91.992c25.99 0 42.913 16.79 42.913 42.575 0 25.188-16.923 42.579-42.913 42.579-25.45 0-51.38-16.85-51.38-42.58 0-25.784 25.93-42.574 51.38-42.574z m-239.544 85.154c-25.384 0-51.374-16.85-51.374-42.58 0-25.784 25.99-42.574 51.374-42.574 25.45 0 42.918 16.79 42.918 42.575 0 25.188-16.924 42.579-42.918 42.579z m736.155 271.655c0-135.647-136.725-246.527-290.983-246.527-162.655 0-290.918 110.88-290.918 246.527 0 136.128 128.263 246.587 290.918 246.587 33.972 0 68.423-8.395 102.818-16.85l93.809 50.973-25.93-84.677c68.907-51.93 120.286-119.815 120.286-196.033z m-385.275-42.58c-16.923 0-34.452-16.79-34.452-34.179 0-16.79 17.529-34.18 34.452-34.18 25.99 0 42.918 16.85 42.918 34.18 0 17.39-16.928 34.18-42.918 34.18z m188.165 0c-16.984 0-33.972-16.79-33.972-34.179 0-16.79 16.927-34.18 33.972-34.18 25.93 0 42.913 16.85 42.913 34.18 0 17.39-16.983 34.18-42.913 34.18z"
|
||||||
|
fill="#09BB07" p-id="3845"></path>
|
||||||
|
</svg>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 拼图验证码 -->
|
<!-- 拼图验证码 -->
|
||||||
<verify
|
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
|
||||||
ref="verify"
|
|
||||||
class="verify-con"
|
|
||||||
verifyType="LOGIN"
|
|
||||||
@change="verifyChange"
|
|
||||||
></verify>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="foot">
|
<div class="foot">
|
||||||
<Row type="flex" justify="space-around" class="help">
|
<Row type="flex" justify="space-around" class="help">
|
||||||
|
@ -142,57 +103,58 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as RegExp from '@/plugins/RegExp.js';
|
import * as RegExp from "@/plugins/RegExp.js";
|
||||||
import { md5 } from '@/plugins/md5.js';
|
import { md5 } from "@/plugins/md5.js";
|
||||||
import * as apiLogin from '@/api/login.js';
|
import * as apiLogin from "@/api/login.js";
|
||||||
import { sendSms } from '@/api/common.js';
|
import { sendSms } from "@/api/common.js";
|
||||||
import { webLogin, loginCallback } from '@/api/login.js';
|
import { webLogin, loginCallback } from "@/api/login.js";
|
||||||
import storage from '@/plugins/storage.js';
|
import storage from "@/plugins/storage.js";
|
||||||
import verify from '@/components/verify';
|
import verify from "@/components/verify";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Login',
|
name: "Login",
|
||||||
components: {
|
components: {
|
||||||
verify
|
verify,
|
||||||
},
|
},
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
type: true, // true 账号登录 false 验证码登录
|
type: true, // true 账号登录 false 验证码登录
|
||||||
formData: {
|
formData: {
|
||||||
// 登录表单
|
// 登录表单
|
||||||
username: '',
|
username: "",
|
||||||
password: ''
|
password: "",
|
||||||
},
|
},
|
||||||
formSms: { // 手机号登录
|
formSms: {
|
||||||
code: '',
|
// 手机号登录
|
||||||
mobile: ''
|
code: "",
|
||||||
|
mobile: "",
|
||||||
},
|
},
|
||||||
verifyStatus: false, // 是否图片验证通过
|
verifyStatus: false, // 是否图片验证通过
|
||||||
ruleInline: {
|
ruleInline: {
|
||||||
// 验证规则
|
// 验证规则
|
||||||
username: [{ required: true, message: '请输入用户名' }],
|
username: [{ required: true, message: "请输入用户名" }],
|
||||||
password: [
|
password: [
|
||||||
{ required: true, message: '请输入密码' },
|
{ required: true, message: "请输入密码" },
|
||||||
{ type: 'string', min: 6, message: '密码不能少于6位' }
|
{ type: "string", min: 6, message: "密码不能少于6位" },
|
||||||
],
|
],
|
||||||
mobile: [
|
mobile: [
|
||||||
{ required: true, message: '请输入手机号码' },
|
{ required: true, message: "请输入手机号码" },
|
||||||
{
|
{
|
||||||
pattern: RegExp.mobile,
|
pattern: RegExp.mobile,
|
||||||
message: '请输入正确的手机号'
|
message: "请输入正确的手机号",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
code: [{ required: true, message: '请输入手机验证码' }]
|
code: [{ required: true, message: "请输入手机验证码" }],
|
||||||
},
|
},
|
||||||
codeMsg: '发送验证码', // 验证码文字
|
codeMsg: "发送验证码", // 验证码文字
|
||||||
interval: null, // 定时器
|
interval: null, // 定时器
|
||||||
time: 60, // 倒计时
|
time: 60, // 倒计时
|
||||||
year: new Date().getFullYear()
|
year: new Date().getFullYear(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 登录
|
// 登录
|
||||||
handleSubmit (name) {
|
handleSubmit(name) {
|
||||||
this.$refs[name].validate((valid) => {
|
this.$refs[name].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.type) {
|
if (this.type) {
|
||||||
|
@ -202,17 +164,20 @@ export default {
|
||||||
apiLogin.smsLogin(data).then((res) => {
|
apiLogin.smsLogin(data).then((res) => {
|
||||||
this.$refs.verify.show = false;
|
this.$refs.verify.show = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('登录成功');
|
this.$Message.success("登录成功");
|
||||||
storage.setItem('accessToken', res.result.accessToken);
|
storage.setItem("accessToken", res.result.accessToken);
|
||||||
storage.setItem('refreshToken', res.result.refreshToken);
|
storage.setItem("refreshToken", res.result.refreshToken);
|
||||||
apiLogin.getMemberMsg().then((res) => {
|
apiLogin.getMemberMsg().then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
storage.setItem('userInfo', res.result);
|
storage.setItem("userInfo", res.result);
|
||||||
let query = this.$route.query;
|
let query = this.$route.query;
|
||||||
if (query.rePath) {
|
if (query.rePath) {
|
||||||
this.$router.push({path: query.rePath, query: JSON.parse(query.query)});
|
this.$router.push({
|
||||||
|
path: query.rePath,
|
||||||
|
query: JSON.parse(query.query),
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$router.push('/');
|
this.$router.push("/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -225,29 +190,29 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 发送手机验证码
|
// 发送手机验证码
|
||||||
sendCode () {
|
sendCode() {
|
||||||
if (this.time === 60) {
|
if (this.time === 60) {
|
||||||
if (this.formSms.mobile === '') {
|
if (this.formSms.mobile === "") {
|
||||||
this.$Message.warning('请先填写手机号');
|
this.$Message.warning("请先填写手机号");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.verifyStatus) {
|
if (!this.verifyStatus) {
|
||||||
this.$Message.warning('请先完成安全验证');
|
this.$Message.warning("请先完成安全验证");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let params = {
|
let params = {
|
||||||
mobile: this.formSms.mobile,
|
mobile: this.formSms.mobile,
|
||||||
verificationEnums: 'LOGIN'
|
verificationEnums: "LOGIN",
|
||||||
};
|
};
|
||||||
sendSms(params).then(res => {
|
sendSms(params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('验证码发送成功');
|
this.$Message.success("验证码发送成功");
|
||||||
let that = this;
|
let that = this;
|
||||||
this.interval = setInterval(() => {
|
this.interval = setInterval(() => {
|
||||||
that.time--;
|
that.time--;
|
||||||
if (that.time === 0) {
|
if (that.time === 0) {
|
||||||
that.time = 60;
|
that.time = 60;
|
||||||
that.codeMsg = '重新发送';
|
that.codeMsg = "重新发送";
|
||||||
that.verifyStatus = false;
|
that.verifyStatus = false;
|
||||||
clearInterval(that.interval);
|
clearInterval(that.interval);
|
||||||
} else {
|
} else {
|
||||||
|
@ -260,70 +225,82 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
verifyChange (con) { // 拼图验证码回显
|
verifyChange(con) {
|
||||||
|
// 拼图验证码回显
|
||||||
if (!con.status) return;
|
if (!con.status) return;
|
||||||
|
|
||||||
if (this.type === true) { // 账号密码登录
|
if (this.type === true) {
|
||||||
|
// 账号密码登录
|
||||||
let data = JSON.parse(JSON.stringify(this.formData));
|
let data = JSON.parse(JSON.stringify(this.formData));
|
||||||
data.password = md5(data.password);
|
data.password = md5(data.password);
|
||||||
this.$refs.verify.show = false;
|
this.$refs.verify.show = false;
|
||||||
this.$Spin.show();
|
this.$Spin.show();
|
||||||
apiLogin.login(data).then((res) => {
|
apiLogin
|
||||||
if (res.success) {
|
.login(data)
|
||||||
this.$Message.success('登录成功');
|
.then((res) => {
|
||||||
storage.setItem('accessToken', res.result.accessToken);
|
if (res.success) {
|
||||||
storage.setItem('refreshToken', res.result.refreshToken);
|
this.$Message.success("登录成功");
|
||||||
apiLogin.getMemberMsg().then((res) => {
|
storage.setItem("accessToken", res.result.accessToken);
|
||||||
this.$Spin.hide();
|
storage.setItem("refreshToken", res.result.refreshToken);
|
||||||
if (res.success) {
|
apiLogin.getMemberMsg().then((res) => {
|
||||||
storage.setItem('userInfo', res.result);
|
this.$Spin.hide();
|
||||||
let query = this.$route.query;
|
if (res.success) {
|
||||||
if (query.rePath) {
|
storage.setItem("userInfo", res.result);
|
||||||
this.$router.push({path: query.rePath, query: JSON.parse(query.query)});
|
let query = this.$route.query;
|
||||||
} else {
|
if (query.rePath) {
|
||||||
this.$router.push('/');
|
this.$router.push({
|
||||||
|
path: query.rePath,
|
||||||
|
query: JSON.parse(query.query),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$router.push("/");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
} else {
|
||||||
} else {
|
this.$Spin.hide();
|
||||||
|
this.$Message.error(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
this.$Spin.hide();
|
this.$Spin.hide();
|
||||||
this.$Message.error(res.message);
|
});
|
||||||
}
|
|
||||||
}).catch(() => {
|
|
||||||
this.$Spin.hide()
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
this.verifyStatus = true;
|
this.verifyStatus = true;
|
||||||
this.$refs.verify.show = false;
|
this.$refs.verify.show = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 开启滑块验证
|
// 开启滑块验证
|
||||||
verifyBtnClick () {
|
verifyBtnClick() {
|
||||||
if (!this.verifyStatus) {
|
if (!this.verifyStatus) {
|
||||||
this.$refs.verify.init();
|
this.$refs.verify.init();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleWebLogin (type) { // 第三方登录
|
handleWebLogin(type) {
|
||||||
|
// 第三方登录
|
||||||
webLogin(type);
|
webLogin(type);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted() {
|
||||||
let uuid = this.$route.query.state;
|
let uuid = this.$route.query.state;
|
||||||
if (uuid) {
|
if (uuid) {
|
||||||
storage.setItem('uuid', uuid);
|
storage.setItem("uuid", uuid);
|
||||||
loginCallback(uuid).then(res => {
|
loginCallback(uuid).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
const result = res.result;
|
const result = res.result;
|
||||||
storage.setItem('accessToken', result.accessToken);
|
storage.setItem("accessToken", result.accessToken);
|
||||||
storage.setItem('refreshToken', result.refreshToken);
|
storage.setItem("refreshToken", result.refreshToken);
|
||||||
apiLogin.getMemberMsg().then((res) => {
|
apiLogin.getMemberMsg().then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
storage.setItem('userInfo', res.result);
|
storage.setItem("userInfo", res.result);
|
||||||
let query = this.$route.query;
|
let query = this.$route.query;
|
||||||
if (query.rePath) {
|
if (query.rePath) {
|
||||||
this.$router.push({path: query.rePath, query: JSON.parse(query.query)});
|
this.$router.push({
|
||||||
|
path: query.rePath,
|
||||||
|
query: JSON.parse(query.query),
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$router.push('/');
|
this.$router.push("/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -332,7 +309,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
type (v) {
|
type(v) {
|
||||||
if (v) {
|
if (v) {
|
||||||
this.$refs.formInline.resetFields();
|
this.$refs.formInline.resetFields();
|
||||||
} else {
|
} else {
|
||||||
|
@ -341,10 +318,10 @@ export default {
|
||||||
this.verifyStatus = false;
|
this.verifyStatus = false;
|
||||||
this.$refs.verify.show = false;
|
this.$refs.verify.show = false;
|
||||||
clearInterval(this.interval);
|
clearInterval(this.interval);
|
||||||
this.codeMsg = '发送验证码';
|
this.codeMsg = "发送验证码";
|
||||||
this.time = 60;
|
this.time = 60;
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@ -402,30 +379,30 @@ export default {
|
||||||
top: 80px;
|
top: 80px;
|
||||||
right: 15%;
|
right: 15%;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
background:rgba(255,255,255,.8);
|
background: rgba(255, 255, 255, 0.8);
|
||||||
.account-number{
|
.account-number {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
>div:nth-child(2){
|
> div:nth-child(2) {
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.tab-switch{
|
.tab-switch {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
||||||
span:nth-child(1){
|
span:nth-child(1) {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
border-right: 1px solid #ddd;
|
border-right: 1px solid #ddd;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
span:nth-child(2){
|
span:nth-child(2) {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
&:hover{
|
&:hover {
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -433,7 +410,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.verify-con{
|
.verify-con {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 16%;
|
right: 16%;
|
||||||
top: 90px;
|
top: 90px;
|
||||||
|
@ -442,8 +419,11 @@ export default {
|
||||||
|
|
||||||
.other-login {
|
.other-login {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
.ivu-icon {
|
> svg {
|
||||||
font-size: 24px;
|
cursor: pointer;
|
||||||
|
width: 24px;
|
||||||
|
margin-right: 10px;
|
||||||
|
height: 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.regist {
|
.regist {
|
||||||
|
@ -477,7 +457,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.icon-hover{
|
.icon-hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -15,6 +15,23 @@ export function unitPrice(val, unit, location) {
|
||||||
}
|
}
|
||||||
return (unit || '') + price
|
return (unit || '') + price
|
||||||
}
|
}
|
||||||
|
// 转义
|
||||||
|
export function enCode(v1) {
|
||||||
|
var entry = {
|
||||||
|
"'": "'",
|
||||||
|
"<": "<",
|
||||||
|
">": ">",
|
||||||
|
"(": "(",
|
||||||
|
")": ")"
|
||||||
|
};
|
||||||
|
|
||||||
|
v1 = v1.replace(/(')|(<)|(>)|(()|())|\s/gi, function($0) {
|
||||||
|
return entry[$0] || $0;
|
||||||
|
});
|
||||||
|
|
||||||
|
return v1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单来源
|
* 订单来源
|
||||||
|
|
|
@ -4,9 +4,10 @@
|
||||||
<div class="mb_10">
|
<div class="mb_10">
|
||||||
<Button @click="addParent" icon="md-add">添加一级分类</Button>
|
<Button @click="addParent" icon="md-add">添加一级分类</Button>
|
||||||
</div>
|
</div>
|
||||||
<Table :load-data="handleLoadData" row-key="id" :loading="loading" :data="tableData" :columns="columns">
|
<Table class="table" :load-data="handleLoadData" row-key="id" :loading="loading" :data="tableData"
|
||||||
|
:columns="columns">
|
||||||
<template slot="action" slot-scope="scope">
|
<template slot="action" slot-scope="scope">
|
||||||
<Dropdown v-show="scope.row.level == 2" trigger="click">
|
<Dropdown v-show="scope.row.level == 2" trigger="click">
|
||||||
<Button size="small">
|
<Button size="small">
|
||||||
绑定
|
绑定
|
||||||
<Icon type="ios-arrow-down"></Icon>
|
<Icon type="ios-arrow-down"></Icon>
|
||||||
|
@ -19,7 +20,7 @@
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
||||||
|
|
||||||
<Dropdown trigger="click">
|
<Dropdown trigger="click">
|
||||||
<Button size="small">
|
<Button size="small">
|
||||||
操作
|
操作
|
||||||
<Icon type="ios-arrow-down"></Icon>
|
<Icon type="ios-arrow-down"></Icon>
|
||||||
|
@ -32,7 +33,8 @@
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
||||||
<Button v-show="scope.row.level != 2" type="primary" @click="addChildren(scope.row)" size="small" icon="md-add" style="margin-right: 5px">添加子分类
|
<Button v-show="scope.row.level != 2" type="primary" @click="addChildren(scope.row)" size="small"
|
||||||
|
icon="md-add" style="margin-right: 5px">添加子分类
|
||||||
</Button>
|
</Button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -41,7 +43,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot="deleteFlag" slot-scope="{row}">
|
<template slot="deleteFlag" slot-scope="{row}">
|
||||||
<Tag :class="{'ml_10': row.deleteFlag}" :color="row.deleteFlag == false ? 'success' : 'error'">{{row.deleteFlag == false ? '正常启用' : '禁用'}}</Tag>
|
<Tag :class="{'ml_10': row.deleteFlag}" :color="row.deleteFlag == false ? 'success' : 'error'">
|
||||||
|
{{row.deleteFlag == false ? '正常启用' : '禁用'}}</Tag>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
|
@ -107,7 +110,7 @@
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -126,15 +129,15 @@ import {
|
||||||
} from "@/api/goods";
|
} from "@/api/goods";
|
||||||
|
|
||||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||||
import {regular} from "@/utils";
|
import { regular } from "@/utils";
|
||||||
export default {
|
export default {
|
||||||
name: "goods-category",
|
name: "goods-category",
|
||||||
components: {
|
components: {
|
||||||
uploadPicInput
|
uploadPicInput,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
submitLoading:false, //加载状态
|
submitLoading: false, //加载状态
|
||||||
categoryList: [], // 分类列表
|
categoryList: [], // 分类列表
|
||||||
loading: false, // 加载状态
|
loading: false, // 加载状态
|
||||||
brands: [], //品牌集合
|
brands: [], //品牌集合
|
||||||
|
@ -168,9 +171,9 @@ export default {
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
formValidate: {
|
formValidate: {
|
||||||
commissionRate: [
|
commissionRate: [
|
||||||
{required: true, message: '请填写佣金比例'},
|
{ required: true, message: "请填写佣金比例" },
|
||||||
{pattern: regular.Integer, message: "佣金比例不能为负"},
|
{ pattern: regular.Integer, message: "佣金比例不能为负" },
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
|
@ -189,7 +192,6 @@ export default {
|
||||||
slot: "commissionRate",
|
slot: "commissionRate",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fixed: "right",
|
|
||||||
title: "操作",
|
title: "操作",
|
||||||
key: "action",
|
key: "action",
|
||||||
|
|
||||||
|
@ -466,4 +468,11 @@ export default {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
</style>
|
/deep/ .ivu-table-wrapper {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.table {
|
||||||
|
min-height: 100vh;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -88,7 +88,7 @@ export default {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu), .ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){
|
.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu), .ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){
|
||||||
color: #ed3f14;
|
color: $theme_color;
|
||||||
}
|
}
|
||||||
/deep/.ivu-menu-vertical .ivu-menu-item-group-title {
|
/deep/.ivu-menu-vertical .ivu-menu-item-group-title {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|
|
@ -195,9 +195,12 @@ export default {
|
||||||
this.$emit("on-change", this.data);
|
this.$emit("on-change", this.data);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(val) {
|
value: {
|
||||||
this.setData(val);
|
handler: function (val) {
|
||||||
|
// 赋值给富文本
|
||||||
|
this.setData(this.$options.filters.enCode(val));
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
@ -15,6 +15,23 @@ export function unitPrice(val, unit, location) {
|
||||||
}
|
}
|
||||||
return (unit || "") + price;
|
return (unit || "") + price;
|
||||||
}
|
}
|
||||||
|
// 转义
|
||||||
|
export function enCode(v1) {
|
||||||
|
var entry = {
|
||||||
|
"'": "'",
|
||||||
|
"<": "<",
|
||||||
|
">": ">",
|
||||||
|
"(": "(",
|
||||||
|
")": ")"
|
||||||
|
};
|
||||||
|
|
||||||
|
v1 = v1.replace(/(')|(<)|(>)|(()|())|\s/gi, function($0) {
|
||||||
|
return entry[$0] || $0;
|
||||||
|
});
|
||||||
|
|
||||||
|
return v1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单来源
|
* 订单来源
|
||||||
|
|
|
@ -250,4 +250,11 @@ export default {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
/deep/ .ivu-table-wrapper {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.table {
|
||||||
|
min-height: 100vh;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -73,3 +73,8 @@ export default {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu), .ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){
|
||||||
|
color: $theme_color;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -194,10 +194,10 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value: {
|
value: {
|
||||||
handler: function (val) {
|
handler: function (val) {
|
||||||
// 赋值给富文本
|
// 赋值给富文本
|
||||||
this.setData(val);
|
this.setData(this.$options.filters.enCode(val));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue