activity-floorMore.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <view class="container floor clearfix">
  3. <view class='navbar-wrap' v-if="showSearch">
  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 ="isRequest" :loadingType="5"></tui-skeleton>
  12. <!-- 楼层 -->
  13. <view class="container-section tui-skeleton">
  14. <!-- 图片模板 -->
  15. <template v-if="pageData && pageData.floorContent.templateType == '8'">
  16. <pictureD :pageData="pageData" :userIdentity="userIdentity" :flag="true" v-if="isRequest"></pictureD>
  17. </template>
  18. <template v-if="pageData && pageData.floorContent.templateType == '10'">
  19. <pictureF :pageData="pageData" :userIdentity="userIdentity" :flag="true" v-if="isRequest"></pictureF>
  20. </template>
  21. <!-- 文章列表 -->
  22. <template v-if="pageData && pageData.floorContent.templateType == '3'">
  23. <articleA :pageData="pageData" :userIdentity="userIdentity" :flag="true" v-if="isRequest"></articleA>
  24. </template>
  25. <template v-if="pageData && pageData.floorContent.templateType == '4'">
  26. <articleB :pageData="pageData" :userIdentity="userIdentity" :flag="true" v-if="isRequest"></articleB>
  27. </template>
  28. <template v-if="pageData && pageData.floorContent.templateType == '6'">
  29. <articleD :pageData="pageData" :userIdentity="userIdentity" :flag="true" v-if="isRequest"></articleD>
  30. </template>
  31. <!-- 产品列表 -->
  32. <template v-if="pageData && pageData.floorContent.templateType == '11'">
  33. <productI :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></productI>
  34. </template>
  35. <template v-if="pageData && pageData.floorContent.templateType == '12'">
  36. <productJ :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></productJ>
  37. </template>
  38. <template v-if="pageData && pageData.floorContent.templateType == '13'">
  39. <productK :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></productK>
  40. </template>
  41. <template v-if="pageData && pageData.floorContent.templateType == '14'">
  42. <productG :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></productG>
  43. </template>
  44. <template v-if="pageData && pageData.floorContent.templateType == '15'">
  45. <productD :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></productD>
  46. </template>
  47. <template v-if="pageData && pageData.floorContent.templateType == '16'">
  48. <productC :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></productC>
  49. </template>
  50. <template v-if="pageData && pageData.floorContent.templateType == '17'">
  51. <productB :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></productB>
  52. </template>
  53. <template v-if="pageData && pageData.floorContent.templateType == '18'">
  54. <productA :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></productA>
  55. </template>
  56. <template v-if="pageData && pageData.floorContent.templateType == '19' || pageData.floorContent.templateType == '20' ">
  57. <productE :pageData="pageData" :userIdentity="userIdentity" v-if="isRequest"></productE>
  58. </template>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import { mapState,mapMutations} from 'vuex';
  64. //引入产品模板
  65. import productA from '@/components/cm-module/pageFloorTemplate/templateA.vue'
  66. import productB from '@/components/cm-module/pageFloorTemplate/templateB.vue'
  67. import productC from '@/components/cm-module/pageFloorTemplate/templateC.vue'
  68. import productD from '@/components/cm-module/pageFloorTemplate/templateD.vue'
  69. import productE from '@/components/cm-module/pageFloorTemplate/templateE.vue'
  70. import productG from '@/components/cm-module/pageFloorTemplate/templateG.vue'
  71. import productI from '@/components/cm-module/pageFloorTemplate/templateI.vue'
  72. import productJ from '@/components/cm-module/pageFloorTemplate/templateJ.vue'
  73. import productK from '@/components/cm-module/pageFloorTemplate/templateK.vue'
  74. //引入图片模板
  75. import pictureD from '@/components/cm-module/pcitureTemplate/templateD.vue'
  76. import pictureF from '@/components/cm-module/pcitureTemplate/templateF.vue'
  77. //引入图文模板
  78. import articleA from '@/components/cm-module/articleTemplate/templateA.vue'
  79. import articleB from '@/components/cm-module/articleTemplate/templateB.vue'
  80. import articleD from '@/components/cm-module/articleTemplate/templateD.vue'
  81. export default{
  82. components:{
  83. productA,
  84. productB,
  85. productC,
  86. productD,
  87. productE,
  88. productG,
  89. productI,
  90. productJ,
  91. productK,
  92. pictureD,
  93. pictureF,
  94. articleA,
  95. articleB,
  96. articleD
  97. },
  98. data(){
  99. return{
  100. clickPath:'/search/pages/search/search',
  101. hotSearchText:'搜索商品/项目仪器',
  102. userIdentity:0,
  103. skeletonShow:true,
  104. isRequest:false,
  105. navBarsList:[],
  106. pageData:{},//楼层
  107. floorId:null,
  108. pageType:null,
  109. userID:'',
  110. noSearch:['3','4','6','8','10'],
  111. showSearch:true
  112. }
  113. },
  114. onLoad(option) {
  115. this.pageType = option.pageType
  116. this.floorId = Number(option.floorId)
  117. uni.setNavigationBarTitle({title:option.title});
  118. this.$api.getComStorage('userInfo').then((resolve) =>{
  119. this.clubStatus = resolve.clubStatus
  120. this.userID = resolve.userId ? resolve.userId : 0;
  121. this.shopId = resolve.shopId ? resolve.shopId : 0;
  122. this.userIdentity = resolve.userIdentity
  123. this.GetHomeFloorContentDetails(this.pageType);
  124. }).catch(error =>{
  125. this.GetHomeFloorContentDetails(this.pageType);
  126. })
  127. },
  128. computed: {
  129. ...mapState(['hasLogin','userInfo','identity'])
  130. },
  131. methods:{
  132. checkShowSearch(templateType){
  133. const result = this.noSearch.indexOf(templateType)
  134. if(result !== -1){
  135. this.showSearch = false
  136. }else {
  137. this.showSearch = true
  138. }
  139. },
  140. GetHomeFloorContentDetails(pageType){//楼层查看更多
  141. if(pageType == '1'){ //首页
  142. this.CommonService.GetHomeFloorContentDetails({userId:this.userID,floorId:this.floorId,source:2}).then(response =>{
  143. this.pageData = response.data
  144. this.skeletonShow = false
  145. this.isRequest = true
  146. }).catch(error =>{
  147. this.$util.msg(error.msg,2000)
  148. })
  149. }else{ //二级页面楼层数据
  150. this.CommonService.GePageFloorContentDetails({userId:this.userID,centreId:this.floorId,source:2}).then(response =>{
  151. this.pageData = response.data
  152. this.skeletonShow = false
  153. this.isRequest = true
  154. this.checkShowSearch(this.pageData.floorContent.templateType)
  155. console.log(this.pageData);
  156. }).catch(error =>{
  157. this.$util.msg(error.msg,2000)
  158. })
  159. }
  160. }
  161. },
  162. onPullDownRefresh() {
  163. setTimeout(() => {
  164. this.GetHomeFloorContentDetails(this.pageType);
  165. uni.stopPullDownRefresh()
  166. }, 200)
  167. },
  168. onShow() {
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. page{
  174. background-color: #FFFFFF;
  175. }
  176. .container-home{
  177. width: 100%;
  178. height: auto;
  179. }
  180. .container-section{
  181. width: 100%;
  182. height: auto;
  183. background-color: #F7F7F7;
  184. box-sizing: border-box;
  185. padding:24rpx;
  186. }
  187. .navbar-wrap {
  188. width: 100%;
  189. height: 116rpx;
  190. box-sizing: border-box;
  191. background: #FFFFFF;
  192. padding: 25rpx 24rpx;
  193. .gosearch-btn{
  194. width: 100%;
  195. height: 100%;
  196. border-radius: 40rpx;
  197. font-size: 28rpx;
  198. line-height: 66rpx;
  199. color: #8A8A8A;
  200. background: #f7f7f7;
  201. position: relative;
  202. box-sizing: border-box;
  203. padding-left: 66rpx;
  204. .search-icon{
  205. width: 66rpx;
  206. height: 66rpx;
  207. position:absolute ;
  208. left: 0;
  209. top: 2rpx;
  210. text-align: center;
  211. line-height: 66rpx;
  212. .icon-iconfonticonfontsousuo1{
  213. margin:0 6rpx;
  214. font-size: $font-size-34;
  215. color: #8A8A8A;
  216. z-index: 10;
  217. }
  218. }
  219. .search-text{
  220. font-size: $font-size-24;
  221. line-height: 66rpx;
  222. color: #8A8A8A;
  223. }
  224. }
  225. }
  226. </style>