mini-setting.blade.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. @extends('layouts.base')
  2. @section('title', trans('基础设置'))
  3. @section('content')
  4. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods1.css')}}"/>
  5. <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-ohter.css')}}"/>
  6. <div id="app" v-cloak>
  7. <el-form ref="form" :model="form" label-width="15%">
  8. <div class="vue-head">
  9. <div class="vue-main-title">
  10. <div class="vue-main-title-left"></div>
  11. <div class="vue-main-title-content">基础设置</div>
  12. </div>
  13. <div class="vue-main-form">
  14. <el-form-item label="开启小程序广告" prop="">
  15. <el-switch v-model="form.open_state" :active-value="1"
  16. :inactive-value="0"></el-switch>
  17. </el-form-item>
  18. </div>
  19. <div class="vue-main-form">
  20. <el-form-item label="广告">
  21. <el-radio-group border="true" v-model="form.adv_type">
  22. <el-radio :label="1">营销云广告</el-radio>
  23. <el-radio :label="2">小程序官方流量主广告</el-radio>
  24. </el-radio-group>
  25. </el-form-item>
  26. </div>
  27. <template v-if="form.adv_type==1">
  28. <div class="vue-main-form">
  29. <el-form-item label="APPID">
  30. <el-input width="70%" v-model="form.app_id"></el-input>
  31. <div class="tip">营销云应用ID</div>
  32. </el-form-item>
  33. </div>
  34. <div class="vue-main-form">
  35. <el-form-item label="第三方广告域名">
  36. <el-input width="70%" v-model="form.adv_url"></el-input>
  37. <div class="tip">小程序服务域名需配置该域名才可正常使用</div>
  38. </el-form-item>
  39. </div>
  40. <div class="vue-main-form">
  41. <el-form-item label="广告ID">
  42. <el-input width="70%" v-model="form.adv_id"></el-input>
  43. <div class="tip">多个广告ID使用逗号(英文格式)分隔</div>
  44. </el-form-item>
  45. </div>
  46. <div class="vue-main-form">
  47. <el-form-item label="微信广告单元ID">
  48. <el-input width="70%" v-model="form.mini_form_id"></el-input>
  49. </el-form-item>
  50. </div>
  51. </template>
  52. <template v-if="form.adv_type==2">
  53. <div class="vue-main-form">
  54. <el-form-item label="微信广告位ID">
  55. <el-input width="70%" v-model="form.mini_id"></el-input>
  56. </el-form-item>
  57. </div>
  58. </template>
  59. </div>
  60. <div class="vue-head">
  61. <div class="vue-main-title">
  62. <div class="vue-main-title-left"></div>
  63. <div class="vue-main-title-content">奖励设置</div>
  64. </div>
  65. <div class="vue-main-form">
  66. <el-form-item label="观看奖励设置">
  67. <template v-for="(v,k) in form.reward_data">
  68. <el-row :gutter="1">
  69. <el-col :span="8">
  70. <el-input v-model="v.amount">
  71. <template slot="prepend">[[v.level_name]]:每个视频奖励</template>
  72. <template slot="append">积分</template>
  73. </el-input>
  74. </el-col>
  75. <el-col :span="8">
  76. <el-input v-model="v.day_max_count">
  77. <template slot="prepend">每天最多观看</template>
  78. <template slot="append">个视频</template>
  79. </el-input>
  80. </el-col>
  81. </el-row>
  82. <p></p>
  83. </template>
  84. </el-form-item>
  85. </div>
  86. </div>
  87. <div class="vue-page">
  88. <div class="vue-center">
  89. <el-button type="primary" @click="submitForm('form')">提交</el-button>
  90. <el-button @click="goBack">返回</el-button>
  91. </div>
  92. </div>
  93. </el-form>
  94. </div>
  95. <script>
  96. new Vue({
  97. el: "#app",
  98. delimiters: ['[[', ']]'],
  99. name: 'test',
  100. data() {
  101. return {
  102. form: {
  103. open_state: 0,
  104. adv_type: 1,
  105. app_id: '',
  106. adv_id: '',
  107. adv_url: '',
  108. mini_form_id: '',
  109. reward_type: 1,
  110. reward_data: [],
  111. },
  112. }
  113. },
  114. created() {
  115. },
  116. mounted() {
  117. this.getData();
  118. },
  119. methods: {
  120. getData() {
  121. let loading = this.$loading({
  122. target: document.querySelector(".content"),
  123. background: 'rgba(0, 0, 0, 0)'
  124. });
  125. this.$http.post('{!! yzWebFullUrl('plugin.flyers-advertise.admin.setting.miniSetting',['is_json'=>1]) !!}').then(function (response) {
  126. if (response.data.result) {
  127. this.form = response.data.data;
  128. } else {
  129. this.$message({message: response.data.msg, type: 'error'});
  130. }
  131. loading.close();
  132. }, function (response) {
  133. this.$message({message: response.data.msg, type: 'error'});
  134. loading.close();
  135. }
  136. );
  137. },
  138. submitForm(formName) {
  139. console.log(this.form);
  140. this.$http.post("{!! yzWebFullUrl('plugin.flyers-advertise.admin.setting.editMiniSetting') !!}", this.form).then(response => {
  141. if (response.data.result) {
  142. this.$message({type: 'success', message: '操作成功!'});
  143. window.location.reload();
  144. } else {
  145. this.$message({message: response.data.msg, type: 'error'});
  146. }
  147. });
  148. },
  149. goBack() {
  150. history.go(-1)
  151. },
  152. },
  153. })
  154. </script>
  155. @endsection