diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue index 4d10bd8..dd3e1e0 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -124,6 +124,9 @@ export default { methods: { init() { const editor = this.$refs.editor; + if (this.readOnly){ + this.options.modules.toolbar = {}; + } this.Quill = new Quill(editor, this.options); // 如果设置了上传地址则自定义图片上传事件 if (this.type == 'url') { @@ -176,7 +179,7 @@ export default { }, handleUploadSuccess(res, file) { // 如果上传成功 - if (res.data.code == 200) { + if (res.code == 200) { // 获取富文本组件实例 let quill = this.Quill; // 获取光标所在位置 diff --git a/src/views/a/detailsComponent.vue b/src/views/a/detailsComponent.vue index ee96ed2..af6ac0e 100644 --- a/src/views/a/detailsComponent.vue +++ b/src/views/a/detailsComponent.vue @@ -1,25 +1,347 @@ diff --git a/src/views/a/index.vue b/src/views/a/index.vue index 5c258db..c168641 100644 --- a/src/views/a/index.vue +++ b/src/views/a/index.vue @@ -25,128 +25,15 @@ - - - 首页 - {{ breadcrumb }} - - - - - - -

- -

-
-
- - -
- -
-
- -
- - - -
-
- -
- - - - -
-
- -
- - - -
-
-
-
- -

{{ good.name }}

{{ namess }} -

¥{{ price }}

- - - - {{ value }} - - - - - - - - 库存{{ stock }} -

总价{{ sumPrice }}

-
- - 加入购物车 - 立即购买 - -
-
-
- - -
- 商品详情 -
- - - - - {{ detail.value }} - - - - - - -
-
+ + + + + + + @@ -160,60 +47,14 @@ export default { computed: {}, data() { return { - /*图片*/ - imageList: [], - /*品牌信息*/ - brandName: "", - good: {}, - like: true, - value1: 999, - value2: 999, - title: "增长人数", - breadcrumbList: [], - //规格表单 - form: { - ruleList: [], - num: 1 - }, - ruleValueList: [], - /*国歌表单*/ - categoryCommonElement: { - templateAttributeGroupList: [], - templateAttributeList: [], - attributeList: [] - }, - /*商品详情*/ - goodDetail: [], - sku: [], - price: 0, - stock: 0, - sumPrice: 0, - a: "", - namess: "", goodList: [], queryParams: {}, } }, created() { - const id = this.$route.params.id; - this.details(id) this.getList() }, - watch: { - "form.num": { - handler(val) { - this.stock = this.stock - 1 - this.sumPrice = this.sumPrice + this.price - } - }, - "stock": { - handler(val) { - if (val === 0) { - this.$message.error("库存不够") - } - } - } - }, + methods: { details1(id) { this.$router.push('/detailsComponent/' + id) @@ -226,87 +67,6 @@ export default { console.log(this.goodList) }); }, - changeRule() { - let selectedValues = this.sku.map((rule, index) => { - return this.form['rule' + index]; // 获取每个索引对应的值 - }).filter(value => value !== '').join(''); // 过滤空值,然后拼接成字符串 - - this.sku.forEach( - sku => { - if (selectedValues === sku.sku) { - this.price = sku.price - this.sumPrice = sku.price - this.stock = sku.stock - this.namess = selectedValues - } - } - ) - - }, - - /*立即购买按钮*/ - onSubmit() { - - }, - details: function (id) { - getPro(id).then( - res => { - this.breadcrumbList = res.data.typeList - this.brandName = res.data.brandName - this.good = res.data.product - console.log(this.good) - this.imageList = res.data.product.carouselImages.split(",") - this.sku = res.data.projectSkuInfo - let e1 = [] - - res.data.ruleList.forEach( - rule => { - e1.push({id: rule.id, name: rule.name, value: rule.value}) - } - ) - - this.form.ruleList = e1 - this.categoryCommonElement = res.data.categoryCommonElementResp - e = [] - let e = [] - this.categoryCommonElement.attributeList.forEach( - attribute => { - e.push( - {name: attribute.name, value: attribute.value} - ) - } - ) - this.categoryCommonElement.templateAttributeList.forEach( - attribute => { - e.push( - {name: attribute.name, value: attribute.value} - ) - } - ) - let f = [] - this.categoryCommonElement.templateAttributeGroupList.forEach( - group => { - f.push(group.attributeList) - } - ) - f.forEach( - group => { - group.forEach( - group1 => { - e.push( - {name: group1.name, value: group1.value} - ) - } - ) - } - ) - - this.goodDetail = [] - this.goodDetail = e.filter(rule => rule.value !== null) - } - ) - } - } }