添加面包屑以及其它

This commit is contained in:
952108534@qq.com
2022-01-10 22:01:29 +08:00
parent 069d6d2531
commit be96454365
9 changed files with 528 additions and 36 deletions

View File

@@ -2,12 +2,15 @@
<div>
<div class="user" v-for="(item,index) in newlist" :key="index">
<Myheader></Myheader>
<unlogin></unlogin>
<tabs></tabs>
<div class="online" ></div>
<div class="rc-top"></div>
<div class="rc-usermain ts-product-detail">
<magnifier v-bind:parentmsg="msg" ></magnifier>
<magnifier ></magnifier>
<div class="rc-header" >
<div class="usermain">
<div class="online"></div>
<div class="online" id="fixed-catbar-seperator"></div>
<div class="rc-main">
<div class="rc-title">
<h2>{{ item.productName }}</h2>
@@ -89,9 +92,21 @@
</div>
</div>
<div class="rc-footimage">
<div class="rc-footimage" >
<img :src=item.showImgFile alt="">
</div>
<div class="rc-fixright" >
<ul >
<li v-for="(userfixed,index) in fixedlist" :key="index" @click="lianxi(userfixed,index)">
<img :src="userfixed.catimage" alt="">
<span> {{userfixed.title}}</span>
</li>
</ul>
<div class="tuntop" @click="toTop" v-show="gotop">
<img src="../../assets/image/turntop.png" alt="">
回到顶部
</div>
</div>
<Myfooter v-on:litentop='showmesg'></Myfooter>
</div>
@@ -165,17 +180,23 @@
<script>
import Myheader from "~/components/header.vue";
import Magnifier from "@/components/magnifier.vue";
import magnifier from "@/components/magnifier.vue";
import tabs from "@/components/tabs.vue";
import unlogin from "~/components/unlogin.vue";
import { mapMutations } from "vuex";
import Myfooter from "~/components/rc-footer.vue";
import { goodsmessage,getConfig,postCourseId,getdraw,alldiscount } from "../../ajax/getData";
const settings = require("@/config");
export default {
middleware: 'metaTitle',
// middleware: 'metaTitle',
meta: {title: '产品详情'},
data() {
return {
tableLabelTest:[],
userimage: require("../../assets/image/unused.png"),
activeIndexa:0,
gotop: false,
dialogInfo1:false,
name: [],
userlist:[],
@@ -208,6 +229,25 @@ export default {
catimage: require("../../assets/image/unused.png"),
},
],
fixedlist: [
{
title: "购物车",
catimage: require("../../assets/buy.png"),
},
{
title: "在线客服",
catimage: require("../../assets/service.png"),
},
{
title: "营养专家",
catimage: require("../../assets/consult.png"),
},
],
newlist: [
@@ -232,14 +272,18 @@ export default {
};
},
components: {
Myheader,
Magnifier,
tabs,
magnifier,
unlogin,
Myfooter
},
mounted() {
window.addEventListener("scroll", this.handleScroll, true);
if(this.usermessage!=='' ||this.usermessage.data!==undefined){
this.usermessage= JSON.parse(localStorage.getItem("userInfo"));
let stype=this.$route.query.stype;
@@ -267,6 +311,52 @@ this.usermessage= JSON.parse(localStorage.getItem("userInfo"));
},
methods: {
...mapMutations(["changemessage"]),
handleScroll(e)
{
let fixedCatbarSeperator = document.getElementById("fixed-catbar-seperator");
let scrolltop = document.documentElement.scrollTop || document.body.scrollTop;
if((scrolltop-fixedCatbarSeperator.offsetTop))
{
this.gotop = true
}
else
{
this.gotop = false;
}
},
lianxi(item,index){
console.log(item,index);
if(item.title=='在线客服'){
var option = {
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
}
dis_livchat(option);
}
if(item.title=='购物车'){
console.log('---12314');
this.$router.push({
path: "../../myorder/userrecord",
});
}
if(item.title=='营养专家'){
var option = {
customer: {id: '', name: '', email: '', mobile: '', memberId: '999999'}
}
dis_livchat(option);
}
},
toTop() {
let top = document.documentElement.scrollTop || document.body.scrollTop;
// 实现滚动效果
const timeTop = setInterval(() => {
document.body.scrollTop = document.documentElement.scrollTop = top -= 400;
if (top <= 0) {
clearInterval(timeTop);
}
}, 10);
},
showmesg(){
console.log('-----');
this.toTop();