manual.blade.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. @extends('layouts.base')
  2. @section('title', trans('基础设置'))
  3. @section('content')
  4. <style>
  5. body {
  6. background-color: #EEEEEE;
  7. }
  8. .el-notification {
  9. margin-top: 35px;
  10. width: 400px;
  11. }
  12. .el-collapse-item__header {
  13. color: #101010;
  14. font-size: 20px;
  15. }
  16. .help_center {
  17. width: 400px;
  18. margin-left: 10px;
  19. background-color: #fff;
  20. padding: 0 20px;
  21. color: #101010;
  22. }
  23. .help_center .tips {
  24. color: #535353;
  25. font-size: 16px;
  26. }
  27. .right-content1 {
  28. width: 80%;
  29. margin: 0 auto;
  30. }
  31. .step-head {
  32. font-size: 35px;
  33. font-weight: 900;
  34. text-align: center;
  35. padding: 50px 0;
  36. }
  37. .right-content-main1 {
  38. margin-top: 30px;
  39. font-size: 18px;
  40. }
  41. .tip {
  42. color: #999;
  43. font-size: 12px;
  44. }
  45. </style>
  46. <div id="app" v-loading="submit_loading" style="display: flex;min-height: 100vh;">
  47. <div style="flex: 1;background-color: #fff;">
  48. <div class="step-head">
  49. <div v-show="active == 1">1 填写信息</div>
  50. <div v-show="active == 2">2 扫码并上传代码</div>
  51. <div v-show="active == 3">3 上传成功</div>
  52. </div>
  53. <div class="rxight-content1">
  54. <el-steps :active="active" align-center space="100%">
  55. <el-step title="1 填写信息" icon="el-icon-menu"></el-step>
  56. <el-step title="2 扫码并上传代码" icon="el-icon-s-promotion"></el-step>
  57. <el-step title="3 上传成功" icon="el-icon-finished"></el-step>
  58. </el-steps>
  59. <div v-show="active == 1" style="padding-top:50px;">
  60. <el-form ref="form" :model="form" :rules="rules" label-width="25.5%">
  61. <el-form-item label="版本号" prop="version">
  62. <el-input v-model="form.version" style="width:70%"></el-input>
  63. <div class="tip">版本号仅限数字,例:1.1.1;<span
  64. style="color:#f00;font-weight:500">上次版本号:[[version]]</span></div>
  65. </el-form-item>
  66. <el-form-item label="版本描述" prop="description">
  67. <el-input type="textarea" v-model="form.description" style="width:70%" rows="5"></el-input>
  68. <div class="tip">本次上传的版本备注,允许100个字符。</div>
  69. </el-form-item>
  70. <el-form-item label="选择版本" prop="">
  71. <el-radio v-model.number="form.type" :label="0">标准版</el-radio>
  72. <el-radio v-model.number="form.type" :label="1">多功能版</el-radio>
  73. <div class="tip" style="color:red;">
  74. 注意:
  75. <br/>
  76. 如果您小程序官方后台功能中不具备小程序直播功能
  77. <br/>
  78. 并且设置--第三方设置--插件管理中添加了小程序直播插件,请选择不含小程序直播版本,否则将无法上传代码!
  79. </div>
  80. </el-form-item>
  81. <el-form-item label="" prop="">
  82. <div style="display: flex;line-height: 1;">
  83. <el-button type="primary" @click="submitForm('form')" v-show="active == 1">提交
  84. </el-button>
  85. <div style="color:#2a2a2a;font-size: 18px;font-weight: 600;line-height: 20px;margin: 20px 0 0 20px;cursor:pointer;"
  86. @click="openNotify">
  87. <span>审核驳回调整方法</span>
  88. <i class="el-icon-question" style="color:#2a2a2a;font-size: 18px;"></i>
  89. </div>
  90. </div>
  91. </el-form-item>
  92. </el-form>
  93. </div>
  94. <div v-show="active == 2" style="padding-top:50px;">
  95. <div v-if="is_waitting==1"
  96. style="text-align:center;font-size:14px;font-weight:600;line-height:60px;">
  97. <div style="font-size:120px">
  98. <i class="el-icon-time"></i>
  99. </div>
  100. <div>
  101. 您前面有[[count]]位客户在等待上传,预计需要等待[[time]]秒。
  102. </div>
  103. <div>
  104. 二维码返回扫码确认时间<span style="color:red">只限45秒</span>,即将排队到您时,请提前打开小程序管理员微信--扫一扫!过期您必须重新排队!
  105. </div>
  106. </div>
  107. <div style="text-align:center" v-if="is_waitting==0">
  108. <img v-if="qr_code" :src="qr_code" alt="" style="width:150px;height:150px;">
  109. <div style="font-size:14px;font-weight:600;line-height:60px;">请扫码二维码,确认后将直接上传代码</div>
  110. <div style="font-size:17px;color:red;font-weight:800">
  111. [[count_down]] S
  112. </div>
  113. <div style="font-size:14px;font-weight:600;line-height:60px;">管理员扫码点击确认后,请等待3-5秒确认上传结果</div>
  114. </div>
  115. <!-- 超时 -->
  116. <div v-if="is_waitting==-1"
  117. style="text-align:center;font-size:14px;font-weight:600;line-height:60px;">
  118. <div style="font-size:120px">
  119. <i class="el-icon-error"></i>
  120. </div>
  121. <div>
  122. 扫码超时,请您重新刷新页面排队上传!
  123. </div>
  124. </div>
  125. <!-- 接口出错时 -->
  126. <div v-if="is_waitting==2"
  127. style="text-align:center;font-size:14px;font-weight:600;line-height:60px;">
  128. <div style="font-size:120px">
  129. <i class="el-icon-error"></i>
  130. </div>
  131. <div>
  132. [[message]]
  133. </div>
  134. <div>
  135. <el-button @click="goBack">返回重新填写</el-button>
  136. </div>
  137. </div>
  138. <!-- 上传中 -->
  139. <div v-if="is_waitting==3"
  140. style="text-align:center;font-size:14px;font-weight:600;line-height:60px;">
  141. <div style="font-size:120px">
  142. <i class="el-icon-time"></i>
  143. </div>
  144. <div>
  145. 上传中,请耐心等待上传结果
  146. </div>
  147. </div>
  148. </div>
  149. <div v-show="active == 3" style="text-align:center;padding-top:30px;">
  150. <div style="font-size:36px;text-align:center;padding-top:30px">
  151. <i class="el-icon-success" style="color:#409eff;"></i>
  152. </div>
  153. <div style="font-weight:800;line-height:48px;font-size:15px">
  154. 上传代码成功,请到微信开发平台小程序后台预览,提交审核应用。
  155. </div>
  156. <div style="font-weight:600;line-height:48px;">
  157. 微信开发平台小程序后台<a style="color:#409eff;" href="https://mp.weixin.qq.com/" target="_blank">https://mp.weixin.qq.com/</a>
  158. </div>
  159. <a href="https://mp.weixin.qq.com/" target="_blank">
  160. <el-button>去提交审核</el-button>
  161. </a>
  162. </div>
  163. <div class="right-content-btn"></div>
  164. </div>
  165. </div>
  166. <div class="help_center" v-show="is_help_center">
  167. <div style="display: flex;height: 60px;align-items: center;">
  168. <div style="flex:1;font-size: 26px;">帮助中心</div>
  169. <i class="el-icon-close" style="font-size: 18px;" @click="is_help_center = false"></i>
  170. </div>
  171. <el-collapse v-model="activeNames">
  172. <el-collapse-item :title="item.title" :name="i" v-for="(item,i) in help_center_list" :key="i">
  173. <ol style="list-style: decimal;font-size: 18px;" v-if="item.child">
  174. <li :key="'child' + index" v-for="(child,index) in item.child">
  175. <strong>[[child.title]]</strong>
  176. <div class="tips" v-if="child.tips">[[child.tips]]</div>
  177. </li>
  178. </ol>
  179. </el-collapse-item>
  180. </el-collapse>
  181. </div>
  182. </div>
  183. <script>
  184. let version = `{!! $version !!}`;
  185. var app = new Vue({
  186. el: '#app',
  187. delimiters: ['[[', ']]'],
  188. data() {
  189. let help_center_list = `{!! $help_center_list !!}`;
  190. help_center_list = help_center_list ? JSON.parse(help_center_list) : [];
  191. return {
  192. submit_loading: false,
  193. form: {
  194. type: 0,
  195. },
  196. version: version,
  197. identifier: '',
  198. qr_code: '',
  199. active: 1,
  200. count_down: 45,//倒计时
  201. is_waitting: 0,//是否需要排队
  202. count: 0,//排队数
  203. time: 0,//等待几秒
  204. real_time: 0,
  205. message: '',
  206. is_scan_success: 0,
  207. rules: {
  208. version: [
  209. {required: true, message: '请输入版本号', trigger: 'blur'},
  210. ],
  211. description: [
  212. {required: true, message: '请输入版本描述', trigger: 'blur'},
  213. ],
  214. },
  215. activeNames: ['1'],
  216. is_help_center: false,
  217. help_center_list: help_center_list
  218. }
  219. },
  220. mounted: function () {
  221. console.log(this.form)
  222. // this.count()
  223. },
  224. methods: {
  225. openNotify() {
  226. this.is_help_center = !this.is_help_center;
  227. },
  228. change(type) {
  229. this.active = 2;
  230. },
  231. submitForm(formName) {
  232. let that = this;
  233. this.$refs[formName].validate((valid) => {
  234. if (valid) {
  235. this.submit_loading = true;
  236. this.$http.post("{!! yzWebFullUrl('plugin.min-app.Backend.Modules.Manual.Controllers.login.index') !!}", {
  237. version: this.form.version,
  238. description: this.form.description,
  239. type: this.form.type
  240. }).then(response => {
  241. if (response.data.result) {
  242. // this.$message({type: 'success',message: '操作成功!'});
  243. // window.location.href='{!! yzWebFullUrl('plugin.asset.Backend.Modules.Category.Controllers.records') !!}';
  244. // 不需等待
  245. if (response.data.data.identifier) {
  246. that.is_waitting = 0;
  247. that.identifier = response.data.data.identifier;
  248. that.qr_code = response.data.data.qr_code;
  249. that.active = 2;
  250. this.count1();
  251. this.submit_loading = false;
  252. setTimeout(function () {
  253. that.isScan();
  254. }, 3000);
  255. }
  256. // 需要等待
  257. else {
  258. that.count = response.data.data.count;
  259. that.time = response.data.data.time;
  260. that.real_time = that.time * 1000;
  261. that.active = 2;
  262. that.is_waitting = 1;
  263. this.submit_loading = false;
  264. this.count2();
  265. //请求等待接口
  266. }
  267. } else {
  268. this.$message({message: response.data.msg, type: 'error'});
  269. this.submit_loading = false;
  270. }
  271. }, response => {
  272. this.submit_loading = false;
  273. });
  274. } else {
  275. console.log('error submit!!');
  276. return false;
  277. }
  278. });
  279. },
  280. isScan() {
  281. let that = this;
  282. this.$http.post("{!! yzWebFullUrl('plugin.min-app.Backend.Modules.Manual.Controllers.output.index') !!}", {identifier: that.identifier}).then(response => {
  283. // 是否扫码登录,三个状态:继续等待(定时请求),超时(显示超时页面),已登录(请求是否上传成功接口)
  284. if (response.data.result) {
  285. if (response.data.data.status == 'SUCCESS') {
  286. that.is_scan_success = 1;
  287. that.is_waitting = 3;
  288. that.isSuccess();
  289. } else if (response.data.data.status == 'WAIT')
  290. if (that.count_down >= 2) {
  291. setTimeout(function () {
  292. that.isScan();
  293. }, 3000);
  294. }
  295. } else {
  296. // that.$message.error(response.data.msg)
  297. that.is_waitting = 2;
  298. that.message = response.data.msg
  299. }
  300. }, response => {
  301. });
  302. },
  303. isSuccess() {
  304. let that = this;
  305. // that.submit_loading = true;
  306. this.$http.post("{!! yzWebFullUrl('plugin.min-app.Backend.Modules.Manual.Controllers.upload.index') !!}", {identifier: that.identifier}).then(response => {
  307. if (response.data.result) {
  308. // that.submit_loading = false;
  309. if (response.data.data.status == 'SUCCESS') {
  310. // that.active = 3;
  311. that.isResult();
  312. }
  313. // else if(response.data.data.status == 'WAIT'){
  314. // // that.is_waitting = 3;
  315. // setTimeout(function(){
  316. // that.isSuccess();
  317. // }, 3000);
  318. // }
  319. } else {
  320. // that.submit_loading = false;
  321. // that.$message.error(response.data.msg)
  322. that.is_waitting = 2;
  323. that.message = response.data.msg
  324. }
  325. }, response => {
  326. });
  327. },
  328. isResult() {
  329. let that = this;
  330. // that.submit_loading = true;
  331. this.$http.post("{!! yzWebFullUrl('plugin.min-app.Backend.Modules.Manual.Controllers.upload-output.index') !!}", {identifier: that.identifier}).then(response => {
  332. if (response.data.result) {
  333. // that.submit_loading = false;
  334. if (response.data.data.status == 'SUCCESS') {
  335. that.active = 3;
  336. } else if (response.data.data.status == 'WAIT') {
  337. // that.is_waitting = 3;
  338. setTimeout(function () {
  339. that.isResult();
  340. }, 3000);
  341. }
  342. } else {
  343. // that.submit_loading = false;
  344. // that.$message.error(response.data.msg)
  345. that.is_waitting = 2;
  346. that.message = response.data.msg
  347. }
  348. }, response => {
  349. });
  350. },
  351. goBack() {
  352. let that = this;
  353. this.active = 1;
  354. this.is_waitting = 0;
  355. this.count_down = 45;
  356. this.is_scan_success = 0;
  357. },
  358. count1() {
  359. let that = this;
  360. if (that.is_scan_success == 1) {
  361. return;
  362. }
  363. console.log(this.count_down)
  364. this.count_down--;
  365. if (this.count_down <= 0) {
  366. this.count_down = 0;
  367. that.is_waitting = -1;
  368. return;
  369. }
  370. setTimeout(() => {
  371. this.count1()
  372. }, 1000);
  373. },
  374. count2() {
  375. let that = this;
  376. that.time--;
  377. if (that.time <= 0) {
  378. that.time = 0;
  379. // that.is_waitting = -1;
  380. that.submitForm('form');
  381. } else {
  382. setTimeout(() => {
  383. this.count2()
  384. }, 1000);
  385. }
  386. }
  387. }
  388. });
  389. </script>
  390. @endsection