index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <template>
  2. <view class="page-community-home">
  3. <uni-nav-bar :fixed="true" height="180rpx" title="社区中心" color="#FFF" left-icon="home" backgroundColor="rgb(0,0,0,0)" :border="false" @clickLeft="onHome"/>
  4. <view class="community-top">
  5. <view class="swiper-item">
  6. <swiper
  7. indicator-dots="true"
  8. autoplay="true"
  9. interval="2000"
  10. duration="500"
  11. >
  12. <swiper-item
  13. v-for="(item, index) in bannerList"
  14. :key="index"
  15. style="width: 100%"
  16. >
  17. <view class="swiper-img" style="width: 100%">
  18. <image
  19. :src="item.imageUrl"
  20. style="width: 100%; height: 150px"
  21. @click="goInfo(item)"
  22. ></image>
  23. </view>
  24. </swiper-item>
  25. </swiper>
  26. </view>
  27. <view class="section1">
  28. <view class="caption">
  29. <view class="left">正在上演</view>
  30. <view class="right" @click="onViewHome()">特权卡售卖中</view>
  31. </view>
  32. <view class="content">
  33. <block v-for="(it,index) in topList">
  34. <VideoItem :item="it"></VideoItem>
  35. </block>
  36. </view>
  37. <!-- <view class="more">查看全部活动 >> </view> -->
  38. </view>
  39. <view class="section2">
  40. <view class="title">主理人</view>
  41. <view class="contents">
  42. <view class="list">
  43. <block v-for="(it,index) in PerformerList">
  44. <view class="content" @click="onViewPerform(it.id)">
  45. <image :src="it.headerImg" class="icon"></image>
  46. </view>
  47. </block>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="section3">
  52. <view class="title">
  53. <view class="l">活动排期</view>
  54. <view class="r"></view>
  55. </view>
  56. <view class="plan-bg">
  57. <PlanDate @onSetDate="onSetDate"></PlanDate>
  58. </view>
  59. <view class="selection">
  60. <uni-data-select class="data-select"
  61. v-model="queryForm.area"
  62. :localdata="dataArea"
  63. @change="onChangeArea"
  64. :clear="false"
  65. ></uni-data-select>
  66. <uni-data-select
  67. v-model="queryForm.type"
  68. :localdata="typeList"
  69. @change="onChangeType"
  70. :clear="false"
  71. ></uni-data-select>
  72. <uni-easyinput v-model="queryForm.keyword" placeholder="请输入内容" @change="onChangeKeyword"></uni-easyinput>
  73. </view>
  74. <view class="events-list">
  75. <block v-for="(it,index) in dataList">
  76. <EventItem :info="it"></EventItem>
  77. </block>
  78. </view>
  79. </view>
  80. </view>
  81. <page-btm-bar :active="2" />
  82. </view>
  83. </template>
  84. <script>
  85. import {
  86. mapState,
  87. mapGetters,
  88. mapMutations
  89. } from 'vuex'
  90. const app = getApp();
  91. let hideLoading = true;
  92. import PlanDate from '@/components/PlanDate/PlanDate.vue'
  93. import VideoItem from '@/components/VideoItem/VideoItem.vue'
  94. import EventItem from '@/components/EventItem/EventItem.vue'
  95. export default {
  96. components:{
  97. VideoItem,
  98. PlanDate,
  99. EventItem
  100. },
  101. computed: {
  102. ...mapState(['store_id','systemInfo'])
  103. },
  104. data() {
  105. return {
  106. bannerList: [],
  107. topList:[],//顶部剧场活动列表
  108. PerformerList:[],//获取主持人信息列表
  109. queryForm:{
  110. page:1,
  111. pageSize:10,
  112. planStartTime:'',
  113. planEndTime:'',
  114. keyword:'',
  115. type:'',
  116. area:'',
  117. },
  118. dataList:[],
  119. recordCount:0,
  120. dataArea:[
  121. {
  122. value:'',
  123. text:'所在区域',
  124. }
  125. ],
  126. typeList:[
  127. {
  128. value:'',
  129. text:'所有分类',
  130. },
  131. {
  132. value:'1',
  133. text:'剧场',
  134. },
  135. {
  136. value:'2',
  137. text:'活动',
  138. }
  139. ],
  140. area:'',
  141. sort:'',
  142. };
  143. },
  144. onLoad() {
  145. // #ifdef MP-ALIPAY
  146. this.$scope.onBeforeGetCoupon = this.onBeforeGetCoupon.bind(this)
  147. this.$scope.onGetCouponSuccess = this.onGetCouponSuccess.bind(this)
  148. this.$scope.onGetCouponFail = this.onGetCouponFail.bind(this)
  149. this.$scope.onUseImmediately = this.onUseImmediately.bind(this)
  150. this.$scope.onClose = this.onClose.bind(this)
  151. // #endif
  152. uni.hideTabBar();
  153. if (this.$store.state.store_id) {
  154. this.http();
  155. // #ifdef MP-ALIPAY
  156. this.getCouponList();
  157. // #endif
  158. }
  159. if (this.$store.state.systemInfo.set) {
  160. if (this.$store.state.systemInfo.set.is_pop != 0) {
  161. let is_pop = this.$store.state.systemInfo.set.is_pop;
  162. this.can_popup(is_pop);
  163. // is_pop == 2 ? this.Coupons() :
  164. // is_pop == 1 ? this.homePop(1) :
  165. // is_pop == 3 ? this.homePop(3) : '';
  166. }
  167. }
  168. uni.getSystemInfo({
  169. success: (e) => {
  170. this.windowHeight = e.windowHeight;
  171. }
  172. })
  173. },
  174. onReady() {
  175. this.$store.commit('SET_MERCHANT_ID', null) //清空分账号授权
  176. // #ifdef MP-ALIPAY
  177. my.getLocation({
  178. type: 1,
  179. success: (res) => {
  180. // console.log('getLocation', res.cityAdcode);
  181. this.cityCode = res.cityAdcode;
  182. // '410100';
  183. },
  184. fail: (err) => {
  185. console.log(err, "err")
  186. }
  187. });
  188. // #endif
  189. let protocal=uni.getStorageSync("protocal");
  190. if(protocal!=true){
  191. uni.navigateTo({
  192. url:'/pages/protocal/protocal'
  193. })
  194. }
  195. },
  196. onShow(){
  197. this.initBanner();
  198. this.onSearchTop();
  199. this.onSearchPerformer();
  200. this.initSearchArea();
  201. let _this=this;
  202. _this.queryForm.page=0;
  203. _this.onSearch();
  204. },
  205. methods:{
  206. //活动详情页
  207. goInfo(item) {
  208. console.log(item.other_link);
  209. uni.navigateTo({
  210. url: item.other_link,
  211. });
  212. },
  213. initSearchArea(){
  214. let _this=this;
  215. _this.$http.request('zc/searcharea',{}, "", "", hideLoading).then(res => {
  216. _this.dataArea=[];
  217. _this.dataArea.push({
  218. value:'',
  219. text:'所在区域',
  220. });
  221. for(var i=0;i<res.data.dataList.length;i++){
  222. _this.dataArea.push({
  223. value:res.data.dataList[i].district,
  224. text:res.data.dataList[i].district,
  225. })
  226. }
  227. }).catch(err => {})
  228. },
  229. onViewHome(e){
  230. // 设置全局数据
  231. getApp().globalData.runMethod = true;
  232. // 切换 tab
  233. uni.switchTab({
  234. url:'/pages/home/home',
  235. });
  236. },
  237. onChangeArea(e){
  238. console.log("e",e);
  239. this.queryForm.area=e;
  240. this.queryForm.page=0;
  241. this.onSearch();
  242. },
  243. onChangeType(e){
  244. this.queryForm.type=e;
  245. this.queryForm.page=0;
  246. this.onSearch();
  247. },
  248. onChangeKeyword(e){
  249. this.queryForm.keyword=e;
  250. this.queryForm.page=0;
  251. this.onSearch();
  252. },
  253. onHome(e){
  254. uni.switchTab({
  255. url:'/pages/theater/index/index'
  256. })
  257. },
  258. onViewPerform(e){
  259. uni.navigateTo({
  260. url:'/pages/theater/chair-man/chair-man?id='+e,
  261. })
  262. },
  263. onSetDate(e){
  264. let _this=this;
  265. _this.queryForm.planStartTime=e+" 00:00:00";
  266. _this.queryForm.planEndTime=e+" 23:00:00";
  267. _this.queryForm.page=0;
  268. _this.onSearch();
  269. },
  270. onSearch(){
  271. let _this=this;
  272. if(_this.queryForm.page<1){
  273. _this.dataList=[];
  274. }
  275. _this.queryForm.page++;
  276. _this.$http.request('zc/search',_this.queryForm,'','',hideLoading).then(res=>{
  277. _this.recordCount=res.data.recordCount;
  278. _this.dataList=_this.dataList.concat(res.data.dataList);
  279. })
  280. },
  281. //搜索顶部列表
  282. onSearchTop(){
  283. let _this=this;
  284. _this.$http.request('zc/search', {
  285. page:1,
  286. pageSize:3,
  287. isComments:1,
  288. }, "", "", hideLoading).then(res => {
  289. _this.topList=res.data.dataList;
  290. }).catch(err => {})
  291. },
  292. //搜索演员
  293. onSearchPerformer(){
  294. let _this=this;
  295. this.$http.request('zc/getPerformersList', {
  296. page:1,
  297. pageSize:10,
  298. type:2,
  299. }, "", "", hideLoading).then(res => {
  300. _this.PerformerList=res.data.dataList;
  301. }).catch(err => {})
  302. },
  303. //轮播图
  304. initBanner() {
  305. let _this = this;
  306. this.$http
  307. .request(
  308. "banner/search",
  309. {
  310. page: 1,
  311. pageSize: 10,
  312. type: 3,
  313. },
  314. "",
  315. "",
  316. hideLoading
  317. )
  318. .then((res) => {
  319. console.log("112", res);
  320. _this.bannerList = res.data.dataList;
  321. })
  322. .catch((err) => {});
  323. },
  324. }
  325. }
  326. </script>
  327. <style lang="scss">
  328. @import "./index.scss"
  329. </style>