diff --git a/pages/bookShop/commodityDetail.vue b/pages/bookShop/commodityDetail.vue index 5e97b70..bca8187 100644 --- a/pages/bookShop/commodityDetail.vue +++ b/pages/bookShop/commodityDetail.vue @@ -8,7 +8,8 @@ - + + @@ -36,7 +37,7 @@ - + {{item.productName}} @@ -111,8 +112,8 @@ - + @@ -122,7 +123,8 @@ - 评价({{commentsList?commentsList.length:0}}) + 评价({{commentsList?commentsList.length:0}}) + @@ -176,7 +178,8 @@ - + 查看详情 @@ -185,8 +188,8 @@ - - + + {{item.productName}} - @@ -213,7 +215,7 @@ import { mapState } from 'vuex'; - import loginVue from '../user/login.vue'; + import loginVue from '../user/login.vue'; export default { data() { return { @@ -223,7 +225,7 @@ options: [{ icon: 'cart', text: '购物车' - }], + }], buttonGroup: [{ text: '加入购物车', backgroundColor: 'linear-gradient(90deg, #FFCD1E, #FF8A18)', @@ -253,7 +255,7 @@ listenList: [], // 关联得听书 linkProducts: [], // 关联的商品, upoShow: false, // 显示底部购买选项 - linkCur: 0, // 当前选中的关联项 + linkCur: 0, // 当前选中的关联项 } }, onLoad(e) { @@ -269,7 +271,13 @@ components: { musicPlay }, - methods: { + methods: { + showImg(e) { + // console.log(e,'点击的内容') + // let contentimg = e.target.dataset.nodes; + this.previewImage(e.target.node.attrs.src) + }, + gotoDetail(item) { // console.log(item,'gotoDetail') uni.navigateTo({ @@ -295,14 +303,14 @@ }) .then(res => { console.log('关联商品', res) - if (res.code == 0) { + if (res.code == 0) { if (res.result.length > 0) { this.linkProducts = res.result this.linkimg = this.linkProducts[0].productImages this.linkCur = 0 - }else{ + } else { this.linkProducts = [] - } + } } }) .catch(e => { @@ -320,9 +328,9 @@ console.log(url) uni.previewImage({ urls: [url], - longPressActions:{ - itemList:['很抱歉,暂不支持保存图片到本地'], - success:function(res){ + longPressActions: { + itemList: ['很抱歉,暂不支持保存图片到本地'], + success: function(res) { // console.log(res,'+++++') } } @@ -479,17 +487,17 @@ // console.log(e) if (e.index == 0) { // 点击的是加入购物车 - // console.log('+.........',this.linkProducts,'this.linkProducts') - if (this.linkProducts.length == 0) { - this.addCart() + // console.log('+.........',this.linkProducts,'this.linkProducts') + if (this.linkProducts.length == 0) { + this.addCart() } else { this.upoShow = true } } else { // 点击的是立即购买 - if (this.linkProducts.length == 0) { - this.goPurse() + if (this.linkProducts.length == 0) { + this.goPurse() } else { this.upoShow = true } @@ -699,6 +707,10 @@ 'max-width:100%;'); return match; }); + // newContent = newContent.replace(/]*>/gi, function(match, capture) { + // match = match.replace(/]*>/gi, "@click='1111'").replace(/]*>/gi, "@click='1111'"); + // return match; + // }); newContent = newContent.replace(/]*\/>/gi, ''); newContent = newContent.replace(/\ - - + + + + +