index.vue 7.0 KB

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