IndexMenu.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view class="div menu clear-fix">
  3. <view class="div menu-item" @click="goStoreclass">
  4. <view class="i iconfont"><image mode="aspectFit" class="img menu-item-icon" src="../../../static/image/home/icon_shop_classify_pre.png" /></view>
  5. <text class="span menu-item-title">店铺分类</text>
  6. </view>
  7. <view class="div menu-item" @click="goBrand">
  8. <view class="i iconfont"><image mode="aspectFit" class="img menu-item-icon" src="../../../static/image/home/icon_brand_name_pre.png" /></view>
  9. <text class="span menu-item-title">品牌</text>
  10. </view>
  11. <view class="div menu-item" @click="goPintuan">
  12. <view class="i iconfont"><image mode="aspectFit" class="img menu-item-icon" src="../../../static/image/home/icon_top_round_pre.png" /></view>
  13. <text class="span menu-item-title">拼团</text>
  14. </view>
  15. <view class="div menu-item" @click="goBargain">
  16. <view class="i iconfont"><image mode="aspectFit" class="img menu-item-icon" src="../../../static/image/home/icon_top_bargain_pre.png" /></view>
  17. <text class="span menu-item-title">砍价</text>
  18. </view>
  19. <view class="div menu-item" @click="goMemberPointSignin">
  20. <view class="i iconfont"><image mode="aspectFit" class="img menu-item-icon" src="../../../static/image/home/icon_top_signin_pre.png" /></view>
  21. <text class="span menu-item-title">签到</text>
  22. </view>
  23. <view class="div menu-item">
  24. <view class="i iconfont"><image mode="aspectFit" class="img menu-item-icon" @click="goNavigate('/pages/home/goodslist/Goodslist',{xianshi:1})" src="../../../static/image/home/icon_top_discount_pre.png" /></view>
  25. <text class="span menu-item-title">秒杀</text>
  26. </view>
  27. <view class="div menu-item" @click="goPointsgoods">
  28. <view class="i iconfont"><image mode="aspectFit" class="img menu-item-icon" src="../../../static/image/home/icon_top_cumulative_pre.png" /></view>
  29. <text class="span menu-item-title">积分商城</text>
  30. </view>
  31. <view class="div menu-item" @click="myOrder">
  32. <view class="i iconfont"><image mode="aspectFit" class="img menu-item-icon" src="../../../static/image/home/icon_top_order_pre.png" /></view>
  33. <text class="span menu-item-title">我的订单</text>
  34. </view>
  35. <!-- <view class="div menu-item" @click="goArticleclass">
  36. <text class="i iconfont bg-4">&#xe674;</text>
  37. <text class="span menu-item-title">帮助中心</text>
  38. </view>
  39. <view class="div menu-item" @click="goMemberIndex">
  40. <text class="i iconfont bg-2">&#xe68c;</text>
  41. <text class="span menu-item-title">个人中心</text>
  42. </view>-->
  43. <view class="div menu-item" @click="goGroupBuy">
  44. <view class="i iconfont"><image mode="aspectFit" class="img menu-item-icon" src="../../../static/image/home/icon_top_knock_pre.png" /></view>
  45. <text class="span menu-item-title">抢购</text>
  46. </view>
  47. <view class="div menu-item" @click="goPresell">
  48. <view class="i iconfont"><image mode="aspectFit" class="img menu-item-icon" src="../../../static/image/home/icon_top_yushou_pre.png" /></view>
  49. <text class="span menu-item-title">预售</text>
  50. </view>
  51. <view class="div menu-item" v-for="(item, index) in navs" :key="index" @click="goAdUrl(item)">
  52. <view class="i iconfont"><image mode="aspectFit" class="img menu-item-icon" :src="item.adv_code" /></view>
  53. <text class="span menu-item-title">{{item.adv_title}}</text>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import { urlencode } from '@/util/common'
  59. import { mapState } from 'vuex'
  60. export default {
  61. name:'HomeMenu',
  62. props: ['items'],
  63. computed: {
  64. ...mapState({
  65. isOnline: state => state.member.isOnline,
  66. navs: state => state.home.navs
  67. })
  68. },
  69. methods:{
  70. goNavigate(path,query=false){
  71. uni.navigateTo({url:path+(query?('?'+urlencode(query)):'')})
  72. },
  73. showLogin () {
  74. uni.navigateTo({ url: '/pages/home/memberlogin/Login' })
  75. },
  76. goPointsgoods () {
  77. uni.navigateTo({ url: '/pages/home/pointsgoods/Index' })
  78. },
  79. goStoreclass () {
  80. uni.navigateTo({ url: '/pages/home/storeclass/Storeclass' })
  81. },
  82. goPintuan () {
  83. uni.navigateTo({ url: '/pages/home/pintuan/PintuanList' })
  84. },
  85. goBargain () {
  86. uni.navigateTo({ url: '/pages/home/bargain/Bargainlist' })
  87. },
  88. goBrand () {
  89. uni.navigateTo({ url: '/pages/home/brand/Brand' })
  90. },
  91. goArticleclass () {
  92. uni.navigateTo({ url: '/pages/home/article/Articleclass' })
  93. },
  94. goMemberIndex () {
  95. uni.navigateTo({ url: '/pages/member/index/Index' })
  96. },
  97. goGroupBuy () {
  98. uni.navigateTo({ url: '/pages/home/groupbuy/GroupBuyList' })
  99. },
  100. goPresell () {
  101. uni.navigateTo({ url: '/pages/home/presell/PresellList' })
  102. },
  103. goMemberPointSignin () {
  104. uni.navigateTo({ url: '/pages/member/point/PointSignin' })
  105. },
  106. myOrder () {
  107. if (this.isOnline) {
  108. uni.navigateTo({ url: '/pages/member/order/OrderList'
  109. })
  110. } else {
  111. this.showLogin()
  112. }
  113. },
  114. goAdUrl (item) {
  115. uni.navigateTo({url:item.adv_typedate})
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. .menu {
  122. overflow: hidden;
  123. justify-content: space-around;
  124. background: #FFFFFF;
  125. box-sizing: border-box;
  126. padding-left:.7rem;
  127. padding-right:.7rem;
  128. margin-bottom:$modelSpace;
  129. .menu-item {
  130. width:20%;
  131. padding:0 .7rem;
  132. padding-bottom:20%;
  133. height: 0;
  134. box-sizing: border-box;
  135. text-align:center;
  136. position: relative;
  137. float: left;
  138. .iconfont{
  139. position: absolute;
  140. margin:auto;
  141. top: 0;
  142. bottom:1.4rem;
  143. left:.7rem;
  144. right:.7rem;
  145. font-size:0;
  146. color:#fff;
  147. overflow: hidden;
  148. display:block;
  149. text-align: center;
  150. }
  151. .menu-item-icon {
  152. width: 100%;
  153. height: 100%;
  154. overflow: hidden;
  155. }
  156. .menu-item-title {
  157. position: absolute;
  158. left:0;
  159. right:0;
  160. bottom:.6rem;
  161. display:block;
  162. color: $formInputColor;
  163. font-size:$fontSize;
  164. overflow: hidden;
  165. text-overflow: ellipsis;
  166. white-space: nowrap;
  167. }
  168. }
  169. }
  170. .bg-1{background-image: linear-gradient(to bottom , #d69dcc,#e8198b );}
  171. .bg-2{background-image: linear-gradient(to bottom , #04befe,#4481eb );}
  172. .bg-3{background-image: linear-gradient(to bottom , #cc208e,#6713d2 );}
  173. .bg-4{background-image: linear-gradient(to bottom , #ff9a44,#fc6076 );}
  174. .bg-5{background-image: linear-gradient(to bottom , #00ecbc,#007adf );}
  175. .bg-6{background-image: linear-gradient(to bottom , #ff8177,#b12a5b );}
  176. </style>