index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. <template>
  2. <doc-alert title="公众号图文" url="https://doc.iocoder.cn/mp/article/" />
  3. <!-- 搜索工作栏 -->
  4. <ContentWrap>
  5. <!-- TODO @芋艿:调整成 el-form 和 WxAccountSelect -->
  6. <WxAccountSelect @change="accountChanged">
  7. <template #actions>
  8. <el-button type="primary" plain @click="handleAdd" v-hasPermi="['mp:draft:create']">
  9. <Icon icon="ep:plus" />新增
  10. </el-button>
  11. </template>
  12. </WxAccountSelect>
  13. </ContentWrap>
  14. <!-- 列表 -->
  15. <ContentWrap>
  16. <div class="waterfall" v-loading="loading">
  17. <template v-for="item in list" :key="item.articleId">
  18. <div class="waterfall-item" v-if="item.content && item.content.newsItem">
  19. <WxNews :articles="item.content.newsItem" />
  20. <!-- 操作按钮 -->
  21. <el-row class="ope-row">
  22. <el-button
  23. type="success"
  24. circle
  25. @click="handlePublish(item)"
  26. v-hasPermi="['mp:free-publish:submit']"
  27. >
  28. <Icon icon="fa:upload" />
  29. </el-button>
  30. <el-button
  31. type="primary"
  32. circle
  33. @click="handleUpdate(item)"
  34. v-hasPermi="['mp:draft:update']"
  35. >
  36. <Icon icon="ep:edit" />
  37. </el-button>
  38. <el-button
  39. type="danger"
  40. circle
  41. @click="handleDelete(item)"
  42. v-hasPermi="['mp:draft:delete']"
  43. >
  44. <Icon icon="ep:delete" />
  45. </el-button>
  46. </el-row>
  47. </div>
  48. </template>
  49. </div>
  50. <!-- 分页记录 -->
  51. <Pagination
  52. :total="total"
  53. v-model:page="queryParams.pageNo"
  54. v-model:limit="queryParams.pageSize"
  55. @pagination="getList"
  56. />
  57. </ContentWrap>
  58. <!-- TODO @Dhb52:迁移成独立路由 -->
  59. <div class="app-container">
  60. <!-- 添加或修改草稿对话框 -->
  61. <Teleport to="body">
  62. <el-dialog
  63. :title="operateMaterial === 'add' ? '新建图文' : '修改图文'"
  64. width="80%"
  65. top="20px"
  66. v-model="dialogNewsVisible"
  67. :before-close="dialogNewsClose"
  68. :close-on-click-modal="false"
  69. >
  70. <div class="left">
  71. <div class="select-item">
  72. <div v-for="(news, index) in articlesAdd" :key="news.id">
  73. <div
  74. class="news-main father"
  75. v-if="index === 0"
  76. :class="{ activeAddNews: isActiveAddNews === index }"
  77. @click="activeNews(index)"
  78. >
  79. <div class="news-content">
  80. <img class="material-img" v-if="news.thumbUrl" :src="news.thumbUrl" />
  81. <div class="news-content-title">{{ news.title }}</div>
  82. </div>
  83. <div class="child" v-if="articlesAdd.length > 1">
  84. <el-button size="small" @click="downNews(index)"
  85. ><Icon icon="ep:sort-down" />下移</el-button
  86. >
  87. <el-button v-if="operateMaterial === 'add'" size="small" @click="minusNews(index)"
  88. ><Icon icon="ep:delete" />删除
  89. </el-button>
  90. </div>
  91. </div>
  92. <div
  93. class="news-main-item father"
  94. v-if="index > 0"
  95. :class="{ activeAddNews: isActiveAddNews === index }"
  96. @click="activeNews(index)"
  97. >
  98. <div class="news-content-item">
  99. <div class="news-content-item-title">{{ news.title }}</div>
  100. <div class="news-content-item-img">
  101. <img
  102. class="material-img"
  103. v-if="news.thumbUrl"
  104. :src="news.thumbUrl"
  105. height="100%"
  106. />
  107. </div>
  108. </div>
  109. <div class="child">
  110. <el-button
  111. v-if="articlesAdd.length > index + 1"
  112. size="small"
  113. @click="downNews(index)"
  114. ><Icon icon="ep:sort-down" />下移
  115. </el-button>
  116. <el-button size="small" @click="upNews(index)"
  117. ><Icon icon="ep:sort-up" />上移</el-button
  118. >
  119. <el-button
  120. v-if="operateMaterial === 'add'"
  121. type="danger"
  122. size="small"
  123. @click="minusNews(index)"
  124. ><Icon icon="ep:delete" />删除
  125. </el-button>
  126. </div>
  127. </div>
  128. </div>
  129. <el-row justify="center" class="ope-row">
  130. <el-button
  131. type="primary"
  132. circle
  133. @click="plusNews(item)"
  134. v-if="articlesAdd.length < 8 && operateMaterial === 'add'"
  135. >
  136. <Icon icon="ep:plus" />
  137. </el-button>
  138. </el-row>
  139. </div>
  140. </div>
  141. <div class="right" v-loading="addMaterialLoading" v-if="articlesAdd.length > 0">
  142. <br />
  143. <br />
  144. <br />
  145. <br />
  146. <!-- 标题、作者、原文地址 -->
  147. <el-input v-model="articlesAdd[isActiveAddNews].title" placeholder="请输入标题(必填)" />
  148. <el-input
  149. v-model="articlesAdd[isActiveAddNews].author"
  150. placeholder="请输入作者"
  151. style="margin-top: 5px"
  152. />
  153. <el-input
  154. v-model="articlesAdd[isActiveAddNews].contentSourceUrl"
  155. placeholder="请输入原文地址"
  156. style="margin-top: 5px"
  157. />
  158. <!-- 封面和摘要 -->
  159. <div class="input-tt">封面和摘要:</div>
  160. <div>
  161. <div class="thumb-div">
  162. <img
  163. class="material-img"
  164. v-if="articlesAdd[isActiveAddNews].thumbUrl"
  165. :src="articlesAdd[isActiveAddNews].thumbUrl"
  166. :class="isActiveAddNews === 0 ? 'avatar' : 'avatar1'"
  167. />
  168. <Icon
  169. v-else
  170. icon="ep:plus"
  171. class="avatar-uploader-icon"
  172. :class="isActiveAddNews === 0 ? 'avatar' : 'avatar1'"
  173. />
  174. <div class="thumb-but">
  175. <el-upload
  176. :action="actionUrl"
  177. :headers="headers"
  178. multiple
  179. :limit="1"
  180. :file-list="fileList"
  181. :data="uploadData"
  182. :before-upload="beforeThumbImageUpload"
  183. :on-success="handleUploadSuccess"
  184. >
  185. <template #trigger>
  186. <el-button size="small" type="primary">本地上传</el-button>
  187. </template>
  188. <el-button
  189. size="small"
  190. type="primary"
  191. @click="openMaterial"
  192. style="margin-left: 5px"
  193. >素材库选择</el-button
  194. >
  195. <template #tip>
  196. <div class="el-upload__tip">支持 bmp/png/jpeg/jpg/gif 格式,大小不超过 2M</div>
  197. </template>
  198. </el-upload>
  199. </div>
  200. <Teleport to="body">
  201. <el-dialog title="选择图片" v-model="dialogImageVisible" width="80%">
  202. <WxMaterialSelect
  203. ref="materialSelectRef"
  204. :objData="{ type: 'image', accountId: queryParams.accountId }"
  205. @select-material="selectMaterial"
  206. />
  207. </el-dialog>
  208. </Teleport>
  209. </div>
  210. <el-input
  211. :rows="8"
  212. type="textarea"
  213. v-model="articlesAdd[isActiveAddNews].digest"
  214. placeholder="请输入摘要"
  215. class="digest"
  216. maxlength="120"
  217. style="float: right"
  218. />
  219. </div>
  220. <!--富文本编辑器组件-->
  221. <el-row>
  222. <WxEditor
  223. v-model="articlesAdd[isActiveAddNews].content"
  224. :account-id="uploadData.accountId"
  225. v-if="hackResetEditor"
  226. />
  227. </el-row>
  228. </div>
  229. <template #footer>
  230. <el-button @click="dialogNewsVisible = false">取 消</el-button>
  231. <el-button type="primary" @click="submitForm">提 交</el-button>
  232. </template>
  233. </el-dialog>
  234. </Teleport>
  235. </div>
  236. </template>
  237. <script setup name="MpDraft">
  238. import WxEditor from '@/views/mp/components/wx-editor/WxEditor.vue'
  239. import WxNews from '@/views/mp/components/wx-news/main.vue'
  240. import WxMaterialSelect from '@/views/mp/components/wx-material-select/main.vue'
  241. import WxAccountSelect from '@/views/mp/components/wx-account-select/main.vue'
  242. import { getAccessToken } from '@/utils/auth'
  243. import * as MpDraftApi from '@/api/mp/draft'
  244. import * as MpFreePublishApi from '@/api/mp/freePublish'
  245. // 可以用改本地数据模拟,避免API调用超限
  246. // import drafts from './mock'
  247. const message = useMessage() // 消息
  248. const loading = ref(true) // 列表的加载中
  249. const total = ref(0) // 列表的总页数
  250. const list = ref([]) // 列表的数据
  251. const queryParams = reactive({
  252. pageNo: 1,
  253. pageSize: 10,
  254. accountId: undefined
  255. })
  256. // ========== 文件上传 ==========
  257. const materialSelectRef = ref()
  258. const BASE_URL = import.meta.env.VITE_BASE_URL
  259. const actionUrl = ref(BASE_URL + '/admin-api/mp/material/upload-permanent') // 上传永久素材的地址
  260. const headers = ref({ Authorization: 'Bearer ' + getAccessToken() }) // 设置上传的请求头部
  261. const fileList = ref([])
  262. const uploadData = reactive({
  263. type: 'image',
  264. accountId: 1
  265. })
  266. // ========== 草稿新建 or 修改 ==========
  267. const dialogNewsVisible = ref(false)
  268. const addMaterialLoading = ref(false) // 添加草稿的 loading 标识
  269. const articlesAdd = ref([])
  270. const isActiveAddNews = ref(0)
  271. const dialogImageVisible = ref(false)
  272. const operateMaterial = ref('add')
  273. const articlesMediaId = ref('')
  274. const hackResetEditor = ref(false)
  275. /** 侦听公众号变化 **/
  276. const accountChanged = (accountId) => {
  277. setAccountId(accountId)
  278. getList()
  279. }
  280. // ======================== 列表查询 ========================
  281. /** 设置账号编号 */
  282. const setAccountId = (accountId) => {
  283. queryParams.accountId = accountId
  284. uploadData.accountId = accountId
  285. }
  286. /** 查询列表 */
  287. const getList = async () => {
  288. // 如果没有选中公众号账号,则进行提示。
  289. if (!queryParams.accountId) {
  290. message.error('未选中公众号,无法查询草稿箱')
  291. return false
  292. }
  293. loading.value = true
  294. try {
  295. const drafts = await MpDraftApi.getDraftPage(queryParams)
  296. drafts.list.forEach((item) => {
  297. const newsItem = item.content.newsItem
  298. // 将 thumbUrl 转成 picUrl,保证 wx-news 组件可以预览封面
  299. newsItem.forEach((article) => {
  300. article.picUrl = article.thumbUrl
  301. })
  302. })
  303. list.value = drafts.list
  304. total.value = drafts.total
  305. } finally {
  306. loading.value = false
  307. }
  308. }
  309. // ======================== 新增/修改草稿 ========================
  310. /** 新增按钮操作 */
  311. const handleAdd = () => {
  312. resetEditor()
  313. reset()
  314. // 打开表单,并设置初始化
  315. operateMaterial.value = 'add'
  316. dialogNewsVisible.value = true
  317. }
  318. /** 更新按钮操作 */
  319. const handleUpdate = (item) => {
  320. resetEditor()
  321. reset()
  322. articlesMediaId.value = item.mediaId
  323. articlesAdd.value = JSON.parse(JSON.stringify(item.content.newsItem))
  324. // 打开表单,并设置初始化
  325. operateMaterial.value = 'edit'
  326. dialogNewsVisible.value = true
  327. }
  328. /** 提交按钮 */
  329. const submitForm = () => {
  330. // TODO @Dhb52: 参考别的模块写法,改成 await 方式
  331. addMaterialLoading.value = true
  332. if (operateMaterial.value === 'add') {
  333. MpDraftApi.createDraft(queryParams.accountId, articlesAdd.value)
  334. .then(() => {
  335. message.notifySuccess('新增成功')
  336. dialogNewsVisible.value = false
  337. getList()
  338. })
  339. .finally(() => {
  340. addMaterialLoading.value = false
  341. })
  342. } else {
  343. MpDraftApi.updateDraft(queryParams.accountId, articlesMediaId.value, articlesAdd.value)
  344. .then(() => {
  345. message.notifySuccess('更新成功')
  346. dialogNewsVisible.value = false
  347. getList()
  348. })
  349. .finally(() => {
  350. addMaterialLoading.value = false
  351. })
  352. }
  353. }
  354. // 关闭弹窗
  355. const dialogNewsClose = async (done) => {
  356. try {
  357. await message.confirm('修改内容可能还未保存,确定关闭吗?')
  358. reset()
  359. resetEditor()
  360. done()
  361. } catch {}
  362. }
  363. // 表单重置
  364. const reset = () => {
  365. isActiveAddNews.value = 0
  366. articlesAdd.value = [buildEmptyArticle()]
  367. }
  368. // 表单 Editor 重置
  369. const resetEditor = () => {
  370. hackResetEditor.value = false // 销毁组件
  371. nextTick(() => {
  372. hackResetEditor.value = true // 重建组件
  373. })
  374. }
  375. // 将图文向下移动
  376. const downNews = (index) => {
  377. let temp = articlesAdd.value[index]
  378. articlesAdd.value[index] = articlesAdd.value[index + 1]
  379. articlesAdd.value[index + 1] = temp
  380. isActiveAddNews.value = index + 1
  381. }
  382. // 将图文向上移动
  383. const upNews = (index) => {
  384. let temp = articlesAdd.value[index]
  385. articlesAdd.value[index] = articlesAdd.value[index - 1]
  386. articlesAdd.value[index - 1] = temp
  387. isActiveAddNews.value = index - 1
  388. }
  389. // 选中指定 index 的图文
  390. const activeNews = (index) => {
  391. resetEditor()
  392. isActiveAddNews.value = index
  393. }
  394. // 删除指定 index 的图文
  395. const minusNews = async (index) => {
  396. try {
  397. await message.confirm('确定删除该图文吗?')
  398. articlesAdd.value.splice(index, 1)
  399. if (isActiveAddNews.value === index) {
  400. isActiveAddNews.value = 0
  401. }
  402. } catch {}
  403. }
  404. // 添加一个图文
  405. const plusNews = () => {
  406. articlesAdd.value.push(buildEmptyArticle())
  407. isActiveAddNews.value = articlesAdd.value.length - 1
  408. }
  409. // 创建空的 article
  410. const buildEmptyArticle = () => {
  411. return {
  412. title: '',
  413. thumbMediaId: '',
  414. author: '',
  415. digest: '',
  416. showCoverPic: '',
  417. content: '',
  418. contentSourceUrl: '',
  419. needOpenComment: '',
  420. onlyFansCanComment: '',
  421. thumbUrl: ''
  422. }
  423. }
  424. // ======================== 文件上传 ========================
  425. const beforeThumbImageUpload = (file) => {
  426. addMaterialLoading.value = true
  427. const isType =
  428. file.type === 'image/jpeg' ||
  429. file.type === 'image/png' ||
  430. file.type === 'image/gif' ||
  431. file.type === 'image/bmp' ||
  432. file.type === 'image/jpg'
  433. if (!isType) {
  434. message.error('上传图片格式不对!')
  435. addMaterialLoading.value = false
  436. return false
  437. }
  438. const isLt = file.size / 1024 / 1024 < 2
  439. if (!isLt) {
  440. message.error('上传图片大小不能超过 2M!')
  441. addMaterialLoading.value = false
  442. return false
  443. }
  444. // 校验通过
  445. return true
  446. }
  447. const handleUploadSuccess = (response, file, fileList) => {
  448. addMaterialLoading.value = false
  449. if (response.code !== 0) {
  450. message.error('上传出错:' + response.msg)
  451. return false
  452. }
  453. // 重置上传文件的表单
  454. fileList.value = []
  455. // 设置草稿的封面字段
  456. articlesAdd.value[isActiveAddNews.value].thumbMediaId = response.data.mediaId
  457. articlesAdd.value[isActiveAddNews.value].thumbUrl = response.data.url
  458. }
  459. // 选择 or 上传完素材,设置回草稿
  460. const selectMaterial = (item) => {
  461. dialogImageVisible.value = false
  462. articlesAdd.value[isActiveAddNews.value].thumbMediaId = item.mediaId
  463. articlesAdd.value[isActiveAddNews.value].thumbUrl = item.url
  464. }
  465. // 打开素材选择
  466. const openMaterial = () => {
  467. dialogImageVisible.value = true
  468. try {
  469. materialSelectRef.value.queryParams.accountId = queryParams.accountId // 强制设置下 accountId,避免二次查询不对
  470. materialSelectRef.value.handleQuery() // 刷新列表,失败也无所谓
  471. } catch (e) {}
  472. }
  473. // ======================== 草稿箱发布 ========================
  474. const handlePublish = async (item) => {
  475. const accountId = queryParams.accountId
  476. const mediaId = item.mediaId
  477. const content =
  478. '你正在通过发布的方式发表内容。 发布不占用群发次数,一天可多次发布。已发布内容不会推送给用户,也不会展示在公众号主页中。 发布后,你可以前往发表记录获取链接,也可以将发布内容添加到自定义菜单、自动回复、话题和页面模板中。'
  479. try {
  480. await message.confirm(content)
  481. await MpFreePublishApi.submitFreePublish(accountId, mediaId)
  482. message.notifySuccess('发布成功')
  483. await getList()
  484. } catch {}
  485. }
  486. /** 删除按钮操作 */
  487. const handleDelete = async (item) => {
  488. const accountId = queryParams.accountId
  489. const mediaId = item.mediaId
  490. try {
  491. await message.confirm('此操作将永久删除该草稿, 是否继续?')
  492. await MpDraftApi.deleteDraft(accountId, mediaId)
  493. message.notifySuccess('删除成功')
  494. await getList()
  495. } catch {}
  496. }
  497. </script>
  498. <style lang="scss" scoped>
  499. .pagination {
  500. float: right;
  501. margin-right: 25px;
  502. }
  503. .add_but {
  504. padding: 10px;
  505. }
  506. .ope-row {
  507. margin-top: 5px;
  508. text-align: center;
  509. border-top: 1px solid #eaeaea;
  510. padding-top: 5px;
  511. }
  512. .item-name {
  513. font-size: 12px;
  514. overflow: hidden;
  515. text-overflow: ellipsis;
  516. white-space: nowrap;
  517. text-align: center;
  518. }
  519. .el-upload__tip {
  520. margin-left: 5px;
  521. }
  522. /*新增图文*/
  523. .left {
  524. display: inline-block;
  525. width: 35%;
  526. vertical-align: top;
  527. margin-top: 200px;
  528. }
  529. .right {
  530. display: inline-block;
  531. width: 60%;
  532. margin-top: -40px;
  533. }
  534. .avatar-uploader {
  535. width: 20%;
  536. display: inline-block;
  537. }
  538. .avatar-uploader .el-upload {
  539. border-radius: 6px;
  540. cursor: pointer;
  541. position: relative;
  542. overflow: hidden;
  543. text-align: unset !important;
  544. }
  545. .avatar-uploader .el-upload:hover {
  546. border-color: #165dff;
  547. }
  548. .avatar-uploader-icon {
  549. border: 1px solid #d9d9d9;
  550. font-size: 28px;
  551. color: #8c939d;
  552. width: 120px;
  553. height: 120px;
  554. line-height: 120px;
  555. text-align: center;
  556. }
  557. .avatar {
  558. width: 230px;
  559. height: 120px;
  560. }
  561. .avatar1 {
  562. width: 120px;
  563. height: 120px;
  564. }
  565. .digest {
  566. width: 60%;
  567. display: inline-block;
  568. vertical-align: top;
  569. }
  570. /*新增图文*/
  571. /*瀑布流样式*/
  572. .waterfall {
  573. width: 100%;
  574. column-gap: 10px;
  575. column-count: 5;
  576. margin: 0 auto;
  577. }
  578. .waterfall-item {
  579. padding: 10px;
  580. margin-bottom: 10px;
  581. break-inside: avoid;
  582. border: 1px solid #eaeaea;
  583. }
  584. p {
  585. line-height: 30px;
  586. }
  587. @media (min-width: 992px) and (max-width: 1300px) {
  588. .waterfall {
  589. column-count: 3;
  590. }
  591. p {
  592. color: red;
  593. }
  594. }
  595. @media (min-width: 768px) and (max-width: 991px) {
  596. .waterfall {
  597. column-count: 2;
  598. }
  599. p {
  600. color: orange;
  601. }
  602. }
  603. @media (max-width: 767px) {
  604. .waterfall {
  605. column-count: 1;
  606. }
  607. }
  608. /*瀑布流样式*/
  609. .news-main {
  610. background-color: #ffffff;
  611. width: 100%;
  612. margin: auto;
  613. height: 120px;
  614. }
  615. .news-content {
  616. background-color: #acadae;
  617. width: 100%;
  618. height: 120px;
  619. position: relative;
  620. }
  621. .news-content-title {
  622. display: inline-block;
  623. font-size: 15px;
  624. color: #ffffff;
  625. position: absolute;
  626. left: 0px;
  627. bottom: 0px;
  628. background-color: black;
  629. width: 98%;
  630. padding: 1%;
  631. opacity: 0.65;
  632. overflow: hidden;
  633. text-overflow: ellipsis;
  634. white-space: nowrap;
  635. height: 25px;
  636. }
  637. .news-main-item {
  638. background-color: #ffffff;
  639. padding: 5px 0px;
  640. border-top: 1px solid #eaeaea;
  641. width: 100%;
  642. margin: auto;
  643. }
  644. .news-content-item {
  645. position: relative;
  646. margin-left: -3px;
  647. }
  648. .news-content-item-title {
  649. display: inline-block;
  650. font-size: 12px;
  651. width: 70%;
  652. }
  653. .news-content-item-img {
  654. display: inline-block;
  655. width: 25%;
  656. background-color: #acadae;
  657. }
  658. .input-tt {
  659. padding: 5px;
  660. }
  661. .activeAddNews {
  662. border: 5px solid #2bb673;
  663. }
  664. .news-main-plus {
  665. width: 280px;
  666. text-align: center;
  667. margin: auto;
  668. height: 50px;
  669. }
  670. .icon-plus {
  671. margin: 10px;
  672. font-size: 25px;
  673. }
  674. .select-item {
  675. width: 60%;
  676. padding: 10px;
  677. margin: 0 auto 10px auto;
  678. border: 1px solid #eaeaea;
  679. }
  680. .father .child {
  681. display: none;
  682. text-align: center;
  683. position: relative;
  684. bottom: 25px;
  685. }
  686. .father:hover .child {
  687. display: block;
  688. }
  689. .thumb-div {
  690. display: inline-block;
  691. width: 30%;
  692. text-align: center;
  693. }
  694. .thumb-but {
  695. margin: 5px;
  696. }
  697. .material-img {
  698. width: 100%;
  699. height: 100%;
  700. }
  701. </style>