张雄 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",

@ -20,11 +20,11 @@
<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-row> -->
<a-button <a-button
type="primary" type="primary"
@click="login" @click="login"
@ -34,7 +34,7 @@
</a-button> </a-button>
<a-row style="margin-top: 20px; margin-left: 23px"> <a-row style="margin-top: 20px; margin-left: 23px">
<a-col :span="14"> <a-col :span="14">
<a-checkbox></a-checkbox>&nbsp;&nbsp; <a-checkbox></a-checkbox>&nbsp;&nbsp;我已同意<a href="/#/rule" target="tar">用户协议</a>
</a-col> </a-col>
<a-col :span="10"> <a-col :span="10">
<span class="logintext" @click="status = 3">忘记密码</span <span class="logintext" @click="status = 3">忘记密码</span
@ -46,6 +46,7 @@
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
<div class="login-input" v-else-if="activeName === '2'"> <div class="login-input" v-else-if="activeName === '2'">
<a-cascader <a-cascader
:options="cityList" :options="cityList"
@ -85,11 +86,11 @@
></a-input> ></a-input>
</span> </span>
<a-button type="primary" @click="getCode"></a-button> <a-button type="primary" @click="getCode"></a-button>
<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-row> -->
<a-button <a-button
type="primary" type="primary"
@click="login" @click="login"
@ -105,7 +106,7 @@
</a-button> </a-button>
<a-row style="margin-top: 20px; margin-left: 23px"> <a-row style="margin-top: 20px; margin-left: 23px">
<a-col :span="14"> <a-col :span="14">
<a-checkbox></a-checkbox>&nbsp;&nbsp; <a-checkbox v-model="isChecked"></a-checkbox>&nbsp;&nbsp;我已同意<a href="/#/rule" target="tar">用户协议</a>
</a-col> </a-col>
<a-col :span="10"> <a-col :span="10">
<span class="logintext" @click="status = 3">忘记密码</span <span class="logintext" @click="status = 3">忘记密码</span
@ -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