修改密码

This commit is contained in:
余同学 2024-11-18 18:22:16 +08:00
parent 066eb8004e
commit 77663be0a1
7 changed files with 223 additions and 190 deletions

View File

@ -170,4 +170,12 @@ export const mer_admin = {
params: {}, params: {},
}); });
}, },
//编辑品牌信息
editBrandInfo: (data) => {
return $http.put(`/merchant-api/brand/edit`, data);
},
//修改密码
changePassword: (data) => {
return $http.put(`/merchant-api/brand/admin_password`, data);
},
}; };

View File

@ -43,10 +43,9 @@
<div v-if="list.video" style="margin-left: 20px"> <div v-if="list.video" style="margin-left: 20px">
<video <video
id="videoPlayer" id="videoPlayer"
width="200px" width="300px"
height="100px" height="200px"
object-fit="fill" object-fit="fill"
autoplay="true"
muted="muted" muted="muted"
loop loop
controls controls
@ -93,7 +92,7 @@
</div> </div>
</div> </div>
<!-- 编辑品牌信息 --> <!-- 编辑品牌信息 -->
<addOrUpdate ref="addOrUpdate"></addOrUpdate> <addOrUpdate @getList="getList" ref="addOrUpdate"></addOrUpdate>
<!-- 修改密码 --> <!-- 修改密码 -->
<changePassword ref="changePassword"></changePassword> <changePassword ref="changePassword"></changePassword>
</div> </div>
@ -136,6 +135,12 @@ export default {
}); });
} }
}, },
pause() {
console.log("暂停播放");
},
ended() {
console.log("播放结束");
},
}, },
}; };
</script> </script>

View File

@ -49,7 +49,11 @@ export default {
}); });
this.isAdd = true; this.isAdd = true;
}, },
update: () => { update: (row) => {
this.fileList = []
this.modalData = JSON.parse(JSON.stringify(row));
console.log(row);
this.isAdd = false; this.isAdd = false;
}, },
}; };
@ -61,36 +65,38 @@ export default {
return [ return [
{ {
label: "品牌名称", label: "品牌名称",
prop: "discount", prop: "name",
type: "Input", type: "Input",
width: "300px", width: "300px",
rules: { required: true, message: "请输入品牌名称" }, rules: { required: true, message: "请输入品牌名称" },
}, },
{ {
label: "品牌ID", label: "品牌ID",
prop: "limitCount", prop: "id",
type: "Input", type: "Input",
disabled: true,
width: "300px", width: "300px",
rules: { required: true, message: "请输入品牌ID" }, rules: { required: true, message: "请输入品牌ID" },
}, },
{ {
label: "品牌LOGO", label: "品牌LOGO",
prop: "DiscountTi", prop: "logo",
type: "Input", type: "Input",
width: "300px", width: "300px",
rules: { required: true, message: "请上传品牌LOGO" },
type: "jsx", type: "jsx",
render: () => { render: () => {
const handleChange = (file, fileList) => { const handleChange = (file, fileList) => {
// console.log(fileList); // console.log(fileList);
}; };
const handleAvatarSuccess = (res, file, fileList) => { const handleAvatarSuccess = (res, file, fileList) => {
this.modalData.logo = res.data;
console.log(res, fileList); console.log(res, fileList);
}; };
const handleRemove = (file, fileList) => { const handleRemove = (file, fileList) => {
console.log(file, fileList); console.log(file, fileList);
}; };
return ( return (
<div style="display: flex;">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
action={this.$api.mer_admin.uploadFile()} action={this.$api.mer_admin.uploadFile()}
@ -106,7 +112,7 @@ export default {
}} }}
multiple={true} multiple={true}
file-list={this.fileList} file-list={this.fileList}
list-type="picture" // list-type="picture"
> >
<el-button size="small" type="primary"> <el-button size="small" type="primary">
<i class="el-icon-upload"></i>点击上传 <i class="el-icon-upload"></i>点击上传
@ -115,20 +121,29 @@ export default {
只能上传jpg/png文件且不超过500kb 只能上传jpg/png文件且不超过500kb
</div> </div>
</el-upload> </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: "品牌首页:", label: "品牌首页:",
prop: "limitCoun", prop: "status",
type: "Input", type: "Input",
width: "300px", width: "300px",
rules: { required: true, message: "请输入品牌ID" },
type: "jsx", type: "jsx",
render: () => { render: () => {
return ( return (
<el-switch <el-switch
v-model={this.value1} active-value="1"
inactive-value="0"
v-model={this.modalData.status}
active-text="开启" active-text="开启"
inactive-text="禁用" inactive-text="禁用"
></el-switch> ></el-switch>
@ -137,29 +152,28 @@ export default {
}, },
{ {
label: "宣传语", label: "宣传语",
prop: "limitCot", prop: "tagline",
type: "Input", type: "Input",
width: "300px", width: "300px",
rules: { required: true, message: "请输入宣传语" },
}, },
{ {
label: "首页背景", label: "首页背景",
prop: "DiscountTime", prop: "background",
type: "Input", type: "Input",
width: "300px", width: "300px",
rules: { required: true, message: "请上传背景图" },
type: "jsx", type: "jsx",
render: () => { render: () => {
const handleChange = (file, fileList) => { const handleChange = (file, fileList) => {
// console.log(fileList); // console.log(fileList);
}; };
const handleAvatarSuccess = (res, file, fileList) => { const handleAvatarSuccess = (res, file, fileList) => {
console.log(res, fileList); this.modalData.background = res.data;
}; };
const handleRemove = (file, fileList) => { const handleRemove = (file, fileList) => {
console.log(file, fileList); console.log(file, fileList);
}; };
return ( return (
<div style="display: flex;">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
action={this.$api.mer_admin.uploadFile()} action={this.$api.mer_admin.uploadFile()}
@ -175,7 +189,7 @@ export default {
}} }}
multiple={true} multiple={true}
file-list={this.fileList} file-list={this.fileList}
list-type="picture" // list-type="picture"
> >
<el-button size="small" type="primary"> <el-button size="small" type="primary">
<i class="el-icon-upload"></i>点击上传 <i class="el-icon-upload"></i>点击上传
@ -184,27 +198,36 @@ export default {
只能上传jpg/png文件且不超过500kb 只能上传jpg/png文件且不超过500kb
</div> </div>
</el-upload> </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: "视频", label: "视频",
prop: "DiscountTim", prop: "video",
type: "Input", type: "Input",
width: "300px", width: "300px",
rules: { required: true, message: "请上传视频" },
type: "jsx", type: "jsx",
render: () => { render: () => {
const handleChange = (file, fileList) => { const handleChange = (file, fileList) => {
// console.log(fileList); // console.log(fileList);
}; };
const handleAvatarSuccess = (res, file, fileList) => { const handleAvatarSuccess = (res, file, fileList) => {
this.modalData.video = res.data;
console.log(res, fileList); console.log(res, fileList);
}; };
const handleRemove = (file, fileList) => { const handleRemove = (file, fileList) => {
console.log(file, fileList); console.log(file, fileList);
}; };
return ( return (
<div style="display: flex;">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
action={this.$api.mer_admin.uploadFile()} action={this.$api.mer_admin.uploadFile()}
@ -220,7 +243,7 @@ export default {
}} }}
multiple={true} multiple={true}
file-list={this.fileList} file-list={this.fileList}
list-type="picture" // list-type="picture"
> >
<el-button size="small" type="primary"> <el-button size="small" type="primary">
<i class="el-icon-upload"></i>点击上传 <i class="el-icon-upload"></i>点击上传
@ -229,12 +252,26 @@ export default {
只能上传jpg/png文件且不超过500kb 只能上传jpg/png文件且不超过500kb
</div> </div>
</el-upload> </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: "联系电话(仅用户可见)", label: "联系电话(仅用户可见)",
prop: "limit", prop: "contactPhone",
type: "Input", type: "Input",
width: "300px", width: "300px",
rules: { required: true, message: "请输入联系电话" }, rules: { required: true, message: "请输入联系电话" },
@ -254,7 +291,19 @@ export default {
type: "primary", type: "primary",
loading: this.isLoading, loading: this.isLoading,
submit: true, 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);
});
},
}, },
]; ];
}, },

View File

@ -30,6 +30,8 @@ export default {
ProductData: {}, ProductData: {},
fileList: [], fileList: [],
isAdd: "", isAdd: "",
totalTime: 60,
content: "获取验证码",
}; };
}, },
methods: { methods: {
@ -63,10 +65,10 @@ export default {
return [ return [
{ {
label: "密码", label: "密码",
prop: "discount", prop: "password",
type: "Input", type: "Input",
width: "300px", width: "300px",
rules: { required: true, message: "请输入密码" }, rules: { required: true, message: "请输入密码" },
}, },
{ {
label: "管理员账号", label: "管理员账号",
@ -76,14 +78,38 @@ export default {
rules: { required: true, message: "请输入管理员账号" }, rules: { required: true, message: "请输入管理员账号" },
type: "jsx", type: "jsx",
render: () => { 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 ( return (
<div> <div>
<div> <div>
<el-input style="width:200px;margin-right:20px;margin-bottom:20px" placeholder="请输入管理员账号"></el-input> <el-input
<el-button type="primary">获取验证码</el-button> 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>
<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>
</div> </div>
); );
@ -129,7 +155,15 @@ export default {
type: "primary", type: "primary",
loading: this.isLoading, loading: this.isLoading,
submit: true, submit: true,
handle: () => {}, handle: () => {
if (this.isAdd) {
console.log(this.modalData);
} else {
this.$api.mer_admin.changePassword(this.modalData).then((res) => {
console.log(res);
});
}
},
}, },
]; ];
}, },

View File

@ -31,11 +31,11 @@
placeholder="商品搜索" placeholder="商品搜索"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item v-if="marketList.length > 0" label="摊铺"> <el-form-item v-if="marketList.length > 0" label="菜市场">
<el-select <el-select
@change="getData" @change="getData"
v-model="formInline.marketId" v-model="formInline.marketId"
placeholder="请选择摊铺" placeholder="请选择菜市场"
> >
<el-option <el-option
v-for="item in marketList" v-for="item in marketList"
@ -45,8 +45,8 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="marketList.length > 0" label="店"> <el-form-item v-if="marketList.length > 0" label="">
<el-select v-model="formInline.shopId" placeholder="请选择店"> <el-select v-model="formInline.shopId" placeholder="请选择">
<el-option <el-option
v-for="item in storeList" v-for="item in storeList"
:key="item.shopId" :key="item.shopId"

View File

@ -198,10 +198,9 @@ export default {
productVideo: "", productVideo: "",
shelfLife: "", shelfLife: "",
shopId: "", shopId: "",
singlePrice: "",
singleStock: "", singleStock: "",
specType: 0, specType: 0,
minCostPrice:"", minCostPrice: "",
status: "UP", status: "UP",
}; };
this.modalData.merchantId = JSON.parse( this.modalData.merchantId = JSON.parse(
@ -253,14 +252,22 @@ export default {
} }
this.place = row.productPlace.split("-"); this.place = row.productPlace.split("-");
this.modalData = row; this.modalData = row;
this.$set(this.modalData, "singleStock", row.stockNum); if (row.minCostPrice == row.maxCostPrice) {
if (row.minSalePrice == row.maxSalePrice) { this.$set(this.modalData, "costPrice", row.minCostPrice);
this.$set(this.modalData, "singlePrice", row.maxSalePrice);
} else { } else {
this.$set( this.$set(
this.modalData, this.modalData,
"singlePrice", "costPrice",
row.minSalePrice + "~" + row.maxSalePrice 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) { if (!row.productAttributeList) {
@ -271,6 +278,8 @@ export default {
} else { } else {
this.modalData.otherAttribute = []; this.modalData.otherAttribute = [];
} }
console.log(this.modalData);
}, },
addSpecs() { addSpecs() {
console.log("123"); console.log("123");
@ -295,9 +304,8 @@ export default {
} }
}, },
// //
getSpecs(tableData, AttributeData, salePrice, stockNum) { getSpecs(tableData, AttributeData) {
console.log(tableData); console.log(tableData);
this.modalData.specType = 1; this.modalData.specType = 1;
let AttributeList = AttributeData.map((item) => { let AttributeList = AttributeData.map((item) => {
return { return {
@ -307,8 +315,6 @@ export default {
}); });
this.$set(this.modalData, "productSpecificationList", tableData); this.$set(this.modalData, "productSpecificationList", tableData);
this.$set(this.modalData, "productAttributeList", AttributeList); this.$set(this.modalData, "productAttributeList", AttributeList);
this.$set(this.modalData, "singlePrice", salePrice);
this.$set(this.modalData, "singleStock", stockNum);
}, },
addAttribute() { addAttribute() {
if (this.isAdd) { if (this.isAdd) {
@ -549,12 +555,6 @@ export default {
{ {
label: "规格", label: "规格",
prop: "productSpecificationList", prop: "productSpecificationList",
// required: true,
// rules: {
// required: true,
// message: "",
// trigger: "blur",
// },
type: "jsx", type: "jsx",
render: () => { render: () => {
return ( return (
@ -598,14 +598,14 @@ export default {
}, },
{ {
label: "库存", label: "库存",
prop: "singleStock", prop: "stockNum",
type: "jsx", type: "jsx",
render: () => { render: () => {
return ( return (
<el-input <el-input
readonly={this.modalData.specType != 0} readonly={this.modalData.specType != 0}
placeholder="请输入库存" placeholder="请输入库存"
v-model={this.modalData.singleStock} v-model={this.modalData.stockNum}
></el-input> ></el-input>
); );
}, },
@ -838,11 +838,10 @@ export default {
{ {
attributeValue: "默认", attributeValue: "默认",
costPrice: this.modalData.costPrice, costPrice: this.modalData.costPrice,
salePrice: this.modalData.singlePrice, marketPrice: this.modalData.marketPrice,
stockNum: this.modalData.singleStock, stockNum: this.modalData.stockNum,
weight: this.modalData.weight, weight: this.modalData.weight,
volume: this.modalData.volume, volume: this.modalData.volume,
marketPrice: this.modalData.marketPrice,
}, },
]; ];
} }
@ -873,8 +872,8 @@ export default {
{ {
attributeValue: "默认", attributeValue: "默认",
costPrice: this.modalData.costPrice, costPrice: this.modalData.costPrice,
salePrice: this.modalData.singlePrice, marketPrice: this.modalData.marketPrice,
stockNum: this.modalData.singleStock, stockNum: this.modalData.stockNum,
weight: this.modalData.weight, weight: this.modalData.weight,
volume: this.modalData.volume, volume: this.modalData.volume,
}, },

View File

@ -287,25 +287,6 @@ export default {
align: "center", align: "center",
"min-width": "160px", "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: "成本(元)", title: "成本(元)",
field: "costPrice", field: "costPrice",
@ -317,7 +298,6 @@ export default {
<div> <div>
<el-input-number <el-input-number
min={0} min={0}
max={row.salePrice}
size="small" size="small"
v-model={row.costPrice} v-model={row.costPrice}
placeholder="请输入成本" placeholder="请输入成本"
@ -438,52 +418,10 @@ export default {
disabled: () => this.tableData.length <= 0, disabled: () => this.tableData.length <= 0,
// submit: true, // submit: true,
handle: () => { 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( this.$emit(
"getSpecs", "getSpecs",
this.tableData, this.tableData,
this.AttributeData, this.AttributeData,
salePrice,
stockNum
); );
this.toggle(); this.toggle();
}, },