good-floor.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view class="container floor clearfix" :style="{paddingTop:CustomBar+'px'}">
  3. <custom-floor :systeminfo='systeminfo'
  4. :navbar-data='nvabarData'
  5. :headerBtnPosi ="headerBtnPosi">
  6. </custom-floor>
  7. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="5"></tui-skeleton>
  8. <view class="container-home tui-skeleton">
  9. <!-- 金刚区菜单 -->
  10. <templateNav :list="navBarsList" v-if="isRequest"></templateNav>
  11. </view>
  12. <!-- ross广告图区 -->
  13. <view class="container-ross" v-if="isRossShow">
  14. <view class="ross-image" @click="this.$api.navigateTo('/pages/supplier/user/my-shop?shopId=1378')">
  15. <image class="image" src="https://static.caimei365.com/app/img/ross/ross-image@2x.jpg" mode=""></image>
  16. </view>
  17. </view>
  18. <!-- 楼层 -->
  19. <view class="container-section tui-skeleton">
  20. <page-floor :list="pageList" :userIdentity="userIdentity" :pageType="2" v-if="isRequest"></page-floor>
  21. </view>
  22. <!-- 侧边 -->
  23. <scroll-top :isScrollTop="isScrollTop" :bottom="50"></scroll-top>
  24. </view>
  25. </template>
  26. <script>
  27. import { mapState,mapMutations} from 'vuex';
  28. import customFloor from '@/components/cm-custom/custom-floor' //自定义导航
  29. import templateNav from '@/components/cm-module/pageTemplate/templateNav.vue'
  30. import pageFloor from '@/components/cm-module/homeIndex/pageFloor.vue'
  31. import authorize from '@/common/config/authorize.js'
  32. import wxLogin from "@/common/config/wxLogin.js"
  33. export default{
  34. components:{
  35. customFloor,
  36. templateNav,
  37. pageFloor
  38. },
  39. data(){
  40. return{
  41. userId:0,
  42. shopId:0,
  43. userIdentity:0,
  44. skeletonShow:true,
  45. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  46. systeminfo: this.setSysteminfo(), //获取设备信息
  47. CustomBar:this.CustomBar,// 顶部导航栏高度
  48. navBarsList:[],
  49. pageList:[],//楼层
  50. isRequest:false,
  51. isScrollTop:false,
  52. pageId:'',
  53. typeSort:'',
  54. }
  55. },
  56. computed: {
  57. ...mapState(['hasLogin','userInfo','isRossShow','isWxAuthorize'])
  58. },
  59. onLoad(option) {
  60. if(option.type =='share'){
  61. wxLogin.wxLoginAuthorize()
  62. }
  63. this.pageId = option.linkId
  64. this.$api.getComStorage('userInfo').then((resolve) =>{
  65. this.userId = resolve.userId ? resolve.userId : 0;
  66. this.shopId = resolve.shopId ? resolve.shopId : 0;
  67. this.userIdentity = resolve.userIdentity
  68. this.GetInstrumentPageData();
  69. }).catch(error =>{
  70. this.GetInstrumentPageData();
  71. })
  72. setTimeout(()=>{
  73. this.skeletonShow = false
  74. },2000)
  75. },
  76. methods:{
  77. GetInstrumentPageData(){//获取楼层数据
  78. this.CommonService.GetInstrumentPageData({pageId:this.pageId,userId:this.userId,source:2}).then(response =>{
  79. let data = response.data
  80. this.typeSort = data.typeSort
  81. this.pageList = data.floorList
  82. uni.setStorageSync('pageLabel',`${data.contentLabel}`)
  83. this.GetHomeInit()
  84. }).catch(error =>{
  85. this.$util.msg(error.msg,2000)
  86. })
  87. },
  88. GetHomeInit(){//金刚区分类
  89. this.CommonService.GetFirstClassly({typeSort:this.typeSort,source:'crm'}).then(response =>{
  90. this.navBarsList = response.data
  91. this.isRequest =true
  92. }).catch(error =>{
  93. this.$util.msg(error.msg,2000)
  94. })
  95. },
  96. setHeaderBtnPosi(){
  97. // 获得胶囊按钮位置信息
  98. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  99. return headerBtnPosi
  100. },
  101. setSysteminfo(){
  102. let systeminfo;
  103. uni.getSystemInfo({ // 获取设备信息
  104. success: (res) => {
  105. systeminfo = res
  106. },
  107. })
  108. return systeminfo
  109. },
  110. },
  111. onPageScroll(e){//实时获取到滚动的值
  112. if(e.scrollTop>400){
  113. this.isScrollTop = true
  114. }else{
  115. this.isScrollTop = false
  116. }
  117. },
  118. onPullDownRefresh() {
  119. setTimeout(() => {
  120. uni.stopPullDownRefresh()
  121. }, 200)
  122. },
  123. onShareAppMessage(res){//分享转发
  124. if (res.from === 'button') {
  125. // 来自页面内转发按钮
  126. }
  127. return {
  128. title: '采美-一站式生/医美采购服务平台',
  129. path: `pages/goods/good-floor?type=share&linkId=${this.pageId}`
  130. }
  131. },
  132. onShow() {
  133. }
  134. }
  135. </script>
  136. <style lang="scss">
  137. page{
  138. background-color: #FFFFFF;
  139. }
  140. .container-home{
  141. width: 100%;
  142. height: auto;
  143. }
  144. .container-ross{
  145. width: 100%;
  146. height: 264rpx;
  147. box-sizing: border-box;
  148. padding: 24rpx 24rpx 0 24rpx;
  149. float: left;
  150. background-color: #F5F5F5;
  151. .ross-image{
  152. width: 100%;
  153. height: 100%;
  154. line-height: 240rpx;
  155. background-color: #F3920D;
  156. border-radius: 16rpx;
  157. text-align: center;
  158. font-size: 80rpx;
  159. color: #FFFFFF;
  160. .image{
  161. width: 100%;
  162. height: 100%;
  163. border-radius: 16rpx;
  164. display: block;
  165. }
  166. }
  167. }
  168. .container-section{
  169. width: 100%;
  170. height: auto;
  171. background-color: #F7F7F7;
  172. }
  173. </style>