index.vue 11 KB

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