diff --git a/src/api/modules/mer_admin.js b/src/api/modules/mer_admin.js index 74ff7d7..41a0e3d 100644 --- a/src/api/modules/mer_admin.js +++ b/src/api/modules/mer_admin.js @@ -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); + }, }; diff --git a/src/views/modules/brand/config/index.vue b/src/views/modules/brand/config/index.vue index 97e8367..43c6c45 100644 --- a/src/views/modules/brand/config/index.vue +++ b/src/views/modules/brand/config/index.vue @@ -43,10 +43,9 @@
- + @@ -136,6 +135,12 @@ export default { }); } }, + pause() { + console.log("暂停播放"); + }, + ended() { + console.log("播放结束"); + }, }, }; diff --git a/src/views/modules/brand/config/popup/add-or-update.vue b/src/views/modules/brand/config/popup/add-or-update.vue index 722b9d9..deccf94 100644 --- a/src/views/modules/brand/config/popup/add-or-update.vue +++ b/src/views/modules/brand/config/popup/add-or-update.vue @@ -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,74 +65,85 @@ 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 ( - - - 点击上传 - -
- 只能上传jpg/png文件,且不超过500kb +
+ + + 点击上传 + +
+ 只能上传jpg/png文件,且不超过500kb +
+
+
+
- +
); }, }, { label: "品牌首页:", - prop: "limitCoun", + prop: "status", type: "Input", width: "300px", - rules: { required: true, message: "请输入品牌ID" }, type: "jsx", render: () => { return ( @@ -137,104 +152,126 @@ 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 ( - - - 点击上传 - -
- 只能上传jpg/png文件,且不超过500kb +
+ + + 点击上传 + +
+ 只能上传jpg/png文件,且不超过500kb +
+
+
+
- +
); }, }, { 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 ( - - - 点击上传 - -
- 只能上传jpg/png文件,且不超过500kb +
+ + + 点击上传 + +
+ 只能上传jpg/png文件,且不超过500kb +
+
+
+
- +
); }, }, { 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); + }); + }, }, ]; }, diff --git a/src/views/modules/brand/config/popup/change-password.vue b/src/views/modules/brand/config/popup/change-password.vue index 85fb772..ae3d873 100644 --- a/src/views/modules/brand/config/popup/change-password.vue +++ b/src/views/modules/brand/config/popup/change-password.vue @@ -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,15 +78,39 @@ 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 ( -
- - 获取验证码 -
-
- -
+
+ + + {this.content} + +
+
+ +
); }, @@ -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); + }); + } + }, }, ]; }, diff --git a/src/views/modules/product/index.vue b/src/views/modules/product/index.vue index f143f17..691a08d 100644 --- a/src/views/modules/product/index.vue +++ b/src/views/modules/product/index.vue @@ -31,11 +31,11 @@ placeholder="商品搜索" > - + - - + + { 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 ( ); }, @@ -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, }, diff --git a/src/views/modules/product/popup/add-specifications.vue b/src/views/modules/product/popup/add-specifications.vue index 8269722..08caa1f 100644 --- a/src/views/modules/product/popup/add-specifications.vue +++ b/src/views/modules/product/popup/add-specifications.vue @@ -287,25 +287,6 @@ export default { align: "center", "min-width": "160px", }, - { - title: "价格(元)", - field: "salePrice", - align: "center", - "min-width": "160px", - type: "jsx", - render: ({ row }) => { - return ( -
- -
- ); - }, - }, { title: "成本(元)", field: "costPrice", @@ -317,7 +298,6 @@ export default {
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(); },