activity-topci.vue 4.3 KB

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