当前位置:   article > 正文

vue-首页

vue

<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>




  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/619636
推荐阅读
相关标签