activity-floorMore.vue 8.4 KB

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