index.vue 20 KB

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