From cd399f756332ec727814fa68c97a5a0216830449 Mon Sep 17 00:00:00 2001 From: longjieli <1060695654@qq.com> Date: Tue, 27 Aug 2024 17:51:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A9=9A=E5=BA=86=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/test.vue | 15 - .../PrivacyAgreementPoup/PrivacyAgreementPoup.vue | 142 ++++++ manifest.json | 3 +- pages.json | 15 +- pages/login/login.vue | 242 ++++------ pages/payment/payment.vue | 91 +++- pages/weddingCelebration/weddingCelebration.vue | 22 + showLogin/showLogin.vue | 80 ++++ static/payment/wedding-celebration.png | Bin 0 -> 9227 bytes uni_modules/uni-fab/changelog.md | 23 + uni_modules/uni-fab/components/uni-fab/uni-fab.vue | 491 ++++++++++++++++++++ uni_modules/uni-fab/package.json | 84 ++++ uni_modules/uni-fab/readme.md | 9 + uni_modules/uni-popup/changelog.md | 84 ++++ .../components/uni-popup-dialog/keypress.js | 45 ++ .../uni-popup-dialog/uni-popup-dialog.vue | 316 +++++++++++++ .../uni-popup-message/uni-popup-message.vue | 143 ++++++ .../components/uni-popup-share/uni-popup-share.vue | 187 ++++++++ .../uni-popup/components/uni-popup/i18n/en.json | 7 + .../uni-popup/components/uni-popup/i18n/index.js | 8 + .../components/uni-popup/i18n/zh-Hans.json | 7 + .../components/uni-popup/i18n/zh-Hant.json | 7 + .../uni-popup/components/uni-popup/keypress.js | 45 ++ .../uni-popup/components/uni-popup/popup.js | 26 ++ .../uni-popup/components/uni-popup/uni-popup.uvue | 90 ++++ .../uni-popup/components/uni-popup/uni-popup.vue | 503 +++++++++++++++++++++ uni_modules/uni-popup/package.json | 88 ++++ uni_modules/uni-popup/readme.md | 17 + uni_modules/uni-transition/changelog.md | 24 + .../components/uni-transition/createAnimation.js | 131 ++++++ .../components/uni-transition/uni-transition.vue | 286 ++++++++++++ uni_modules/uni-transition/package.json | 85 ++++ uni_modules/uni-transition/readme.md | 11 + utils/api.js | 59 +++ utils/http.js | 144 ++++++ 35 files changed, 3353 insertions(+), 177 deletions(-) delete mode 100644 component/test.vue create mode 100644 components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue create mode 100644 pages/weddingCelebration/weddingCelebration.vue create mode 100644 showLogin/showLogin.vue create mode 100644 static/payment/wedding-celebration.png create mode 100644 uni_modules/uni-fab/changelog.md create mode 100644 uni_modules/uni-fab/components/uni-fab/uni-fab.vue create mode 100644 uni_modules/uni-fab/package.json create mode 100644 uni_modules/uni-fab/readme.md create mode 100644 uni_modules/uni-popup/changelog.md create mode 100644 uni_modules/uni-popup/components/uni-popup-dialog/keypress.js create mode 100644 uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue create mode 100644 uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue create mode 100644 uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue create mode 100644 uni_modules/uni-popup/components/uni-popup/i18n/en.json create mode 100644 uni_modules/uni-popup/components/uni-popup/i18n/index.js create mode 100644 uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json create mode 100644 uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json create mode 100644 uni_modules/uni-popup/components/uni-popup/keypress.js create mode 100644 uni_modules/uni-popup/components/uni-popup/popup.js create mode 100644 uni_modules/uni-popup/components/uni-popup/uni-popup.uvue create mode 100644 uni_modules/uni-popup/components/uni-popup/uni-popup.vue create mode 100644 uni_modules/uni-popup/package.json create mode 100644 uni_modules/uni-popup/readme.md create mode 100644 uni_modules/uni-transition/changelog.md create mode 100644 uni_modules/uni-transition/components/uni-transition/createAnimation.js create mode 100644 uni_modules/uni-transition/components/uni-transition/uni-transition.vue create mode 100644 uni_modules/uni-transition/package.json create mode 100644 uni_modules/uni-transition/readme.md create mode 100644 utils/api.js create mode 100644 utils/http.js diff --git a/component/test.vue b/component/test.vue deleted file mode 100644 index ca33e03..0000000 --- a/component/test.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - - - \ No newline at end of file diff --git a/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue b/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue new file mode 100644 index 0000000..620aa8f --- /dev/null +++ b/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue @@ -0,0 +1,142 @@ + + + + + \ No newline at end of file diff --git a/manifest.json b/manifest.json index a9e797d..1903f66 100644 --- a/manifest.json +++ b/manifest.json @@ -54,7 +54,8 @@ "setting" : { "urlCheck" : false }, - "usingComponents" : true + "usingComponents" : true, + "__usePrivacyCheck__": true }, "mp-alipay" : { "usingComponents" : true diff --git a/pages.json b/pages.json index d95c259..6497bb7 100644 --- a/pages.json +++ b/pages.json @@ -1,10 +1,5 @@ { "pages": [{ - "path": "pages/login/login", - "style": { - "navigationBarTitleText": "登录" - } - }, { "path": "pages/payment/payment", "style": { "navigationBarTitleText": "支付" @@ -14,6 +9,16 @@ "style": { "navigationBarTitleText": "个人中心" } + }, { + "path": "pages/weddingCelebration/weddingCelebration", + "style": { + "navigationBarTitleText": "婚庆服务" + } + }, { + "path": "pages/login/login", + "style": { + "navigationBarTitleText": "登录" + } }], "globalStyle": { "navigationBarTextStyle": "black", diff --git a/pages/login/login.vue b/pages/login/login.vue index 24951bb..c483469 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -1,170 +1,128 @@ - \ No newline at end of file diff --git a/pages/payment/payment.vue b/pages/payment/payment.vue index 2ed7c56..2a0350e 100644 --- a/pages/payment/payment.vue +++ b/pages/payment/payment.vue @@ -3,8 +3,17 @@ - + + + + + + #95 + + + + @@ -23,11 +32,15 @@ - 提交订单 + - + + + + @@ -39,25 +52,60 @@ reactive, ref } from "vue"; - import test from '../../component/test.vue' + import PrivacyAgreementPoup from "../../components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue"; + import api from '@/utils/api.js' const form = reactive({ money: '' }) const index = ref(0) + const showPrivacy = ref() + const content = reactive([{ + iconPath: '/static/payment/wedding-celebration.png', + text: '婚庆服务', + active: false, + path : '/pages/weddingCelebration/weddingCelebration' + } + ]) + const horizontal = ref('right') + const vertical = ref('bottom') + const direction = ref('vertical') //生命周期 onShow(() => { - if (wx.onNeedPrivacyAuthorization) { - console.log('onNeedPrivacyAuthorization'); - wx.onNeedPrivacyAuthorization(resolve => { - console.log('onNeedPrivacyAuthorization'); - // 需要用户同意隐私授权时 - // 弹出开发者自定义的隐私授权弹窗 - // this.resolvePrivacyAuthorization = resolve - // showPrivacy.init(resolve) - }) - } + // if (wx.onNeedPrivacyAuthorization) { + // console.log('onNeedPrivacyAuthorization'); + // wx.onNeedPrivacyAuthorization(resolve => { + // console.log('onNeedPrivacyAuthorization'); + // this.resolvePrivacyAuthorization = resolve + // showPrivacy.value.init(resolve) + // }) + // } + + // uni.login({ + // success(res) { + // console.log(res); + // if (res.errMsg != "login:ok") { + // return + // } + + // api('wxLogin', { + // code: res.code + // }, res => { + // if (res.code != 200) { + // return + // } + + // // state.userInfo = res.result.userInfo + // // uni.setStorageSync('token', res.result.token) + + // if (state.userInfo) { + + // } + // }) + // } + // }) + }) //用户选择加油金额 @@ -70,6 +118,13 @@ function focus() { } + + //用户点击了悬浮按钮 + function clickMenu({ item }){ + uni.navigateTo({ + url: item.path + }) + } \ No newline at end of file diff --git a/showLogin/showLogin.vue b/showLogin/showLogin.vue new file mode 100644 index 0000000..9ed4875 --- /dev/null +++ b/showLogin/showLogin.vue @@ -0,0 +1,80 @@ + + + + + \ No newline at end of file diff --git a/static/payment/wedding-celebration.png b/static/payment/wedding-celebration.png new file mode 100644 index 0000000000000000000000000000000000000000..b8cdb1495c9b06d0e6f005eaf2350ce2f9ea2245 GIT binary patch literal 9227 zcmeHNWn5I@vp&1jBF#z&2#5koE+I%Gr8I(cgMc(ri-atSgn+1Ym#}nqE-4MtOG~pf zNY`EO|9-vS?}z*8ob&s==Z%?no|$K6LN(N0kldlW0{{St;!8PA003cMK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xxKEs`>*i#tb8jPI0)Ojby~x^IY!lC|1#T2}9ALHYNU2hQN(oJFAwTUzy-Q+Z||25242Fa>T{86OAT@617&mOj0& z_~h8~R-n=DuEf{-zl;NAwcM`}@8i{P4&?9!>Yxma=OW~R%%a4SthTGpxt|Np^0CD@ zjpe5n#!B?;l#5PrJ7K1G)ovnKz73|Xn5`rsc&V3{_ct!DzR!M~eG&GwKRYM$DOWFb za&B~Qs*2ogj+b*|hYE7C{)c+OAHAra6zP5%C~W41L!_7-jmMK>`wdIRcj!CVjs?2u zHe=1O_?C9LUp}^mNoriz0wu4kAM`WV~(7b%3_kdZd;2O_3v!{Hq zx`Op`HyGiTXcho8k=_U&8l-jFdN + + + + + + + {{ item.text }} + + + + + + + + + + + + + + diff --git a/uni_modules/uni-fab/package.json b/uni_modules/uni-fab/package.json new file mode 100644 index 0000000..18c0810 --- /dev/null +++ b/uni_modules/uni-fab/package.json @@ -0,0 +1,84 @@ +{ + "id": "uni-fab", + "displayName": "uni-fab 悬浮按钮", + "version": "1.2.5", + "description": "悬浮按钮 fab button ,点击可展开一个图标按钮菜单。", + "keywords": [ + "uni-ui", + "uniui", + "按钮", + "悬浮按钮", + "fab" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, +"dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": ["uni-scss","uni-icons"], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "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" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uni_modules/uni-fab/readme.md b/uni_modules/uni-fab/readme.md new file mode 100644 index 0000000..9a444e8 --- /dev/null +++ b/uni_modules/uni-fab/readme.md @@ -0,0 +1,9 @@ +## Fab 悬浮按钮 +> **组件名:uni-fab** +> 代码块: `uFab` + + +点击可展开一个图形按钮菜单 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-fab) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/uni_modules/uni-popup/changelog.md b/uni_modules/uni-popup/changelog.md new file mode 100644 index 0000000..decd775 --- /dev/null +++ b/uni_modules/uni-popup/changelog.md @@ -0,0 +1,84 @@ +## 1.9.1(2024-04-02) +- 修复 uni-popup-dialog vue3下使用value无法进行绑定的bug(双向绑定兼容旧写法) +## 1.9.0(2024-03-28) +- 修复 uni-popup-dialog 双向绑定时初始化逻辑修正 +## 1.8.9(2024-03-20) +- 修复 uni-popup-dialog 数据输入时修正为双向绑定 +## 1.8.8(2024-02-20) +- 修复 uni-popup 在微信小程序下出现文字向上闪动的bug +## 1.8.7(2024-02-02) +- 新增 uni-popup-dialog 新增属性focus:input模式下,是否自动自动聚焦 +## 1.8.6(2024-01-30) +- 新增 uni-popup-dialog 新增属性maxLength:限制输入框字数 +## 1.8.5(2024-01-26) +- 新增 uni-popup-dialog 新增属性showClose:控制关闭按钮的显示 +## 1.8.4(2023-11-15) +- 新增 uni-popup 支持uni-app-x 注意暂时仅支持 `maskClick` `@open` `@close` +## 1.8.3(2023-04-17) +- 修复 uni-popup 重复打开时的 bug +## 1.8.2(2023-02-02) +- uni-popup-dialog 组件新增 inputType 属性 +## 1.8.1(2022-12-01) +- 修复 nvue 下 v-show 报错 +## 1.8.0(2022-11-29) +- 优化 主题样式 +## 1.7.9(2022-04-02) +- 修复 弹出层内部无法滚动的bug +## 1.7.8(2022-03-28) +- 修复 小程序中高度错误的bug +## 1.7.7(2022-03-17) +- 修复 快速调用open出现问题的Bug +## 1.7.6(2022-02-14) +- 修复 safeArea 属性不能设置为false的bug +## 1.7.5(2022-01-19) +- 修复 isMaskClick 失效的bug +## 1.7.4(2022-01-19) +- 新增 cancelText \ confirmText 属性 ,可自定义文本 +- 新增 maskBackgroundColor 属性 ,可以修改蒙版颜色 +- 优化 maskClick属性 更新为 isMaskClick ,解决微信小程序警告的问题 +## 1.7.3(2022-01-13) +- 修复 设置 safeArea 属性不生效的bug +## 1.7.2(2021-11-26) +- 优化 组件示例 +## 1.7.1(2021-11-26) +- 修复 vuedoc 文字错误 +## 1.7.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-popup](https://uniapp.dcloud.io/component/uniui/uni-popup) +## 1.6.2(2021-08-24) +- 新增 支持国际化 +## 1.6.1(2021-07-30) +- 优化 vue3下事件警告的问题 +## 1.6.0(2021-07-13) +- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.5.0(2021-06-23) +- 新增 mask-click 遮罩层点击事件 +## 1.4.5(2021-06-22) +- 修复 nvue 平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug +## 1.4.4(2021-06-18) +- 修复 H5平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug +## 1.4.3(2021-06-08) +- 修复 错误的 watch 字段 +- 修复 safeArea 属性不生效的问题 +- 修复 点击内容,再点击遮罩无法关闭的Bug +## 1.4.2(2021-05-12) +- 新增 组件示例地址 +## 1.4.1(2021-04-29) +- 修复 组件内放置 input 、textarea 组件,无法聚焦的问题 +## 1.4.0 (2021-04-29) +- 新增 type 属性的 left\right 值,支持左右弹出 +- 新增 open(String:type) 方法参数 ,可以省略 type 属性 ,直接传入类型打开指定弹窗 +- 新增 backgroundColor 属性,可定义主窗口背景色,默认不显示背景色 +- 新增 safeArea 属性,是否适配底部安全区 +- 修复 App\h5\微信小程序底部安全区占位不对的Bug +- 修复 App 端弹出等待的Bug +- 优化 提升低配设备性能,优化动画卡顿问题 +- 优化 更简单的组件自定义方式 +## 1.2.9(2021-02-05) +- 优化 组件引用关系,通过uni_modules引用组件 +## 1.2.8(2021-02-05) +- 调整为uni_modules目录规范 +## 1.2.7(2021-02-05) +- 调整为uni_modules目录规范 +- 新增 支持 PC 端 +- 新增 uni-popup-message 、uni-popup-dialog扩展组件支持 PC 端 diff --git a/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js b/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js new file mode 100644 index 0000000..6ef26a2 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js @@ -0,0 +1,45 @@ +// #ifdef H5 +export default { + name: 'Keypress', + props: { + disable: { + type: Boolean, + default: false + } + }, + mounted () { + const keyNames = { + esc: ['Esc', 'Escape'], + tab: 'Tab', + enter: 'Enter', + space: [' ', 'Spacebar'], + up: ['Up', 'ArrowUp'], + left: ['Left', 'ArrowLeft'], + right: ['Right', 'ArrowRight'], + down: ['Down', 'ArrowDown'], + delete: ['Backspace', 'Delete', 'Del'] + } + const listener = ($event) => { + if (this.disable) { + return + } + const keyName = Object.keys(keyNames).find(key => { + const keyName = $event.key + const value = keyNames[key] + return value === keyName || (Array.isArray(value) && value.includes(keyName)) + }) + if (keyName) { + // 避免和其他按键事件冲突 + setTimeout(() => { + this.$emit(keyName, {}) + }, 0) + } + } + document.addEventListener('keyup', listener) + this.$once('hook:beforeDestroy', () => { + document.removeEventListener('keyup', listener) + }) + }, + render: () => {} +} +// #endif diff --git a/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue new file mode 100644 index 0000000..08707d4 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue @@ -0,0 +1,316 @@ + + + + + diff --git a/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue b/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue new file mode 100644 index 0000000..91370a8 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue @@ -0,0 +1,143 @@ + + + + diff --git a/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue b/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue new file mode 100644 index 0000000..f7e667c --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue @@ -0,0 +1,187 @@ + + + + diff --git a/uni_modules/uni-popup/components/uni-popup/i18n/en.json b/uni_modules/uni-popup/components/uni-popup/i18n/en.json new file mode 100644 index 0000000..7f1bd06 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/i18n/en.json @@ -0,0 +1,7 @@ +{ + "uni-popup.cancel": "cancel", + "uni-popup.ok": "ok", + "uni-popup.placeholder": "pleace enter", + "uni-popup.title": "Hint", + "uni-popup.shareTitle": "Share to" +} diff --git a/uni_modules/uni-popup/components/uni-popup/i18n/index.js b/uni_modules/uni-popup/components/uni-popup/i18n/index.js new file mode 100644 index 0000000..de7509c --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/i18n/index.js @@ -0,0 +1,8 @@ +import en from './en.json' +import zhHans from './zh-Hans.json' +import zhHant from './zh-Hant.json' +export default { + en, + 'zh-Hans': zhHans, + 'zh-Hant': zhHant +} diff --git a/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json b/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json new file mode 100644 index 0000000..5e3003c --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json @@ -0,0 +1,7 @@ +{ + "uni-popup.cancel": "取消", + "uni-popup.ok": "确定", + "uni-popup.placeholder": "请输入", + "uni-popup.title": "提示", + "uni-popup.shareTitle": "分享到" +} diff --git a/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json b/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json new file mode 100644 index 0000000..13e39eb --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json @@ -0,0 +1,7 @@ +{ + "uni-popup.cancel": "取消", + "uni-popup.ok": "確定", + "uni-popup.placeholder": "請輸入", + "uni-popup.title": "提示", + "uni-popup.shareTitle": "分享到" +} diff --git a/uni_modules/uni-popup/components/uni-popup/keypress.js b/uni_modules/uni-popup/components/uni-popup/keypress.js new file mode 100644 index 0000000..62dda46 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/keypress.js @@ -0,0 +1,45 @@ +// #ifdef H5 +export default { + name: 'Keypress', + props: { + disable: { + type: Boolean, + default: false + } + }, + mounted () { + const keyNames = { + esc: ['Esc', 'Escape'], + tab: 'Tab', + enter: 'Enter', + space: [' ', 'Spacebar'], + up: ['Up', 'ArrowUp'], + left: ['Left', 'ArrowLeft'], + right: ['Right', 'ArrowRight'], + down: ['Down', 'ArrowDown'], + delete: ['Backspace', 'Delete', 'Del'] + } + const listener = ($event) => { + if (this.disable) { + return + } + const keyName = Object.keys(keyNames).find(key => { + const keyName = $event.key + const value = keyNames[key] + return value === keyName || (Array.isArray(value) && value.includes(keyName)) + }) + if (keyName) { + // 避免和其他按键事件冲突 + setTimeout(() => { + this.$emit(keyName, {}) + }, 0) + } + } + document.addEventListener('keyup', listener) + // this.$once('hook:beforeDestroy', () => { + // document.removeEventListener('keyup', listener) + // }) + }, + render: () => {} +} +// #endif diff --git a/uni_modules/uni-popup/components/uni-popup/popup.js b/uni_modules/uni-popup/components/uni-popup/popup.js new file mode 100644 index 0000000..c4e5781 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/popup.js @@ -0,0 +1,26 @@ + +export default { + data() { + return { + + } + }, + created(){ + this.popup = this.getParent() + }, + methods:{ + /** + * 获取父元素实例 + */ + getParent(name = 'uniPopup') { + let parent = this.$parent; + let parentName = parent.$options.name; + while (parentName !== name) { + parent = parent.$parent; + if (!parent) return false + parentName = parent.$options.name; + } + return parent; + }, + } +} diff --git a/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue b/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue new file mode 100644 index 0000000..5eb8d5b --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue @@ -0,0 +1,90 @@ + + + + + \ No newline at end of file diff --git a/uni_modules/uni-popup/components/uni-popup/uni-popup.vue b/uni_modules/uni-popup/components/uni-popup/uni-popup.vue new file mode 100644 index 0000000..8349e99 --- /dev/null +++ b/uni_modules/uni-popup/components/uni-popup/uni-popup.vue @@ -0,0 +1,503 @@ + + + + diff --git a/uni_modules/uni-popup/package.json b/uni_modules/uni-popup/package.json new file mode 100644 index 0000000..3cfa384 --- /dev/null +++ b/uni_modules/uni-popup/package.json @@ -0,0 +1,88 @@ +{ + "id": "uni-popup", + "displayName": "uni-popup 弹出层", + "version": "1.9.1", + "description": " Popup 组件,提供常用的弹层", + "keywords": [ + "uni-ui", + "弹出层", + "弹窗", + "popup", + "弹框" + ], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": [ + "uni-scss", + "uni-transition" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y", + "alipay": "n" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "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" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} diff --git a/uni_modules/uni-popup/readme.md b/uni_modules/uni-popup/readme.md new file mode 100644 index 0000000..fdad4b3 --- /dev/null +++ b/uni_modules/uni-popup/readme.md @@ -0,0 +1,17 @@ + + +## Popup 弹出层 +> **组件名:uni-popup** +> 代码块: `uPopup` +> 关联组件:`uni-transition` + + +弹出层组件,在应用中弹出一个消息提示窗口、提示框等 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-popup) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 + + + + + diff --git a/uni_modules/uni-transition/changelog.md b/uni_modules/uni-transition/changelog.md new file mode 100644 index 0000000..faaf336 --- /dev/null +++ b/uni_modules/uni-transition/changelog.md @@ -0,0 +1,24 @@ +## 1.3.3(2024-04-23) +- 修复 当元素会受变量影响自动隐藏的bug +## 1.3.2(2023-05-04) +- 修复 NVUE 平台报错的问题 +## 1.3.1(2021-11-23) +- 修复 init 方法初始化问题 +## 1.3.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-transition](https://uniapp.dcloud.io/component/uniui/uni-transition) +## 1.2.1(2021-09-27) +- 修复 init 方法不生效的 Bug +## 1.2.0(2021-07-30) +- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) +## 1.1.1(2021-05-12) +- 新增 示例地址 +- 修复 示例项目缺少组件的 Bug +## 1.1.0(2021-04-22) +- 新增 通过方法自定义动画 +- 新增 custom-class 非 NVUE 平台支持自定义 class 定制样式 +- 优化 动画触发逻辑,使动画更流畅 +- 优化 支持单独的动画类型 +- 优化 文档示例 +## 1.0.2(2021-02-05) +- 调整为 uni_modules 目录规范 diff --git a/uni_modules/uni-transition/components/uni-transition/createAnimation.js b/uni_modules/uni-transition/components/uni-transition/createAnimation.js new file mode 100644 index 0000000..8f89b18 --- /dev/null +++ b/uni_modules/uni-transition/components/uni-transition/createAnimation.js @@ -0,0 +1,131 @@ +// const defaultOption = { +// duration: 300, +// timingFunction: 'linear', +// delay: 0, +// transformOrigin: '50% 50% 0' +// } +// #ifdef APP-NVUE +const nvueAnimation = uni.requireNativePlugin('animation') +// #endif +class MPAnimation { + constructor(options, _this) { + this.options = options + // 在iOS10+QQ小程序平台下,传给原生的对象一定是个普通对象而不是Proxy对象,否则会报parameter should be Object instead of ProxyObject的错误 + this.animation = uni.createAnimation({ + ...options + }) + this.currentStepAnimates = {} + this.next = 0 + this.$ = _this + + } + + _nvuePushAnimates(type, args) { + let aniObj = this.currentStepAnimates[this.next] + let styles = {} + if (!aniObj) { + styles = { + styles: {}, + config: {} + } + } else { + styles = aniObj + } + if (animateTypes1.includes(type)) { + if (!styles.styles.transform) { + styles.styles.transform = '' + } + let unit = '' + if(type === 'rotate'){ + unit = 'deg' + } + styles.styles.transform += `${type}(${args+unit}) ` + } else { + styles.styles[type] = `${args}` + } + this.currentStepAnimates[this.next] = styles + } + _animateRun(styles = {}, config = {}) { + let ref = this.$.$refs['ani'].ref + if (!ref) return + return new Promise((resolve, reject) => { + nvueAnimation.transition(ref, { + styles, + ...config + }, res => { + resolve() + }) + }) + } + + _nvueNextAnimate(animates, step = 0, fn) { + let obj = animates[step] + if (obj) { + let { + styles, + config + } = obj + this._animateRun(styles, config).then(() => { + step += 1 + this._nvueNextAnimate(animates, step, fn) + }) + } else { + this.currentStepAnimates = {} + typeof fn === 'function' && fn() + this.isEnd = true + } + } + + step(config = {}) { + // #ifndef APP-NVUE + this.animation.step(config) + // #endif + // #ifdef APP-NVUE + this.currentStepAnimates[this.next].config = Object.assign({}, this.options, config) + this.currentStepAnimates[this.next].styles.transformOrigin = this.currentStepAnimates[this.next].config.transformOrigin + this.next++ + // #endif + return this + } + + run(fn) { + // #ifndef APP-NVUE + this.$.animationData = this.animation.export() + this.$.timer = setTimeout(() => { + typeof fn === 'function' && fn() + }, this.$.durationTime) + // #endif + // #ifdef APP-NVUE + this.isEnd = false + let ref = this.$.$refs['ani'] && this.$.$refs['ani'].ref + if(!ref) return + this._nvueNextAnimate(this.currentStepAnimates, 0, fn) + this.next = 0 + // #endif + } +} + + +const animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d', + 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY', + 'translateZ' +] +const animateTypes2 = ['opacity', 'backgroundColor'] +const animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'] +animateTypes1.concat(animateTypes2, animateTypes3).forEach(type => { + MPAnimation.prototype[type] = function(...args) { + // #ifndef APP-NVUE + this.animation[type](...args) + // #endif + // #ifdef APP-NVUE + this._nvuePushAnimates(type, args) + // #endif + return this + } +}) + +export function createAnimation(option, _this) { + if(!_this) return + clearTimeout(_this.timer) + return new MPAnimation(option, _this) +} diff --git a/uni_modules/uni-transition/components/uni-transition/uni-transition.vue b/uni_modules/uni-transition/components/uni-transition/uni-transition.vue new file mode 100644 index 0000000..f3ddd1f --- /dev/null +++ b/uni_modules/uni-transition/components/uni-transition/uni-transition.vue @@ -0,0 +1,286 @@ + + + + + diff --git a/uni_modules/uni-transition/package.json b/uni_modules/uni-transition/package.json new file mode 100644 index 0000000..d5c20e1 --- /dev/null +++ b/uni_modules/uni-transition/package.json @@ -0,0 +1,85 @@ +{ + "id": "uni-transition", + "displayName": "uni-transition 过渡动画", + "version": "1.3.3", + "description": "元素的简单过渡动画", + "keywords": [ + "uni-ui", + "uniui", + "动画", + "过渡", + "过渡动画" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, +"dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue" + }, + "uni_modules": { + "dependencies": ["uni-scss"], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y", + "alipay": "n" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "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" + }, + "快应用": { + "华为": "u", + "联盟": "u" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-transition/readme.md b/uni_modules/uni-transition/readme.md new file mode 100644 index 0000000..2f8a77e --- /dev/null +++ b/uni_modules/uni-transition/readme.md @@ -0,0 +1,11 @@ + + +## Transition 过渡动画 +> **组件名:uni-transition** +> 代码块: `uTransition` + + +元素过渡动画 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-transition) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/utils/api.js b/utils/api.js new file mode 100644 index 0000000..43ce0b2 --- /dev/null +++ b/utils/api.js @@ -0,0 +1,59 @@ +import http from './http.js' + +const config = { + // 示例 + // wxLogin : {url : '/api/wxLogin', method : 'POST', + // auth : false, showLoading : true, loadingTitle : '加载中...', + // limit : 1000 + // }, + + wxLogin : {url : '/api/wxLogin', method : 'GET', limit : 500}, +} + + + +export function api(key, data, callback, loadingTitle){ + let req = config[key] + + if (!req) { + console.error('无效key' + key); + return + } + + if(typeof callback == 'string'){ + loadingTitle = callback + } + + if(typeof data == 'function'){ + callback = data + data = {} + } + + // 接口限流 + if(req.limit){ + let storageKey = 'limit:' + req.url + let storage = uni.getStorageSync(storageKey) + if(storage && new Date().getTime() - parseInt(storage) < req.limit){ + return + } + uni.setStorageSync(storageKey, new Date().getTime()) + } + + //必须登录 + if (req.auth) { + if (!uni.getStorageSync('token')) { + uni.navigateTo({ + url: '/pages/login/mobile' + }) + console.error('需要登录') + return + } + } + + http.http(req.url, data, callback, req.method, + loadingTitle || req.showLoading, loadingTitle || req.loadingTitle) +} + + + +export default api \ No newline at end of file diff --git a/utils/http.js b/utils/http.js new file mode 100644 index 0000000..ef01852 --- /dev/null +++ b/utils/http.js @@ -0,0 +1,144 @@ + +function http(uri, data, callback, method = 'GET', showLoading, title) { + + if (showLoading) { + uni.showLoading({ + title: title || '正在提交...' + }); + } + + uni.request({ + url: 'http://www.baidu.com' + uri, + data: enhanceData(data), + method: method, + header: { + // 'X-Access-Token': localStorage.getItem('token'), + 'Content-Type': method == 'POST' ? 'application/x-www-form-urlencoded' : 'application/json' + }, + success: (res) => { + + if (showLoading) { + uni.hideLoading(); + } + + if (res.statusCode == 401) { + localStorage.removeItem('token') + localStorage.removeItem('userInfo') + console.error('登录过期'); + uni.navigateTo({ + url: '/pages/login/login' + }) + } + + //后端接口token出现问题 + if (res.data && res.data.code == 500 && res.data.message == '操作失败,token非法无效!') { + localStorage.removeItem('token') + localStorage.removeItem('userInfo') + console.error('登录过期'); + uni.navigateTo({ + url: '/pages/login/login' + }) + } + + if (res.statusCode == 200 && res.data.code != 200) { + uni.showToast({ + mask: true, + duration: 1000, + title: res.data.message, + }); + } + + callback(res.data) + }, + + fail: () => { + uni.showLoading({}) + setTimeout(() => { + uni.hideLoading() + uni.showToast({ + icon: "none", + title: "网络异常" + }) + }, 3000) + + if (showLoading) { + uni.hideLoading(); + } + } + }); +} + +function deleted(uri, data, callback) { + http(uri, data, callback, 'DELETE') +} + +function post(uri, data, callback) { + http(uri, data, callback, 'POST') +} + +function get(uri, data, callback) { + http(uri, data, callback, 'GET') +} + +function enhanceData(data) { + const userid = uni.getStorageSync("userid") + if (!data) { + data = {} + } + if (userid) { + data.userid = userid + } + return data +} + + + + + +function sync(method, uri, data) { + return new Promise((resolve, reject) => { + uni.request({ + url: uri, + data: data, + method: method, + header: { + 'auth': '1AS9F1HPC4FBC9EN00J7KX2L5RJ99XHZ' + }, + success: (res) => { + resolve(res.data) + }, + fail: (err) => { + reject(err); + } + }) + }) +} + + +let cache = null + +function async (method, uri, data) { + const promise = sync(method, uri, data).then(res => { + cache = res + }).catch(err => { + + }) +} + + +function syncHttp(uri, data, method = 'GET') { + async (method, uri, data) +} + + + + + + +export default { + http: http, + delete: deleted, + post: post, + get: get, + syncHttp: syncHttp +} \ No newline at end of file