张雄 3 years ago
parent 28504d792b
commit eb381eda7d

@ -85,6 +85,12 @@ const router = [
...setting, ...setting,
] ]
}, },
{
path: "/rule",
name: "Rule",
title: "用户协议",
component: resolve => require(['@/views/Rule'], resolve)
},
{ {
path: "/login", path: "/login",
name: "Login", name: "Login",

@ -11,163 +11,164 @@
</a-col> --> </a-col> -->
<!-- <a-col :span="1" class="box-cen"></a-col> --> <!-- <a-col :span="1" class="box-cen"></a-col> -->
<!-- 登录 --> <!-- 登录 -->
<a-col class="box-b" v-if="status === 1"> <a-col class="box-b" v-if="status === 1">
<a-tabs v-model="activeName" @change="tabsSwitch"> <a-tabs v-model="activeName" @change="tabsSwitch">
<!-- <a-tab-pane key="1" tab="密码登录"> <!-- <a-tab-pane key="1" tab="密码登录">
</a-tab-pane> --> </a-tab-pane> -->
<a-tab-pane key="2" tab="验证码登录"> </a-tab-pane> <a-tab-pane key="2" tab="验证码登录"> </a-tab-pane>
</a-tabs> </a-tabs>
<div class="login-input" v-if="activeName === '1'"> <div class="login-input" v-if="activeName === '1'">
<a-input placeholder="请输入手机号码"></a-input> <a-input placeholder="请输入手机号码"></a-input>
<a-input type="password" placeholder="请输入密码"></a-input> <a-input type="password" placeholder="请输入密码"></a-input>
<a-row> <!-- <a-row>
<a-col :span="12" style="margin-left: 23px" <a-col :span="12" style="margin-left: 23px"
><a-checkbox></a-checkbox>&nbsp;&nbsp;</a-col ><a-checkbox></a-checkbox>&nbsp;&nbsp;</a-col
>
</a-row>
<a-button
type="primary"
@click="login"
style="width: 90%; margin: 30px"
>
登录
</a-button>
<a-row style="margin-top: 20px; margin-left: 23px">
<a-col :span="14">
<a-checkbox></a-checkbox>&nbsp;&nbsp;
</a-col>
<a-col :span="10">
<span class="logintext" @click="status = 3">忘记密码</span
>&nbsp;&nbsp;&nbsp;&nbsp;<span
class="logintext"
@click="status = 2"
>免费注册</span
> >
</a-col> </a-row> -->
</a-row> <a-button
</div> type="primary"
<div class="login-input" v-else-if="activeName === '2'"> @click="login"
<a-cascader style="width: 90%; margin: 30px"
:options="cityList"
placeholder="请选择城市"
v-model="cityvalue"
:show-search="{ filter }"
@change="onChange"
:field-names="{
label: 'name',
value: 'id',
children: 'cityList',
}"
/>
<span class="form">
<a-select
v-model="communityCode"
notFoundContent="该城市无可选择小区"
:disabled="cityvalue.length === 0"
placeholder="请选择小区"
> >
<a-select-option 登录
v-for="item in communityList" </a-button>
:key="item.id" <a-row style="margin-top: 20px; margin-left: 23px">
:value="item.code" <a-col :span="14">
>{{ item.name }}</a-select-option <a-checkbox></a-checkbox>&nbsp;&nbsp;我已同意<a href="/#/rule" target="tar">用户协议</a>
</a-col>
<a-col :span="10">
<span class="logintext" @click="status = 3">忘记密码</span
>&nbsp;&nbsp;&nbsp;&nbsp;<span
class="logintext"
@click="status = 2"
>免费注册</span
>
</a-col>
</a-row>
</div>
<div class="login-input" v-else-if="activeName === '2'">
<a-cascader
:options="cityList"
placeholder="请选择城市"
v-model="cityvalue"
:show-search="{ filter }"
@change="onChange"
:field-names="{
label: 'name',
value: 'id',
children: 'cityList',
}"
/>
<span class="form">
<a-select
v-model="communityCode"
notFoundContent="该城市无可选择小区"
:disabled="cityvalue.length === 0"
placeholder="请选择小区"
> >
</a-select> <a-select-option
<a-input v-for="item in communityList"
placeholder="请输入手机号码" :key="item.id"
v-model="form.tel" :value="item.code"
></a-input> >{{ item.name }}</a-select-option
<a-input >
placeholder="请输入验证码" </a-select>
v-model="form.code" <a-input
style="width: 60%" placeholder="请输入手机号码"
></a-input> v-model="form.tel"
</span> ></a-input>
<a-button type="primary" @click="getCode"></a-button> <a-input
<a-row> placeholder="请输入验证码"
<a-col :span="12" style="margin-left: 23px" v-model="form.code"
><a-checkbox></a-checkbox>&nbsp;&nbsp;</a-col style="width: 60%"
> ></a-input>
</a-row> </span>
<a-button <a-button type="primary" @click="getCode"></a-button>
type="primary" <!-- <a-row>
@click="login" <a-col :span="12" style="margin-left: 23px"
style=" ><a-checkbox></a-checkbox>&nbsp;&nbsp;</a-col
width: 90%;
margin-left: 30px;
margin-top: 20px;
height:38px;
margin-bottom: 10px;
"
>
登录
</a-button>
<a-row style="margin-top: 20px; margin-left: 23px">
<a-col :span="14">
<a-checkbox></a-checkbox>&nbsp;&nbsp;
</a-col>
<a-col :span="10">
<span class="logintext" @click="status = 3">忘记密码</span
>&nbsp;&nbsp;&nbsp;&nbsp;<span
class="logintext"
@click="status = 2"
>免费注册</span
> >
</a-col> </a-row> -->
</a-row> <a-button
</div> type="primary"
</a-col> @click="login"
<!-- 注册 --> style="
<a-col class="box-b" v-if="status === 2"> width: 90%;
<div class="cardTitle">新建账号</div> margin-left: 30px;
<a-form-model margin-top: 20px;
ref="ruleForm" height:38px;
:model="form" margin-bottom: 10px;
:rules="rules"
layout="vertical"
>
<a-form-model-item ref="tel" label="手机号码" prop="tel">
<a-input
v-model="form.tel"
style="width: 100%"
placeholder="请输入手机号"
@blur="
() => {
$refs.tel.onFieldBlur();
}
" "
/> >
<a-row style="margin-top: 20px"> 登录
<a-col :span="16" style="margin-right: 10px"> </a-button>
<a-input <a-row style="margin-top: 20px; margin-left: 23px">
style="width: 100%" <a-col :span="14">
v-model="form.verificationCode" <a-checkbox v-model="isChecked"></a-checkbox>&nbsp;&nbsp;我已同意<a href="/#/rule" target="tar">用户协议</a>
placeholder="请输入验证码"
/>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="10">
<a-button type="primary" @click="getCode" <span class="logintext" @click="status = 3">忘记密码</span
>获取验证码</a-button >&nbsp;&nbsp;&nbsp;&nbsp;<span
class="logintext"
@click="status = 2"
>免费注册</span
> >
</a-col> </a-col>
</a-row> </a-row>
</a-form-model-item> </div>
<a-form-model-item label="设置密码" prop="psw"> </a-col>
<a-input placeholder="请输入密码" /> <!-- 注册 -->
</a-form-model-item> <a-col class="box-b" v-if="status === 2">
<a-form-model-item label="确认密码" prop="confirmPsw"> <div class="cardTitle">新建账号</div>
<a-input placeholder="请再次输入密码" /> <a-form-model
</a-form-model-item> ref="ruleForm"
<a-form-model-item> :model="form"
<a-button type="primary" style="width: 100%"> 确定 </a-button> :rules="rules"
</a-form-model-item> layout="vertical"
<a-form-model-item> >
<span>已有账号</span <a-form-model-item ref="tel" label="手机号码" prop="tel">
><span class="logintext" @click="status = 1">登录</span> <a-input
</a-form-model-item> v-model="form.tel"
</a-form-model> style="width: 100%"
</a-col> placeholder="请输入手机号"
@blur="
() => {
$refs.tel.onFieldBlur();
}
"
/>
<a-row style="margin-top: 20px">
<a-col :span="16" style="margin-right: 10px">
<a-input
style="width: 100%"
v-model="form.verificationCode"
placeholder="请输入验证码"
/>
</a-col>
<a-col :span="6">
<a-button type="primary" @click="getCode"
>获取验证码</a-button
>
</a-col>
</a-row>
</a-form-model-item>
<a-form-model-item label="设置密码" prop="psw">
<a-input placeholder="请输入密码" />
</a-form-model-item>
<a-form-model-item label="确认密码" prop="confirmPsw">
<a-input placeholder="请再次输入密码" />
</a-form-model-item>
<a-form-model-item>
<a-button type="primary" style="width: 100%"> 确定 </a-button>
</a-form-model-item>
<a-form-model-item>
<span>已有账号</span
><span class="logintext" @click="status = 1">登录</span>
</a-form-model-item>
</a-form-model>
</a-col>
<!-- 找回密码 --> <!-- 找回密码 -->
<a-col class="box-b" v-if="status === 3"> <a-col class="box-b" v-if="status === 3">
<div class="cardTitle">找回密码</div> <div class="cardTitle">找回密码</div>
@ -235,6 +236,7 @@ export default {
tel: "", tel: "",
code: "", code: "",
}, },
isChecked: false,
communityCode: undefined, communityCode: undefined,
rules: { rules: {
tel: [ tel: [
@ -334,7 +336,11 @@ export default {
if (this.communityCode === undefined) { if (this.communityCode === undefined) {
this.$message.error("先选择小区"); this.$message.error("先选择小区");
return; return;
} };
if (this.isChecked == false) {
this.$message.error("请阅读并同意《用户协议》");
return;
};
loginTel(this.form).then((res) => { loginTel(this.form).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.msg); this.$message.success(res.msg);
@ -352,10 +358,10 @@ export default {
this.$message.error("先选择小区"); this.$message.error("先选择小区");
return; return;
} }
console.log(this.getCommunityCode);
sendTelCode(this.form).then((res) => { sendTelCode(this.form).then((res) => {
if (res) { if (res) {
this.$message.success(res.msg + " " + res.data); console.log(res)
this.$message.success(res.msg);
} }
}); });
}, },

@ -10,7 +10,7 @@ export const form = {
} }
const handleConfirm = (rule,value,callback) => { const handleConfirm = (rule,value,callback) => {
if(value.length != 20) { if(value.length != 18) {
callback('请输入正确的格式') callback('请输入正确的格式')
}; };
callback(); callback();
@ -21,7 +21,7 @@ export const rules = {
contact:[{required:true,message:'请输入联系方式',trigger:'blur'}], contact:[{required:true,message:'请输入联系方式',trigger:'blur'}],
tel:[{required:true,message:'请输入',trigger:'blur'}], tel:[{required:true,message:'请输入',trigger:'blur'}],
idType:[{required:true,message:'请选择',trigger:'change'}], idType:[{required:true,message:'请选择',trigger:'change'}],
idNumber:[{required:true,message:'请输入证件号码',trigger:['blur','change']},{validator: (rule,value,callback) => handleConfirm(rule,value,callback)}], idNumber:[{required:true,message:'请输入证件号码',trigger:'blur'},{validator: (rule,value,callback) => handleConfirm(rule,value,callback)}],
remarks:[{required:true,message:'请输入备注',trigger:'blur'}], remarks:[{required:true,message:'请输入备注',trigger:'blur'}],
} }
export const options = { export const options = {

@ -118,6 +118,7 @@ export default {
this.addClose() this.addClose()
}, },
submit() { submit() {
// console.log(this.form)
this.$refs.ruleForm.validate(async (valid) => { this.$refs.ruleForm.validate(async (valid) => {
if (valid) { if (valid) {
if(this.editId === null) { if(this.editId === null) {
@ -153,6 +154,7 @@ export default {
if(val!==null){ if(val!==null){
this.title = '修改话题' this.title = '修改话题'
this.form.id = val this.form.id = val
this.form.imgUrls = [];
topicInfo({topicId:val}).then(res=>{ topicInfo({topicId:val}).then(res=>{
let data = res.data let data = res.data
this.form.title = data.title this.form.title = data.title
@ -161,7 +163,6 @@ export default {
this.form.isPublic = data.isPublic this.form.isPublic = data.isPublic
this.form.isRating = data.isRating this.form.isRating = data.isRating
if(data.imgList.length>0){ if(data.imgList.length>0){
console.log(data.imgList);
const pic = [] const pic = []
for(let item of data.imgList){ for(let item of data.imgList){
let obj = { let obj = {
@ -174,6 +175,7 @@ export default {
pic.push(obj) pic.push(obj)
} }
this.fileList = pic this.fileList = pic
// this.form.imgUrls.push(pic[0].name)
} }
}) })
}else{ }else{

@ -2,7 +2,7 @@
<div> <div>
<div class="cardTitle">品牌管理</div> <div class="cardTitle">品牌管理</div>
<searchForm :formItem="formItem" @getSearch="search($event)"></searchForm> <searchForm :formItem="formItem" @getSearch="search($event)"></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true" <a-button style="margin: 10px" class="add-btn" @click="handlerAdd"
>新增品牌</a-button >新增品牌</a-button
> >
<a-table <a-table
@ -41,7 +41,7 @@
</span> </span>
</div> </div>
<a-drawer <a-drawer
:title="drawer.title" :title="activeMode==1?'新增品牌':'修改品牌'"
:width="720" :width="720"
:visible="drawer.show" :visible="drawer.show"
:body-style="{ paddingBottom: '80px' }" :body-style="{ paddingBottom: '80px' }"
@ -102,6 +102,8 @@ export default {
pagination, pagination,
// index // index
selectedRowKeys: [], selectedRowKeys: [],
//
activeMode: 1, //12
}; };
}, },
mounted() { mounted() {
@ -123,10 +125,10 @@ export default {
this.selectedRowKeys = []; this.selectedRowKeys = [];
}, },
edit(data) { edit(data) {
this.activeMode = 2;
this.form.brandName = data.brandName this.form.brandName = data.brandName
this.form.id = data.id this.form.id = data.id
this.drawer.show = true; this.drawer.show = true;
this.drawer.title = '修改品牌';
}, },
del(ids) { del(ids) {
this.$confirm({ this.$confirm({
@ -165,16 +167,19 @@ export default {
this.pagination = pager; this.pagination = pager;
this.getData(); this.getData();
}, },
//
handlerAdd() {
this.activeMode = 1;
this.drawer.show = true
},
addClose() { addClose() {
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
this.drawer.show = false; this.drawer.show = false;
this.drawer.title = '新增品牌';
}, },
submit() { submit() {
console.log(this.form);
this.$refs.ruleForm.validate(async (valid) => { this.$refs.ruleForm.validate(async (valid) => {
if (valid) { if (valid) {
if (this.form.id === null) { if (this.activeMode == 1) {
let res = await brandInsert(this.form); let res = await brandInsert(this.form);
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.msg); this.$message.success(res.msg);
@ -183,8 +188,7 @@ export default {
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
} else { } else if (this.activeMode == 2) {
console.log(this.form);
let res = await brandUpdate(this.form); let res = await brandUpdate(this.form);
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.msg); this.$message.success(res.msg);

@ -25,7 +25,7 @@
> >
<span slot="action" slot-scope="text, row"> <span slot="action" slot-scope="text, row">
<a-space> <a-space>
<a v-if="row.status == 1" class="ant-dropdown-link" @click="push(row.id)"></a> <a v-if="row.status == 0 && row.appShopPush == 0" class="ant-dropdown-link" @click="push(row.id)"></a>
</a-space> </a-space>
</span> </span>
<span slot="mainPhoto" slot-scope="text, row"> <span slot="mainPhoto" slot-scope="text, row">

@ -2,7 +2,7 @@
<div> <div>
<div class="cardTitle">店铺管理</div> <div class="cardTitle">店铺管理</div>
<searchForm :formItem="formItem" @getSearch="search($event)"></searchForm> <searchForm :formItem="formItem" @getSearch="search($event)"></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true" <a-button style="margin: 10px" class="add-btn" @click="handlerAdd"
>新增店铺</a-button >新增店铺</a-button
> >
<a-table <a-table
@ -41,7 +41,7 @@
</span> </span>
</div> </div>
<a-drawer <a-drawer
:title="drawer.title" :title="activeMode == 1?'新增店铺':'修改店铺'"
:width="720" :width="720"
:visible="drawer.show" :visible="drawer.show"
:body-style="{ paddingBottom: '80px' }" :body-style="{ paddingBottom: '80px' }"
@ -102,6 +102,7 @@ export default {
pagination, pagination,
// index // index
selectedRowKeys: [], selectedRowKeys: [],
activeMode: 1,//12
}; };
}, },
mounted() { mounted() {
@ -123,10 +124,10 @@ export default {
this.selectedRowKeys = []; this.selectedRowKeys = [];
}, },
edit(data) { edit(data) {
this.activeMode = 2;
this.form.shopName = data.shopName this.form.shopName = data.shopName
this.form.id = data.id this.form.id = data.id
this.drawer.show = true; this.drawer.show = true;
this.drawer.title = '修改店铺';
}, },
del(ids) { del(ids) {
this.$confirm({ this.$confirm({
@ -156,6 +157,13 @@ export default {
this.del(this.selectedRowKeys); this.del(this.selectedRowKeys);
} }
}, },
//
handlerAdd() {
this.activeMode = 1;
this.form.shopName = '';
this.form.id = undefined;
this.drawer.show = true
},
// //
handleTableChange(pagination) { handleTableChange(pagination) {
console.log(pagination); console.log(pagination);
@ -168,13 +176,12 @@ export default {
addClose() { addClose() {
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
this.drawer.show = false; this.drawer.show = false;
this.drawer.title = '新增店铺';
}, },
submit() { submit() {
console.log(this.form); console.log(this.form);
this.$refs.ruleForm.validate(async (valid) => { this.$refs.ruleForm.validate(async (valid) => {
if (valid) { if (valid) {
if (this.form.id === null) { if (this.activeMode == 1) {
let res = await shopInsert(this.form); let res = await shopInsert(this.form);
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.msg); this.$message.success(res.msg);

Binary file not shown.
Loading…
Cancel
Save