good-floor.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.GetInstrumentPageDataa(this.pageId)
  65. },
  66. methods:{
  67. async GetInstrumentPageDataa(pageId){//获取楼层数据
  68. const userInfo = await this.$api.getStorage()
  69. this.userId = userInfo.userId ? userInfo.userId : 0
  70. this.shopId = userInfo.shopId ? userInfo.shopId : 0
  71. this.userIdentity = userInfo.userIdentity
  72. this.CommonService.GetInstrumentPageData({pageId:pageId,userId:this.userId,source:2}).then(response =>{
  73. let data = response.data
  74. uni.setStorageSync('pageLabel',`${data.contentLabel}`)
  75. this.GetHomeInit(data.typeSort,data.floorList)
  76. }).catch(error =>{
  77. this.$util.msg(error.msg,2000)
  78. })
  79. },
  80. GetHomeInit(typeSort,floorList){//金刚区分类
  81. this.CommonService.GetFirstClassly({typeSort:typeSort,source:'crm'}).then(response =>{
  82. this.navBarsList = response.data
  83. this.pageList = floorList
  84. setTimeout(()=>{
  85. this.skeletonShow = false
  86. this.isRequest =true
  87. },200)
  88. }).catch(error =>{
  89. this.$util.msg(error.msg,2000)
  90. })
  91. },
  92. setHeaderBtnPosi(){
  93. // 获得胶囊按钮位置信息
  94. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  95. return headerBtnPosi
  96. },
  97. setSysteminfo(){
  98. let systeminfo;
  99. uni.getSystemInfo({ // 获取设备信息
  100. success: (res) => {
  101. systeminfo = res
  102. },
  103. })
  104. return systeminfo
  105. },
  106. },
  107. onPageScroll(e){//实时获取到滚动的值
  108. if(e.scrollTop>400){
  109. this.isScrollTop = true
  110. }else{
  111. this.isScrollTop = false
  112. }
  113. },
  114. onPullDownRefresh() {
  115. setTimeout(() => {
  116. uni.stopPullDownRefresh()
  117. }, 200)
  118. },
  119. onShareAppMessage(res){//分享转发
  120. if (res.from === 'button') {
  121. // 来自页面内转发按钮
  122. }
  123. return {
  124. title: '采美-一站式生/医美采购服务平台',
  125. path: `pages/goods/good-floor?type=share&linkId=${this.pageId}`
  126. }
  127. },
  128. onShow() {
  129. }
  130. }
  131. </script>
  132. <style lang="scss">
  133. page{
  134. background-color: #FFFFFF;
  135. }
  136. .container-home{
  137. width: 100%;
  138. height: auto;
  139. }
  140. .container-ross{
  141. width: 100%;
  142. height: 264rpx;
  143. box-sizing: border-box;
  144. padding: 24rpx 24rpx 0 24rpx;
  145. float: left;
  146. background-color: #F5F5F5;
  147. .ross-image{
  148. width: 100%;
  149. height: 100%;
  150. line-height: 240rpx;
  151. background-color: #F3920D;
  152. border-radius: 16rpx;
  153. text-align: center;
  154. font-size: 80rpx;
  155. color: #FFFFFF;
  156. .image{
  157. width: 100%;
  158. height: 100%;
  159. border-radius: 16rpx;
  160. display: block;
  161. }
  162. }
  163. }
  164. .container-section{
  165. width: 100%;
  166. height: auto;
  167. background-color: #F7F7F7;
  168. }
  169. </style>