index.vue 8.3 KB

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