express_info.blade.php 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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="类型选择">
  65. <template>
  66. <el-radio-group v-model="express_type" >
  67. <el-radio label="1">快递鸟</el-radio>
  68. <el-radio label="2">快递查询</el-radio>
  69. </el-radio-group>
  70. </template>
  71. {{-- <p>芸签快递查询套餐费用远低于快递鸟,购买请联系客服!</p>--}}
  72. </el-form-item>
  73. <template v-if="express_type=='1'">
  74. <el-form-item label="套餐类型">
  75. <el-radio-group v-model="form.KDN.package_type">
  76. <el-radio :label="1">在途监控</el-radio>
  77. <el-radio :label="2">快递查询</el-radio>
  78. </el-radio-group>
  79. </el-form-item>
  80. <el-form-item label="是否收费接口" v-show="form.KDN.package_type=='1'">
  81. <template>
  82. <el-switch
  83. v-model="form.KDN.express_api"
  84. active-value="8001"
  85. inactive-value="1002"
  86. >
  87. </el-switch>
  88. </template>
  89. </el-form-item>
  90. <el-form-item label="用户ID">
  91. <el-input v-model="form.KDN.eBusinessID" placeholder="请输入用户ID" style="width:70%;"></el-input>
  92. </el-form-item>
  93. <el-form-item label="API key">
  94. <el-input v-model="form.KDN.appKey" placeholder="请输入APIKey" style="width:70%;"></el-input>
  95. </el-form-item>
  96. <el-form-item label="青龙配送编码">
  97. <el-input v-model="form.KDN.CustomerName" placeholder="请输入青龙配送编码" style="width:70%;"></el-input>
  98. <div style="color:#737373;font-size:12px;">在青龙系统申请一个商家编码,也叫青龙配送编码,格式:数字+字母+数字,举例:001K123456,京东配送必填</div>
  99. <div style="color:#737373;font-size:12px;">使用快递鸟物流接口,请注意开通相关账号。官网: <a href="https://www.kdniao.com/reg?from=cbbyzxx" target="_blank">https://www.kdniao.com/reg?from=cbbyzxx</a> ,开通详情步骤说明请联系客服。</div>
  100. </el-form-item>
  101. </template>
  102. <template v-if="express_type=='2'">
  103. <el-form-item label="AppId" >
  104. <el-input v-model="yun_form.YQ.appId" style="width:70%;"></el-input>
  105. </el-form-item>
  106. <el-form-item label="AppSecret" >
  107. <el-input v-model="yun_form.YQ.appSecret" style="width:70%;"></el-input>
  108. <p>接口总数:[[yun_form.YQ.apiTotalCount]] 单;接口使用总数: [[yun_form.YQ.statistics]] 单;接口剩余总数:[[yun_form.YQ.surplus]] 单;到期时间:[[yun_form.YQ.expireData]]</p>
  109. </el-form-item>
  110. </template>
  111. </div>
  112. </div>
  113. <div class="confirm-btn">
  114. <el-button type="primary" @click="submit">提交</el-button>
  115. </div>
  116. </el-form>
  117. </div>
  118. </div>
  119. <script>
  120. var vm = new Vue({
  121. el: "#re_content",
  122. delimiters: ['[[', ']]'],
  123. data() {
  124. return {
  125. express_type:'1',
  126. activeName: 'one',
  127. yun_form:{
  128. YQ:{
  129. appId:'',
  130. appSecret:'',
  131. apiTotalCount:0,
  132. statistics:0,
  133. expireData:'',
  134. surplus:0
  135. }
  136. },
  137. form:{
  138. KDN: {
  139. express_api:'0',
  140. eBusinessID:'',
  141. appKey:'',
  142. Mobile:'',
  143. CustomerName:'',
  144. package_type:1
  145. },
  146. },
  147. }
  148. },
  149. mounted () {
  150. this.getData()
  151. },
  152. methods: {
  153. getData(){
  154. this.$http.post('{!! yzWebFullUrl('setting.shop.express-info') !!}').then(function (response){
  155. if (response.data.result) {
  156. if(response.data.data.set){
  157. for(let i in response.data.data.set){
  158. response.data.data.type==2?this.yun_form[i]=response.data.data.set[i]:this.form[i]=response.data.data.set[i]
  159. }
  160. }
  161. if(response.data.data.type == 2){
  162. // console.log(response.data.data.statistics)
  163. this.yun_form.YQ.statistics = response.data.data.statistics.statistics;
  164. this.yun_form.YQ.apiTotalCount = response.data.data.statistics.apiTotalCount;
  165. this.yun_form.YQ.surplus = response.data.data.statistics.apiTotalCount - response.data.data.statistics.statistics;
  166. this.yun_form.YQ.expireData = response.data.data.statistics.expireData;
  167. }
  168. if(response.data.data.type){
  169. this.express_type=String(response.data.data.type)
  170. }
  171. }else {
  172. this.$message({message: response.data.msg,type: 'error'});
  173. }
  174. },function (response) {
  175. this.$message({message: response.data.msg,type: 'error'});
  176. })
  177. },
  178. submit() {
  179. let json={}
  180. if(this.express_type=='1'){
  181. json=this.form
  182. }else{
  183. json=this.yun_form
  184. }
  185. let loading = this.$loading({
  186. target: document.querySelector(".content"),
  187. background: 'rgba(0, 0, 0, 0)'
  188. });
  189. this.$http.post('{!! yzWebFullUrl('setting.shop.express-info') !!}',{'express_info':json,type:this.express_type}).then(function (response){
  190. if (response.data.result) {
  191. this.$message({message: response.data.msg,type: 'success'});
  192. }else {
  193. this.$message({message: response.data.msg,type: 'error'});
  194. }
  195. loading.close();
  196. location.reload();
  197. },function (response) {
  198. this.$message({message: response.data.msg,type: 'error'});
  199. })
  200. },
  201. },
  202. });
  203. </script>
  204. @endsection