123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Document</title>
- <!-- Import style -->
- <link rel="stylesheet" href="//unpkg.com/element-plus/dist/index.css" />
- <!-- Import Vue 3 -->
- <script src="//unpkg.com/vue@3"></script>
- <!-- Import component library -->
- <script src="//unpkg.com/element-plus"></script>
- </head>
- <body>
- <div id="app">
- <h2>{{ message }}</h2>
- <el-form label-width="120px">
- <el-form-item label="小程序链接">
- <el-input v-model="form.link" :rows="3" type="textarea" placeholder="请输入小程序开柜码内容" />
- </el-form-item>
- <el-form-item label="小程序主体">
- <el-select v-model="form.value" placeholder="请选择">
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
- </el-select>
- </el-form-item>
- <el-form-item label="">
- <el-button @click="onSubmit">生成</el-button>
- </el-form-item>
- <el-form-item label="生成后链接">
- <el-input v-model="form.miniLink" readonly rows="3" type="textarea" />
- </el-form-item>
- </el-form>
- </div>
- <script>
- // ## 小程序普通链接二维码前缀
- // ```
- // # 企业云卡
- // https://superdesk.avic-s.com/super_cloud/pcm/shortcut/cloud_card_uni/
-
- // # 超级前台(北大)
- // https://superdesk.avic-s.com/super_cloud/pcm/shortcut/service_routine_uni/
- // ```
-
- const App = {
- data() {
- return {
- message: "小程序普通链接二维码内容前缀更换",
- form: {
- link: 'https://bcos.superdesk.cn/super_cloud/pcm/shortcut/service_routine_uni/?p1=615&p2=582&extParam=deviceNo%3D646dcddb4efb9500119f88d8%26doorNum%3D1',
- value: "cloud_card_uni",
- miniLink: ''
- },
- options: [
- {
- value: "cloud_card_uni",
- prefix: 'https://superdesk.avic-s.com/super_cloud/pcm/shortcut/cloud_card_uni/',
- label: "企业云卡",
- },
- {
- value: "service_routine_uni",
- prefix: 'https://superdesk.avic-s.com/super_cloud/pcm/shortcut/service_routine_uni/',
- label: "超级前台(北大)",
- },
- {
- value: "xcx",
- prefix: 'https://fm.superdesk.cn/xcx/youpengGood/',
- label: "前台优选",
- },
- ],
- };
- },
- methods: {
- onSubmit() {
- const originalUrl = this.form.link
- const replacedUrl = originalUrl.replace(originalUrl.split('?')[0], this.options.find(v => v.value === this.form.value).prefix)
- this.form.miniLink = replacedUrl
- }
- }
- };
- const app = Vue.createApp(App);
- app.use(ElementPlus);
- app.mount("#app");
- </script>
- </body>
- </html>
|