index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="home" :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox" :style="'backgroundColor:'+backgroundColor">
  4. <uni-nav-bar color="#272727" title="商圈" :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
  5. </uni-nav-bar>
  6. <view class="flexc plr12 mt10 mb10">
  7. <view class="topl flexc">
  8. <image :src="adrimg" ></image>
  9. <view class="over">{{city}}</view>
  10. </view>
  11. <view class="search flexc">
  12. <image :src="search"></image>
  13. <!-- confirm-type="search" @confirm="getConfirm" -->
  14. <input placeholder="请输入商品名称进行搜索" v-model="text"/>
  15. <view class="btn" @click="getConfirm">搜索</view>
  16. </view>
  17. </view>
  18. </view>
  19. <!-- 主体 -->
  20. <view class="wymain mt10">
  21. <!-- 轮播图 circular-->
  22. <swiper class="swiper mb12" circular :indicator-color="incolorh" :indicator-active-color="activecolorh" :indicator-dots="indicatorDotsh" :autoplay="autoplayh">
  23. <!-- v-if="checkPermi(['system:application:list'])" -->
  24. <swiper-item>
  25. <image :src="banner" class="bannerimg"></image>
  26. </swiper-item>
  27. </swiper>
  28. <view class="grid mb18">
  29. <view class="grid-item-box" @click="getHouseFn" >
  30. <view class="img"><image :src="gtaba" class="imga"></image></view>
  31. <view>积分商城</view>
  32. </view>
  33. <view class="grid-item-box" @click="getCarFn" >
  34. <view class="img"><image :src="gtabb" class="imga"></image></view>
  35. <view>每日签到</view>
  36. </view>
  37. <view class="grid-item-box" @click="getBusListFn(1)" >
  38. <view class="img"><image :src="gtabc" class="imga"></image></view>
  39. <view>领券中心</view>
  40. </view>
  41. <view class="grid-item-box" @click="getBusListFn(1)" >
  42. <view class="img"><image :src="gtabd" class="imga"></image></view>
  43. <view>精选商品</view>
  44. </view>
  45. </view>
  46. </view>
  47. <!-- 今日优惠 -->
  48. <view class="hlist">
  49. <view class="hlista flexc mb12 ">
  50. <view class="line" ></view>
  51. <view class="tit flex1">今日优惠</view>
  52. <view class="more flex0 flexc">更多<image :src="more"></image></view>
  53. </view>
  54. </view>
  55. <view class="mb20">
  56. <box-list type='coupon' :datainfo="list"></box-list>
  57. </view>
  58. <!-- 推荐商品 -->
  59. <view class="hlist">
  60. <view class="hlista flexc mb15 ">
  61. <view class="line" ></view>
  62. <view class="tit flex1">推荐商品</view>
  63. <view class="more flex0 flexc" @click="getMoreFn">更多<image :src="more"></image></view>
  64. </view>
  65. </view>
  66. <view class="mb4">
  67. <box-list type='goods' :datainfo="list"></box-list>
  68. </view>
  69. <loading></loading>
  70. <pop-up :type="type" @getClose="getClose"></pop-up>
  71. <footers v-if="isfootflag" :footerindex="footerindex"></footers>
  72. </view>
  73. </template>
  74. <script>
  75. import footers from '@/components/footer/footer.vue'
  76. import notice from '@/components/swiper/notice.vue'
  77. import boxList from "@/components/box/list.vue"
  78. import popUp from "@/components/box/popup.vue"
  79. export default {
  80. components:{footers,notice,boxList,popUp},
  81. data(){
  82. return{
  83. footerindex:'goods',
  84. isfootflag:true,
  85. nvaHeight:96,
  86. activeColor:'#A7A7A7',
  87. nactiveColor:'#E6E6E6',
  88. text:'',
  89. backgroundColor: "transparent",
  90. adrimg:require("@/static/images/goods/adr.png"),
  91. search:require('@/static/images/goods/search.png'),
  92. banner:require('@/static/images/goods/banner.png'),
  93. gtaba:require("@/static/images/goods/gtaba.png"),
  94. gtabb:require("@/static/images/goods/gtabb.png"),
  95. gtabc:require("@/static/images/goods/gtabc.png"),
  96. gtabd:require("@/static/images/goods/gtabd.png"),
  97. more:require("@/static/images/home/more.png"),
  98. type:'',//wygj
  99. wtdt:"加载更多",
  100. autoplay:false,
  101. autoplayh:false,
  102. incolorh:'#E6E6E6',
  103. activecolorh:'#A7A7A7',
  104. indicatorDotsh: false,
  105. city:'幸福大街',
  106. list:[],
  107. tabval:0,
  108. tablist:[{tit:'本地资讯',val:"0"},{tit:'供求资讯',val:"1"},{tit:'热门资讯',val:"2"}],
  109. noticelist:[{noticeTitle:"您有1条报修信息,请及时查看处理!",num:'11-14'},{noticeTitle:"您有1条报修信息,请及时查看处理!",num:'11-14'}]
  110. }
  111. },
  112. onPageScroll(e) {
  113. var scrollTop = Number(e.scrollTop);
  114. if (scrollTop > 0) {
  115. this.backgroundColor = '#FFF7E1'
  116. } else {
  117. this.backgroundColor = 'transparent'
  118. }
  119. },
  120. onLoad: function() {
  121. uni.getSystemInfo({
  122. success: (e) => {
  123. this.nvaHeight = Number(e.statusBarHeight)+96;
  124. }
  125. })
  126. },
  127. methods:{
  128. getClose(){
  129. this.type=''
  130. },
  131. getNoticeDet(){
  132. },
  133. getZhanFn(){
  134. this.zhanflag=!this.zhanflag
  135. },
  136. getMoreFn(){//积分商城
  137. this.$tab.navigateTo(`/goods/pages/points/index`)
  138. },
  139. }
  140. }
  141. </script>
  142. <style lang="scss" scoped>
  143. .home{min-height: 100vh;background: linear-gradient(180deg, #FFF6E1 0%, rgba(214,164,164,0) 100%) no-repeat;background-size: 100% 614rpx;}
  144. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  145. .navbg{width: 100%;height: 782rpx;}
  146. .wymain{z-index: 2;position: relative;padding: 0 24rpx;}
  147. .topl{overflow: hidden;padding-left: 2rpx;max-width: 240rpx;
  148. image{width: 18rpx;height: 22rpx;margin-right: 14rpx;flex: 0 0 auto;}
  149. view{font-weight: bold;font-size: 26rpx;color: #272727;}
  150. }
  151. .search{flex: 1;margin-left: 16rpx;height: 64rpx;background: #FFFFFF;border-radius: 32rpx;border: 2rpx solid #FE5A0E;padding-left: 24rpx;box-sizing: border-box;
  152. image{width: 32rpx;height: 34rpx;margin-right: 22rpx;flex: 0 0 auto;}
  153. input{flex: 1;font-size: 26rpx;color: #272727;}
  154. .btn{width: 100rpx;height: 64rpx;background: #FE5A0E;border-radius: 32rpx;flex: 0 0 auto;font-weight: bold;text-align: center;line-height: 64rpx;font-size: 26rpx;color: #FFFFFF;}
  155. }
  156. .swiper{
  157. width: 100%;height: 314rpx;
  158. image{width: 100%;height: 314rpx;}
  159. }
  160. .line{width: 14rpx;height: 48rpx;background: #FE5A0E;border-radius:0 12rpx 12rpx 0;margin-right: 18rpx;}
  161. // tab栏
  162. .grid{
  163. display: flex;align-items: center;flex-wrap: wrap;
  164. .grid-item-box {display: flex;flex-direction: column;align-items: center;width: 25%;box-sizing: border-box;
  165. .img{width: 108rpx;height: 108rpx;display: flex;align-items: center;justify-content: center;
  166. .imga{width: 108rpx;height: 108rpx;}
  167. }
  168. view{font-weight: bold;font-size: 26rpx;color: #272727;position: relative;}
  169. }
  170. }
  171. .hlist{
  172. .hlista{padding: 8rpx 0;
  173. .limg{width: 32rpx;height: 32rpx;margin-right: 18rpx;}
  174. .tit{font-weight: bold;font-size: 30rpx;color: #272727;}
  175. .more{font-weight: 500;font-size: 24rpx;color: #AAAAAA;
  176. image{width: 18rpx;height: 16rpx;margin-left: 16rpx;}
  177. }
  178. .htabs{flex: 1;overflow: auto;padding: 10rpx 0;
  179. view{font-weight: 500;font-size: 28rpx;color: #666666;position: relative;height: 56rpx;line-height: 56rpx;margin-right: 48rpx;flex: 0 0 auto;
  180. &.act{font-size: 15px;font-weight: bold;color: #272727;
  181. &:after{width: 36rpx;height: 10rpx;background: linear-gradient(150deg, rgba(177,240,216,0.97), rgba(3,218,138,0.97));border-radius: 6rpx;content: '';position: absolute;bottom: -10rpx;left: 50%;margin-left: -18rpx;}
  182. }
  183. }
  184. }
  185. }
  186. }
  187. </style>