index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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="staticUrl+'/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="staticUrl+'/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="staticUrl+'/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="staticUrl+'/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="staticUrl+'/img/index-nav-4.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="" v-if="vuex_member_info.priceType>1">
  60. <text class="price">¥ <text class="price-num">{{item.vipPrice}}</text></text>
  61. <text class="vip-icon">VIP</text>
  62. </view>
  63. <view class="" v-else>
  64. <text class="price">¥ <text class="price-num">{{item.salePrice}}</text></text>
  65. </view>
  66. </view>
  67. <view class="down">
  68. <!-- <text class="discount">8.8折</text> -->
  69. <text v-if="vuex_member_info.priceType>1" class="original-price gray line-through">¥ {{item.salePrice}}</text>
  70. <!-- <text class="sales gray">销量 {{item.salePrice}}</text> -->
  71. </view>
  72. </view>
  73. <!-- <u--image :showLoading="false" @click.native.stop="addCart(item.id)" :src="staticUrl+'/img/add.png'" width="48rpx" height="48rpx"></u--image> -->
  74. <view class="btn">去看看</view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="experience">
  80. <view class="single-til u-flex u-row-between">
  81. <text class="text">体验店分布</text>
  82. <!-- <view class="u-flex">
  83. <text class="more-text" @click="$u.route('/xushuo/experience')">更多</text>
  84. <u-icon name="arrow-right" color="#676767" size="24rpx"></u-icon>
  85. </view> -->
  86. </view>
  87. <view class="index-img">
  88. <u--image class="image" :src="indexData.uxImg" width="100%" height="500rpx" radius="15rpx"></u--image>
  89. </view>
  90. </view>
  91. <!-- <tabbar :tabbarIndexProps='0' /> -->
  92. </view>
  93. <u-toast ref="uToast"></u-toast>
  94. </view>
  95. </template>
  96. <script>
  97. import { systemInfo } from "@/mixin.js";
  98. import tabbar from "../../components/tabbar.vue";
  99. export default {
  100. components:{
  101. tabbar,
  102. },
  103. mixins:[systemInfo],
  104. data() {
  105. return {
  106. staticUrl:this.$commonConfig.staticUrl,
  107. advantageSize:14,
  108. bannerList: [],
  109. hotGoods:[],
  110. xsIntro:{},
  111. indexData:{},
  112. }
  113. },
  114. onLoad() {
  115. // let userInfo = uni.getStorageSync('userInfo');
  116. // console.log('userInfo',userInfo);
  117. let that = this;
  118. this.swiperList();
  119. this.getSystemInfo();
  120. // console.log('statusBarHeight',this.statusBarHeight);
  121. // console.log('navigationBarHeight',this.navigationBarHeight);
  122. // console.log('windowHeight',this.windowHeight);
  123. // console.log('navHeight',this.navHeight);
  124. },
  125. onShow() {
  126. this.getHotGoods();
  127. this.getIndexData();
  128. },
  129. methods: {
  130. swiperList(){
  131. this.$u.api.swiperList({postion:4}).then(res=>{
  132. this.bannerList = res.data.rows;
  133. // console.log('res',res.data.rows);
  134. }).catch(err=>{
  135. console.log('swiperList',err.data);
  136. })
  137. },
  138. bannerClick(e){
  139. // console.log('e',e);
  140. // console.log('bannerClick',this.bannerList[e]);
  141. let item = this.bannerList[e];
  142. uni.$u.route('/xushuo/dynamicdetails', {
  143. type: 'swiperDetail',
  144. id: item.id
  145. });
  146. },
  147. getHotGoods(){
  148. this.$u.api.topGoodList({pageNum:1,pageSize:1}).then(res=>{
  149. this.hotGoods = res.data.rows;
  150. console.log('res',res);
  151. }).catch(err=>{
  152. console.log('getHotGoods',err.data);
  153. })
  154. },
  155. getIndexData(){
  156. this.$u.api.indexData().then(res=>{
  157. this.indexData = res.data;
  158. console.log('this.indexData',this.indexData);
  159. }).catch(err=>{
  160. console.log('getHotGoods',err.data);
  161. })
  162. },
  163. }
  164. }
  165. </script>
  166. <style>
  167. page{
  168. background-color: #F9F9F9;
  169. padding-top: 0;
  170. }
  171. </style>
  172. <style lang="scss" scoped>
  173. .page-bg{
  174. .img{
  175. height: 100vh;
  176. }
  177. }
  178. .icon-nav{
  179. margin: 50rpx auto;
  180. }
  181. .user{
  182. margin-bottom: 40rpx;
  183. .name{
  184. margin: 0 20rpx 0 24rpx;
  185. font-size: 36rpx;
  186. font-weight: 600;
  187. color: #333333;
  188. }
  189. .level{
  190. font-size: 20rpx;
  191. font-weight: 400;
  192. color: #999999;
  193. }
  194. }
  195. .experience{
  196. margin-bottom: 50rpx;
  197. }
  198. .product{
  199. background-color: #F5F5F5;
  200. border-bottom: 0;
  201. .btn{
  202. padding: 14rpx 40rpx;
  203. background: linear-gradient(90deg, #00D17D 0%, #00A447 100%);
  204. color: #fff;
  205. position: relative;
  206. right: -20rpx;
  207. border-top-left-radius: 50rpx;
  208. border-bottom-left-radius: 50rpx;
  209. }
  210. }
  211. </style>