diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a503fa2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/unpackage/ diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..01e9904 --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,18 @@ +{ + "version" : "1.0", + "configurations" : [ + { + "default" : { + "launchtype" : "local" + }, + "h5" : { + "launchtype" : "local" + }, + "mp-weixin" : { + "launchtype" : "local" + }, + "provider" : "aliyun", + "type" : "uniCloud" + } + ] +} diff --git a/common/config.js b/common/config.js index 643a29d..5464227 100644 --- a/common/config.js +++ b/common/config.js @@ -1,6 +1,6 @@ -const ROOTPATH1 = "https://duanju.xianmxkj.com/sqx_fast"; // -const ROOTPATH = "https://duanju.xianmxkj.com/sqx_fast"; //后台服务域名 -const ROOTPATH2 = "https://duanju.xianmxkj.com"; //后台服务域名 +const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; // +const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名 +const ROOTPATH2 = "https://video.hnsiyao.cn"; //后台服务域名 // const ROOTPATH1 = location.origin + "/sqx_fast"; // // const ROOTPATH = location.origin + "/sqx_fast"; //后台服务域名 diff --git a/common/queue.js b/common/queue.js index d38dcb5..df494fd 100644 --- a/common/queue.js +++ b/common/queue.js @@ -18,11 +18,11 @@ module.exports = { }, //全局域名 部分html中需要单独替换 需要修改config中的网络请求域名 publicYuMing() { - return 'https://duanju.xianmxkj.com' + return 'https://video.hnsiyao.cn' }, //全局域名 部分html中需要单独替换 需要修改config中的网络请求域名 publicYuMingAll() { - return 'https://duanju.xianmxkj.com/sqx_fast' + return 'https://video.hnsiyao.cn/sqx_fast/' }, minMoney() { return uni.getStorageSync("minMoney") ? uni.getStorageSync("minMoney") : '0.3' diff --git a/manifest.json b/manifest.json index f3a09b8..d63dd02 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { - "name" : "短剧", - "appid" : "__UNI__CA593C1", + "name" : "斯耀短剧", + "appid" : "__UNI__E0B05B1", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", @@ -159,7 +159,7 @@ "enable" : false }, "h5" : { - "title" : "短剧", + "title" : "斯耀短剧", "domain" : "https://jiaoyu.xianmxkj.com", "router" : { "mode" : "history" diff --git a/pages/index/index copy.vue b/pages/index/index copy.vue index 0e9ffbd..41e18d1 100644 --- a/pages/index/index copy.vue +++ b/pages/index/index copy.vue @@ -116,7 +116,7 @@ 会员免费领 @@ -136,7 +136,7 @@ {{xxJDNum}} 金豆 diff --git a/pages/index/index.vue b/pages/index/index.vue index bf3f05a..f34f625 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -143,7 +143,7 @@ 会员免费领 @@ -163,7 +163,7 @@ {{xxJDNum}} 金豆 diff --git a/pages/me/vip/index.vue b/pages/me/vip/index.vue index 66a3d3a..1763b9d 100644 --- a/pages/me/vip/index.vue +++ b/pages/me/vip/index.vue @@ -81,7 +81,7 @@ 会员免费领 diff --git a/uniCloud-aliyun/cloudfunctions/login/index.js b/uniCloud-aliyun/cloudfunctions/login/index.js index 0c5e58f..db45eed 100644 --- a/uniCloud-aliyun/cloudfunctions/login/index.js +++ b/uniCloud-aliyun/cloudfunctions/login/index.js @@ -4,7 +4,7 @@ const db = uniCloud.database() exports.main = async (event, context) => { const res = await uniCloud.getPhoneNumber({ - appid: '__UNI__CA593C1', // 替换成自己开通一键登录的应用的DCloud appid,使用callFunction方式调用时可以不传(会自动取当前客户端的appid),如果使用云函数URL化的方式访问必须传此参数 + appid: '__UNI__E0B05B1', // 替换成自己开通一键登录的应用的DCloud appid,使用callFunction方式调用时可以不传(会自动取当前客户端的appid),如果使用云函数URL化的方式访问必须传此参数 provider: 'univerify', apiKey: '999f511095b875f4e1ac9eb495e4d208', // 在开发者中心开通服务并获取apiKey apiSecret: 'd81d7c58aa11848c687c0970f615c5dc', // 在开发者中心开通服务并获取apiSecret diff --git a/uni_modules/lime-dialer/changelog.md b/uni_modules/lime-dialer/changelog.md new file mode 100644 index 0000000..294a53e --- /dev/null +++ b/uni_modules/lime-dialer/changelog.md @@ -0,0 +1,16 @@ +## 0.2.5(2024-11-11) +- fix: 优化styleOpt样式 +## 0.2.4(2024-07-19) +- chore: 更新文档,增加背景框 +## 0.2.3(2024-05-27) +- fix: 修复只有2项时无法显示的问题 +## 0.2.2(2024-05-07) +- chore: stylus 改成 scss +- fix: 修复vue3点击多触发问题 +## 0.2.1(2023-05-08) +- chore: 增加示例 +## 0.2.0(2021-07-09) +- chore: 统一命名规范,无须主动引入组件 +## 0.1.0(2021-06-16) +- 首次上传 +- 纯CSS实现的抽奖转盘 diff --git a/uni_modules/lime-dialer/components/l-dialer/index.scss b/uni_modules/lime-dialer/components/l-dialer/index.scss new file mode 100644 index 0000000..a004fd5 --- /dev/null +++ b/uni_modules/lime-dialer/components/l-dialer/index.scss @@ -0,0 +1,130 @@ + +@mixin theme($property, $variable) { + $theme: ( + 'dialer_text_color': #ffb400, + 'dialer_prize_font_size': 12px, + 'dialer_prize_name_padding': 8px, + 'dialer_prize_inner_padding': 8px, + 'dialer_prize_image_size': 36px + ); + + $value: map-get($theme, $variable); + #{$property}: $value; + + /* #ifndef APP-IOS || APP-ANDROID */ + $css-variable: var(--#{$variable}, #{$value}); + #{$property}: #{$css-variable}; + /* #endif */ +} + +.l-dialer { + position: relative; + + &__inner { + width: 100%; + height: 100%; + flex:1; + position: relative; + @include theme('color', 'dialer_text_color'); + background-repeat: no-repeat; + background-size: cover; + box-sizing: border-box; + border-radius: 999px; + overflow: hidden; + // transition: transform 3s ease; + // transform-origin: 50% 50%; + transition-property: transform; + transition-timing-function: cubic-bezier(0.250, 0.460, 0.455, 0.995); + &-border { + position: absolute; + left: 0; + top: 0; + bottom: 0; + right: 0; + } + + &-wrap { + position: relative; + z-index: 1; + width: 100%; + height: 100%; + border-radius: 999px; + overflow: hidden; + box-sizing: border-box; + // background: red; + /* #ifndef APP-ANDROID */ + &::after { + position: absolute; + left: 0; + top: 0; + bottom: 0; + right: 0; + content: ''; + border-radius: 50%; + box-shadow: 0 0 20rpx currentColor inset; + } + /* #endif */ + } + + &-item { + overflow: hidden; + position: absolute; + top: -50%; + left: 50%; + width: 100%; + height: 100%; + transform-origin: 0 100%; + } + + &-content { + position: absolute; + @include theme('padding-top', 'dialer_prize_inner_padding'); + box-sizing: border-box; + width: 100%; + height: 100%; + left: -50%; + bottom: -50%; + display: flex; + flex-direction: column; + align-items: center; + } + + &-name { + @include theme('padding-top', 'dialer_prize_name_padding'); + @include theme('padding-bottom', 'dialer_prize_name_padding'); + @include theme('font-size', 'dialer_prize_font_size'); + @include theme('color', 'dialer_text_color'); + } + + &-img { + @include theme('width', 'dialer_prize_image_size'); + @include theme('height', 'dialer_prize_image_size'); + } + } + + &__pointer { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + z-index: 1; + } +} + +/* #ifndef APP-IOS || APP-ANDROID */ +.heart { + animation: heart 1s infinite; +} + +@keyframes heart { + 0% { + transform: scale(1); + } + 25% { + transform: scale(1.03); + } + to { + transform: scale(1); + } +} +/* #endif */ \ No newline at end of file diff --git a/uni_modules/lime-dialer/components/l-dialer/index.styl b/uni_modules/lime-dialer/components/l-dialer/index.styl new file mode 100644 index 0000000..7fe85c6 --- /dev/null +++ b/uni_modules/lime-dialer/components/l-dialer/index.styl @@ -0,0 +1,111 @@ +replace2(val) + r = match('\$[^() ]+', val, 'gi') + re = val + for v, i in r + k = split(v, re) + j = s('%s', convert(v)) + re = join(j, k) + unquote(re) + +theme($property, $imp) + a = replace('(\$[^() ]+)', '$1', $imp) + // #ifndef APP-NVUE + b = replace('(\$)([^() ]+)', 'var(--$2, $1$2)', $imp) + // #endif + {$property} replace2(a) + // #ifndef APP-NVUE + {$property} replace2(b) + // #endif + +$dialer_text_color ?= #ffb400 +$dialer_prize_font_size ?= 12px +$dialer_prize_name_padding ?= 8px +$dialer_prize_inner_padding ?= 8px +$dialer_prize_image_size ?= 36px + +.l-dialer + position relative + &__inner + width 100% + height 100% + position relative + // color $dialer_text_color + theme('color', '$dialer_text_color') + background-repeat no-repeat + background-size cover + box-sizing border-box + &-border + position absolute + left 0 + top 0 + bottom 0 + right 0 + &-wrap + position relative + z-index 1 + // flex 1 + width 100% + height 100% + border-radius 50% + overflow hidden + box-sizing border-box + + &::after + position absolute + left 0 + top 0 + bottom 0 + right 0 + content '' + border-radius 50% + box-shadow 0 0 20rpx currentColor inset + &-item + overflow hidden + position absolute + top -50% + left 50% + width 100% + height 100% + transform-origin 0 100% + &-content + position absolute + theme('padding-top', '$dialer_prize_inner_padding') + // padding-top $dialer_prize_inner_padding + box-sizing border-box + width 100% + height 100% + left -50% + bottom -50% + display flex + flex-direction column + align-items center + &-name + theme('padding-top', '$dialer_prize_name_padding') + theme('padding-bottom', '$dialer_prize_name_padding') + theme('font-size', '$dialer_prize_font_size') + theme('color', '$dialer_text_color') + // padding-top $dialer_prize_name_padding + // padding-bottom $dialer_prize_name_padding + // font-size $dialer_prize_font_size + // color $dialer_text_color + &-img + // margin-top 24rpx + theme('width', '$dialer_prize_image_size') + theme('height', '$dialer_prize_image_size') + // width $dialer_prize_image_size + // height $dialer_prize_image_size + &__pointer + position absolute + left 50% + top 50% + transform translate(-50%, -50%) + z-index 1 +.heart + animation heart 1s infinite +@keyframes heart + 0% + transform scale(1) + 25% + transform scale(1.03) + to + transform scale(1) \ No newline at end of file diff --git a/uni_modules/lime-dialer/components/l-dialer/l-dialer.uvue b/uni_modules/lime-dialer/components/l-dialer/l-dialer.uvue new file mode 100644 index 0000000..ea3b336 --- /dev/null +++ b/uni_modules/lime-dialer/components/l-dialer/l-dialer.uvue @@ -0,0 +1,260 @@ + + + \ No newline at end of file diff --git a/uni_modules/lime-dialer/components/l-dialer/l-dialer.vue b/uni_modules/lime-dialer/components/l-dialer/l-dialer.vue new file mode 100644 index 0000000..dabeec8 --- /dev/null +++ b/uni_modules/lime-dialer/components/l-dialer/l-dialer.vue @@ -0,0 +1,176 @@ + + + diff --git a/uni_modules/lime-dialer/components/lime-dialer/lime-dialer.uvue b/uni_modules/lime-dialer/components/lime-dialer/lime-dialer.uvue new file mode 100644 index 0000000..2642811 --- /dev/null +++ b/uni_modules/lime-dialer/components/lime-dialer/lime-dialer.uvue @@ -0,0 +1,97 @@ + + + + + \ No newline at end of file diff --git a/uni_modules/lime-dialer/components/lime-dialer/lime-dialer.vue b/uni_modules/lime-dialer/components/lime-dialer/lime-dialer.vue new file mode 100644 index 0000000..2c0a664 --- /dev/null +++ b/uni_modules/lime-dialer/components/lime-dialer/lime-dialer.vue @@ -0,0 +1,93 @@ + + + + + \ No newline at end of file diff --git a/uni_modules/lime-dialer/package.json b/uni_modules/lime-dialer/package.json new file mode 100644 index 0000000..c2ffd97 --- /dev/null +++ b/uni_modules/lime-dialer/package.json @@ -0,0 +1,82 @@ +{ + "id": "lime-dialer", + "displayName": "幸运转盘", + "version": "0.2.5", + "description": "幸运转盘 抽奖 抽奖转盘,兼容uniapp/uniappX(h5,ios,安卓)", + "keywords": [ + "转盘", + "抽奖", + "抽奖转盘" + ], + "repository": "", + "engines": { + "HBuilderX": "^3.4.12" + }, + "dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y", + "alipay": "n" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "n", + "app-uvue": "y", + "app-harmony": "u" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "y", + "联盟": "y" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/lime-dialer/readme.md b/uni_modules/lime-dialer/readme.md new file mode 100644 index 0000000..1137a1f --- /dev/null +++ b/uni_modules/lime-dialer/readme.md @@ -0,0 +1,176 @@ +# Dialer 转盘抽奖 +> 营销活动类组件 +> [查看更多](https://limeui.qcoon.cn/#/dialer)
+ + + +### 平台兼容 +| H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 头条小程序 | QQ小程序 | App | +|-----------|-----------|-----------|-----------|-----------|-----------|-----------| +| √ | √ | √ | √ | √ | √ | √ | + + +### 代码演示 +#### 基础用法 + +```html + +``` +```js +export default { + data() { + return { + // 奖品列表, + prizeList: [ + { + id: 'coupon88', + name: '8.8折', + img: 'https://img11.360buyimg.com/pop/jfs/t1/175718/35/12595/5477/60b660c6Eb850717b/a1cfe750dcdb5b78.png', + }, + { + id: 'coupon900', + Color: 'rgb(251, 219, 216)', + name: '900', + img: 'https://img11.360buyimg.com/pop/jfs/t1/190845/9/6092/4489/60b65fe8Ebb8f8284/955da889f6d1c13e.png', + }, + { + id: 'coupon1', + name: '1元', + img: 'https://img11.360buyimg.com/pop/jfs/t1/189927/14/6092/4174/60b66173E23c472ea/44af15a151defca1.png', + }, + { + id: 'apple', + Color: 'rgba(246, 142, 46, 0.5)', + name: '苹果手机', + img: 'https://img11.360buyimg.com/pop/jfs/t1/177670/26/4591/2514/60a25874Ee0e5332a/99c7bdfede732ae4.png' + }, + { + id: 'coupon210', + name: '210元', + img: 'https://img11.360buyimg.com/pop/jfs/t1/124578/12/20170/4429/60b635d8E7089ebb0/7a47d76a2a260cc0.png' + }, + { + id: 'jd100', + name: '100京豆', + img: 'https://img11.360buyimg.com/pop/jfs/t1/162790/37/15087/28046/6062a49aE8f2c10f2/5591ff0ff38a45e2.png', + }, + { + id: 'coupon400', + name: '400元', + img: 'https://img11.360buyimg.com/pop/jfs/t1/177090/2/7001/4535/60b6607aEe9c1db2a/76c67675f547db3f.png' + }, + { + id: 'thanks', + name: '谢谢参与', + img: 'https://storage.jd.com/cdn-upload/dialTemplateHeart.png', + } + ] + }; + }, + methods: { + onDone(index) { + const prize = this.prizeList[index] + uni.showModal({ + title: prize.id == 'thanks' ? '很遗憾': '恭喜您', + content: (prize.id !== 'thanks' ? `获得`:'') + prize.name + }) + }, + onClick() { + // 奖品的索引 + this.$refs.dialer.run(5) + } + } +} +``` + +#### 表框 +- 1、通过设置`dial-style`设置背景的方式设置,必须是网络图片 +- 2、通过插槽`border`设置 + +```html +// 方式1 + + +// 方式2 + + + +``` + +#### 指针 +- 1、可通过`pointer-style`设置背景的方式设置,但必须为网络图片 +- 2、可通过插槽`pointer`设置 +- 3、因为插件是能过获取内部方法实现抽奖,只要获取方法,任何元素都是指针按钮 + +```html +// 方式1 + +// 方式2 + + + +``` + +#### 奖品插槽 +- 默认会按奖品列表渲染,但想更个性可通过插槽`prize`设置 +- 微信小程序最好使用HX3.7.12+并且在`manifest.json`设置`slotMultipleInstance` +```json +"mp-weixin" : { + "slotMultipleInstance" : true +} +``` + +```html + + + +``` + + +### 查看示例 +- 导入后直接使用这个标签查看演示效果 + +```html + + +``` + + +### 插件标签 +- 默认 l-dialer 为 component +- 默认 lime-dialer 为 demo + + + +### API +#### Props + +| 参数 | 说明 | 类型 | 默认值 | 版本 | +| --- | --- | --- | --- | --- | +| size | 转盘直径,默认单位为 `rpx` | Number | `300` | - | +| prizeList | 奖品列表 | Array | [] | - | +| turns | 旋转圈数 | Number | `10` | - | +| duration | 旋转过程时间,单位为 `s` | Number | `3` | - | +| styleOpt | 转盘中的样式,包括每个扇区的背景颜色(在每条数据中页可单独设置prizeColor),扇区的边框颜色 | Object | {prizeBgColors: [],borderColor: ''} | - | +| customStyle | 外容器的自定义样式 | String | | - | +| dialStyle | 转盘自定义样式 | String | | - | +| pointerStyle | 指针自定义样式 | String | `width:30%` | - | + +#### Event + +| 名称 | 说明 | +| ---- | ---------------------------------------------------------- | +| run(index) | 旋转到指定索引,该事件是通过`ref`获取插件实例的内部方法 | +| done | 旋转结束,该事件是通过标签接收的方法 | +| click | 点击指针,该事件是通过标签接收的方法 | + + +#### Slots + +| 名称 | 说明 | +| ---- | ---------------------------------------------------------- | +| border | 边框插槽 | +| prize | 奖品插槽 | +| pointer | 指针插槽 | diff --git a/uni_modules/lime-dialer/static/lottery-bg-.png b/uni_modules/lime-dialer/static/lottery-bg-.png new file mode 100644 index 0000000..79f3039 Binary files /dev/null and b/uni_modules/lime-dialer/static/lottery-bg-.png differ diff --git a/uni_modules/lime-dialer/static/turnable_btn.png b/uni_modules/lime-dialer/static/turnable_btn.png new file mode 100644 index 0000000..15999ff Binary files /dev/null and b/uni_modules/lime-dialer/static/turnable_btn.png differ