good-floorMore.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="container floor clearfix">
  3. <view class='navbar-wrap'>
  4. <view class="gosearch-btn" @click="this.$api.navigateTo(clickPath)">
  5. <view class="search-icon">
  6. <text class="iconfont icon-iconfonticonfontsousuo1"></text>
  7. </view>
  8. <view class="search-text">{{hotSearchText}}</view>
  9. </view>
  10. </view>
  11. <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading ="true" :loadingType="5"></tui-skeleton>
  12. <!-- 楼层 -->
  13. <view class="container-section tui-skeleton">
  14. <template v-if="pageData.floorContent.templateType == '1'">
  15. <templateA :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></templateA>
  16. </template>
  17. <template v-if="pageData.floorContent.templateType == '2'">
  18. <templateB :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></templateB>
  19. </template>
  20. <template v-if="pageData.floorContent.templateType == '3'">
  21. <templateC :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></templateC>
  22. </template>
  23. <template v-if="pageData.floorContent.templateType == '4'">
  24. <templateD :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></templateD>
  25. </template>
  26. <template v-if="pageData.floorContent.templateType == '5' || pageData.floorContent.templateType == '6'">
  27. <templateE :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></templateE>
  28. </template>
  29. <template v-if="pageData.floorContent.templateType == '7'">
  30. <templateF :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></templateF>
  31. </template>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import { mapState,mapMutations} from 'vuex';
  37. import templateA from '@/components/cm-module/pageFloorTemplate/templateA.vue'
  38. import templateB from '@/components/cm-module/pageFloorTemplate/templateB.vue'
  39. import templateC from '@/components/cm-module/pageFloorTemplate/templateC.vue'
  40. import templateD from '@/components/cm-module/pageFloorTemplate/templateD.vue'
  41. import templateE from '@/components/cm-module/pageFloorTemplate/templateE.vue'
  42. import templateF from '@/components/cm-module/pageFloorTemplate/templateF.vue'
  43. export default{
  44. components:{
  45. templateA,
  46. templateB,
  47. templateC,
  48. templateD,
  49. templateE,
  50. templateF
  51. },
  52. data(){
  53. return{
  54. clickPath:'/search/pages/search/search',
  55. hotSearchText:'搜索商品/供应商/项目仪器',
  56. userIdentity:0,
  57. skeletonShow:true,
  58. isRequest:false,
  59. navBarsList:[],
  60. pageData:{},//楼层
  61. floorId:null,
  62. pageType:null
  63. }
  64. },
  65. onLoad(option) {
  66. this.pageType = option.pageType
  67. this.floorId = Number(option.floorId)
  68. uni.setNavigationBarTitle({title:option.title});
  69. this.$api.getComStorage('userInfo').then((resolve) =>{
  70. this.clubStatus = resolve.clubStatus
  71. this.userID = resolve.userID ? resolve.userID : 0;
  72. this.shopId = resolve.shopID ? resolve.shopID : 0;
  73. this.userIdentity = resolve.userIdentity
  74. this.GetHomeFloorContentDetails(this.pageType);
  75. }).catch(error =>{
  76. this.GetHomeFloorContentDetails(this.pageType);
  77. })
  78. },
  79. computed: {
  80. ...mapState(['hasLogin','userInfo','identity'])
  81. },
  82. methods:{
  83. GetHomeFloorContentDetails(pageType){//楼层查看更多
  84. if(pageType == '1'){
  85. this.CommonService.GetHomeFloorContentDetails({userId:this.userID,floorId:this.floorId,source:2}).then(response =>{
  86. this.pageData = response.data
  87. this.skeletonShow = false
  88. this.isRequest = true
  89. }).catch(error =>{
  90. this.$util.msg(error.msg,2000)
  91. })
  92. }else{
  93. this.CommonService.GePageFloorContentDetails({userId:this.userID,centreId:this.floorId,source:2}).then(response =>{
  94. this.pageData = response.data
  95. this.skeletonShow = false
  96. this.isRequest = true
  97. }).catch(error =>{
  98. this.$util.msg(error.msg,2000)
  99. })
  100. }
  101. }
  102. },
  103. onPullDownRefresh() {
  104. setTimeout(() => {
  105. this.GetHomeFloorContentDetails();
  106. uni.stopPullDownRefresh()
  107. }, 200)
  108. },
  109. onShow() {
  110. }
  111. }
  112. </script>
  113. <style lang="scss">
  114. page{
  115. background-color: #FFFFFF;
  116. }
  117. .container-home{
  118. width: 100%;
  119. height: auto;
  120. }
  121. .container-section{
  122. width: 100%;
  123. height: auto;
  124. background-color: #F7F7F7;
  125. box-sizing: border-box;
  126. padding:24rpx;
  127. }
  128. .navbar-wrap {
  129. width: 100%;
  130. height: 116rpx;
  131. box-sizing: border-box;
  132. background: #FFFFFF;
  133. padding: 25rpx 24rpx;
  134. .gosearch-btn{
  135. width: 100%;
  136. height: 100%;
  137. border-radius: 40rpx;
  138. font-size: 28rpx;
  139. line-height: 66rpx;
  140. color: #8A8A8A;
  141. background: #f7f7f7;
  142. position: relative;
  143. box-sizing: border-box;
  144. padding-left: 66rpx;
  145. .search-icon{
  146. width: 66rpx;
  147. height: 66rpx;
  148. position:absolute ;
  149. left: 0;
  150. top: 2rpx;
  151. text-align: center;
  152. line-height: 66rpx;
  153. .icon-iconfonticonfontsousuo1{
  154. margin:0 6rpx;
  155. font-size: $font-size-34;
  156. color: #8A8A8A;
  157. z-index: 10;
  158. }
  159. }
  160. .search-text{
  161. font-size: $font-size-24;
  162. line-height: 66rpx;
  163. color: #8A8A8A;
  164. }
  165. }
  166. }
  167. </style>