소스 검색

抽奖页面

xiaohaizhao 1 년 전
부모
커밋
5a51fc9870
6개의 변경된 파일391개의 추가작업 그리고 95개의 파일을 삭제
  1. 76 76
      manifest.json
  2. 0 19
      package (2).json
  3. 4 0
      pages.json
  4. 248 0
      store/lottery/modules/sudoku.vue
  5. 39 0
      store/lottery/shareable.vue
  6. 24 0
      store/lottery/unshareable.vue

+ 76 - 76
manifest.json

@@ -1,28 +1,28 @@
 {
-    "name": "营销工具",
-    "appid": "__UNI__60CDE76",
-    "description": "",
-    "versionName": "1.0.0",
-    "versionCode": "100",
-    "transformPx": false,
+    "name" : "营销工具",
+    "appid" : "__UNI__60CDE76",
+    "description" : "",
+    "versionName" : "1.0.0",
+    "versionCode" : "100",
+    "transformPx" : false,
     /* 5+App特有相关 */
-    "app-plus": {
-        "usingComponents": true,
-        "nvueStyleCompiler": "uni-app",
-        "compilerVersion": 3,
-        "splashscreen": {
-            "alwaysShowBeforeRender": true,
-            "waiting": true,
-            "autoclose": true,
-            "delay": 0
+    "app-plus" : {
+        "usingComponents" : true,
+        "nvueStyleCompiler" : "uni-app",
+        "compilerVersion" : 3,
+        "splashscreen" : {
+            "alwaysShowBeforeRender" : true,
+            "waiting" : true,
+            "autoclose" : true,
+            "delay" : 0
         },
         /* 模块配置 */
-        "modules": {},
+        "modules" : {},
         /* 应用发布信息 */
-        "distribute": {
+        "distribute" : {
             /* android打包配置 */
-            "android": {
-                "permissions": [
+            "android" : {
+                "permissions" : [
                     "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
                     "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
@@ -41,87 +41,87 @@
                 ]
             },
             /* ios打包配置 */
-            "ios": {},
+            "ios" : {},
             /* SDK配置 */
-            "sdkConfigs": {}
+            "sdkConfigs" : {}
         }
     },
     /* 快应用特有相关 */
-    "quickapp": {},
+    "quickapp" : {},
     /* 小程序特有相关 */
-    "mp-weixin": {
-        "appid": "wx08b337e860e3ea58",
-        "setting": {
-            "urlCheck": false,
-            "es6": true,
-            "postcss": true,
-            "minified": true
+    "mp-weixin" : {
+        "appid" : "wx08b337e860e3ea58",
+        "setting" : {
+            "urlCheck" : false,
+            "es6" : true,
+            "postcss" : true,
+            "minified" : true
         },
-        "usingComponents": true,
-        "permission": {
-            "scope.userLocation": {
-                "desc": "向您推荐附近门店信息,方便自主定位帮您规划导航路线"
+        "usingComponents" : true,
+        "permission" : {
+            "scope.userLocation" : {
+                "desc" : "向您推荐附近门店信息,方便自主定位帮您规划导航路线"
             }
         },
-        "requiredPrivateInfos": ["getLocation"]
+        "requiredPrivateInfos" : [ "getLocation" ]
     },
-    "mp-alipay": {
-        "usingComponents": true
+    "mp-alipay" : {
+        "usingComponents" : true
     },
-    "mp-baidu": {
-        "usingComponents": true
+    "mp-baidu" : {
+        "usingComponents" : true
     },
-    "mp-toutiao": {
-        "usingComponents": true
+    "mp-toutiao" : {
+        "usingComponents" : true
     },
-    "uniStatistics": {
-        "enable": false
+    "uniStatistics" : {
+        "enable" : false
     },
-    "vueVersion": "2",
-    "h5": {
-        "router": {
-            "mode": "hash",
-            "base": "./"
+    "vueVersion" : "2",
+    "h5" : {
+        "router" : {
+            "mode" : "hash",
+            "base" : "./"
         },
-        "devServer": {
-            "https": false,
-            "disableHostCheck": true,
-            "proxy": {
-                "/socket1": {
-                    "target": "ws://61.164.207.46:8200",
-                    "changeOrigin": true,
-                    "pathRewrite": {
-                        "^/apis1": ""
+        "devServer" : {
+            "https" : false,
+            "disableHostCheck" : true,
+            "proxy" : {
+                "/socket1" : {
+                    "target" : "ws://61.164.207.46:8200",
+                    "changeOrigin" : true,
+                    "pathRewrite" : {
+                        "^/apis1" : ""
                     }
                 },
-                "/socket": {
-                    "target": "wss://www.ibpchina.com.cn",
-                    "changeOrigin": false,
-                    "pathRewrite": {
-                        "^/apis": ""
+                "/socket" : {
+                    "target" : "wss://www.ibpchina.com.cn",
+                    "changeOrigin" : false,
+                    "pathRewrite" : {
+                        "^/apis" : ""
                     }
                 },
-                "/apis1": {
-                    "target": "http://61.164.207.46:8200",
-                    "changeOrigin": true,
-                    "pathRewrite": {
-                        "^/apis1": ""
+                "/apis1" : {
+                    "target" : "http://61.164.207.46:8200",
+                    "changeOrigin" : true,
+                    "pathRewrite" : {
+                        "^/apis1" : ""
                     }
                 },
-                "/apis": {
-                    "target": "https://www.ibpchina.com.cn",
-                    "changeOrigin": false,
-                    "pathRewrite": {
-                        "^/apis": ""
+                "/apis" : {
+                    "target" : "https://www.ibpchina.com.cn",
+                    "changeOrigin" : false,
+                    "pathRewrite" : {
+                        "^/apis" : ""
                     }
                 }
             }
         },
-        "optimization": {
-            "treeShaking": {
-                "enable": true
+        "optimization" : {
+            "treeShaking" : {
+                "enable" : true
             }
         },
-        "title": "营销工具"
+        "title" : "营销工具"
     }
-}
+}

+ 0 - 19
package (2).json

@@ -1,19 +0,0 @@
-{
-    "id": "lucky-canvas",
-    "displayName": "lucky-canvas【大转盘|九宫格|老虎机】抽奖插件 ",
-    "version": "v0.0.10_4",
-    "description": "奖品/文字/图片/颜色/按钮均可配置,支持同步/异步抽奖,概率前/后端可控,自动根据dpr调整清晰度",
-    "keywords": [
-        "抽奖",
-        "大转盘抽奖",
-        "九宫格抽奖",
-        "小程序抽奖",
-        "老虎机抽奖"
-    ],
-    "dcloudext": {
-        "category": [
-            "前端组件",
-            "通用组件"
-        ]
-    }
-}

+ 4 - 0
pages.json

@@ -80,6 +80,10 @@
 			"path": "insert/member"
 		}, {
 			"path": "center/detail"
+		}, {
+			"path": "lottery/shareable"
+		}, {
+			"path": "lottery/unshareable"
 		}]
 	}, {
 		"root": "cloud",

+ 248 - 0
store/lottery/modules/sudoku.vue

@@ -0,0 +1,248 @@
+<template>
+    <view class="box">
+        <view class="lottery-box">
+            <navigator class="my-list" url="/cloud/winningNews/index">
+                我的奖品
+            </navigator>
+            <image class="bg-image"
+                src="https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202405281716860202553Be55ba55.webp" />
+            <view class="lottery">
+                <view>
+                    <LuckyGrid ref="myLucky" width="590rpx" height="590rpx" :prizes="prizes" :buttons="buttons"
+                        :defaultStyle="defaultStyle" @start="startCallBack" @end="endCallBack" />
+                </view>
+            </view>
+        </view>
+        <view class="winners-list">
+            <image class="image"
+                src="https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202405281716863577428B1faf5081.webp"
+                mode="widthFix" />
+            <view class="content">
+                <view class="title">
+                    <view class="text">
+                        抽奖名单
+                    </view>
+                </view>
+                <swiper class="swiper" autoplay easing-function="linear" interval="1000" duration="1000" circular vertical
+                    display-multiple-items="7">
+                    <swiper-item v-for="(item, index) in 20" :key="index">
+                        <view class="swiper-item u-line-2">
+                            {{ item }}df sdf 、
+                        </view>
+                    </swiper-item>
+                </swiper>
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+import LuckyGrid from '@/components/@lucky-canvas/uni/lucky-grid'
+export default {
+    components: { LuckyGrid },
+    props: {
+        sa_awardid: {
+            type: [Number || String]
+        },
+        shareuserid: {
+            type: [Number || String]
+        }
+    },
+    data() {
+        return {
+            prizes: [
+                { x: 0, y: 0, borderRadius: '20rpx' },
+                { x: 2, y: 0, borderRadius: '20rpx' },
+                { x: 0, y: 2, borderRadius: '20rpx' },
+                { x: 2, y: 2, borderRadius: '20rpx' },
+                { x: 1, y: 0, borderRadius: '20rpx' },
+                { x: 2, y: 1, borderRadius: '20rpx' },
+                { x: 1, y: 2, borderRadius: '20rpx' },
+                { x: 0, y: 1, borderRadius: '20rpx' },
+            ],
+            buttons: [{
+                background: 'rgba(0,0,0,0)',
+                x: 1, y: 1,
+                imgs: [{
+                    src: 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202405281716861339513B3a575413.webp',
+                    width: '183.34rpx',
+                    height: '183.34rpx',
+                }],
+            }],
+            defaultStyle: {
+                background: '#FFFFFF',
+                width: '183.34rpx',
+                height: '183.34rpx',
+            },
+            usableCount: 0,
+        }
+    },
+    methods: {
+        init() {
+            console.log("this.sa_awardid", this.sa_awardid)
+            this.$Http.basic({
+                "id": 20240514131402,
+                content: {
+                    "sa_awardid": this.sa_awardid,
+                    "where": {
+                        "condition": "",
+                        "type": ""
+                    }
+                }
+            }).then(res => {
+                console.log("奖品列表", res)
+                if (this.cutoff(res.msg)) return;
+            })
+
+            this.$Http.basic({
+                "classname": "sysmanage.develop.datafunction.datafunction",
+                "method": "execute",
+                "content": {
+                    "functionname": "queryAwardCount",
+                    "parameter": {
+                        "sa_awardid": this.sa_awardid
+                    }
+                }
+            }).then(res => {
+                console.log("抽奖可用次数", res)
+                if (this.cutoff(res.msg)) return;
+                this.usableCount = res.data.length ? res.data[0].count : 0;
+            })
+        },
+        startCallBack() {
+            console.log("开始抽奖")
+            this.$refs.myLucky.play()
+            setTimeout(() => {
+                // 假设后端返回的中奖索引是0
+                const index = 0
+                // 调用stop停止旋转并传递中奖索引
+                this.$refs.myLucky.stop(index)
+            }, 3000)
+        },
+        endCallBack(prize) {
+            console.log("抽到的奖品", prize)
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.box {
+    width: 100vw;
+    min-height: 100vh;
+    background: linear-gradient(90deg, #FE5A46 0%, #F11F46 100%);
+
+    .lottery-box {
+        position: relative;
+        width: 100vw;
+        height: 511px;
+
+        .my-list {
+            position: absolute;
+            top: 20px;
+            left: 0;
+            width: 86px;
+            height: 40px;
+            line-height: 40px;
+            text-align: center;
+            background: linear-gradient(180deg, #FAD96D 0%, #FFC300 4%, #FFCD2B 16%, #FFDF77 42%, #FFD241 70%, #FFC300 94%, #FC9228 100%);
+            border-radius: 0px 20px 20px 0px;
+            font-family: Source Han Sans SC, Source Han Sans SC;
+            font-weight: bold;
+            font-size: 14px;
+            color: #C30D23;
+            z-index: 2;
+        }
+
+        .bg-image {
+            position: absolute;
+            width: 100vw;
+            height: 511px;
+            top: 0;
+            left: 0;
+            z-index: 1;
+            vertical-align: bottom;
+        }
+
+
+        .lottery {
+            position: absolute;
+            width: 100%;
+            z-index: 2;
+            top: 140px;
+        }
+    }
+
+    .winners-list {
+        width: 100vw;
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        padding-bottom: 20px;
+
+        .image {
+            width: 355px;
+        }
+
+        .title {
+            position: relative;
+            width: 80px;
+            height: 29px;
+            margin: 0 auto;
+
+            .text {
+                position: absolute;
+                top: 0px;
+                left: 0;
+                width: 80px;
+                line-height: 29px;
+                text-align: center;
+                font-family: Source Han Sans SC, Source Han Sans SC;
+                font-weight: bold;
+                font-size: 20px;
+                color: #333333;
+                z-index: 2;
+            }
+        }
+
+        .title::after {
+            content: '';
+            position: absolute;
+            bottom: 0px;
+            left: 0;
+            width: 80px;
+            height: 8px;
+            background: #FAD96D;
+            border-radius: 5px;
+            z-index: 1;
+        }
+
+        .content {
+            background: #fff;
+            padding: 0 15px 20px;
+            width: 669.7672675rpx;
+            box-sizing: border-box;
+
+            .swiper {
+                width: 100%;
+                height: 300px;
+                margin-top: 20px;
+
+                .swiper-item {
+                    width: 100%;
+                    height: 40px;
+                    text-align: center;
+                    line-height: 20px;
+                    font-family: Source Han Sans SC, Source Han Sans SC;
+                    font-size: 14px;
+                    color: #666666;
+                    overflow: hidden;
+                }
+            }
+        }
+    }
+
+
+
+}
+</style>

+ 39 - 0
store/lottery/shareable.vue

@@ -0,0 +1,39 @@
+<template>
+    <view>
+        <sudoku ref="sudoku" :sa_awardid="sa_awardid" :shareuserid="shareuserid" />
+    </view>
+</template>
+
+<script>
+import sudoku from "./modules/sudoku"
+export default {
+    components: { sudoku },
+    data() {
+        return {
+            sa_awardid: 2,
+            shareuserid: 0,
+        }
+    },
+    onLoad(options) {
+        this.sa_awardid = options.id || 2;
+        this.shareuserid = options.userid || 0;
+        uni.setNavigationBarTitle({
+            title: '活动抽奖'
+        });
+    },
+    onShow() {
+        this.$Http.basic({
+            "id": 20240514101502,
+            "content": {
+                "sa_awardid": this.sa_awardid,
+            }
+        }).then(res => {
+            console.log("奖品详情", res)
+            if (this.cutoff(res.msg)) return;
+        })
+        this.$refs.sudoku.init();
+    }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 24 - 0
store/lottery/unshareable.vue

@@ -0,0 +1,24 @@
+<template>
+    <view>
+        <sudoku />
+    </view>
+</template>
+
+<script>
+import sudoku from "./modules/sudoku"
+export default {
+    components: { sudoku },
+    data() {
+        return {
+
+        }
+    },
+    onLoad() {
+        uni.setNavigationBarTitle({
+            title: '活动抽奖'
+        });
+    }
+}
+</script>
+
+<style lang="scss" scoped></style>