news.blade.php 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. @extends('layouts.base')
  2. @section('title', '基础设置')
  3. @section('content')
  4. <link rel="stylesheet" href="{{resource_get('plugins/fight-group-statistics-award/views/admin/index.css')}}">
  5. <style>
  6. .main-panel > .content {
  7. padding: 0;
  8. }
  9. .main-panel {
  10. margin-top: 42px;
  11. }
  12. #app {
  13. padding-bottom: 40px;
  14. }
  15. .rightlist #app .rightlist-head {
  16. line-height: 50px;
  17. padding: 0 0 15px 0;
  18. }
  19. .rightlist {
  20. background: #eff3f6;
  21. margin-top: 10px;
  22. margin-bottom: 20px;
  23. padding-bottom: 20px;
  24. }
  25. .form-list {
  26. padding-top: 30px;
  27. background: #fff;
  28. border-radius: 10px;
  29. position: relative;
  30. top: 10px;
  31. margin-left: 10px;
  32. width: calc(100% - 20px);
  33. }
  34. .table-list {
  35. padding-top: 30px;
  36. background: #fff;
  37. border-radius: 10px;
  38. margin-top: 20px;
  39. margin-left: 10px;
  40. width: calc(100% - 20px);
  41. }
  42. .table-option a {
  43. font-size: 12px;
  44. font-weight: 600;
  45. color: #29ba9c;
  46. padding: 10px 0;
  47. }
  48. /* .el-form-item__label{padding-right:30px;} */
  49. .tip {
  50. font-size: 12px;
  51. color: #999;
  52. font-weight: 500;
  53. line-height: 24px;
  54. }
  55. .rightlist-head-con {
  56. padding-right: 20px;
  57. font-size: 16px;
  58. color: #888;
  59. }
  60. .el-tag {
  61. /* font-weight: 700;
  62. font-size: 15px;
  63. margin-bottom: 30px; */
  64. }
  65. /* 单选框边框颜色 */
  66. .el-radio__inner {
  67. border: 1px solid #c8cede;
  68. }
  69. /* 多选框边框颜色 */
  70. .el-checkbox__inner{
  71. border: 1px solid #c8cede;
  72. }
  73. .el-icon-edit {
  74. font-size: 16px;
  75. padding: 0 15px;
  76. color: #409eff;
  77. cursor: pointer;
  78. }
  79. /* 滑块选择小白点 */
  80. .el-switch.is-checked .el-switch__core::after {
  81. left: 100%;
  82. margin-left: -17px;
  83. }
  84. .el-switch__core::after {
  85. content: "";
  86. position: absolute;
  87. top: 1px;
  88. left: 1px;
  89. border-radius: 100%;
  90. transition: all 0.3s;
  91. width: 16px;
  92. height: 16px;
  93. background-color: #fff;
  94. }
  95. .el-checkbox__label {
  96. display: inline-block;
  97. padding-left: 3px;
  98. }
  99. .el-checkbox.is-bordered + .el-checkbox.is-bordered {
  100. margin-left: 0px;
  101. }
  102. .vue-page {
  103. border-radius: 5px;
  104. width: calc(100% - 266px);
  105. float: right;
  106. margin-right: 10px;
  107. position: fixed;
  108. bottom: 0;
  109. right: 0;
  110. padding: 15px 5% 15px 0;
  111. background: #fff;
  112. height: 60px;
  113. z-index: 999;
  114. margin-top: 0;
  115. box-shadow: 0 2px 9px rgba(51, 51, 51, 0.1);
  116. }
  117. .vue-center {
  118. text-align: center;
  119. }
  120. .loading-height {
  121. height: 500px;
  122. }
  123. .el-checkbox.is-bordered.el-checkbox--mini {
  124. margin: 0 0;
  125. }
  126. [v-cloak] {
  127. display: none;
  128. }
  129. .all {
  130. background: #eff3f6;
  131. min-height: 100vh;
  132. padding-top: 20px;
  133. }
  134. .vue-main {
  135. background: #fff;
  136. border-radius: 5px;
  137. margin: 0 10px;
  138. padding: 10px;
  139. min-height: calc(100vh - 90px);
  140. }
  141. .vue-nav {
  142. background: #fff;
  143. border-radius: 5px;
  144. margin: 0 10px;
  145. padding: 10px;
  146. }
  147. .vue-head {
  148. background: #fff;
  149. border-radius: 5px;
  150. margin: 0 10px;
  151. padding: 10px;
  152. margin-bottom: 15px;
  153. }
  154. .vue-crumbs {
  155. margin: 0 20px;
  156. font-size: 14px;
  157. color: #333;
  158. font-weight: 400;
  159. padding-bottom: 10px;
  160. line-height: 32px;
  161. }
  162. .vue-crumbs a {
  163. color: #333;
  164. }
  165. .vue-crumbs a:hover {
  166. color: #29ba9c;
  167. }
  168. .vue-main-title {
  169. display: flex;
  170. margin: 5px 0;
  171. line-height: 28px;
  172. font-size: 14px;
  173. color: #333;
  174. font-weight: 700;
  175. }
  176. .vue-main-title-left {
  177. width: 4px;
  178. height: 14px;
  179. margin-top: 6px;
  180. background: #29ba9c;
  181. display: inline-block;
  182. margin-right: 10px;
  183. }
  184. .vue-main-title-content {
  185. font-size: 14px;
  186. flex: 1;
  187. }
  188. .vue-main-title-button {
  189. text-align: right;
  190. flex:1;
  191. }
  192. .vue-main-form {
  193. margin-top: 20px;
  194. margin-left: 150px;
  195. }
  196. .vue-category-title {
  197. padding: 15px;
  198. border-bottom: 1px solid #ccc;
  199. margin-bottom: 15px;
  200. font-weight: 600;
  201. font-size: 15px;
  202. }
  203. .el-link-edit {
  204. border-right: 1px solid;
  205. line-height: 16px;
  206. }
  207. .el-link-edit-start {
  208. border-right: 1px solid;
  209. padding-right: 20px;
  210. line-height: 16px;
  211. }
  212. .el-link-edit-middle {
  213. border-right: 1px solid;
  214. padding: 0 20px;
  215. line-height: 16px;
  216. }
  217. .el-link-edit-end {
  218. border-right: 0px;
  219. padding-left: 20px;
  220. line-height: 16px;
  221. }
  222. /* 上传图片 */
  223. .avatar-uploader .el-upload {
  224. margin-top: 15px;
  225. border: 1px dashed #d9d9d9;
  226. border-radius: 6px;
  227. cursor: pointer;
  228. position: relative;
  229. overflow: hidden;
  230. }
  231. .avatar-uploader .el-upload:hover {
  232. border-color: #29ba9c;
  233. }
  234. .avatar-uploader-icon {
  235. font-size: 28px;
  236. color: #8c939d;
  237. width: 178px;
  238. height: 178px;
  239. line-height: 178px;
  240. text-align: center;
  241. }
  242. .avatar_box {
  243. width: 80%;
  244. height: 80%;
  245. margin: 0 auto;
  246. }
  247. .avatar {
  248. width: 50%;
  249. height: 50%;
  250. object-fit: cover;
  251. }
  252. .el-upload-tip {
  253. width: 178px;
  254. margin: 0;
  255. padding: 0;
  256. color: #999;
  257. text-align: center;
  258. }
  259. input[type="file"] {
  260. display: none;
  261. }
  262. .avatar-uploader-box {
  263. position: relative;
  264. margin-top: 20px;
  265. width: 200px;
  266. }
  267. .el-icon-circle-close1 {
  268. position: absolute;
  269. top: -3px;
  270. right: -3px;
  271. color: #fff;
  272. background-color: #000;
  273. border-radius: 50%;
  274. }
  275. .vue-two{
  276. text-overflow: -o-ellipsis-lastline;
  277. overflow: hidden;
  278. text-overflow: ellipsis;
  279. display: -webkit-box;
  280. -webkit-line-clamp: 2;
  281. line-clamp: 2;
  282. -webkit-box-orient: vertical;
  283. }
  284. /*弹窗上传图片*/
  285. #upload-img {
  286. }
  287. #upload-img .avatar {
  288. width: 100px;
  289. height: 100px;
  290. display: block;
  291. }
  292. #upload-img .avatar-uploader-box {
  293. position: relative;
  294. margin: 20px 0 0 10px;
  295. width: 110px;
  296. }
  297. #upload-img .el-icon-circle-close {
  298. position: absolute;
  299. top: -7px;
  300. right: 1px;
  301. color: #999;
  302. }
  303. .imgList {
  304. display: flex;
  305. flex-wrap: wrap;
  306. margin: 10px auto;
  307. }
  308. /* 辅助色 */
  309. .vue-assist-color,
  310. .el-link-assist,
  311. .el-link:hover {
  312. color: #ff9b19 !important;
  313. }
  314. /* 选中及未选图片样式 */
  315. .upload-box:hover {
  316. border-color: #29ba9c;
  317. color: #29ba9c;
  318. }
  319. .upload-box {
  320. width: 150px;
  321. height: 150px;
  322. display: flex;
  323. cursor: pointer;
  324. border: 1px dashed #dde2ee;
  325. justify-content: center;
  326. align-items: center;
  327. border-radius: 5px;
  328. }
  329. .upload-boxed {
  330. width: 150px;
  331. height: 150px;
  332. position: relative;
  333. border-radius: 5px;
  334. display: inline-block;
  335. }
  336. .upload-boxed-text {
  337. position: absolute;
  338. bottom: 0;
  339. line-height: 32px;
  340. color: #fff;
  341. text-align: center;
  342. width: 100%;
  343. background: #000;
  344. opacity: 0.7;
  345. border-radius: 0px 0px 5px 5px;
  346. }
  347. .upload-boxed-text-clear {
  348. position: absolute;
  349. bottom: 0;
  350. right:-70px;
  351. cursor: pointer;
  352. line-height: 32px;
  353. color: #ee3939;
  354. }
  355. .upload-boxed-list {
  356. display: flex;
  357. position: relative;
  358. border-radius: 5px;
  359. flex-wrap: wrap;
  360. }
  361. .upload-boxed-list-a {
  362. width: 150px;
  363. height: 170px;
  364. margin: 0 10px 5px 0;
  365. position: relative;
  366. }
  367. .upload-boxed-list-a .el-icon-close {
  368. position: absolute;
  369. top: -5px;
  370. right: -5px;
  371. color: #fff;
  372. background: #333;
  373. border-radius: 50%;
  374. cursor: pointer;
  375. }
  376. .vue-main-title-content a {
  377. color: #333;
  378. }
  379. .vue-main-title-content a:hover {
  380. color: #29ba9c;
  381. }
  382. .vue-ellipsis {
  383. overflow: hidden;
  384. text-overflow: ellipsis;
  385. white-space: nowrap;
  386. }
  387. .black {
  388. color: #333;
  389. }
  390. .upload-box-member {
  391. text-align: center;
  392. font-weight: 600;
  393. font-size: 16px;
  394. }
  395. .el-form-item__label{
  396. margin-right: 30px;
  397. }
  398. .el-form-item__error{
  399. margin-left: 30px;
  400. }
  401. </style>
  402. <div class="all">
  403. <div id="app" v-cloak>
  404. <el-form ref="form" :model="form" label-width="15%">
  405. <div class="vue-crumbs">
  406. 公众号图文数据
  407. </div>
  408. <div class="vue-main">
  409. <div class="vue-main-title">
  410. <div class="vue-main-title-left"></div>
  411. <div class="vue-main-title-content">公众号图文数据</div>
  412. </div>
  413. <div class="vue-main-form">
  414. <el-form-item label="图文" prop="is_open">
  415. <el-row class="div1">
  416. <el-col :span="2">
  417. <el-button @click="selectMsgUrl(1)">
  418. <i class="iconfont icon-haibao" style="line-height:20px;float:left;display:inline-block;font-size:20px;width:100%;text-align:center"></i>
  419. 选择
  420. </el-button>
  421. </el-col>
  422. <el-col :span="2">
  423. <el-button v-show="news.thumb_url" type="text" icon="el-icon-delete" @click="clearImage" size="mini"></el-button>
  424. </el-col>
  425. </el-row>
  426. </el-form-item>
  427. <div style="padding-left: 17%;" v-if="news.thumb_url && news.thumb_url!=null">
  428. <img :src="news.thumb_url" style="min-width:230px;height:180px;overflow:hidden;" alt="">
  429. </br>
  430. <div>[[news.title]]</div>
  431. </div>
  432. </br>
  433. <el-form-item label="复制图文链接">
  434. <el-row class="div1">
  435. <el-col :span="15">
  436. <el-input v-model="news.url" :title="news.url"></el-input>
  437. </el-col>
  438. <el-col :span="2">
  439. <el-button type="success" @click="copy(news.url)">复制</el-button>
  440. </el-col>
  441. </el-row>
  442. </el-form-item>
  443. <el-form-item label="小程序路径">
  444. <el-row class="div1">
  445. <el-col :span="15">
  446. <el-input v-model="news.min_app" :title="news.min_app"></el-input>
  447. </el-col>
  448. <el-col :span="2">
  449. <el-button type="success" @click="copy(news.min_app)">复制</el-button>
  450. </el-col>
  451. </el-row>
  452. </el-form-item>
  453. </div>
  454. </div>
  455. <el-dialog title="图文" :visible.sync="img_text_url" width="60%" v-loading="dialog_loading">
  456. <div>
  457. <el-tabs v-model="img_text_url0" @tab-click="handleClickImgText">
  458. <el-tab-pane label="微信" name="img_text_url1">
  459. <el-row>
  460. <el-col :span="12">
  461. <el-input placeholder="请输入标题" v-model="search_img_text"></el-input>
  462. </el-col>
  463. <el-col :span="12">
  464. <el-button @click="currentChangeWechatTextImg(1)">搜索</el-button>
  465. </el-col>
  466. </el-row>
  467. <el-row style="overflow-y: scroll;max-height:400px;">
  468. <el-col :span="6" v-for="(item,index) in img_text_list" :key="index" style="margin:10px 10px;width:280px;" @click.native="chooseImgTextUrl(index)">
  469. <div class="image_text_head">
  470. <div style="width:100%;">
  471. <div class="image_text_head_time" style="width:90%;margin-left:5%;border-bottom:1px #dadada solid">
  472. <div style="width:80%;padding:10px 0;">[[item.created_at]]</div>
  473. </div>
  474. </div>
  475. <div style="padding:10px 30px">
  476. <div class="image_text_con" style="min-width:230px;height:180px;overflow:hidden;position:relative;">
  477. <img :src="item.has_many_wechat_news[0].thumb_url" style="min-width:230px;height:180px;overflow:hidden;" alt="">
  478. <div class="image_text_con_title" style="position:absolute;bottom:0;width:100%;line-height:32px;background:#000;opacity:0.5;color:#fff;padding:0 15px;">
  479. [[item.has_many_wechat_news[0].title]]
  480. </div>
  481. </div>
  482. </div>
  483. </div>
  484. </el-col>
  485. </el-row>
  486. <!-- 分页 -->
  487. <el-row>
  488. <el-col :span="24" align="right" style="padding:15px 5% 15px 0">
  489. <el-pagination layout="prev, pager, next" @current-change="currentChangeWechatTextImg" :total="total" :page-size="per_size" background v-loading="loading"></el-pagination>
  490. </el-col>
  491. </el-row>
  492. </el-tab-pane>
  493. </el-tabs>
  494. </div>
  495. <span slot="footer" class="dialog-footer">
  496. <el-button @click="img_text_url = false">取 消</el-button>
  497. <!-- <el-button type="primary" @click="img_text_url = false">确 定</el-button> -->
  498. </span>
  499. </el-dialog>
  500. </el-form>
  501. <!-- 分页 -->
  502. <div class="vue-page">
  503. <div class="vue-center">
  504. <el-button type="primary" @click="submitForm('form')">提交</el-button>
  505. <el-button @click="goBack">返回</el-button>
  506. </div>
  507. </div>
  508. </div>
  509. </div>
  510. <script>
  511. var app = new Vue({
  512. el:"#app",
  513. delimiters: ['[[', ']]'],
  514. name: 'test',
  515. data() {
  516. return{
  517. form:{
  518. is_open:0,
  519. },
  520. img_text_url:false,
  521. img_text_url0:"img_text_url1",
  522. dialog_loading:false,
  523. search_img_text:'',
  524. loading:false,
  525. img_text_list:[],
  526. total:0,
  527. current_page:0,
  528. per_size:0,
  529. selectedMenuIndex:'',//当前选中菜单索引
  530. news:{
  531. 'min_app':'/packageI/web-view/h5View'
  532. }
  533. }
  534. },
  535. created() {
  536. },
  537. mounted() {
  538. this.getData();
  539. },
  540. methods: {
  541. copy(data) {
  542. console.log(data)
  543. let url = data
  544. let oInput = document.createElement('input')
  545. console.log(url)
  546. console.log(oInput)
  547. oInput.value = url
  548. document.body.appendChild(oInput)
  549. oInput.select() // 选择对象
  550. document.execCommand("Copy") // 执行浏览器复制命令
  551. this.$message({
  552. message: '复制成功',
  553. type: 'success'
  554. })
  555. oInput.remove()
  556. },
  557. clearImage(){
  558. this.news={};
  559. },
  560. selectMsgUrl(x) {
  561. console.log("选择发送消息!!!");
  562. var that = this;
  563. that.img_text_url = true;
  564. that.dialog_loading = true,
  565. that.img_text_url0 = "img_text_url1";
  566. that.handleClickImgText();
  567. },
  568. // 图文弹出框里的tabs
  569. handleClickImgText() {
  570. var that = this;
  571. this.search_img_text = '';
  572. if(that.img_text_url0 == "img_text_url1"){
  573. that.dialog_loading=true,
  574. that.$http.post("{!! yzWebFullUrl('plugin.min-app.Backend.Controllers.news.get-news') !!}",{}).then(response => {
  575. console.log(response);
  576. if(response.data.result==1){
  577. that.img_text_list = response.data.data.data;
  578. that.per_size = response.data.data.per_page;
  579. that.total = response.data.data.total;
  580. that.current_page = response.data.data.current_page;
  581. that.dialog_loading = false;
  582. }
  583. that.dialog_loading = false;
  584. }),function(res){
  585. console.log(res);
  586. that.dialog_loading = false;
  587. };
  588. }
  589. else if(that.img_text_url0 == "img_text_url2"){
  590. that.dialog_loading=true,
  591. that.$http.post("{!! yzWebFullUrl('plugin.wechat.admin.material.controller.news.get-local-news') !!}",{}).then(response => {
  592. console.log(response);
  593. if(response.data.result==1){
  594. that.img_text_list = response.data.data.data;
  595. that.per_size = response.data.data.per_page;
  596. that.total = response.data.data.total;
  597. that.current_page = response.data.data.current_page;
  598. that.dialog_loading = false;
  599. }
  600. that.dialog_loading = false;
  601. }),function(res){
  602. console.log(res);
  603. that.dialog_loading = false;
  604. };
  605. }
  606. },
  607. // 选择图文
  608. chooseImgTextUrl(index){
  609. var that = this;
  610. console.log(index,'选择图文')
  611. console.log(that.img_text_list[index].has_many_wechat_news[0].url,'选择图文4444555')
  612. that.news = {
  613. 'url':that.img_text_list[index].has_many_wechat_news[0].url,
  614. 'id':that.img_text_list[index].id,
  615. 'media_id':that.img_text_list[index].media_id,
  616. 'title':that.img_text_list[index].has_many_wechat_news[0].title,
  617. 'thumb_url':that.img_text_list[index].has_many_wechat_news[0].thumb_url,
  618. 'min_app':'/packageI/web-view/h5View'
  619. }
  620. that.img_text_url = false;
  621. that.dialog_loading = false
  622. },
  623. // 微信图文分页
  624. currentChangeWechatTextImg(val){
  625. var that = this;
  626. this.loading = true;
  627. this.$http.post('{!! yzWebFullUrl('plugin.min-app.Backend.Controllers.news.get-news') !!}',{page:val,search:this.search_img_text}).then(function (response){
  628. console.log(response);
  629. that.img_text_list = response.data.data.data;
  630. that.per_size = response.data.data.per_page;
  631. that.total = response.data.data.total;
  632. that.current_page = response.data.data.current_page;
  633. that.loading = false;
  634. },function (response) {
  635. console.log(response);
  636. this.loading = false;
  637. }
  638. );
  639. },
  640. // 本地图文分页
  641. currentChangeLocalTextImg(val){
  642. this.loading = true;
  643. this.$http.post('{!! yzWebFullUrl('plugin.min-app.Backend.Controllers.news.index') !!}',{page:val,filename:this.search_img_text}).then(function (response){
  644. console.log(response);
  645. this.img_text_list = response.data.data.data;
  646. this.per_size = response.data.data.per_page;
  647. this.total = response.data.data.total;
  648. this.current_page = response.data.data.current_page;
  649. this.loading = false;
  650. },function (response) {
  651. console.log(response);
  652. this.loading = false;
  653. }
  654. );
  655. },
  656. submitForm(formName) {
  657. console.log(this.form)
  658. let that = this;
  659. let json = that.news;
  660. console.log(json);
  661. this.$refs[formName].validate((valid) => {
  662. if (valid) {
  663. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  664. this.$http.post('{!! yzWebFullUrl('plugin.min-app.Backend.Controllers.news.save') !!}',{data:json}).then(response => {
  665. if (response.data.result) {
  666. this.$message({type: 'success',message: '操作成功!'});
  667. } else {
  668. this.$message({message: response.data.msg,type: 'error'});
  669. }
  670. loading.close();
  671. },response => {
  672. loading.close();
  673. });
  674. }
  675. else {
  676. console.log('error submit!!');
  677. return false;
  678. }
  679. });
  680. },
  681. getData() {
  682. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  683. this.$http.post("{!! yzWebFullUrl('plugin.min-app.Backend.Controllers.news.get-data') !!}",{}).then(function (response) {
  684. if (response.data.result){
  685. if(response.data.data) {
  686. console.log(response.data.data)
  687. this.news = {
  688. ...response.data.data
  689. }
  690. this.news.min_app = '/packageI/web-view/h5View'
  691. }
  692. }
  693. else {
  694. this.$message({message: response.data.msg,type: 'error'});
  695. }
  696. loading.close();
  697. },function (response) {
  698. this.$message({message: response.data.msg,type: 'error'});
  699. loading.close();
  700. }
  701. );
  702. },
  703. goBack() {
  704. history.go(-1)
  705. },
  706. },
  707. })
  708. </script>
  709. @endsection