video.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <template>
  2. <div style="width:100%;background:gray">
  3. <template v-for="video in list">
  4. <div class="video2">
  5. <div class="video-box">
  6. <div class="video-img">
  7. <img class="img" :src="video.cover_url" alt />
  8. <div class="length">formatSeconds(video.duration)</div>
  9. <a :href="'proginn://community/video?id='+ video.video_id ">
  10. <img class="play" src="<?=STA_URL?>/image_v3/icon/play.png" />
  11. </a>
  12. </div>
  13. <div class="video-detail">
  14. <div class="video-des">((video.title))</div>
  15. <div class="video-info justify-between">
  16. <div class="live-source align-center">
  17. <img :src="video.avatar" style="border-radius: 50%" />
  18. <div>{{video.name}}</div>
  19. </div>
  20. <div class="flex">
  21. <div class="live-people gray-51 align-center">
  22. <img
  23. class="see icon"
  24. src="<?=STA_URL?>/quan_v3/icon/paly_num.png?v=v<?=STA_VERSION?>"
  25. />
  26. <div>{{ video.view_count }}</div>
  27. </div>
  28. <div class="live-people live-zan gray-51 align-center">
  29. <img class="see icon" src="<?=STA_URL?>/quan_v3/icon/zan.png?v=v<?=STA_VERSION?>" />
  30. <div>{{ video.like_count }}</div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <router-view />
  39. <van-tabbar route>
  40. <van-tabbar-item replace badge="3" to="/user/index/article">
  41. <span>文章</span>
  42. <template #icon="props">
  43. <img :src="props.active ? icon.article.active : icon.article.inactive" />
  44. </template>
  45. </van-tabbar-item>
  46. <van-tabbar-item replace to="/user/index/video" icon="search">
  47. <span>视频</span>
  48. <template #icon="props">
  49. <img :src="props.active ? icon.video.active : icon.video.inactive" />
  50. </template>
  51. </van-tabbar-item>
  52. <van-tabbar-item
  53. replace
  54. :to="`/u/`+$store.state.userinfo.uid"
  55. icon="search"
  56. v-if="$store.state.userinfo.uid"
  57. >
  58. <span>我的</span>
  59. <template #icon="props">
  60. <img :src="props.active ? icon.my.active : icon.my.inactive" />
  61. </template>
  62. </van-tabbar-item>
  63. <van-tabbar-item replace @click="goLogin()" icon="search" v-else>
  64. <span>我的</span>
  65. <template #icon="props">
  66. <img :src="props.active ? icon.my.active : icon.my.inactive" />
  67. </template>
  68. </van-tabbar-item>
  69. </van-tabbar>
  70. </div>
  71. </template>
  72. <script>
  73. import { Tabbar, TabbarItem } from "vant";
  74. let container;
  75. export default {
  76. layout: "opacity_header",
  77. async asyncData() {
  78. return {
  79. title: `选择新建类型-程序员客栈`
  80. };
  81. },
  82. data() {
  83. return {
  84. ad: {},
  85. icon: {
  86. article: {
  87. active: require("../../../assets/quan/icon/book_s.png"),
  88. inactive: require("../../../assets/quan/icon/book.png")
  89. },
  90. video: {
  91. active: require("../../../assets/quan/icon/video_s.png"),
  92. inactive: require("../../../assets/quan/icon/video.png")
  93. },
  94. my: {
  95. active: require("../../../assets/quan/icon/my_s.png"),
  96. inactive: require("../../../assets/quan/icon/my.png")
  97. }
  98. },
  99. ops: {
  100. mode: "native",
  101. sizeStrategy: "percent",
  102. detectResize: true
  103. },
  104. active: "default",
  105. list: [],
  106. page: {
  107. page: 1,
  108. noMore: 0
  109. }
  110. };
  111. },
  112. mounted() {
  113. container = this.$refs.container;
  114. },
  115. created() {
  116. this.needLogin();
  117. this.getList();
  118. },
  119. methods: {
  120. getList() {
  121. let that = this;
  122. let page = that.page;
  123. this.$axios
  124. .$get(
  125. this.$store.state.domainConfig.jishuinUrl +
  126. "/list/" +
  127. this.active +
  128. "/" +
  129. page.page
  130. )
  131. .then(res => {
  132. if (res.topics.length > 0) {
  133. let list = that.list;
  134. that.list = list.concat(res.topics);
  135. page++;
  136. } else {
  137. page.noMore = 1;
  138. }
  139. that.page = page;
  140. });
  141. }
  142. }
  143. };
  144. </script>
  145. <style scoped>
  146. @import "@/assets/css/user/mui.min.css";
  147. body {
  148. background-color: white;
  149. }
  150. </style>
  151. <style lang='less' scoped>
  152. .community-u {
  153. position: absolute;
  154. top: 0;
  155. left: 0;
  156. right: 0;
  157. bottom: 20px;
  158. }
  159. .avatar {
  160. border-radius: 50%;
  161. }
  162. .add-con {
  163. width: 3rem;
  164. height: 3rem;
  165. background: rgba(48, 142, 255, 1);
  166. box-shadow: 0rem 0.12rem 0.54rem 0rem rgba(48, 142, 255, 0.63);
  167. color: white;
  168. position: fixed;
  169. right: 1rem;
  170. bottom: 4rem;
  171. line-height: 3rem;
  172. text-align: center;
  173. z-index: 1000;
  174. border-radius: 50%;
  175. font-size: 2rem;
  176. }
  177. .live,
  178. .article-box {
  179. margin: 0 0.63rem;
  180. padding: 1.25rem 0 1.1rem 0;
  181. position: relative;
  182. }
  183. .live-title {
  184. width: 20.31rem;
  185. font-size: 0.94rem;
  186. font-family: PingFangSC-Medium;
  187. font-weight: 500;
  188. color: rgba(17, 17, 17, 1);
  189. line-height: 1.31rem;
  190. }
  191. .live-statu {
  192. height: 1.13rem;
  193. background: rgba(255, 153, 0, 1);
  194. border-radius: 0.14rem;
  195. font-size: 0.56rem;
  196. font-family: PingFangSC-Semibold, PingFang SC;
  197. font-weight: 600;
  198. color: rgba(255, 255, 255, 1);
  199. line-height: 0.81rem;
  200. padding: 0.13rem 0.18rem;
  201. margin-right: 0.63rem;
  202. }
  203. .live-statu > img {
  204. width: 0.61rem !important;
  205. height: 0.47rem;
  206. margin-right: 0.25rem;
  207. }
  208. .live-source {
  209. font-size: 0.69rem;
  210. font-family: PingFangSC-Medium, PingFang SC;
  211. font-weight: 500;
  212. color: rgba(34, 34, 34, 1);
  213. line-height: 1rem;
  214. margin-right: 0.38rem;
  215. }
  216. .live-source > img {
  217. width: 1.13rem !important;
  218. height: 1.13rem;
  219. }
  220. .live-time {
  221. font-size: 0.69rem;
  222. font-family: PingFangSC-Regular, PingFang SC;
  223. font-weight: 400;
  224. color: rgba(153, 153, 153, 1);
  225. line-height: 1rem;
  226. margin-right: 0.7rem;
  227. }
  228. .live-people {
  229. font-size: 0.69rem;
  230. font-family: PingFangSC-Medium, PingFang SC;
  231. font-weight: 500;
  232. color: rgba(51, 51, 51, 1);
  233. line-height: 1rem;
  234. margin-right: 0.3rem;
  235. }
  236. .live-bottom {
  237. margin-top: 0.44rem;
  238. position: relative;
  239. }
  240. .live .close {
  241. position: absolute;
  242. top: 1.35rem;
  243. right: 0px;
  244. width: 0.75rem !important;
  245. height: 0.75rem;
  246. }
  247. .see {
  248. width: 1rem !important;
  249. height: 1rem;
  250. margin-right: 0.13rem;
  251. }
  252. .mui-table-view > li {
  253. }
  254. .article-title {
  255. font-size: 0.94rem;
  256. font-family: PingFangSC-Regular, PingFang SC;
  257. font-weight: 400;
  258. color: rgba(17, 17, 17, 1);
  259. line-height: 1.31rem;
  260. }
  261. .article-box .justify-between {
  262. flex-direction: column;
  263. min-height: 4.5rem;
  264. }
  265. .article-img {
  266. width: 6.75rem !important;
  267. height: 5rem;
  268. border-radius: 0.13rem;
  269. object-fit: cover;
  270. }
  271. li {
  272. box-shadow: 0rem -0.03rem 0rem 0rem rgba(243, 243, 243, 1);
  273. }
  274. .mui-active .img-no {
  275. display: none;
  276. }
  277. .mui-active .img-select {
  278. display: inline-block;
  279. }
  280. .img-select {
  281. display: none;
  282. }
  283. .mui-slider-indicator.mui-segmented-control {
  284. height: 2.81rem;
  285. background: white;
  286. }
  287. .mui-segmented-control .mui-control-item {
  288. line-height: 2.81rem;
  289. }
  290. /*.mui-slider-progress-bar {
  291. width:1rem;
  292. margin-left: 5.45rem;
  293. }*/
  294. .mui-slider
  295. .mui-segmented-control.mui-segmented-control-inverted
  296. ~ .mui-slider-group
  297. .mui-slider-item {
  298. border: none;
  299. }
  300. .video2 {
  301. margin: 0.63rem;
  302. box-shadow: 0rem 0.06rem 0.24rem 0rem rgba(8, 27, 50, 0.05);
  303. border-radius: 0.08rem;
  304. overflow: hidden;
  305. }
  306. .video-box {
  307. box-shadow: 0rem 0.06rem 0.24rem 0rem rgba(8, 27, 50, 0.05);
  308. border-radius: 0.08rem;
  309. overflow: hidden;
  310. }
  311. .video-img {
  312. position: relative;
  313. width: 100%;
  314. height: 12.13rem;
  315. }
  316. .video-img .img {
  317. width: 100%;
  318. height: 100%;
  319. object-fit: cover;
  320. border-radius: 0.25rem 0.25rem 0rem 0rem;
  321. }
  322. .video-des {
  323. font-size: 0.94rem;
  324. font-family: PingFangSC-Regular, PingFang SC;
  325. color: rgba(51, 51, 51, 1);
  326. line-height: 1.31rem;
  327. margin: 0.63rem 0 0.88rem 0;
  328. }
  329. .video-detail {
  330. padding: 0.63rem 0.94rem;
  331. box-shadow: 0rem 0.19rem 0.75rem 0rem rgba(8, 27, 50, 0.05);
  332. border-radius: 0rem 0rem 0.25rem 0.25rem;
  333. }
  334. .length {
  335. position: absolute;
  336. right: 10px;
  337. bottom: 10px;
  338. line-height: 22px;
  339. background: rgba(0, 0, 0, 0.3);
  340. border-radius: 11px;
  341. border: 1px solid rgba(255, 255, 255, 0.08);
  342. padding: 0 22px;
  343. color: white;
  344. }
  345. .play {
  346. position: absolute;
  347. width: 2.88rem !important;
  348. height: 2.88rem;
  349. top: 4.6rem;
  350. left: 9.7rem;
  351. }
  352. .live-zan {
  353. margin-left: 0.75rem;
  354. }
  355. </style>