activity-floorMore.vue 9.1 KB

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