index.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>Document</title>
  7. <!-- Import style -->
  8. <link rel="stylesheet" href="//unpkg.com/element-plus/dist/index.css" />
  9. <!-- Import Vue 3 -->
  10. <script src="//unpkg.com/vue@3"></script>
  11. <!-- Import component library -->
  12. <script src="//unpkg.com/element-plus"></script>
  13. </head>
  14. <body>
  15. <div id="app">
  16. <h2>{{ message }}</h2>
  17. <el-form label-width="120px">
  18. <el-form-item label="小程序链接">
  19. <el-input v-model="form.link" :rows="3" type="textarea" placeholder="请输入小程序开柜码内容" />
  20. </el-form-item>
  21. <el-form-item label="小程序主体">
  22. <el-select v-model="form.value" placeholder="请选择">
  23. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="">
  27. <el-button @click="onSubmit">生成</el-button>
  28. </el-form-item>
  29. <el-form-item label="生成后链接">
  30. <el-input v-model="form.miniLink" readonly rows="3" type="textarea" />
  31. </el-form-item>
  32. </el-form>
  33. </div>
  34. <script>
  35. // ## 小程序普通链接二维码前缀
  36. // ```
  37. // # 企业云卡
  38. // https://superdesk.avic-s.com/super_cloud/pcm/shortcut/cloud_card_uni/
  39. // # 超级前台(北大)
  40. // https://superdesk.avic-s.com/super_cloud/pcm/shortcut/service_routine_uni/
  41. // ```
  42. const App = {
  43. data() {
  44. return {
  45. message: "小程序普通链接二维码内容前缀更换",
  46. form: {
  47. link: 'https://bcos.superdesk.cn/super_cloud/pcm/shortcut/service_routine_uni/?p1=615&p2=582&extParam=deviceNo%3D646dcddb4efb9500119f88d8%26doorNum%3D1',
  48. value: "cloud_card_uni",
  49. miniLink: ''
  50. },
  51. options: [
  52. {
  53. value: "cloud_card_uni",
  54. prefix: 'https://superdesk.avic-s.com/super_cloud/pcm/shortcut/cloud_card_uni/',
  55. label: "企业云卡",
  56. },
  57. {
  58. value: "service_routine_uni",
  59. prefix: 'https://superdesk.avic-s.com/super_cloud/pcm/shortcut/service_routine_uni/',
  60. label: "超级前台(北大)",
  61. },
  62. {
  63. value: "xcx",
  64. prefix: 'https://fm.superdesk.cn/xcx/youpengGood/',
  65. label: "前台优选",
  66. },
  67. ],
  68. };
  69. },
  70. methods: {
  71. onSubmit() {
  72. const originalUrl = this.form.link
  73. const replacedUrl = originalUrl.replace(originalUrl.split('?')[0], this.options.find(v => v.value === this.form.value).prefix)
  74. this.form.miniLink = replacedUrl
  75. }
  76. }
  77. };
  78. const app = Vue.createApp(App);
  79. app.use(ElementPlus);
  80. app.mount("#app");
  81. </script>
  82. </body>
  83. </html>