index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view class="pages">
  3. <view class="" :style="{height: navHeight+'px' }"></view>
  4. <view class="page-wrap">
  5. <view class="user u-flex" @click="$u.route('/center/center',{})">
  6. <u-icon name="../../static/img/icon-user.png" color="#333" size="38rpx"></u-icon>
  7. <text class="name">{{vuex_user_info.username}}</text>
  8. <!-- <text class="level">白金代理人</text> -->
  9. </view>
  10. <u-swiper
  11. :list="bannerList"
  12. indicator
  13. height="130"
  14. keyName="sliderImg"
  15. indicatorMode="dot"
  16. @click="bannerClick()"
  17. ></u-swiper>
  18. <view class="icon-nav u-flex u-row-around">
  19. <!-- <view class="nav-item" @click="$u.route('/center/mybalance')">
  20. <u--image class="image" :src="staticUrl+'/img/index-nav-4.png'" width="101rpx" height="101rpx"></u--image>
  21. 需要删除
  22. </view> -->
  23. <view class="nav-item" @click="$u.route('/shopping/producTypetList',{})">
  24. <u--image class="image" src="../../static/img/index-nav-1.png" width="101rpx" height="101rpx"></u--image>
  25. 选品
  26. </view>
  27. <view class="nav-item" @click="$u.route('/shopping/cart',{})">
  28. <u--image class="image" src="../../static/img/index-nav-2.png" width="101rpx" height="101rpx"></u--image>
  29. 购物车
  30. </view>
  31. <view class="nav-item" @click="$u.route('/center/dealList',{})">
  32. <u--image class="image" src="../../static/img/index-nav-3.png" width="101rpx" height="101rpx"></u--image>
  33. 我的业绩
  34. </view>
  35. <view class="nav-item" @click="$u.route('/center/client',{type:'reLaunch'})">
  36. <u--image class="image" src="../../static/img/index-nav-4.png" width="101rpx" height="101rpx"></u--image>
  37. 我的会员
  38. </view>
  39. <view class="nav-item" @click="$u.route('/center/mystore',{type:'reLaunch'})">
  40. <u--image class="image" src="../../static/img/index-nav-5.png" width="101rpx" height="101rpx"></u--image>
  41. 我的门店
  42. </view>
  43. </view>
  44. <view class="hot-product">
  45. <view class="single-til u-flex u-row-between">
  46. <text class="text">热销产品</text>
  47. <!-- <view class="u-flex" @click="$u.route('/shopping/productList',{typeId:1,typeName:'热销产品',type:'redirectTo'})">
  48. <text class="more-text">更多</text>
  49. <u-icon name="arrow-right" color="#676767" size="24rpx"></u-icon>
  50. </view> -->
  51. </view>
  52. <view class="product u-flex" @click="$u.route('/shopping/productdetails',{id:item.id})" v-for="item in hotGoods" :key="item.id">
  53. <u--image :showLoading="true" :src="item.mainImg" width="180rpx" height="180rpx"></u--image>
  54. <view class="text">
  55. <view class="name ellipsis-2">{{item.goodsName}}</view>
  56. <view class="u-flex u-row-between">
  57. <view class="left">
  58. <view class="up">
  59. <view class="">
  60. <text class="price">¥ <text class="price-num">{{item.patchPrice}}</text></text>
  61. </view>
  62. </view>
  63. <view class="down">
  64. <text class="original-price gray line-through">¥ {{item.salePrice}}</text>
  65. </view>
  66. </view>
  67. <view class="btn">去看看</view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="experience">
  73. <view class="single-til u-flex u-row-between">
  74. <text class="text">体验店分布</text>
  75. <!-- <view class="u-flex">
  76. <text class="more-text" @click="$u.route('/xushuo/experience')">更多</text>
  77. <u-icon name="arrow-right" color="#676767" size="24rpx"></u-icon>
  78. </view> -->
  79. </view>
  80. <view class="index-img">
  81. <u--image class="image" :src="indexData.uxImg" width="100%" height="500rpx" radius="15rpx"></u--image>
  82. </view>
  83. </view>
  84. <!-- <tabbar :tabbarIndexProps='0' /> -->
  85. </view>
  86. <u-toast ref="uToast"></u-toast>
  87. </view>
  88. </template>
  89. <script>
  90. import { systemInfo } from "@/mixin.js";
  91. import tabbar from "../../components/tabbar.vue";
  92. export default {
  93. components:{
  94. tabbar,
  95. },
  96. mixins:[systemInfo],
  97. data() {
  98. return {
  99. staticUrl:this.$commonConfig.staticUrl,
  100. advantageSize:14,
  101. bannerList: [],
  102. hotGoods:[],
  103. xsIntro:{},
  104. indexData:{},
  105. }
  106. },
  107. onLoad() {
  108. // let userInfo = uni.getStorageSync('userInfo');
  109. // console.log('userInfo',userInfo);
  110. let that = this;
  111. this.swiperList();
  112. this.getSystemInfo();
  113. // console.log('statusBarHeight',this.statusBarHeight);
  114. // console.log('navigationBarHeight',this.navigationBarHeight);
  115. // console.log('windowHeight',this.windowHeight);
  116. // console.log('navHeight',this.navHeight);
  117. },
  118. onShow() {
  119. this.getHotGoods();
  120. this.getIndexData();
  121. },
  122. methods: {
  123. swiperList(){
  124. this.$u.api.swiperList({postion:4}).then(res=>{
  125. this.bannerList = res.data.rows;
  126. // console.log('res',res.data.rows);
  127. }).catch(err=>{
  128. console.log('swiperList',err.data);
  129. })
  130. },
  131. bannerClick(e){
  132. // console.log('e',e);
  133. // console.log('bannerClick',this.bannerList[e]);
  134. let item = this.bannerList[e];
  135. uni.$u.route('/xushuo/dynamicdetails', {
  136. type: 'swiperDetail',
  137. id: item.id
  138. });
  139. },
  140. getHotGoods(){
  141. this.$u.api.topGoodList({pageNum:1,pageSize:1}).then(res=>{
  142. this.hotGoods = res.data.rows;
  143. console.log('res',res);
  144. }).catch(err=>{
  145. console.log('getHotGoods',err.data);
  146. })
  147. },
  148. getIndexData(){
  149. this.$u.api.indexData().then(res=>{
  150. this.indexData = res.data;
  151. console.log('this.indexData',this.indexData);
  152. }).catch(err=>{
  153. console.log('getHotGoods',err.data);
  154. })
  155. },
  156. }
  157. }
  158. </script>
  159. <style>
  160. page{
  161. background-color: #F9F9F9;
  162. padding-top: 0;
  163. }
  164. </style>
  165. <style lang="scss" scoped>
  166. .page-bg{
  167. .img{
  168. height: 100vh;
  169. }
  170. }
  171. .icon-nav{
  172. margin: 50rpx auto;
  173. }
  174. .user{
  175. margin-bottom: 40rpx;
  176. .name{
  177. margin: 0 20rpx 0 24rpx;
  178. font-size: 36rpx;
  179. font-weight: 600;
  180. color: #333333;
  181. }
  182. .level{
  183. font-size: 20rpx;
  184. font-weight: 400;
  185. color: #999999;
  186. }
  187. }
  188. .experience{
  189. margin-bottom: 50rpx;
  190. }
  191. .product{
  192. background-color: #F5F5F5;
  193. border-bottom: 0;
  194. .btn{
  195. padding: 14rpx 40rpx;
  196. background: linear-gradient(90deg, #00D17D 0%, #00A447 100%);
  197. color: #fff;
  198. position: relative;
  199. right: -20rpx;
  200. border-top-left-radius: 50rpx;
  201. border-bottom-left-radius: 50rpx;
  202. }
  203. }
  204. </style>