赞
踩
<template> <div class="maincont"> <div class="head-top"> <img src="@/assets/images/head.jpg"/> <dl> <dt> <a v-if="is_login" href="user.html"> <img :src="user_info.head_img"/> </a> <a v-else href="javascript:;" @click="gotoPage('Login')"> <img src="@/assets/images/touxiang.jpg"/> </a> </dt> <dd> <h1 v-if="is_login" class="username">{{user_info.user_name}}</h1> <h1 v-else class="username">请先登录,登陆之后可以查看</h1> <ul> <li><a href="prolist.html"><strong>34</strong> <p>全部商品</p></a></li> <li><a href="javascript:;"><span class="glyphicon glyphicon-star-empty"></span> <p>收藏本店</p></a></li> <li style="background:none;"><a href="javascript:;"><span class="glyphicon glyphicon-picture"></span> <p>二维码</p></a></li> <div class="clearfix"></div> </ul> </dd> <div class="clearfix"></div> </dl> </div><!--head-top/--> <form action="#" method="get" class="search"> <input type="text" class="seaText fl"/> <input type="submit" value="搜索" class="seaSub fr"/> </form><!--search/--> <ul class="reg-login-click" v-if="is_login==0"> <li><a href="javascript:;" @click="gotoPage('Login')">登录</a></li> <li><a href="javascript:;" @click="gotoPage('Reg')" class="rlbg">注册</a></li> <div class="clearfix"></div> </ul><!--reg-login-click/--> <div class="one">最新活动</div> <div id="sliderA" class="slider"> <img src="@/assets/images/image1.jpg"/> <img src="@/assets/images/image2.jpg"/> <img src="@/assets/images/image3.jpg"/> <img src="@/assets/images/image4.jpg"/> <img src="@/assets/images/image5.jpg"/> </div><!--sliderA/--> <div class="one">分类推荐</div> <ul class="pronav"> <li><a href="prolist.html">晋恩干红</a></li> <li><a href="prolist.html">万能手链</a></li> <li><a href="prolist.html">高级手镯</a></li> <li><a href="prolist.html">特异戒指</a></li> <div class="clearfix"></div> </ul><!--pronav/--> <div class="one">热销商品</div> <div class="prolist"> <dl> <dt><a href="proinfo.html"><img src="@/assets/images/prolist1.jpg" width="100" height="100"/></a></dt> <dd> <h3><a href="proinfo.html">四叶草</a></h3> <div class="prolist-price"><strong>¥299</strong> <span>¥599</span></div> <div class="prolist-yishou"><span>5.0折</span> <em>已售:35</em></div> </dd> <div class="clearfix"></div> </dl> <dl> <dt><a href="proinfo.html"><img src="@/assets/images/prolist1.jpg" width="100" height="100"/></a></dt> <dd> <h3><a href="proinfo.html">四叶草</a></h3> <div class="prolist-price"><strong>¥299</strong> <span>¥599</span></div> <div class="prolist-yishou"><span>5.0折</span> <em>已售:35</em></div> </dd> <div class="clearfix"></div> </dl> <dl> <dt><a href="proinfo.html"><img src="@/assets/images/prolist1.jpg" width="100" height="100"/></a></dt> <dd> <h3><a href="proinfo.html">四叶草</a></h3> <div class="prolist-price"><strong>¥299</strong> <span>¥599</span></div> <div class="prolist-yishou"><span>5.0折</span> <em>已售:35</em></div> </dd> <div class="clearfix"></div> </dl> </div><!--prolist/--> <div class="one">推荐商品</div> <div class="index-pro1"> <div class="index-pro1-list"> <dl> <dt><a href="proinfo.html"><img src="@/assets/images/pro1.jpg"/></a></dt> <dd class="ip-text"><a href="proinfo.html">这是产品的名称</a><span>已售:488</span></dd> <dd class="ip-price"><strong>¥299</strong> <span>¥599</span></dd> </dl> </div> <div class="index-pro1-list"> <dl> <dt><a href="proinfo.html"><img src="@/assets/images/pro1.jpg"/></a></dt> <dd class="ip-text"><a href="proinfo.html">这是产品的名称</a></dd> <dd class="ip-price"><strong>¥299</strong> <span>¥599</span></dd> </dl> </div> <div class="index-pro1-list"> <dl> <dt><a href="proinfo.html"><img src="@/assets/images/pro1.jpg"/></a></dt> <dd class="ip-text"><a href="proinfo.html">这是产品的名称</a><span>已售:488</span></dd> <dd class="ip-price"><strong>¥299</strong> <span>¥599</span></dd> </dl> </div> <div class="index-pro1-list"> <dl> <dt><a href="proinfo.html"><img src="@/assets/images/pro1.jpg"/></a></dt> <dd class="ip-text"><a href="proinfo.html">这是产品的名称</a></dd> <dd class="ip-price"><strong>¥299</strong> <span>¥599</span></dd> </dl> </div> <div class="index-pro1-list"> <dl> <dt><a href="proinfo.html"><img src="@/assets/images/pro1.jpg"/></a></dt> <dd class="ip-text"><a href="proinfo.html">这是产品的名称</a><span>已售:488</span></dd> <dd class="ip-price"><strong>¥299</strong> <span>¥599</span></dd> </dl> </div> <div class="index-pro1-list"> <dl> <dt><a href="proinfo.html"><img src="@/assets/images/pro1.jpg"/></a></dt> <dd class="ip-text"><a href="proinfo.html">这是产品的名称</a></dd> <dd class="ip-price"><strong>¥299</strong> <span>¥599</span></dd> </dl> </div> <div class="index-pro1-list"> <dl> <dt><a href="proinfo.html"><img src="@/assets/images/pro1.jpg"/></a></dt> <dd class="ip-text"><a href="proinfo.html">这是产品的名称</a><span>已售:488</span></dd> <dd class="ip-price"><strong>¥299</strong> <span>¥599</span></dd> </dl> </div> <div class="clearfix"></div> </div><!--index-pro1/--> <tab-bar></tab-bar> </div><!--maincont--> </template> <script> import "@/assets/css/bootstrap.min.css" import "@/assets/css/style.css" import "@/assets/css/response.css" import "@/assets/js/jquery.min.js" import "@/assets/js/jquery.excoloSlider.js" import "@/assets/js/style.js" import TabBar from "./Public/TabBar"; import Common from "../Mixins/Common"; export default { name: 'Index', components: {TabBar}, mixins:[ Common ], data () { return { is_login: 0, user_info:[] } }, component: { TabBar:TabBar }, methods: { }, mounted(){ $("#sliderA").excoloSlider(); // 判断用户是否登陆 let user_info = this.getUserInfo(); if( user_info ){ this.is_login=1; this.user_info = user_info; } console.log( user_info); } } </script> <!-- Add "scoped" attribute to limit CSS to this component only --> <style scoped> .username{ background-color: #00CC00; } </style>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。