good-floor-temp.vue 4.4 KB

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