修改密码
This commit is contained in:
parent
066eb8004e
commit
77663be0a1
|
@ -170,4 +170,12 @@ export const mer_admin = {
|
|||
params: {},
|
||||
});
|
||||
},
|
||||
//编辑品牌信息
|
||||
editBrandInfo: (data) => {
|
||||
return $http.put(`/merchant-api/brand/edit`, data);
|
||||
},
|
||||
//修改密码
|
||||
changePassword: (data) => {
|
||||
return $http.put(`/merchant-api/brand/admin_password`, data);
|
||||
},
|
||||
};
|
||||
|
|
|
@ -43,10 +43,9 @@
|
|||
<div v-if="list.video" style="margin-left: 20px">
|
||||
<video
|
||||
id="videoPlayer"
|
||||
width="200px"
|
||||
height="100px"
|
||||
width="300px"
|
||||
height="200px"
|
||||
object-fit="fill"
|
||||
autoplay="true"
|
||||
muted="muted"
|
||||
loop
|
||||
controls
|
||||
|
@ -93,7 +92,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- 编辑品牌信息 -->
|
||||
<addOrUpdate ref="addOrUpdate"></addOrUpdate>
|
||||
<addOrUpdate @getList="getList" ref="addOrUpdate"></addOrUpdate>
|
||||
<!-- 修改密码 -->
|
||||
<changePassword ref="changePassword"></changePassword>
|
||||
</div>
|
||||
|
@ -136,6 +135,12 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
pause() {
|
||||
console.log("暂停播放");
|
||||
},
|
||||
ended() {
|
||||
console.log("播放结束");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -49,7 +49,11 @@ export default {
|
|||
});
|
||||
this.isAdd = true;
|
||||
},
|
||||
update: () => {
|
||||
update: (row) => {
|
||||
this.fileList = []
|
||||
this.modalData = JSON.parse(JSON.stringify(row));
|
||||
console.log(row);
|
||||
|
||||
this.isAdd = false;
|
||||
},
|
||||
};
|
||||
|
@ -61,36 +65,38 @@ export default {
|
|||
return [
|
||||
{
|
||||
label: "品牌名称",
|
||||
prop: "discount",
|
||||
prop: "name",
|
||||
type: "Input",
|
||||
width: "300px",
|
||||
rules: { required: true, message: "请输入品牌名称" },
|
||||
},
|
||||
{
|
||||
label: "品牌ID",
|
||||
prop: "limitCount",
|
||||
prop: "id",
|
||||
type: "Input",
|
||||
disabled: true,
|
||||
width: "300px",
|
||||
rules: { required: true, message: "请输入品牌ID" },
|
||||
},
|
||||
{
|
||||
label: "品牌LOGO",
|
||||
prop: "DiscountTi",
|
||||
prop: "logo",
|
||||
type: "Input",
|
||||
width: "300px",
|
||||
rules: { required: true, message: "请上传品牌LOGO" },
|
||||
type: "jsx",
|
||||
render: () => {
|
||||
const handleChange = (file, fileList) => {
|
||||
// console.log(fileList);
|
||||
};
|
||||
const handleAvatarSuccess = (res, file, fileList) => {
|
||||
this.modalData.logo = res.data;
|
||||
console.log(res, fileList);
|
||||
};
|
||||
const handleRemove = (file, fileList) => {
|
||||
console.log(file, fileList);
|
||||
};
|
||||
return (
|
||||
<div style="display: flex;">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action={this.$api.mer_admin.uploadFile()}
|
||||
|
@ -106,7 +112,7 @@ export default {
|
|||
}}
|
||||
multiple={true}
|
||||
file-list={this.fileList}
|
||||
list-type="picture"
|
||||
// list-type="picture"
|
||||
>
|
||||
<el-button size="small" type="primary">
|
||||
<i class="el-icon-upload"></i>点击上传
|
||||
|
@ -115,20 +121,29 @@ export default {
|
|||
只能上传jpg/png文件,且不超过500kb
|
||||
</div>
|
||||
</el-upload>
|
||||
<div style="margin-left:20px">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
src={this.modalData.logo}
|
||||
preview-src-list={[this.modalData.logo]}
|
||||
></el-image>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "品牌首页:",
|
||||
prop: "limitCoun",
|
||||
prop: "status",
|
||||
type: "Input",
|
||||
width: "300px",
|
||||
rules: { required: true, message: "请输入品牌ID" },
|
||||
type: "jsx",
|
||||
render: () => {
|
||||
return (
|
||||
<el-switch
|
||||
v-model={this.value1}
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
v-model={this.modalData.status}
|
||||
active-text="开启"
|
||||
inactive-text="禁用"
|
||||
></el-switch>
|
||||
|
@ -137,29 +152,28 @@ export default {
|
|||
},
|
||||
{
|
||||
label: "宣传语",
|
||||
prop: "limitCot",
|
||||
prop: "tagline",
|
||||
type: "Input",
|
||||
width: "300px",
|
||||
rules: { required: true, message: "请输入宣传语" },
|
||||
},
|
||||
{
|
||||
label: "首页背景",
|
||||
prop: "DiscountTime",
|
||||
prop: "background",
|
||||
type: "Input",
|
||||
width: "300px",
|
||||
rules: { required: true, message: "请上传背景图" },
|
||||
type: "jsx",
|
||||
render: () => {
|
||||
const handleChange = (file, fileList) => {
|
||||
// console.log(fileList);
|
||||
};
|
||||
const handleAvatarSuccess = (res, file, fileList) => {
|
||||
console.log(res, fileList);
|
||||
this.modalData.background = res.data;
|
||||
};
|
||||
const handleRemove = (file, fileList) => {
|
||||
console.log(file, fileList);
|
||||
};
|
||||
return (
|
||||
<div style="display: flex;">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action={this.$api.mer_admin.uploadFile()}
|
||||
|
@ -175,7 +189,7 @@ export default {
|
|||
}}
|
||||
multiple={true}
|
||||
file-list={this.fileList}
|
||||
list-type="picture"
|
||||
// list-type="picture"
|
||||
>
|
||||
<el-button size="small" type="primary">
|
||||
<i class="el-icon-upload"></i>点击上传
|
||||
|
@ -184,27 +198,36 @@ export default {
|
|||
只能上传jpg/png文件,且不超过500kb
|
||||
</div>
|
||||
</el-upload>
|
||||
<div style="margin-left:20px">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
src={this.modalData.background}
|
||||
preview-src-list={[this.modalData.background]}
|
||||
></el-image>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "视频",
|
||||
prop: "DiscountTim",
|
||||
prop: "video",
|
||||
type: "Input",
|
||||
width: "300px",
|
||||
rules: { required: true, message: "请上传视频" },
|
||||
type: "jsx",
|
||||
render: () => {
|
||||
const handleChange = (file, fileList) => {
|
||||
// console.log(fileList);
|
||||
};
|
||||
const handleAvatarSuccess = (res, file, fileList) => {
|
||||
this.modalData.video = res.data;
|
||||
console.log(res, fileList);
|
||||
};
|
||||
const handleRemove = (file, fileList) => {
|
||||
console.log(file, fileList);
|
||||
};
|
||||
return (
|
||||
<div style="display: flex;">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
action={this.$api.mer_admin.uploadFile()}
|
||||
|
@ -220,7 +243,7 @@ export default {
|
|||
}}
|
||||
multiple={true}
|
||||
file-list={this.fileList}
|
||||
list-type="picture"
|
||||
// list-type="picture"
|
||||
>
|
||||
<el-button size="small" type="primary">
|
||||
<i class="el-icon-upload"></i>点击上传
|
||||
|
@ -229,12 +252,26 @@ export default {
|
|||
只能上传jpg/png文件,且不超过500kb
|
||||
</div>
|
||||
</el-upload>
|
||||
<div style="margin-left:20px">
|
||||
<video
|
||||
id="videoPlayer"
|
||||
width="200px"
|
||||
height="100px"
|
||||
object-fit="fill"
|
||||
muted="muted"
|
||||
loop
|
||||
controls
|
||||
>
|
||||
<source src={this.modalData.video} type="video/mp4" />
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "联系电话(仅用户可见)",
|
||||
prop: "limit",
|
||||
prop: "contactPhone",
|
||||
type: "Input",
|
||||
width: "300px",
|
||||
rules: { required: true, message: "请输入联系电话" },
|
||||
|
@ -254,7 +291,19 @@ export default {
|
|||
type: "primary",
|
||||
loading: this.isLoading,
|
||||
submit: true,
|
||||
handle: () => {},
|
||||
handle: () => {
|
||||
console.log(this.modalData);
|
||||
this.$api.mer_admin
|
||||
.editBrandInfo(this.modalData)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
this.toggle();
|
||||
this.$emit("getList");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
|
|
|
@ -30,6 +30,8 @@ export default {
|
|||
ProductData: {},
|
||||
fileList: [],
|
||||
isAdd: "",
|
||||
totalTime: 60,
|
||||
content: "获取验证码",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -63,10 +65,10 @@ export default {
|
|||
return [
|
||||
{
|
||||
label: "密码",
|
||||
prop: "discount",
|
||||
prop: "password",
|
||||
type: "Input",
|
||||
width: "300px",
|
||||
rules: { required: true, message: "请输入旧密码" },
|
||||
rules: { required: true, message: "请输入密码" },
|
||||
},
|
||||
{
|
||||
label: "管理员账号",
|
||||
|
@ -76,14 +78,38 @@ export default {
|
|||
rules: { required: true, message: "请输入管理员账号" },
|
||||
type: "jsx",
|
||||
render: () => {
|
||||
let getCode = () => {
|
||||
console.log("123");
|
||||
if (this.totalTime == 0) {
|
||||
this.content = "获取验证码";
|
||||
this.totalTime = 60;
|
||||
return;
|
||||
}
|
||||
this.content = this.totalTime + "秒后重新获取";
|
||||
this.totalTime--;
|
||||
setTimeout(getCode, 1000);
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<div>
|
||||
<el-input style="width:200px;margin-right:20px;margin-bottom:20px" placeholder="请输入管理员账号"></el-input>
|
||||
<el-button type="primary">获取验证码</el-button>
|
||||
<el-input
|
||||
style="width:200px;margin-right:20px;margin-bottom:20px"
|
||||
placeholder="请输入管理员账号"
|
||||
></el-input>
|
||||
<el-button
|
||||
disabled={this.totalTime < 60}
|
||||
onclick={getCode}
|
||||
type="primary"
|
||||
>
|
||||
{this.content}
|
||||
</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-input style="width:300px" placeholder="请输入验证码"></el-input>
|
||||
<el-input
|
||||
v-model={this.modalData.mobile}
|
||||
style="width:300px"
|
||||
placeholder="请输入验证码"
|
||||
></el-input>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -129,7 +155,15 @@ export default {
|
|||
type: "primary",
|
||||
loading: this.isLoading,
|
||||
submit: true,
|
||||
handle: () => {},
|
||||
handle: () => {
|
||||
if (this.isAdd) {
|
||||
console.log(this.modalData);
|
||||
} else {
|
||||
this.$api.mer_admin.changePassword(this.modalData).then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
|
|
|
@ -31,11 +31,11 @@
|
|||
placeholder="商品搜索"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="marketList.length > 0" label="摊铺">
|
||||
<el-form-item v-if="marketList.length > 0" label="菜市场">
|
||||
<el-select
|
||||
@change="getData"
|
||||
v-model="formInline.marketId"
|
||||
placeholder="请选择摊铺"
|
||||
placeholder="请选择菜市场"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in marketList"
|
||||
|
@ -45,8 +45,8 @@
|
|||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="marketList.length > 0" label="商店">
|
||||
<el-select v-model="formInline.shopId" placeholder="请选择商店">
|
||||
<el-form-item v-if="marketList.length > 0" label="店铺">
|
||||
<el-select v-model="formInline.shopId" placeholder="请选择店铺">
|
||||
<el-option
|
||||
v-for="item in storeList"
|
||||
:key="item.shopId"
|
||||
|
|
|
@ -198,10 +198,9 @@ export default {
|
|||
productVideo: "",
|
||||
shelfLife: "",
|
||||
shopId: "",
|
||||
singlePrice: "",
|
||||
singleStock: "",
|
||||
specType: 0,
|
||||
minCostPrice:"",
|
||||
minCostPrice: "",
|
||||
status: "UP",
|
||||
};
|
||||
this.modalData.merchantId = JSON.parse(
|
||||
|
@ -253,14 +252,22 @@ export default {
|
|||
}
|
||||
this.place = row.productPlace.split("-");
|
||||
this.modalData = row;
|
||||
this.$set(this.modalData, "singleStock", row.stockNum);
|
||||
if (row.minSalePrice == row.maxSalePrice) {
|
||||
this.$set(this.modalData, "singlePrice", row.maxSalePrice);
|
||||
if (row.minCostPrice == row.maxCostPrice) {
|
||||
this.$set(this.modalData, "costPrice", row.minCostPrice);
|
||||
} else {
|
||||
this.$set(
|
||||
this.modalData,
|
||||
"singlePrice",
|
||||
row.minSalePrice + "~" + row.maxSalePrice
|
||||
"costPrice",
|
||||
row.minCostPrice + "~" + row.maxCostPrice
|
||||
);
|
||||
}
|
||||
if (row.minMarketPrice == row.maxMarketPrice) {
|
||||
this.$set(this.modalData, "marketPrice", row.minMarketPrice);
|
||||
} else {
|
||||
this.$set(
|
||||
this.modalData,
|
||||
"marketPrice",
|
||||
row.minMarketPrice + "~" + row.maxMarketPrice
|
||||
);
|
||||
}
|
||||
if (!row.productAttributeList) {
|
||||
|
@ -271,6 +278,8 @@ export default {
|
|||
} else {
|
||||
this.modalData.otherAttribute = [];
|
||||
}
|
||||
console.log(this.modalData);
|
||||
|
||||
},
|
||||
addSpecs() {
|
||||
console.log("123");
|
||||
|
@ -295,9 +304,8 @@ export default {
|
|||
}
|
||||
},
|
||||
//获取属性
|
||||
getSpecs(tableData, AttributeData, salePrice, stockNum) {
|
||||
getSpecs(tableData, AttributeData) {
|
||||
console.log(tableData);
|
||||
|
||||
this.modalData.specType = 1;
|
||||
let AttributeList = AttributeData.map((item) => {
|
||||
return {
|
||||
|
@ -307,8 +315,6 @@ export default {
|
|||
});
|
||||
this.$set(this.modalData, "productSpecificationList", tableData);
|
||||
this.$set(this.modalData, "productAttributeList", AttributeList);
|
||||
this.$set(this.modalData, "singlePrice", salePrice);
|
||||
this.$set(this.modalData, "singleStock", stockNum);
|
||||
},
|
||||
addAttribute() {
|
||||
if (this.isAdd) {
|
||||
|
@ -549,12 +555,6 @@ export default {
|
|||
{
|
||||
label: "规格",
|
||||
prop: "productSpecificationList",
|
||||
// required: true,
|
||||
// rules: {
|
||||
// required: true,
|
||||
// message: "请选择销售单位",
|
||||
// trigger: "blur",
|
||||
// },
|
||||
type: "jsx",
|
||||
render: () => {
|
||||
return (
|
||||
|
@ -598,14 +598,14 @@ export default {
|
|||
},
|
||||
{
|
||||
label: "库存",
|
||||
prop: "singleStock",
|
||||
prop: "stockNum",
|
||||
type: "jsx",
|
||||
render: () => {
|
||||
return (
|
||||
<el-input
|
||||
readonly={this.modalData.specType != 0}
|
||||
placeholder="请输入库存"
|
||||
v-model={this.modalData.singleStock}
|
||||
v-model={this.modalData.stockNum}
|
||||
></el-input>
|
||||
);
|
||||
},
|
||||
|
@ -838,11 +838,10 @@ export default {
|
|||
{
|
||||
attributeValue: "默认",
|
||||
costPrice: this.modalData.costPrice,
|
||||
salePrice: this.modalData.singlePrice,
|
||||
stockNum: this.modalData.singleStock,
|
||||
marketPrice: this.modalData.marketPrice,
|
||||
stockNum: this.modalData.stockNum,
|
||||
weight: this.modalData.weight,
|
||||
volume: this.modalData.volume,
|
||||
marketPrice: this.modalData.marketPrice,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
@ -873,8 +872,8 @@ export default {
|
|||
{
|
||||
attributeValue: "默认",
|
||||
costPrice: this.modalData.costPrice,
|
||||
salePrice: this.modalData.singlePrice,
|
||||
stockNum: this.modalData.singleStock,
|
||||
marketPrice: this.modalData.marketPrice,
|
||||
stockNum: this.modalData.stockNum,
|
||||
weight: this.modalData.weight,
|
||||
volume: this.modalData.volume,
|
||||
},
|
||||
|
|
|
@ -287,25 +287,6 @@ export default {
|
|||
align: "center",
|
||||
"min-width": "160px",
|
||||
},
|
||||
{
|
||||
title: "价格(元)",
|
||||
field: "salePrice",
|
||||
align: "center",
|
||||
"min-width": "160px",
|
||||
type: "jsx",
|
||||
render: ({ row }) => {
|
||||
return (
|
||||
<div>
|
||||
<el-input-number
|
||||
min={0}
|
||||
size="small"
|
||||
v-model={row.salePrice}
|
||||
placeholder="请输入价格"
|
||||
></el-input-number>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "成本(元)",
|
||||
field: "costPrice",
|
||||
|
@ -317,7 +298,6 @@ export default {
|
|||
<div>
|
||||
<el-input-number
|
||||
min={0}
|
||||
max={row.salePrice}
|
||||
size="small"
|
||||
v-model={row.costPrice}
|
||||
placeholder="请输入成本"
|
||||
|
@ -438,52 +418,10 @@ export default {
|
|||
disabled: () => this.tableData.length <= 0,
|
||||
// submit: true,
|
||||
handle: () => {
|
||||
let volume = ""; //重量
|
||||
let weight = ""; //体积
|
||||
let salePrice = ""; //价格范围
|
||||
let stockNum = ""; //库存范围
|
||||
let minSalePrice = Math.min.apply(
|
||||
Math,
|
||||
this.tableData.map((item) => {
|
||||
return item.salePrice;
|
||||
})
|
||||
);
|
||||
let maxSalePrice = Math.max.apply(
|
||||
Math,
|
||||
this.tableData.map((item) => {
|
||||
return item.salePrice;
|
||||
})
|
||||
);
|
||||
let minStockNum = Math.min.apply(
|
||||
Math,
|
||||
this.tableData.map((item) => {
|
||||
return item.stockNum;
|
||||
})
|
||||
);
|
||||
let maxStockNum = Math.max.apply(
|
||||
Math,
|
||||
this.tableData.map((item) => {
|
||||
return item.stockNum;
|
||||
})
|
||||
);
|
||||
if (minSalePrice == maxSalePrice) {
|
||||
salePrice = maxSalePrice;
|
||||
} else {
|
||||
salePrice = minSalePrice + "~" + maxSalePrice;
|
||||
}
|
||||
if (minStockNum == maxStockNum) {
|
||||
stockNum = maxStockNum;
|
||||
} else {
|
||||
stockNum = minStockNum + "~" + maxStockNum;
|
||||
}
|
||||
console.log(this.tableData);
|
||||
|
||||
this.$emit(
|
||||
"getSpecs",
|
||||
this.tableData,
|
||||
this.AttributeData,
|
||||
salePrice,
|
||||
stockNum
|
||||
);
|
||||
this.toggle();
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue