notice.blade.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. @extends('layouts.base')
  2. @section('content')
  3. <style>
  4. .panel{
  5. margin-bottom:10px!important;
  6. padding-left: 20px;
  7. border-radius: 10px;
  8. }
  9. .panel .active a {
  10. background-color: #29ba9c!important;
  11. border-radius: 18px!important;
  12. color:#fff;
  13. }
  14. .panel a{
  15. border:none!important;
  16. background-color:#fff!important;
  17. }
  18. .content{
  19. background: #eff3f6;
  20. padding: 10px!important;
  21. }
  22. .con{
  23. padding-bottom:40px;
  24. position:relative;
  25. border-radius: 8px;
  26. min-height:100vh;
  27. background: #fff;
  28. }
  29. .con .setting .block{
  30. padding:10px;
  31. background-color:#fff;
  32. border-radius: 8px;
  33. }
  34. .con .setting .block .title{
  35. font-size:18px;
  36. margin-bottom:15px;
  37. display:flex;
  38. align-items:center;
  39. }
  40. .confirm-btn{
  41. width: calc(100% - 266px);
  42. position:fixed;
  43. bottom:0;
  44. right:0;
  45. margin-right:10px;
  46. line-height:63px;
  47. background-color: #ffffff;
  48. box-shadow: 0px 8px 23px 1px
  49. rgba(51, 51, 51, 0.3);
  50. background-color:#fff;
  51. text-align:center;
  52. }
  53. b{
  54. font-size:14px;
  55. }
  56. .add-people{
  57. width: 91px;
  58. height: 91px;
  59. border: dashed 1px #dde2ee;
  60. display:flex;
  61. flex-direction:column;
  62. justify-content:center;
  63. align-items:center;
  64. }
  65. </style>
  66. <div id='re_content' >
  67. @include('layouts.newTabs')
  68. <div class="con">
  69. <div class="setting">
  70. <el-form ref="form" label-width="15%" v-if="temp_list.length>0">
  71. <div class="block">
  72. <div class="title">
  73. <span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span>
  74. <b>基础设置
  75. </b>
  76. <i class="iconfont icon-ht_tips" style="font-size:16px;color:#ff9b19;margin-left:16px;" slot="reference">
  77. <el-popover
  78. placement="bottom-start"
  79. title="提示"
  80. width="400"
  81. trigger="hover"
  82. content="小程序公众平台服务类目请添加商家自营 > 美妆/洗护。
  83. 点击模版消息后方开关按钮即可开启默认模版消息,无需进行额外设置。
  84. ">
  85. <el-button slot="reference" style="opacity: 0;margin-left:-10px;"></el-button>
  86. </el-popover>
  87. </i>
  88. </div>
  89. <template v-for="(item,index,key) in temp_list">
  90. <el-form-item :label="item.title">
  91. <template>
  92. <el-switch
  93. @change="changeVal(item.id)"
  94. v-model="item.is_open"
  95. :active-value="1"
  96. :inactive-value="0"
  97. >
  98. </el-switch>
  99. </template>
  100. </el-form-item>
  101. <el-form-item :label="item.title">
  102. <el-input :value="item.title" disabled style="width:70%;"></el-input>
  103. </el-form-item>
  104. </template>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <script>
  110. var vm = new Vue({
  111. el: "#re_content",
  112. delimiters: ['[[', ']]'],
  113. data() {
  114. return {
  115. temp_list:[],
  116. activeName: 'one',
  117. }
  118. },
  119. mounted () {
  120. this.getData();
  121. },
  122. methods: {
  123. changeVal(val){
  124. let that=this;
  125. var open=false
  126. this.temp_list.forEach((item,index,key)=>{
  127. if(item.id==val){
  128. open=item.is_open
  129. }
  130. })
  131. var postdata={
  132. id:val,
  133. open:open
  134. }
  135. this.$http.post("{!! yzWebUrl('setting.small-program.set-notice') !!}",postdata).then(function (response){
  136. if (response.data.result==1) {
  137. this.$message({message:'操作成功',type: 'success'});
  138. }else {
  139. this.$message({message: response.data.msg,type: 'error'});
  140. }
  141. },function (response) {
  142. this.$message({message: response.data.msg,type: 'error'});
  143. })
  144. },
  145. getData(){
  146. this.$http.post('{!! yzWebFullUrl('setting.small-program.notice') !!}').then(function (response){
  147. if (response.data.result) {
  148. this.temp_list=response.data.data.temp_list;
  149. }else {
  150. this.$message({message: response.data.msg,type: 'error'});
  151. }
  152. },function (response) {
  153. this.$message({message: response.data.msg,type: 'error'});
  154. })
  155. },
  156. },
  157. });
  158. </script>
  159. @endsection