setting.blade.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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:20px;
  24. position:relative;
  25. border-radius: 8px;
  26. min-height:100vh;
  27. background-color:#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. </style>
  57. <div id='re_content' >
  58. @include('layouts.newTabs')
  59. <div class="con">
  60. <div class="setting">
  61. <el-form ref="form" :model="form" label-width="15%">
  62. <div class="block">
  63. <div class="title"> <span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>高德地图</b></div>
  64. <el-form-item label="Web服务:key">
  65. <el-input v-model="form.web" style="width:70%;" ></el-input>
  66. <el-button type="primary" @click="synchronize" v-if="synchronize_store != 1">同步到门店</el-button>
  67. <div style="color:#737373;font-size:12px;">
  68. <span>此处指定高德绑定服务"Web服务",如何注册高德地图KEY</span>
  69. <a href="https://jingyan.baidu.com/article/bea41d43c78831b4c51be68b.html">查看帮助</a>,
  70. </div>
  71. </el-form-item>
  72. <el-form-item label="Web端(JS API)">
  73. <el-input v-model="form.web_js_key" style="width:70%;" ></el-input>
  74. <div style="color:#737373;font-size:12px;">
  75. <span>此处指定高德绑定服务"Web服务",如何注册高德地图KEY</span>
  76. <a href="https://jingyan.baidu.com/article/bea41d43c78831b4c51be68b.html">查看帮助</a>,
  77. <span>注:请注意Web端(JS API) 和 Web服务是有区别的</span>
  78. </div>
  79. </el-form-item>
  80. <el-form-item label="Web端(JS API) 安全密钥">
  81. <el-input v-model="form.web_js_secret_key" style="width:70%;" ></el-input>
  82. </el-form-item>
  83. <div class="confirm-btn">
  84. <el-button type="primary" @click="submit">提交</el-button>
  85. </div>
  86. </div>
  87. </el-form>
  88. </div>
  89. </div>
  90. </div>
  91. <script>
  92. var vm = new Vue({
  93. el: "#re_content",
  94. delimiters: ['[[', ']]'],
  95. data() {
  96. let map = {!! json_encode($map) !!};
  97. return {
  98. activeName: 'one',
  99. disabled:map ? !!map.web : false,
  100. synchronize_store: map.synchronize_store ? map.synchronize_store : 0,
  101. form:{
  102. web: map ? map.web : '',
  103. web_js_key: map ? map.web_js_key : '',
  104. web_js_secret_key: map ? map.web_js_secret_key : '',
  105. },
  106. }
  107. },
  108. mounted () {
  109. },
  110. methods: {
  111. submit() {
  112. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  113. this.$http.post('{!! yzWebFullUrl('map.setting.index') !!}',{'a_map':this.form}).then(function (response){
  114. if (response.data.result) {
  115. this.$message({message: response.data.msg,type: 'success'});
  116. }else {
  117. this.$message({message: response.data.msg,type: 'error'});
  118. }
  119. loading.close();
  120. location.reload();
  121. },function (response) {
  122. this.$message({message: response.data.msg,type: 'error'});
  123. })
  124. },
  125. synchronize() {
  126. let loading = this.$loading({target:document.querySelector(".content"),background: 'rgba(0, 0, 0, 0)'});
  127. this.$http.post('{!! yzWebFullUrl('map.setting.synchronize') !!}',{'a_map':this.form}).then(function (response){
  128. if (response.data.result) {
  129. this.$message({message: response.data.msg,type: 'success'});
  130. }else {
  131. this.$message({message: response.data.msg,type: 'error'});
  132. }
  133. loading.close();
  134. location.reload();
  135. },function (response) {
  136. this.$message({message: response.data.msg,type: 'error'});
  137. })
  138. },
  139. },
  140. });
  141. </script>
  142. @endsection