bigpic_demo.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <template>
  2. <div class="lunbo " id="jssor_1">
  3. <ul ref="jssor" class="jssor-wrapper" data-u="slides" @mousedown="mousedown" @mousemove="mousemove">
  4. <li class="jssor-slide" @click.stop="handleItem(item)"
  5. :class="{ weiyi: i % 2 != 0, flipActive: active.id == item.id }" v-for="(item, i) in piclist" :key="i">
  6. <div data-u="image">
  7. <div class="imgdefault">
  8. <!-- 'http://192.168.0.109:8004/'+ -->
  9. <img :class="{ hideImg: noImg }" :src="item.thumb" alt="" />
  10. <p>
  11. <strong :title="item.name">{{ item.name }}</strong>
  12. <span v-if="item.level != 6" :title="item.title || g_typeStr[item.level]">{{ item.title ||
  13. g_typeStr[item.level]
  14. }}</span>
  15. <span :title="item.years ? `(${item.years})` : ''">{{ item.years ? `(${item.years})` : "" }}</span>
  16. </p>
  17. </div>
  18. <div class="imgactive">
  19. <h2>
  20. <strong :title="item.name">{{ item.name }}</strong>
  21. <span :title="item.years ? `(${item.years})` : ''">{{ item.years ? `(${item.years})` : "" }}</span>
  22. </h2>
  23. <h2>
  24. <strong v-if="item.level != 6" :title="item.title || g_typeStr[item.level]">{{ item.title ||
  25. g_typeStr[item.level]
  26. }}</strong>
  27. </h2>
  28. <!-- 'http://192.168.0.245:8004/'+ -->
  29. <div v-if="showVideo && item.video" @click.stop="openVideo(item)" class="iivideo"
  30. :class="{ iimask: showBofang, iinourl: item.url }">
  31. <img class="bofang" :src="require(`@/assets/images/expert/bofang.png`)" v-if="showBofang" />
  32. <img class="poster" :src="item.thumb" v-if="showBofang" />
  33. </div>
  34. <p :class="{ novideo: !item.video, nourl: !item.video && !item.url }" v-html="item.description"></p>
  35. <div class="enter" :title="item.urlName" v-if="item.url" @click.stop="open(item)">
  36. <span>{{ item.urlName || "-" }}</span>
  37. </div>
  38. </div>
  39. </div>
  40. </li>
  41. </ul>
  42. </div>
  43. </template>
  44. <script>
  45. var jssor_1_options = {
  46. $AutoPlay: 0,
  47. $Idle: 0,
  48. $SlideDuration: 5000,
  49. $SlideEasing: $Jease$.$Linear,
  50. $PauseOnHover: 4,
  51. $SlideSpacing: 60,
  52. $SlideWidth: 340,
  53. $SlideHeight: 560,
  54. $Loop: 0,
  55. $Align: 0
  56. };
  57. export default {
  58. props: ["list"],
  59. data() {
  60. return {
  61. piclist: [...this.list],
  62. active: "",
  63. showBofang: "",
  64. hadvideo: false,
  65. clkLock: false,
  66. showVideo: false,
  67. noImg: false,
  68. TO: null,
  69. TT: null,
  70. TTT: null,
  71. isStopProp: true
  72. };
  73. },
  74. methods: {
  75. mousedown(e) {
  76. if (this.isStopProp) {
  77. e.stopPropagation()
  78. }
  79. },
  80. mousemove(e) {
  81. if (this.isStopProp) {
  82. e.stopPropagation()
  83. }
  84. },
  85. listenFn() {
  86. window.jssor_1_slider.$AutoPlay(1)
  87. this.isStopProp = false
  88. },
  89. open(item) {
  90. let windowObjectReference = window.open();
  91. let temp = this.changetohttp(item.url);
  92. windowObjectReference.location.href = temp;
  93. // window.open(item.url,'_blank')
  94. },
  95. openVideo(item) {
  96. this.$emit("current", item);
  97. },
  98. handleItem(item) {
  99. if (this.clkLock) {
  100. return;
  101. }
  102. setTimeout(() => {
  103. this.clkLock = false;
  104. }, 500);
  105. this.clkLock = true;
  106. if (item == this.active) {
  107. this.active = "";
  108. if (!this.isStopProp) {
  109. window.jssor_1_slider.$AutoPlay(1)
  110. }
  111. this.noImg = false;
  112. this.TO && clearTimeout(this.TO);
  113. this.TO = setTimeout(() => {
  114. this.showVideo = false;
  115. }, 300);
  116. } else {
  117. this.active = item;
  118. if (!this.isStopProp) {
  119. window.jssor_1_slider.$AutoPlay(0)
  120. }
  121. this.TT && clearTimeout(this.TT);
  122. this.TT = setTimeout(() => {
  123. this.noImg = true;
  124. }, 600);
  125. if (item.video) {
  126. this.showVideo = true;
  127. } else {
  128. this.showVideo = false;
  129. }
  130. }
  131. this.showBofang = true;
  132. this.hadvideo = false;
  133. },
  134. },
  135. mounted() {
  136. window.jssor_1_slider = new $JssorSlider$("jssor_1", jssor_1_options);
  137. window.jssor_1_slider.$AutoPlay(0)
  138. this.$bus.$on('startLoop', this.listenFn)
  139. },
  140. destroyed() {
  141. this.$bus.$off("startLoop", this.listenFn);
  142. },
  143. };
  144. </script>
  145. <style lang="less" scoped>
  146. @jianjinw: 10%;
  147. .lunbo {
  148. width: 100%;
  149. position: relative;
  150. height: 100%;
  151. color: #fff;
  152. bottom: 0;
  153. left: 0;
  154. padding: 0 10px;
  155. .jssor-wrapper {
  156. width: 100%;
  157. height: 100%;
  158. left: 0;
  159. top: 0;
  160. position: absolute;
  161. padding: 0 60px;
  162. .jssor-slide {
  163. display: inline-block;
  164. margin: 0;
  165. position: relative;
  166. top: 158px !important;
  167. height: auto;
  168. // cursor: pointer;
  169. width: 340px;
  170. perspective: 1000px;
  171. .imgdefault,
  172. .imgactive {
  173. width: 100%;
  174. padding: 10px;
  175. display: inline-block;
  176. vertical-align: bottom;
  177. border: 2px solid rgba(243, 199, 165, 0.4);
  178. background: linear-gradient(180deg, rgba(178, 69, 81, 0.2) 0%, rgba(239, 167, 120, 0.2) 100%);
  179. position: relative;
  180. backface-visibility: hidden;
  181. transition: 0.6s;
  182. transform-style: preserve-3d;
  183. //transform: rotateX(0);
  184. &::before {
  185. filter: blur(2px);
  186. content: '';
  187. width: 100%;
  188. height: 100%;
  189. position: absolute;
  190. top: 0;
  191. left: 0;
  192. background: rgba(178, 69, 81, .2);
  193. z-index: -1;
  194. }
  195. >img {
  196. width: 100%;
  197. height: 414px;
  198. position: relative;
  199. object-fit: cover;
  200. }
  201. >p {
  202. text-align: left;
  203. font-size: 22px;
  204. font-weight: bold;
  205. margin: 10px 0;
  206. white-space: nowrap;
  207. >strong {
  208. font-size: 22px;
  209. font-weight: bold;
  210. width: 90px;
  211. overflow: hidden;
  212. text-overflow: ellipsis;
  213. white-space: nowrap;
  214. display: inline-block;
  215. vertical-align: bottom;
  216. }
  217. >span {
  218. display: inline-block;
  219. font-size: 16px;
  220. width: 78px;
  221. overflow: hidden;
  222. text-overflow: ellipsis;
  223. white-space: nowrap;
  224. display: inline-block;
  225. vertical-align: bottom;
  226. text-align: center;
  227. &:last-of-type {
  228. width: auto;
  229. max-width: 170px;
  230. }
  231. }
  232. }
  233. }
  234. .imgactive {
  235. position: absolute;
  236. left: 0;
  237. bottom: 0;
  238. height: 560px;
  239. text-align: left;
  240. transform: rotateY(-180deg);
  241. background: linear-gradient(180deg, rgba(178, 69, 81, 0.5) 0%, rgba(239, 167, 120, 0.5) 100%);
  242. padding: 20px 26px;
  243. .iivideo {
  244. width: 100%;
  245. height: 70%;
  246. position: relative;
  247. z-index: 99;
  248. overflow: hidden;
  249. .bofang {
  250. position: absolute;
  251. top: 50%;
  252. cursor: pointer;
  253. left: 50%;
  254. transform: translate(-50%, -50%);
  255. z-index: 9999;
  256. }
  257. .poster {
  258. width: 100%;
  259. position: absolute;
  260. top: 50%;
  261. transform: translateY(-50%);
  262. }
  263. }
  264. .iinourl {
  265. height: 60%;
  266. }
  267. .iimask {
  268. &::before {
  269. content: "";
  270. display: inline-block;
  271. background-color: rgba(0, 0, 0, 0.6);
  272. z-index: 1;
  273. width: 100%;
  274. height: 100%;
  275. position: absolute;
  276. top: 0;
  277. left: 0;
  278. }
  279. }
  280. >h2 {
  281. font-size: 24px;
  282. font-weight: normal;
  283. margin-bottom: 6px;
  284. height: 7%;
  285. >strong {
  286. font-size: 24px;
  287. font-weight: bold;
  288. width: 120px;
  289. overflow: hidden;
  290. text-overflow: ellipsis;
  291. white-space: nowrap;
  292. display: inline-block;
  293. vertical-align: bottom;
  294. }
  295. &:last-of-type {
  296. >strong {
  297. width: 300px;
  298. }
  299. }
  300. span {
  301. width: auto;
  302. max-width: 160px;
  303. overflow: hidden;
  304. text-overflow: ellipsis;
  305. white-space: nowrap;
  306. display: inline-block;
  307. vertical-align: bottom;
  308. }
  309. }
  310. >p {
  311. text-indent: 28px;
  312. font-weight: normal;
  313. font-size: 14px;
  314. width: 100%;
  315. max-height: 12%;
  316. overflow-y: auto;
  317. overflow-x: hidden;
  318. line-height: 1.5;
  319. white-space: break-spaces;
  320. }
  321. .novideo {
  322. max-height: 64%;
  323. min-height: 320px;
  324. font-size: 16px;
  325. margin-top: 40px;
  326. text-align: justify;
  327. overflow-y: auto;
  328. padding-right: 10px;
  329. margin-bottom: 20px;
  330. }
  331. .nourl {
  332. max-height: 76%;
  333. min-height: 380px;
  334. }
  335. .enter {
  336. margin: 0 auto;
  337. background: linear-gradient(360deg, #ffe0a6 0%, #fcf5d3 100%);
  338. height: 45px;
  339. line-height: 45px;
  340. width: 70%;
  341. color: #a58056;
  342. position: relative;
  343. padding: 0 20px;
  344. cursor: pointer;
  345. text-align: center;
  346. overflow: hidden;
  347. text-overflow: ellipsis;
  348. white-space: nowrap;
  349. vertical-align: bottom;
  350. >span {
  351. font-size: 20px;
  352. }
  353. }
  354. }
  355. }
  356. .flipActive {
  357. width: 360px;
  358. .imgdefault {
  359. transform: rotateY(-180deg);
  360. >img {
  361. width: 100%;
  362. position: relative;
  363. }
  364. .hideImg {
  365. display: none;
  366. }
  367. }
  368. .imgactive {
  369. transform: rotateY(0deg);
  370. }
  371. }
  372. .weiyi {
  373. transform: translateY(-55px);
  374. }
  375. }
  376. }
  377. @media screen and (max-width: 1700px) {
  378. .lunbo {
  379. .jssor-wrapper {
  380. .jssor-slide {
  381. top: 124px !important;
  382. }
  383. }
  384. }
  385. }
  386. </style>