|
@@ -2,7 +2,7 @@
|
|
|
<div id="">
|
|
|
<el-dialog
|
|
|
:visible.sync="dialogVisible"
|
|
|
- width="1060px"
|
|
|
+ width="1160px"
|
|
|
:show-close="false"
|
|
|
:close-on-click-modal="false"
|
|
|
>
|
|
@@ -63,7 +63,16 @@
|
|
|
<div class="lis">
|
|
|
<el-checkbox v-model="modelData.goods.checked"
|
|
|
>商品图:</el-checkbox
|
|
|
- ><input id="goods" type="file" @change="uploadImg" />
|
|
|
+ ><label for="goods"
|
|
|
+ ><i class="btn">{{
|
|
|
+ modelData.goods.name ? "更换商品图" : "上传商品图"
|
|
|
+ }}</i></label
|
|
|
+ ><input
|
|
|
+ style="display: none"
|
|
|
+ id="goods"
|
|
|
+ type="file"
|
|
|
+ @change="uploadImg"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="lis">
|
|
|
<el-checkbox v-model="modelData.distribution.checked"
|
|
@@ -76,7 +85,11 @@
|
|
|
<div class="lis">
|
|
|
<el-checkbox v-model="modelData.advertise.checked"
|
|
|
>广告语:</el-checkbox
|
|
|
- ><el-input v-model="modelData.advertise.name"></el-input
|
|
|
+ ><el-input
|
|
|
+ type="textarea"
|
|
|
+ :rows="4"
|
|
|
+ v-model="modelData.advertise.name"
|
|
|
+ ></el-input
|
|
|
><el-color-picker
|
|
|
v-model="modelData.advertise.css.color"
|
|
|
show-alpha
|
|
@@ -150,6 +163,7 @@ export default {
|
|
|
modelData: {
|
|
|
background: {
|
|
|
name: "",
|
|
|
+ type: 0,
|
|
|
css: {
|
|
|
top: "0px",
|
|
|
left: "0px",
|
|
@@ -160,6 +174,7 @@ export default {
|
|
|
},
|
|
|
title: {
|
|
|
name: "",
|
|
|
+ type: 1,
|
|
|
top: 38,
|
|
|
left: 0,
|
|
|
width: 375,
|
|
@@ -173,6 +188,7 @@ export default {
|
|
|
goods: {
|
|
|
// name: require("@/assets/model_images/model1.png"),
|
|
|
name: "",
|
|
|
+ type: 2,
|
|
|
top: 126,
|
|
|
left: 28,
|
|
|
width: 330,
|
|
@@ -184,10 +200,11 @@ export default {
|
|
|
},
|
|
|
distribution: {
|
|
|
name: "",
|
|
|
+ type: 3,
|
|
|
top: 476,
|
|
|
left: 114,
|
|
|
width: 121,
|
|
|
- height: 111,
|
|
|
+ height: 121,
|
|
|
css: {
|
|
|
width: "100%",
|
|
|
height: "100%",
|
|
@@ -195,10 +212,11 @@ export default {
|
|
|
},
|
|
|
cardCode: {
|
|
|
name: "",
|
|
|
+ type: 3,
|
|
|
top: 476,
|
|
|
left: 244,
|
|
|
- width: 125,
|
|
|
- height: 112,
|
|
|
+ width: 121,
|
|
|
+ height: 121,
|
|
|
css: {
|
|
|
width: "100%",
|
|
|
height: "100%",
|
|
@@ -206,6 +224,7 @@ export default {
|
|
|
},
|
|
|
advertise: {
|
|
|
name: "",
|
|
|
+ type: 1,
|
|
|
top: 490,
|
|
|
left: 0,
|
|
|
width: 102,
|
|
@@ -217,6 +236,7 @@ export default {
|
|
|
},
|
|
|
mechanism: {
|
|
|
name: "",
|
|
|
+ type: 1,
|
|
|
top: 623,
|
|
|
left: 0,
|
|
|
width: 375,
|
|
@@ -245,8 +265,8 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.ruleForm = {
|
|
|
name: e.name,
|
|
|
- posterTempId: e.posterTempId,
|
|
|
- posterUrl: e.posterUrl,
|
|
|
+ posterId: e.posterId,
|
|
|
+ url: e.url,
|
|
|
remark: e.remark,
|
|
|
status: e.status,
|
|
|
};
|
|
@@ -254,87 +274,97 @@ export default {
|
|
|
});
|
|
|
} else {
|
|
|
this.$nextTick(() => {
|
|
|
- this.modelData = {
|
|
|
- background: {
|
|
|
- name: "",
|
|
|
- css: {
|
|
|
- top: "0px",
|
|
|
- left: "0px",
|
|
|
- width: "375px",
|
|
|
- height: "667px",
|
|
|
- position: "absolute",
|
|
|
+ this.modelData = {
|
|
|
+ background: {
|
|
|
+ name: "",
|
|
|
+ type: 0,
|
|
|
+ css: {
|
|
|
+ top: "0px",
|
|
|
+ left: "0px",
|
|
|
+ width: "375px",
|
|
|
+ height: "667px",
|
|
|
+ position: "absolute",
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- title: {
|
|
|
- name: "",
|
|
|
- top: 38,
|
|
|
- left: 0,
|
|
|
- width: 375,
|
|
|
- height: 50,
|
|
|
- css: {
|
|
|
- textAlign: "center",
|
|
|
- fontSize: "30px",
|
|
|
- margin: "0px",
|
|
|
+ title: {
|
|
|
+ name: "",
|
|
|
+ type: 1,
|
|
|
+ top: 38,
|
|
|
+ left: 0,
|
|
|
+ width: 375,
|
|
|
+ height: 50,
|
|
|
+ css: {
|
|
|
+ textAlign: "center",
|
|
|
+ fontSize: "30px",
|
|
|
+ margin: "0px",
|
|
|
+ lineHeight: "36px",
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- goods: {
|
|
|
- // name: require("@/assets/model_images/model1.png"),
|
|
|
- name: "",
|
|
|
- top: 126,
|
|
|
- left: 28,
|
|
|
- width: 330,
|
|
|
- height: 330,
|
|
|
- css: {
|
|
|
- width: "100%",
|
|
|
- height: "100%",
|
|
|
+ goods: {
|
|
|
+ // name: require("@/assets/model_images/model1.png"),
|
|
|
+ name: "",
|
|
|
+ type: 2,
|
|
|
+ top: 126,
|
|
|
+ left: 28,
|
|
|
+ width: 330,
|
|
|
+ height: 330,
|
|
|
+ css: {
|
|
|
+ width: "100%",
|
|
|
+ height: "100%",
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- distribution: {
|
|
|
- name: "",
|
|
|
- top: 476,
|
|
|
- left: 114,
|
|
|
- width: 121,
|
|
|
- height: 111,
|
|
|
- css: {
|
|
|
- width: "100%",
|
|
|
- height: "100%",
|
|
|
+ distribution: {
|
|
|
+ name: "",
|
|
|
+ type: 3,
|
|
|
+ top: 476,
|
|
|
+ left: 114,
|
|
|
+ width: 121,
|
|
|
+ height: 121,
|
|
|
+ css: {
|
|
|
+ width: "100%",
|
|
|
+ height: "100%",
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- cardCode: {
|
|
|
- name: "",
|
|
|
- top: 476,
|
|
|
- left: 244,
|
|
|
- width: 125,
|
|
|
- height: 112,
|
|
|
- css: {
|
|
|
- width: "100%",
|
|
|
- height: "100%",
|
|
|
+ cardCode: {
|
|
|
+ name: "",
|
|
|
+ type: 3,
|
|
|
+ top: 476,
|
|
|
+ left: 244,
|
|
|
+ width: 121,
|
|
|
+ height: 121,
|
|
|
+ css: {
|
|
|
+ width: "100%",
|
|
|
+ height: "100%",
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- advertise: {
|
|
|
- name: "",
|
|
|
- top: 490,
|
|
|
- left: 0,
|
|
|
- width: 102,
|
|
|
- height: 96,
|
|
|
- css: {
|
|
|
- fontSize: "20px",
|
|
|
- margin: "0px",
|
|
|
+ advertise: {
|
|
|
+ name: "",
|
|
|
+ type: 1,
|
|
|
+ top: 490,
|
|
|
+ left: 0,
|
|
|
+ width: 102,
|
|
|
+ height: 96,
|
|
|
+ css: {
|
|
|
+ fontSize: "20px",
|
|
|
+ margin: "0px",
|
|
|
+ lineHeight: "36px",
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- mechanism: {
|
|
|
- name: "",
|
|
|
- top: 623,
|
|
|
- left: 0,
|
|
|
- width: 375,
|
|
|
- height: 44,
|
|
|
- css: {
|
|
|
- fontSize: "16px",
|
|
|
- textAlign: "center",
|
|
|
- margin: "0px",
|
|
|
+ mechanism: {
|
|
|
+ name: "",
|
|
|
+ type: 1,
|
|
|
+ top: 623,
|
|
|
+ left: 0,
|
|
|
+ width: 375,
|
|
|
+ height: 44,
|
|
|
+ css: {
|
|
|
+ fontSize: "16px",
|
|
|
+ textAlign: "center",
|
|
|
+ margin: "0px",
|
|
|
+ lineHeight: "36px",
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- };
|
|
|
+ };
|
|
|
this.ruleForm = {};
|
|
|
});
|
|
|
}
|
|
@@ -348,10 +378,10 @@ export default {
|
|
|
this.$refs[formName].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
this.disabledBtn = true;
|
|
|
- this.ruleForm.posterUrl = await this.$refs.modelView.changeFile();
|
|
|
+ this.ruleForm.url = await this.$refs.modelView.changeFile();
|
|
|
this.ruleForm.posterConfig = JSON.stringify(this.modelData);
|
|
|
this.$api[
|
|
|
- this.ruleForm.posterTempId
|
|
|
+ this.ruleForm.posterId
|
|
|
? "editdistributionposter"
|
|
|
: "distributionpostersave"
|
|
|
](this.ruleForm)
|
|
@@ -389,10 +419,12 @@ export default {
|
|
|
var file = e.target.files[0];
|
|
|
if (file === undefined) {
|
|
|
self.$set(self.modelData.goods, "name", "");
|
|
|
+ e.target.value = "";
|
|
|
return;
|
|
|
}
|
|
|
- if (file.size > 0.3 * 1024 * 1024) {
|
|
|
- self.$message.error("图片不得大于300kb");
|
|
|
+ if (file.size > 0.8 * 1024 * 1024) {
|
|
|
+ self.$message.error("图片不得大于800kb");
|
|
|
+ e.target.value = "";
|
|
|
return;
|
|
|
}
|
|
|
var type = e.target.value.toLowerCase().split(".").splice(-1);
|
|
@@ -420,6 +452,33 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.btn {
|
|
|
+ display: inline-block;
|
|
|
+ line-height: 1;
|
|
|
+ white-space: nowrap;
|
|
|
+ cursor: pointer;
|
|
|
+ background: #ffffff;
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
+ -webkit-appearance: none;
|
|
|
+ text-align: center;
|
|
|
+ -webkit-box-sizing: border-box;
|
|
|
+ box-sizing: border-box;
|
|
|
+ outline: none;
|
|
|
+ margin: 0;
|
|
|
+ -webkit-transition: 0.1s;
|
|
|
+ transition: 0.1s;
|
|
|
+ font-weight: 400;
|
|
|
+ -moz-user-select: none;
|
|
|
+ -webkit-user-select: none;
|
|
|
+ -ms-user-select: none;
|
|
|
+ border-radius: 8px;
|
|
|
+ color: #ffffff;
|
|
|
+ background-color: #1890ff;
|
|
|
+ border-color: #1890ff;
|
|
|
+ padding: 10px 20px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-style: normal;
|
|
|
+}
|
|
|
.header_img {
|
|
|
& > .imageStyBoxShow {
|
|
|
border-radius: 50%;
|
|
@@ -453,7 +512,7 @@ export default {
|
|
|
align-items: center;
|
|
|
margin-bottom: 10px;
|
|
|
& > .el-input {
|
|
|
- width: 200px;
|
|
|
+ // width: 200px;
|
|
|
}
|
|
|
}
|
|
|
}
|