quality.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <div class="quality">
  3. <div class="main">
  4. <div class="top">
  5. <h2>{{Mylangue?'精品典藏':'Collections'}}</h2>
  6. <i class="el-icon-close" @click="$emit('close')"></i>
  7. </div>
  8. <div class="conten">
  9. <div class="search">
  10. <el-input
  11. v-model="input"
  12. :placeholder="Mylangue?'请输入藏品名称...':'Enter title here'"
  13. suffix-icon="el-icon-search"
  14. ></el-input>
  15. <el-button type="primary" size="small" style="margin-left: 15px"
  16. >{{Mylangue?'搜索':'Search'}}</el-button
  17. >
  18. <el-button size="small">{{Mylangue?'重置':'Reset'}}</el-button>
  19. </div>
  20. <!-- 内容 -->
  21. <div class="rowAll">
  22. <div class="row" v-for="i in 8" :key="i">
  23. <img src="../../../assets/images/myModel.jpg" alt="" />
  24. <p>藏品名称</p>
  25. </div>
  26. </div>
  27. <!-- 分页 -->
  28. <div class="pagination" v-if="!isMobile">
  29. <el-pagination
  30. layout="prev,pager,next,jumper"
  31. :page-size="8"
  32. :current-page="formData.pageNum"
  33. @current-change="currentChange"
  34. @size-change="sizeChange"
  35. :total="50"
  36. >
  37. </el-pagination>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. export default {
  45. name: "quality",
  46. components: {},
  47. data() {
  48. //这里存放数据
  49. return {
  50. input: "",
  51. formData: {
  52. pageNum: 1,
  53. pageSize: 8,
  54. },
  55. };
  56. },
  57. //监听属性 类似于data概念
  58. computed: {},
  59. //监控data中的数据变化
  60. watch: {},
  61. //方法集合
  62. methods: {
  63. // 分页器方法
  64. currentChange(val) {
  65. // console.log('当前页改变了', val)
  66. this.formData.pageNum = val;
  67. },
  68. sizeChange(val) {
  69. // console.log('条数改变了', val)
  70. this.formData.pageNum = 1;
  71. this.formData.pageSize = val;
  72. },
  73. },
  74. //生命周期 - 创建完成(可以访问当前this实例)
  75. created() {},
  76. //生命周期 - 挂载完成(可以访问DOM元素)
  77. mounted() {
  78. // 控制分页器的英文版文字
  79. if(!this.Mylangue) {
  80. let dom = document.getElementsByClassName("el-pagination__jump")
  81. dom[0].childNodes[0].nodeValue = "Jump to";
  82. dom[0].childNodes[2].nodeValue = "page";
  83. }
  84. },
  85. beforeCreate() {}, //生命周期 - 创建之前
  86. beforeMount() {}, //生命周期 - 挂载之前
  87. beforeUpdate() {}, //生命周期 - 更新之前
  88. updated() {}, //生命周期 - 更新之后
  89. beforeDestroy() {}, //生命周期 - 销毁之前
  90. destroyed() {}, //生命周期 - 销毁完成
  91. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  92. };
  93. </script>
  94. <style lang='less' scoped>
  95. ::-webkit-scrollbar-thumb {
  96. outline: 2px solid #165491;
  97. }
  98. .quality {
  99. background-color: rgba(0,0,0,.5);
  100. position: fixed;
  101. top: 0;
  102. left: 0;
  103. z-index: 9999;
  104. width: 100vw;
  105. height: 100vh;
  106. .main {
  107. padding: 20px;
  108. padding-top: 100px;
  109. border-radius: 3px;
  110. position: absolute;
  111. top: 50%;
  112. left: 50%;
  113. transform: translate(-50%, -50%);
  114. z-index: 9999;
  115. width: 1100px;
  116. height: 800px;
  117. background: url("../../../assets/img/bg.png");
  118. background-size: 100% 100%;
  119. }
  120. .top {
  121. margin-bottom: 20px;
  122. display: flex;
  123. justify-content: space-between;
  124. align-items: center;
  125. color: #165491;
  126. font-weight: 700;
  127. font-size: 22px;
  128. & > i {
  129. cursor: pointer;
  130. font-size: 30px;
  131. }
  132. }
  133. .conten {
  134. padding: 30px 20px;
  135. border-radius: 3px;
  136. width: 100%;
  137. height: 610px;
  138. background-color: rgba(22, 84, 145, 0.5);
  139. .search {
  140. display: flex;
  141. width: 500px;
  142. margin: 0 auto;
  143. /deep/.el-input__icon {
  144. line-height: 30px;
  145. color: #165491;
  146. font-size: 18px;
  147. }
  148. }
  149. .rowAll {
  150. margin-top: 40px;
  151. display: flex;
  152. flex-wrap: wrap;
  153. .row {
  154. margin-right: 10px;
  155. margin-bottom: 20px;
  156. overflow: hidden;
  157. border-radius: 5px;
  158. background-color: #fff;
  159. width: 247px;
  160. height: 190px;
  161. & > img {
  162. width: 247px;
  163. height: 150px;
  164. object-fit: cover;
  165. }
  166. & > p {
  167. width: 95%;
  168. background: url("../../../assets/img/come.png") no-repeat right center;
  169. padding: 0 30px 0 10px;
  170. height: 40px;
  171. line-height: 40px;
  172. overflow: hidden;
  173. text-overflow: ellipsis;
  174. white-space: nowrap;
  175. color: #999999;
  176. font-size: 16px;
  177. }
  178. &:nth-of-type(4n) {
  179. margin-right: 0;
  180. }
  181. &:hover {
  182. background-color: #165491;
  183. & > p {
  184. background: url("../../../assets/img/comeAc.png") no-repeat right
  185. center;
  186. color: #fff;
  187. }
  188. }
  189. }
  190. }
  191. .pagination {
  192. margin-top: 20px;
  193. width: 100%;
  194. display: flex;
  195. justify-content: center;
  196. }
  197. }
  198. }
  199. @media only screen and (max-width: 800px) {
  200. .quality {
  201. .main {
  202. max-height: 640px;
  203. width: 100%;
  204. max-width: 350px;
  205. height: calc(100vh - 150px);
  206. background: url("../../../assets/imgM/bg.png");
  207. background-size: 100% 100%;
  208. padding-top: 70px;
  209. }
  210. .top {
  211. margin-bottom: 5px;
  212. }
  213. .conten {
  214. height: calc(100% - 30px);
  215. padding: 10px;
  216. .search {
  217. width: 100%;
  218. button{
  219. width: 56px !important;
  220. padding: 5px 8px !important;
  221. }
  222. }
  223. .rowAll{
  224. justify-content: center;
  225. margin-top: 20px;
  226. height: calc(100% - 42px);
  227. overflow-y: auto;
  228. .row{
  229. margin-right: 0;
  230. margin-bottom: 10px;
  231. }
  232. }
  233. }
  234. }
  235. }
  236. </style>