liyongli 3 tahun lalu
induk
melakukan
3d2d96390a
3 mengubah file dengan 82 tambahan dan 0 penghapusan
  1. 6 0
      public/index.html
  2. 6 0
      src/router/index.js
  3. 70 0
      src/views/ActionSheet.vue

+ 6 - 0
public/index.html

@@ -8,6 +8,12 @@
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <script src="//cdn.bootcdn.net/ajax/libs/eruda/2.4.1/eruda.min.js"></script>
     <script>eruda.init();</script>
+       <!--导入原生js库-->
+    <script src="http://cmp/v1.0.0/js/cordova/__CMPSHELL_PLATFORM__/cordova.js"></script>
+    <script src="http://cmp/v1.0.0/js/cordova/cordova-plugins.js"></script>
+    <!--导入cmp.js-->
+    <script src="http://cmp/v/js/cmp-i18n.js"></script>
+    <script src="http://cmp/v/js/cmp.js"></script>
     <title>
         <%= htmlWebpackPlugin.options.title %>
     </title>

+ 6 - 0
src/router/index.js

@@ -22,7 +22,13 @@ const routes = [
       name: "Appointment",
       component: () => import("../views/Appointment.vue"),
     },
+    {
+        path: '/actionSheet',
+        name: "ActionSheet",
+        component: () => import("../views/ActionSheet.vue")
+    }
 ];
+// http://djweb.smcic.net/hair/index.html#/appointment
 
 const router = new VueRouter({
   routes,

+ 70 - 0
src/views/ActionSheet.vue

@@ -0,0 +1,70 @@
+<template>
+  <div class="actionSheet" >
+    <img :src="url" alt="" @mousedown="md" @mouseup="mu" class="qr" />
+  </div>
+</template>
+
+<script>
+// @ is an alias to /src
+// let sT = 0;
+
+export default {
+  name: "Applyreal",
+  data() {
+    return {
+      url: "https://dangjian-web.oss-cn-chengdu.aliyuncs.com/img/qr.png",
+    };
+  },
+  mounted() {
+      document.title = '车险';
+      console.log(window.cmp.sdk)
+  },
+  computed: {},
+  methods: {
+    md() {
+        console.log("---")
+    //   sT = Date.now();
+    //   let s = window.setTimeout(() => {
+    //       window.clearInterval(s);
+    //     if (sT === 0) return;
+        this.downimg();
+    //   }, 1000);
+    },
+    mu() {
+        console.log("+++")
+    //   sT = 0;
+    },
+    downimg() {
+        console.log("长按",window.cmp)
+      window.cmp.dialog.actionSheet(
+        [{ key: 1, name: "操作组item1" }],
+        "取消",
+        function selectedCallback() {
+          //do something with result
+        },
+        function cancelCallback() {
+          //do something with tap cancel button
+        }
+      );
+    },
+  },
+  beforeUnmount: function () {},
+  components: {},
+};
+</script>
+
+<style>
+.actionSheet{
+    background-image: url('https://djweb.smcic.net/img/cx.png');
+    background-size: 100% 100%;
+    width: 100vw;
+    height: 100vh;
+    position: relative;
+}
+.actionSheet .qr{
+    position: absolute;
+    top: 50%;
+    width: 100%;
+    transform: translateY(-60%)
+}
+</style>