index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. <template>
  2. <view>
  3. <!-- 标题栏和状态栏占位符 -->
  4. <!-- <view class="titleNview-placing"> </view> -->
  5. <sub-tabvs class="" :tabs="typetab" @change="changeIndex" :selectIndex="selecttype" :scrollTop="scrollTop"></sub-tabvs>
  6. <view v-if="selecttype==1">
  7. <home-jqjs :datasa="listjq"></home-jqjs>
  8. </view>
  9. <view v-if="selecttype==2" class="flex space pd10_15" style="display:flex; flex-wrap:wrap;">
  10. <block v-for="(value,key) in listbz" :key="key">
  11. <view style="width: 49%; margin-bottom: 20upx;">
  12. <image style="height: 500upx; width: 100%; border-radius: 18upx;" mode="aspectFill" :src="value.img"></image>
  13. </view>
  14. </block>
  15. </view>
  16. <view v-if="selecttype==0">
  17. <view class="home-header pd0_15 mt10" :style="'background: '+mbgColor+';'">
  18. <view class="home-mendian flex alcenter space plr15 cl-w9" style="display: none;">
  19. <navigator style="width: calc(100% - 80rpx);" url="/pages/client/tuan/ss">
  20. <view class="flex alcenter" style="width: calc(100% - 80rpx);">
  21. <text class="iconfont iconsousuo ft14 mr10"></text>
  22. <text class="text-over ft14" style="width: calc(100% - 60rpx);">请输入搜索内容</text>
  23. </view>
  24. </navigator>
  25. <!-- <text @click="saoma()" class="iconfont iconicon_saoma ft24"></text> -->
  26. </view>
  27. <view class="">
  28. <home-banner :banners="banners"></home-banner>
  29. </view>
  30. </view>
  31. <view class="integral-mall-main plr15" style="margin-top: 30upx;">
  32. <view class="integal-mall-menu flex pt10 pb10">
  33. <view class="col2 text-center" @click="linkTo" data-link="/pages/client/tuan/zjjl">
  34. <view>
  35. <image style="width: 100rpx; height: 100rpx;" :src="statics.zhuico[0]"></image>
  36. </view>
  37. <view class="ft14 ftw600">追剧</view>
  38. </view>
  39. <view class="col2 text-center bd-left" @click="linkTo" data-link="/pages/client/tuan/ss">
  40. <view>
  41. <image style="width: 100rpx; height: 100rpx;" :src="statics.zhuico[6]"></image>
  42. </view>
  43. <view class="ft14 ftw600">最新</view>
  44. </view>
  45. <!-- /pages/client/integral/role -->
  46. <view class="col2 text-center bd-left" @click="linkTo" data-link="/pages/client/tuan/ss?selectIndex=3">
  47. <view>
  48. <image style="width: 100rpx; height: 100rpx;" :src="statics.zhuico[2]"></image>
  49. </view>
  50. <view class="ft14 ftw600">排行</view>
  51. </view>
  52. <view class="col2 text-center bd-left" @click="linkTo" data-link="/pages/client/tuan/ss?selectIndex=2">
  53. <view>
  54. <image style="width: 100rpx; height: 100rpx;" :src="statics.zhuico[5]"></image>
  55. </view>
  56. <view class="ft14 ftw600">免费</view>
  57. </view>
  58. </view>
  59. <view @click="linkTosa" data-link="/pages/client/vipcard/adviser" class="mt15" style="padding: 30upx; background: #ffffff; width: 100%; text-align: center; border-radius: 16upx;box-shadow: 0px 4px 20px 0px rgba(0,0,0,0.04);">
  60. <text class="ft12" style="color:#ff0000;">正版源码联系 微信:zhuzhi520 QQ:306003105</text>
  61. </view>
  62. <view class="mt24" v-if="hotdata[1]">
  63. <view class="flex alcenter space">
  64. <view class="flex alcenter">
  65. <image style="width: 40rpx;height: 40rpx;" :src="statics.zhuico[0]"></image>
  66. <text class="ft16 ftw600 cl-main ml15">本周热门</text>
  67. </view>
  68. <!-- <navigator url="/pages/client/tuan/ss?selectIndex=1"> -->
  69. <view @click="huanyihuan()" class="ft14 cl-notice">换一换</view>
  70. <!-- </navigator> -->
  71. </view>
  72. <view class="mt16 flex space">
  73. <block v-for="(value,key) in hotdata" :key="key" v-if="key>=hyh && key<hyh+3">
  74. <view class="box pb10" style="width:31%; position: relative; border-radius:20rpx;" @click="detail(value.id,0)">
  75. <!-- <view class="btn-mini" style="position: absolute; top: 20upx; right: 20upx; border-radius: 10upx;font-size: 18upx;width: 60upx; height: 36upx; z-index: 1;" :style="getBtnStyle">{{value.lxname}}</view> -->
  76. <image class="integral-mall-goods" mode="aspectFill" :src="value.img"></image>
  77. <view class="mt8 plr10 ft14 ftw400 text-center text-over cl-main">{{value.name}}</view>
  78. </view>
  79. </block>
  80. </view>
  81. </view>
  82. <view class="mt24" v-if="givedata[3]">
  83. <view class="flex alcenter space">
  84. <view class="flex alcenter">
  85. <image style="width: 40rpx;height: 40rpx;" :src="statics.zhuico[2]"></image>
  86. <text class="ft16 ftw600 cl-main ml15">排行榜</text>
  87. </view>
  88. <!-- <navigator url="/pages/client/tuan/ss?selectIndex=3"> -->
  89. <view class="ft14 cl-notice">每周热剧TOP3</view>
  90. <!-- </navigator> -->
  91. </view>
  92. <view class="mt16 flex space">
  93. <block v-for="(value,key) in givedata" :key="key" v-if="key<3">
  94. <view class="integral-mall-coupon" style="width: 31%;" @click="detail(value.id,0)">
  95. <view class="top">
  96. <view class="flex center">
  97. <view class="coupon-value" >
  98. <!-- <view class="btn-mini" style="position: absolute; top: 10upx; right: 10upx; border-radius: 10upx;font-size: 18upx;width: 60upx; height: 36upx; z-index: 1;" :style="getBtnStyle">{{value.lxname}}</view> -->
  99. <image class="integral-tuan-l" style="height: 280upx;" mode="aspectFill" :src="value.img"></image>
  100. <!--<view class="num cl-orange">
  101. <text class="ft24 ftw600">¥</text>
  102. <text class="ft24 ftw600 ml4">20</text>
  103. </view> -->
  104. <view class="ft14 plr10 cl-main ftw400 text-center text-over mt10">{{value.name}}</view>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="y-l"></view>
  109. <view class="y-r"></view>
  110. </view>
  111. </block>
  112. </view>
  113. </view>
  114. </view>
  115. <home-default :datasa="datasa"></home-default>
  116. <!-- <com-footer model="index"></com-footer> -->
  117. </view>
  118. </view>
  119. </template>
  120. <script>
  121. export default{
  122. data(){
  123. return {
  124. hyh:0,
  125. navLock:false,
  126. datasa:[],
  127. listjq:[],
  128. listbz:[],
  129. showdyxx:true,
  130. dataconfig:[],
  131. banners:[],
  132. datainfo:[],
  133. dataindex:[],
  134. hotdata:[],
  135. givedata:[],
  136. typetab:[
  137. {name:'推荐短剧',id:1},
  138. {name:'剧情介绍',id:2},
  139. {name:'剧情壁纸',id:3},
  140. ],
  141. selecttype:0,
  142. scrollTop:0,
  143. type:1,
  144. mbgColor:this.$mbgColor,
  145. }
  146. },
  147. computed:{
  148. },
  149. onPageScroll(e){
  150. if(e.scrollTop > 44){
  151. if(this.navLock == false){
  152. this.navLock = true;
  153. uni.setNavigationBarColor({
  154. frontColor:"#000000",
  155. backgroundColor:"#FFFFFF",
  156. complete:()=>{
  157. this.navLock = false;
  158. }
  159. });
  160. }
  161. }else{
  162. if(this.navLock == false){
  163. this.navLock = true;
  164. let this_=this
  165. uni.setNavigationBarColor({
  166. frontColor:"#000000",
  167. backgroundColor:this_.mbgColor,
  168. complete:()=>{
  169. this.navLock = false;
  170. }
  171. });
  172. }
  173. }
  174. },
  175. onShareAppMessage(e){
  176. },
  177. onShareTimeline(e){
  178. },
  179. onLoad(e){
  180. // uni.setStorage({//缓存配置信息
  181. // key: 'webUrl',
  182. // data: this.configs.webUrl
  183. // })
  184. //this.getList();
  185. },
  186. onShow() {
  187. this.getList();
  188. // this.getList(1);
  189. // this.getList(2);
  190. // this.getList(3);
  191. let this_=this
  192. },
  193. methods:{
  194. changeIndex(index){
  195. if(this.typetab[index].id){
  196. this.type=this.typetab[index].id
  197. //this.getList(0)
  198. }
  199. console.log(this.type)
  200. this.selecttype = index;
  201. },
  202. huanyihuan(){
  203. if(this.hyh<12){
  204. this.hyh=this.hyh+3
  205. }
  206. if(this.hyh>=12){
  207. this.hyh=0
  208. }
  209. },
  210. getList() {
  211. let this_=this
  212. let data = {};
  213. uni.request({
  214. url: this.configs.webUrl+'/api/video/indexdata',
  215. data: data,
  216. success: data => {
  217. //console.log(data.data)
  218. uni.setStorage({//缓存配置信息
  219. key: 'config',
  220. data: data.data.config
  221. })
  222. this.banners=data.data.config.banner
  223. if(data.data.config.name){
  224. uni.setNavigationBarTitle({
  225. title: data.data.config.name
  226. });
  227. }
  228. if(data.data.config.mbgColor){
  229. this.mbgColor=data.data.config.mbgColor
  230. uni.setNavigationBarColor({
  231. frontColor:"#000000",
  232. backgroundColor:this_.mbgColor,
  233. complete:()=>{
  234. this.navLock = false;
  235. }
  236. });
  237. }
  238. this.listbz=data.data.listbz
  239. this.listjq=data.data.listjq
  240. this.datasa=data.data.new
  241. this.hotdata=data.data.hotdata
  242. this.givedata=data.data.givedata
  243. },
  244. fail: (data, code) => {
  245. }
  246. });
  247. },
  248. saoma(){
  249. //#ifdef APP-PLUS
  250. uni.scanCode({
  251. success: function (res) {
  252. if(res.result.indexOf("uid") != -1){
  253. var obj = JSON.parse(res.result);
  254. if(obj.uid){
  255. uni.navigateTo({
  256. url:'/pages/login/reg?uid='+obj.uid
  257. })
  258. }
  259. }else{
  260. uni.showToast({ title: res.result,icon:"none" });
  261. }
  262. }
  263. });
  264. //#endif
  265. },
  266. detail(vid,mid){
  267. var fxpid=1
  268. if(uni.getStorageSync("userinfo")){
  269. fxpid=uni.getStorageSync("userinfo").id
  270. }
  271. uni.navigateTo({
  272. url:'/pages/client/tuan/detail?vid='+vid+'&mid='+mid+'&fxpid='+fxpid
  273. })
  274. },
  275. linkTo(e){
  276. if(this.isLogin == false){
  277. this.showLogin = true;
  278. }else{
  279. let link = e.currentTarget.dataset.link;
  280. uni.navigateTo({
  281. url:link
  282. })
  283. }
  284. },
  285. linkTosa(e){
  286. let link = e.currentTarget.dataset.link;
  287. uni.navigateTo({
  288. url:link
  289. })
  290. },
  291. exchange(e){
  292. if(this.isLogin == false){
  293. this.showLogin = true;
  294. }else{
  295. let id = e.currentTarget.dataset.id;
  296. uni.navigateTo({
  297. url:'/pages/client/integral/exchange?id='+id
  298. })
  299. }
  300. },
  301. },
  302. }
  303. </script>
  304. <style>
  305. .home-header{
  306. /* height: 300rpx; */
  307. width: 100%;
  308. position: relative;
  309. border-radius: 0rpx 0rpx 48rpx 48rpx;
  310. }
  311. .home-main{
  312. width: 100%;
  313. position: relative;
  314. margin-top: -156rpx;
  315. padding: 0 30rpx;
  316. }
  317. .home-mendian{
  318. width: 100%;
  319. height: 84rpx;
  320. background:rgba(255,255,255,0.1);
  321. border-radius: 42rpx;
  322. }
  323. .integral-mall-header{
  324. position: relative;
  325. height: 320rpx;
  326. }
  327. .integral-mall-header .bg{
  328. width: 100%;
  329. height: 320rpx;
  330. }
  331. .integral-mall-header .main{
  332. position: absolute;
  333. left: 0;
  334. top: 0;
  335. width: 100%;
  336. height: 320rpx;
  337. }
  338. .swiper-integral{
  339. height: 32rpx;
  340. width: 100%;
  341. }
  342. .integral-mall-main{
  343. position: relative;
  344. /* margin-top: -104rpx; */
  345. }
  346. .integal-mall-menu{
  347. width: 100%;
  348. height: 190rpx;
  349. background: #FFFFFF;
  350. border-radius: 20rpx;
  351. }
  352. .integral-tuan-l{
  353. width: 100%;
  354. height: 280rpx;
  355. background: #f2f2f2;
  356. border-radius: 16rpx;
  357. }
  358. .integral-mall-coupon{
  359. background: #FFFFFF;
  360. position: relative;
  361. border-radius: 16rpx;
  362. overflow: hidden;
  363. }
  364. .integral-mall-coupon .top{
  365. padding: 0rpx 0rpx 24rpx 0rpx;
  366. border-bottom: 2rpx dashed #FEC675;
  367. }
  368. .integral-mall-coupon .y-l,.integral-mall-coupon .y-r{
  369. width: 20rpx;
  370. height: 20rpx;
  371. border-radius: 10rpx;
  372. background: #F5F6FA;
  373. position: absolute;
  374. z-index: 2;
  375. top: 284rpx;
  376. }
  377. .integral-mall-coupon .y-l{
  378. left: -10rpx;
  379. }
  380. .integral-mall-coupon .y-r{
  381. right: -10rpx;
  382. }
  383. .integral-mall-coupon .coupon-value{
  384. width: 100%;
  385. }
  386. .integral-mall-coupon .coupon-value image{
  387. width: 100%;
  388. }
  389. .integral-mall-coupon .coupon-value .num{
  390. width: 100%;
  391. height: 64rpx;
  392. display: flex;
  393. justify-content: center;
  394. align-items: center;
  395. position: absolute;
  396. left: 0;
  397. top: 0;
  398. }
  399. .integral-mall-goods{
  400. width: 100%;
  401. height: 280rpx;
  402. background: #F2F2F2;
  403. border-radius: 16upx;
  404. }
  405. .titleNview-placing {
  406. height: var(--status-bar-height);
  407. padding-top: 44px;
  408. box-sizing: content-box;
  409. }
  410. </style>