activity-floorMore.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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/cm-module/pcitureTemplate/templateD.vue'
  86. import pictureF from '@/components/cm-module/pcitureTemplate/templateF.vue'
  87. //引入图文模板
  88. import articleA from '@/components/cm-module/articleTemplate/templateA.vue'
  89. import articleB from '@/components/cm-module/articleTemplate/templateB.vue'
  90. import articleD from '@/components/cm-module/articleTemplate/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:'',
  120. noSearch:['3','4','6','8','10'],
  121. showSearch:true
  122. }
  123. },
  124. onLoad(option) {
  125. this.pageType = option.pageType
  126. this.floorId = Number(option.floorId)
  127. uni.setNavigationBarTitle({title:option.title})
  128. this.$api.getComStorage('userInfo').then((resolve) =>{
  129. this.clubStatus = resolve.clubStatus
  130. this.userID = resolve.userId ? resolve.userId : 0
  131. this.shopId = resolve.shopId ? resolve.shopId : 0
  132. this.userIdentity = resolve.userIdentity
  133. this.GetHomeFloorContentDetails(this.pageType)
  134. }).catch(error =>{
  135. this.GetHomeFloorContentDetails(this.pageType)
  136. })
  137. },
  138. computed: {
  139. ...mapState(['hasLogin','userInfo','identity'])
  140. },
  141. methods:{
  142. checkShowSearch(templateType){
  143. const result = this.noSearch.indexOf(templateType)
  144. if(result !== -1){
  145. this.showSearch = false
  146. }else {
  147. this.showSearch = true
  148. }
  149. },
  150. GetHomeFloorContentDetails(pageType){//楼层查看更多
  151. if(pageType == '1'){ //首页
  152. this.CommonService.GetHomeFloorContentDetails({userId:this.userID,floorId:this.floorId,source:2}).then(response =>{
  153. this.pageData = response.data
  154. this.skeletonShow = false
  155. this.isRequest = true
  156. }).catch(error =>{
  157. this.$util.msg(error.msg,2000)
  158. })
  159. }else{ //二级页面楼层数据
  160. this.CommonService.GePageFloorContentDetails({userId:this.userID,centreId:this.floorId,source:2}).then(response =>{
  161. this.pageData = response.data
  162. this.skeletonShow = false
  163. this.isRequest = true
  164. this.checkShowSearch(this.pageData.floorContent.templateType)
  165. console.log(this.pageData)
  166. }).catch(error =>{
  167. this.$util.msg(error.msg,2000)
  168. })
  169. }
  170. }
  171. },
  172. onPullDownRefresh() {
  173. setTimeout(() => {
  174. this.GetHomeFloorContentDetails(this.pageType)
  175. uni.stopPullDownRefresh()
  176. }, 200)
  177. },
  178. onShow() {
  179. }
  180. }
  181. </script>
  182. <style lang="scss">
  183. page{
  184. background-color: #FFFFFF;
  185. }
  186. .container-home{
  187. width: 100%;
  188. height: auto;
  189. }
  190. .container-section{
  191. width: 100%;
  192. height: auto;
  193. background-color: #F7F7F7;
  194. box-sizing: border-box;
  195. padding:24rpx;
  196. }
  197. .navbar-wrap {
  198. width: 100%;
  199. height: 116rpx;
  200. box-sizing: border-box;
  201. background: #FFFFFF;
  202. padding: 25rpx 24rpx;
  203. .gosearch-btn{
  204. width: 100%;
  205. height: 100%;
  206. border-radius: 40rpx;
  207. font-size: 28rpx;
  208. line-height: 66rpx;
  209. color: #8A8A8A;
  210. background: #f7f7f7;
  211. position: relative;
  212. box-sizing: border-box;
  213. padding-left: 66rpx;
  214. .search-icon{
  215. width: 66rpx;
  216. height: 66rpx;
  217. position:absolute ;
  218. left: 0;
  219. top: 2rpx;
  220. text-align: center;
  221. line-height: 66rpx;
  222. .icon-iconfonticonfontsousuo1{
  223. margin:0 6rpx;
  224. font-size: $font-size-34;
  225. color: #8A8A8A;
  226. z-index: 10;
  227. }
  228. }
  229. .search-text{
  230. font-size: $font-size-24;
  231. line-height: 66rpx;
  232. color: #8A8A8A;
  233. }
  234. }
  235. }
  236. </style>