Frontend layout fixed

This commit is contained in:
Vion
2022-01-30 15:07:06 +08:00
parent b3c21bb35f
commit 2fdfb0e9c1
5 changed files with 31 additions and 63 deletions

View File

@@ -15,12 +15,7 @@
rc-border-colour--brand4
"
>
<div class="uservideo" v-if="videoshow">
<video controls="" preload="videoimg">
<source :src= videolist type="video/mp4">
</video>
</div>
<div class="rc-column" v-if="!videoshow">
<div class="rc-column">
<div data-js-carousel="" data-image-gallery="true">
<div
class="rc-carousel rc-carousel__gallery-image"
@@ -30,11 +25,10 @@
<!-- Big images-->
<div v-for="(item, index) in productAttachmentList" :key="index">
<div>
<img :src="item.attachmentPath" />
<!-- <img
src="https://cdn.royalcanin-weshare-online.io/m2kia2QBG95Xk-RBC8jn/v1/medium-maxi-giant-pos-2012-packshots-ma-ad-shn-packshot?w=420&fm=jpg&auto=compress"
alt="Product alt text"
/> -->
<img v-if="(item.attachmentPath.indexOf('mp4')<0)" :src="item.attachmentPath" />
<video v-if="(item.attachmentPath.indexOf('mp4')>0)" preload="meta" controls="controls">
<source :src= item.attachmentPath type="video/mp4">
</video>
</div>
</div>
@@ -57,7 +51,8 @@
:key="index"
>
<div class="rc-img--square">
<img :src="item.attachmentPath" />
<img :src="item.attachmentPath" v-if="(item.attachmentPath.indexOf('mp4')<0)" />
<img src="/images/default.jpg" v-if="(item.attachmentPath.indexOf('mp4')>0)" />
</div>
</div>
<!-- <div class="rc-carousel__gallery-thumbnail">
@@ -113,15 +108,15 @@
<span>{{ curItem.categoryName }}</span>
</div>
<div class="rc-button" v-if="!userbuy">
<span @click="chuafangbuy()">立即购买</span>
</div>
<div class="rc-button" v-if="!userbuy && curItem.goodUrl && curItem.goodUrl.length>5">
<a :href="curItem.goodUrl" target='_blank' class="ts-standard-btn">立即购买</a>
</div>
<div class="rc-productdetail" v-if="userbuy">
<i class="ts-row-title">商品价格</i>
<span class="ts-realprice">{{ curItem.ecPrice }}</span>
<span class="ts-remove ts-ecprice"
<span class="ts-remove ts-ecprice" v-if="curItem.ecPrice<curItem.rsp"
>{{ curItem.rsp }}
</span>
<span class="ts-record" v-if="curItem.basePoint!==0">
@@ -284,9 +279,9 @@
<span @click="usertanchu(curItem, 0)">加入购物车</span>
<span @click="usertanchu(curItem, 1)">立即购买</span>
</div>
<div class="rc-button rc-md-down " v-if="(!userbuy)">
<span @click="chuafangbuy()" style="margin-right: 20px">立即购买</span>
</div>
<div class="rc-button rc-md-down " v-if="!userbuy && curItem.goodUrl && curItem.goodUrl.length>5">
<a :href="curItem.goodUrl" target='_blank' class="ts-standard-btn">立即购买</a>
</div>
</div>
</template>
@@ -315,8 +310,7 @@ export default {
let userbuy = true;
let newlist = [];
let curItem = {};
let chufang = {};
let videolist=[];
let videolist=[];
let productAttachmentList = [];
let userlistmenu = [];
isRxGoods = (isRxGoods == '1'?true:false);
@@ -330,7 +324,6 @@ export default {
let data = await oncequery(mainProductCode);
let outputObj = {};
if (data) {
chufang=data;
outputObj = data;
outputObj.productName = data.name;
outputObj.picture = outputObj.picture;
@@ -379,10 +372,10 @@ export default {
activeIndexa,
curItem,
newlist,
chufang,
videolist,
productAttachmentList,
userbuy
userbuy,
isRxGoods
}
},
data() {
@@ -393,7 +386,6 @@ export default {
dialogInfo1: false,
videolist:[],
videoimg:'',
videoshow: false,
name: [],
userlist: [],
drawlist: [], //用户可以领取的优惠券
@@ -467,31 +459,6 @@ export default {
if (this.usermessage !== "" || this.usermessage.data !== undefined) {
this.usermessage = this.$store.state.userInfo;
this.productCode = this.$route.query.productCode;
//video显示
this.productAttachmentList.map(element=>{
if(element.attachmentPath.substring(element.attachmentPath.lastIndexOf(".")+1)=='mp4'){
this.videolist=element.attachmentPath;
}
})
this.videoimg=this.productAttachmentList[0].attachmentPath;
if(this.videolist.length>0){
this.videoshow=true
}else{
this.videoshow=false;
}
/*
let stype = this.$route.query.stype;
let isRxGoods = this.$route.query.isRxGoods;
isRxGoods = (isRxGoods == '1'?true:false);
if(isRxGoods){
this.rxquery(this.productCode);
this.userbuy = false;
} else {
this.userquery(this.productCode);
this.userbuy = true;
}
*/
_hmt.push([
"_trackCustomEvent",
"product_visit",
@@ -542,15 +509,6 @@ export default {
});
}
},
//处方用粮跳转
chuafangbuy(){
window.location.href =this.chufang.goodUrl;
},
// changeName(newName){
// this.name = newName;
// },
userclose() {
this.userlist = [];
this.dialogInfo1=false;