index.vue 11 KB

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