Ver código fonte

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

lifanagju_citu 5 meses atrás
pai
commit
f050064a59

+ 1 - 1
components.d.ts

@@ -43,7 +43,7 @@ declare module 'vue' {
     IndustryTypeCard: typeof import('./src/components/industryTypeCard/index.vue')['default']
     Info: typeof import('./src/components/Enterprise/info.vue')['default']
     InitPay: typeof import('./src/components/personalRecharge/initPay.vue')['default']
-    Item: typeof import('./src/components/PositionLongStrip/item.vue')['default']
+    Item: typeof import('./src/components/Position/item.vue')['default']
     JobTypeCard: typeof import('./src/components/jobTypeCard/index.vue')['default']
     ListGroup: typeof import('./src/components/FormUI/nestedListGroup/components/listGroup.vue')['default']
     Loading: typeof import('./src/components/Loading/index.vue')['default']

+ 58 - 0
package-lock.json

@@ -8,6 +8,7 @@
       "name": "vuetify-project",
       "version": "0.0.0",
       "dependencies": {
+        "@lucky-canvas/vue": "^0.1.11",
         "@mdi/font": "7.0.96",
         "@vuepic/vue-datepicker": "^8.7.0",
         "@wangeditor/editor": "^5.1.23",
@@ -696,6 +697,57 @@
         "@jridgewell/sourcemap-codec": "^1.4.14"
       }
     },
+    "node_modules/@lucky-canvas/vue": {
+      "version": "0.1.11",
+      "resolved": "https://registry.npmmirror.com/@lucky-canvas/vue/-/vue-0.1.11.tgz",
+      "integrity": "sha512-5vm0txSKRBtMgrE/HZEvw1joSTx9NTdAkc8tBp/aX0LxyhQtiTVBLsRgdYUK/OiURCL8bo+046BTGnV+Q4JFlg==",
+      "license": "Apache-2.0",
+      "dependencies": {
+        "@vue/composition-api": "^1.0.0",
+        "lucky-canvas": "^1.7.23",
+        "vue-demi": "^0.7.4"
+      },
+      "peerDependencies": {
+        "vue": "^2.0.0 || >=3.0.0-rc.0"
+      },
+      "peerDependenciesMeta": {
+        "@vue/composition-api": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/@lucky-canvas/vue/node_modules/@vue/composition-api": {
+      "version": "1.7.2",
+      "resolved": "https://registry.npmmirror.com/@vue/composition-api/-/composition-api-1.7.2.tgz",
+      "integrity": "sha512-M8jm9J/laYrYT02665HkZ5l2fWTK4dcVg3BsDHm/pfz+MjDYwX+9FUaZyGwEyXEDonQYRCo0H7aLgdklcIELjw==",
+      "license": "MIT",
+      "peerDependencies": {
+        "vue": ">= 2.5 < 2.7"
+      }
+    },
+    "node_modules/@lucky-canvas/vue/node_modules/vue-demi": {
+      "version": "0.7.5",
+      "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.7.5.tgz",
+      "integrity": "sha512-eFSQSvbQdY7C9ujOzvM6tn7XxwLjn0VQDXQsiYBLBwf28Na+2nTQR4BBBcomhmdP6mmHlBKAwarq6a0BPG87hQ==",
+      "hasInstallScript": true,
+      "license": "MIT",
+      "bin": {
+        "vue-demi-fix": "bin/vue-demi-fix.js",
+        "vue-demi-switch": "bin/vue-demi-switch.js"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/antfu"
+      },
+      "peerDependencies": {
+        "@vue/composition-api": "^1.0.0-beta.1",
+        "vue": "^2.6.0 || >=3.0.0-rc.1"
+      },
+      "peerDependenciesMeta": {
+        "@vue/composition-api": {
+          "optional": true
+        }
+      }
+    },
     "node_modules/@mdi/font": {
       "version": "7.0.96",
       "resolved": "https://registry.npmmirror.com/@mdi/font/-/font-7.0.96.tgz",
@@ -5004,6 +5056,12 @@
         "node": ">=10"
       }
     },
+    "node_modules/lucky-canvas": {
+      "version": "1.7.27",
+      "resolved": "https://registry.npmmirror.com/lucky-canvas/-/lucky-canvas-1.7.27.tgz",
+      "integrity": "sha512-Ftz6qD+863bI7xijBmZg3dw3cNEc7odPr70EZQcGA14y3TgTAzH65HPosOCd6kKUlMwhntBaHMx3onoj9MtJRQ==",
+      "license": "Apache-2.0"
+    },
     "node_modules/magic-string": {
       "version": "0.30.11",
       "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.11.tgz",

+ 1 - 0
package.json

@@ -10,6 +10,7 @@
     "format": "prettier --write src/"
   },
   "dependencies": {
+    "@lucky-canvas/vue": "^0.1.11",
     "@mdi/font": "7.0.96",
     "@vuepic/vue-datepicker": "^8.7.0",
     "@wangeditor/editor": "^5.1.23",

+ 3 - 0
src/main.js

@@ -27,6 +27,8 @@ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' // pinia 持
 import VueDatePicker from '@vuepic/vue-datepicker';
 import '@vuepic/vue-datepicker/dist/main.css'
 
+import VueLuckyCanvas from '@lucky-canvas/vue'
+
 import router from './router'
 
 import './permission'
@@ -42,6 +44,7 @@ app.use(ElementPlus)
 app.use(pinia)
 app.use(router)
 app.use(Clipboard)
+app.use(VueLuckyCanvas)
 
 // app.config.globalProperties.$echarts = echarts
 registerPlugins(app)

+ 71 - 0
src/views/mall/components/prizeDraw.vue

@@ -0,0 +1,71 @@
+<template>
+  <LuckyGrid
+    ref="myLucky"
+    width="300px"
+    height="300px"
+    :prizes="prizes"
+    :blocks="blocks"
+    :buttons="buttons"
+    :activeStyle="activeStyle"
+    :defaultStyle="defaultStyle"
+    @start="startCallback"
+    @end="endCallback"
+  />
+  <v-btn @click="startCallback" class="mt-3" color="primary">开始抽奖</v-btn>
+</template>
+
+<script setup>
+defineOptions({ name: 'prizeDraw'})
+import { ref } from 'vue'
+
+const myLucky = ref()
+const blocks = [
+  { padding: '10px', background: '#869cfa' },
+  { padding: '10px', background: '#e9e8fe' },
+]
+const prizes = [
+  { x: 0, y: 0 },
+  { x: 1, y: 0 },
+  { x: 2, y: 0 },
+  { x: 2, y: 1 },
+  { x: 2, y: 2 },
+  { x: 1, y: 2 },
+  { x: 0, y: 2 },
+  { x: 0, y: 1 }
+]
+const buttons = [
+  {
+    x: 1, y: 1,
+    background: '#fe9202',
+    borderRaduis: '10px',
+    fonts: [{ text: '开始抽奖', fontColor: '#fff', top: 30}]
+  }
+]
+const defaultStyle = {
+  background: '#b8c5f2'
+}
+const activeStyle = {
+  fontColor: 'red',
+  background: '#869cfa'
+}
+
+const startCallback = () => {
+  // 调用抽奖组件的play方法开始游戏
+  myLucky.value.play()
+  // 模拟调用接口异步抽奖
+  setTimeout(() => {
+    // 假设后端返回的中奖索引是0
+    const index = 3
+    // 调用stop停止旋转并传递中奖索引
+    myLucky.value.stop(index)
+  }, 1500)
+}
+
+const endCallback  = (prize) => {
+  console.log(prize, 'end')
+}
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 0 - 1
src/views/mall/user/address/index.vue

@@ -67,7 +67,6 @@ const props = defineProps({
     default: false,
   }
 })
-console.log('showSelect:', props.showSelect)
 
 const isAdd = ref(true)
 const editId = ref(null)