diff --git a/App.vue b/App.vue
index d14a8c4..c3adbac 100644
--- a/App.vue
+++ b/App.vue
@@ -1,6 +1,6 @@
@@ -87,4 +92,4 @@
.li-top-border {
border-top: solid 1px #eaeaea;
}
-
+
\ No newline at end of file
diff --git a/pages/login/index.vue b/pages/login/index.vue
index efb15d2..7d72950 100644
--- a/pages/login/index.vue
+++ b/pages/login/index.vue
@@ -43,14 +43,16 @@
《隐私政策》
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-atom.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-atom.vue
new file mode 100644
index 0000000..3b3b75e
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-atom.vue
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-bounce.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-bounce.vue
new file mode 100644
index 0000000..860d23d
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-bounce.vue
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-circle.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-circle.vue
new file mode 100644
index 0000000..958bb14
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-circle.vue
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-equal.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-equal.vue
new file mode 100644
index 0000000..b68b86c
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-equal.vue
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-eyes.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-eyes.vue
new file mode 100644
index 0000000..f7a18d1
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-eyes.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-gear.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-gear.vue
new file mode 100644
index 0000000..19ce873
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-gear.vue
@@ -0,0 +1,118 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-love.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-love.vue
new file mode 100644
index 0000000..9b5e6cd
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-love.vue
@@ -0,0 +1,201 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-pulse.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-pulse.vue
new file mode 100644
index 0000000..9c32c7e
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-pulse.vue
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-radar.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-radar.vue
new file mode 100644
index 0000000..ebafa85
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-radar.vue
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-sun.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-sun.vue
new file mode 100644
index 0000000..ed079d8
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-sun.vue
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-surround.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-surround.vue
new file mode 100644
index 0000000..0e47a11
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-surround.vue
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-sword.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-sword.vue
new file mode 100644
index 0000000..8efb848
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-sword.vue
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/static/loading-wobble.vue b/uni_modules/zero-loading/components/zero-loading/static/loading-wobble.vue
new file mode 100644
index 0000000..d8f6283
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/static/loading-wobble.vue
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/components/zero-loading/zero-loading.vue b/uni_modules/zero-loading/components/zero-loading/zero-loading.vue
new file mode 100644
index 0000000..ff83c7a
--- /dev/null
+++ b/uni_modules/zero-loading/components/zero-loading/zero-loading.vue
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ text }}
+
+
+
+
+
+
+
diff --git a/uni_modules/zero-loading/package.json b/uni_modules/zero-loading/package.json
new file mode 100644
index 0000000..0092ae7
--- /dev/null
+++ b/uni_modules/zero-loading/package.json
@@ -0,0 +1,81 @@
+{
+ "id": "zero-loading",
+ "displayName": "zero-loading(加载动画)",
+ "version": "1.4.1",
+ "description": "纯css加载动画, 一个标签元素即可实现炫酷的全屏loading效果,支持vue2,vue3",
+ "keywords": [
+ "loading",
+ "加载动画",
+ "css动画",
+ "加载"
+],
+ "repository": "",
+ "engines": {
+ "HBuilderX": "^3.1.0"
+ },
+"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": "u",
+ "app-nvue": "u"
+ },
+ "H5-mobile": {
+ "Safari": "y",
+ "Android Browser": "y",
+ "微信浏览器(Android)": "y",
+ "QQ浏览器(Android)": "y"
+ },
+ "H5-pc": {
+ "Chrome": "y",
+ "IE": "u",
+ "Edge": "y",
+ "Firefox": "y",
+ "Safari": "y"
+ },
+ "小程序": {
+ "微信": "y",
+ "阿里": "u",
+ "百度": "u",
+ "字节跳动": "u",
+ "QQ": "u"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/uni_modules/zero-loading/readme.md b/uni_modules/zero-loading/readme.md
new file mode 100644
index 0000000..5b3651f
--- /dev/null
+++ b/uni_modules/zero-loading/readme.md
@@ -0,0 +1,67 @@
+# zero-loading
+
+> 仅测试于 vue2, vue3, 微信小程序. 其他平台自行测试
+
+## 使用方法
+
+导入 `uni_modules` 后直接使用即可
+
+提供多种加载动画类型,传入 type 改变 loading 样式,不传默认 circle
+
+### 全屏使用
+
+```html
+
+```
+
+### 局部使用
+
+**父元素的 `position` 记得改为 `relative` 不然可能影响效果**
+
+```html
+
+```
+
+## 参数说明
+
+| 参数 | 类型 | 默认值 | 描述 |
+| ----------- | -------- | --------- | ---------------------------------------------- |
+| type | String | atom | 样式 |
+| position | String | fixed | 定位方式 |
+| zIndex | Number | 9 | |
+| mask | Boolean | false | 是否需要遮罩 (默认为全屏遮罩,背景色默认为黑色) |
+| maskOpacity | Number | 0.1 | 遮罩透明度 |
+| maskMini | Boolean | false | 传入 true 时,使用小遮罩 |
+| maskDark | Boolean | true | 传入 false 时,遮罩背景色为白色 |
+| color | String | #0396FF | 自定义颜色,仅部分支持 |
+| showText | showText | false | 是否显示文字 |
+| text | String | 加载中... | 文本内容 |
+| textSize | String | 28rpx | 文字大小 |
+| textColor | String | #333333 | 文字颜色 |
+| textGap | String | 40rpx | 文字与 loading 动画的间距 |
+
+### type 可选值:
+
+| type 值 | 描述 |
+| -------- | ----------------- |
+| equal | 等边 (自定义颜色) |
+| wobble | 摇摆 (自定义颜色) |
+| annulus | 圆环 (自定义颜色) |
+| sword | 剑气 (自定义颜色) |
+| atom | 原子 (自定义颜色) |
+| pulse | 脉冲 (自定义颜色) |
+| circle | 圆圈 (自定义颜色) |
+| eyes | 眼睛 |
+| surround | 环绕 |
+| bounce | 弹跳 |
+| radar | 雷达 |
+| gear | 齿轮 |
+| love | 爱心 |
+| sun | 太阳 |
+
+插件预览:
+
+
+> 小程序搜索: zerojs 零技术
+
+> 预览的小程序不一定能及时更新当前插件
diff --git a/unocss/a-hua-unocss/index.scss b/unocss/a-hua-unocss/index.scss
index 32723e8..4f42636 100644
--- a/unocss/a-hua-unocss/index.scss
+++ b/unocss/a-hua-unocss/index.scss
@@ -2,6 +2,7 @@
.li-items-center{align-items:center}
.items-center{align-items:center}
.li-justify-center{justify-content:center}
+.justify-end{justify-content:end}
.justify-center{justify-content:center}
.li-justify-between{justify-content:space-between}
.justify-between{justify-content:space-between}
@@ -18,7 +19,6 @@
.li-ml-22{margin-left:22rpx}
.li-ml-25{margin-left:25rpx}
.li-ml-35{margin-left:35rpx}
-.li-mr-25{margin-right:25rpx}
.li-mr-5{margin-right:5rpx}
.li-mt-10{margin-top:10rpx}
.li-mt-12{margin-top:12rpx}
@@ -43,7 +43,6 @@
.li-text-30{font-size:30rpx}
.li-text-343333-color{color:rgb(52,51,51)}
.li-text-43{font-size:43rpx}
-.li-text-48{font-size:48rpx}
.li-text-AFB2B8-color{color:rgb(175,178,184)}
.li-text-B1B0B0-color{color:rgb(177,176,176)}
.li-text-F42429-color{color:rgb(244,36,41)}
@@ -52,7 +51,80 @@
.li-w-58{width:58rpx}
.li-w-full-70{width:70%}
.li-w-full-88{width:88%}
-.pt-10{padding-top:10rpx}
+.li-h-100{height:100rpx}
+.li-ml-20{margin-left:20rpx}
+.li-ml-200{margin-left:200rpx}
+.li-ml-30{margin-left:30rpx}
+.li-mr-10{margin-right:10rpx}
+.li-mr-30{margin-right:30rpx}
+.li-pt-2{padding-top:2rpx}
+.li-py-20{padding-top:20rpx;padding-bottom:20rpx}
+.li-rd-full-50{border-radius:50%}
+.li-text-25{font-size:25rpx}
+.li-text-35{font-size:35rpx}
+.li-text-38{font-size:38rpx}
+.li-text-42{font-size:42rpx}
+.li-text-46{font-size:46rpx}
+.li-w-100{width:100rpx}
+.li-w-full-80{width:80%}
+.bg-FFFFFF{background-color:rgb(255,255,255)}
+.bg-f9f9f9{background-color:rgb(249,249,249)}
+.border-4-white{border-style:solid;border-color:rgb(255,255,255);border-width:4rpx}
+.li-h-240{height:240rpx}
+.li-h-250{height:250rpx}
+.li-h-50{height:50rpx}
+.li-h-60{height:60rpx}
+.li-items-end{align-items:end}
+.li-justify-start{justify-content:start}
+.li-mb-2{margin-bottom:2rpx}
+.li-ml-4{margin-left:4rpx}
+.li-ml-50{margin-left:50rpx}
+.li-mr-20{margin-right:20rpx}
+.li-mr-50{margin-right:50rpx}
+.li-mt-26{margin-top:26rpx}
+.li-mt-6{margin-top:6rpx}
+.li-mt-60{margin-top:60rpx}
+.li-mx-20{margin-left:20rpx;margin-right:20rpx}
+.li-mx-40{margin-left:40rpx;margin-right:40rpx}
+.li-pb-10{padding-bottom:10rpx}
+.li-pb-14{padding-bottom:14rpx}
+.li-pb-20{padding-bottom:20rpx}
+.li-pt-20{padding-top:20rpx}
+.li-pt-8{padding-top:8rpx}
+.li-rd-20{border-radius:20rpx}
+.li-rd-tl-30-important{border-top-left-radius:30rpx !important}
+.li-rd-tr-30-important{border-top-right-radius:30rpx !important}
+.li-text-000000-color{color:rgb(0,0,0)}
+.li-text-19171B-color{color:rgb(25,23,27)}
+.li-text-20{font-size:20rpx}
+.li-text-32{font-size:32rpx}
+.li-text-34{font-size:34rpx}
+.li-text-706e70-color{color:rgb(112,110,112)}
+.li-text-B2B2B2-color{color:rgb(178,178,178)}
+.li-text-BBBDDA-color{color:rgb(187,189,218)}
+.li-text-F2F7FD-color{color:rgb(242,247,253)}
+.li-text-F8C883-color{color:rgb(248,200,131)}
+.li-text-FFFFFF-color{color:rgb(255,255,255)}
+.li-text-b1bbc7-color{color:rgb(177,187,199)}
+.li-w-240{width:240rpx}
+.li-w-50{width:50rpx}
+.li-w-60{width:60rpx}
+.li-w-full-94{width:94%}
+.li-mb-25{margin-bottom:25rpx}
+.li-mb-8{margin-bottom:8rpx}
+.li-ml-15{margin-left:15rpx}
+.li-mr-6{margin-right:6rpx}
+.li-p-15{padding:15rpx}
+.li-pb-15{padding-bottom:15rpx}
+.li-pb-30{padding-bottom:30rpx}
+.li-pt-25{padding-top:25rpx}
+.li-text-009aff-color{color:rgb(0,154,255)}
+.li-text-55{font-size:55rpx}
+.li-text-70{font-size:70rpx}
+.li-text-999-color{color:rgb(153,153,153)}
+.li-text-9a9a9a-color{color:rgb(154,154,154)}
+.li-w-full-90{width:90%}
+.li-w-full-92{width:92%}
.li-font-550{font-weight:550}
.li-h-68{height:68rpx}
.li-mt-100{margin-top:100rpx}
@@ -62,12 +134,50 @@
.li-mx-10{margin-left:10rpx;margin-right:10rpx}
.li-pt-270{padding-top:270rpx}
.li-rd-40{border-radius:40rpx}
-.li-text-000000-color{color:rgb(0,0,0)}
.li-text-2EA1EA-color{color:rgb(46,161,234)}
-.li-text-38{font-size:38rpx}
.li-text-a5a5a5-color{color:rgb(165,165,165)}
.li-w-150{width:150rpx}
.li-w-420{width:420rpx}
-.li-w-full-80{width:80%}
.li-w-full-85{width:85%}
-.li-w-full-90{width:90%}
+.li-font-400{font-weight:400}
+.li-m-30{margin:30rpx}
+.li-text-595959-color{color:rgb(89,89,89)}
+
+.li-bottom-0{bottom:0}
+.li-fixed{position:fixed}
+.li-h-110{height:110rpx}
+.li-items-start{align-items:start}
+.li-mb-12{margin-bottom:12rpx}
+.li-mb-20{margin-bottom:20rpx}
+.li-mr-12{margin-right:12rpx}
+.li-mr-3{margin-right:3rpx}
+.li-mt-40{margin-top:40rpx}
+.li-pb-25{padding-bottom:25rpx}
+.li-pl-20{padding-left:20rpx}
+.li-pl-30{padding-left:30rpx}
+.li-pr-30{padding-right:30rpx}
+.li-pt-30{padding-top:30rpx}
+.li-py-35{padding-top:35rpx;padding-bottom:35rpx}
+.li-py-6{padding-top:6rpx;padding-bottom:6rpx}
+.li-rd-bl-50-important{border-bottom-left-radius:50rpx !important}
+.li-text-40{font-size:40rpx}
+.li-text-5f5f5f-color{color:rgb(95,95,95)}
+.li-text-right{text-align:right}
+.li-w-110{width:110rpx}
+.li-w-400{width:400rpx}
+.li-w-full-100{width:100%}
+.overflow-hidden{overflow:hidden}
+
+.li-ml-6{margin-left:6rpx}
+.li-pt-4{padding-top:4rpx}
+.li-text-323232-color{color:rgb(50,50,50)}
+.li-text-333333-color{color:rgb(51,51,51)}
+.li-text-36{font-size:36rpx}
+.li-text-ff0000-color{color:rgb(255,0,0)}
+
+
+.li-mr-40{margin-right:40rpx}
+.li-text-a3a3a3-color{color:rgb(163,163,163)}
+
+
+
diff --git a/utils/common.ts b/utils/common.ts
index 0937c79..17ecc06 100644
--- a/utils/common.ts
+++ b/utils/common.ts
@@ -139,6 +139,68 @@ export const getCityCode = async (longitude : number, latitude : number) : Promi
})
}
+
+// 检测小程序是否更新
+export const VersionUpdate = () => {
+ // 判断应用的 getUpdateManager 是否在当前版本可用
+ console.log(uni.canIUse('getUpdateManager'));
+ if (uni.canIUse('getUpdateManager')) {
+ const updateManager = uni.getUpdateManager()
+ // 向小程序后台请求完新版本信息
+ updateManager.onCheckForUpdate(function(res) {
+ if (res.hasUpdate) {
+ //小程序有新版本,静默下载新版本,新版本下载完成
+ updateManager.onUpdateReady(function() {
+ //模态弹窗(确认、取消)
+ uni.showModal({
+ title: '更新提示',
+ content: '小程序已发布新版本,是否重启?',
+ success: function(res) {
+ //用户点击确定
+ if (res.confirm) {
+ //当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
+ updateManager.applyUpdate()
+ }
+ //用户点击取消
+ else if (res.cancel) {
+ //强制用户更新,弹出第二次弹窗
+ uni.showModal({
+ title: '提示',
+ content: '小程序已发布新版本,是否重启',
+ showCancel: false, //隐藏取消按钮
+ success: function(res) {
+ //第二次提示后,强制更新
+ if (res.confirm) {
+ // 当新版本下载完成,调用该方法会强制当前小程序应用上新版本并重启
+ updateManager.applyUpdate()
+ } else if (res.cancel) {
+ //重新回到版本更新提示
+ VersionUpdate()
+ }
+ },
+ })
+ }
+ },
+ })
+ })
+ // 当新版本下载失败
+ updateManager.onUpdateFailed(function() {
+ uni.showModal({
+ title: '提示',
+ content: '请您删除当前小程序,重新打开小程序',
+ })
+ })
+ }
+ })
+ } else {
+ // 提示用户在最新版本的客户端上体验
+ uni.showModal({
+ title: '温馨提示',
+ content: '当前微信版本过低,可能无法使用该功能,请升级到最新版本后重试。',
+ })
+ }
+}
+
/*
base64编码
*/
diff --git a/utils/request.ts b/utils/request.ts
index a8463d6..7803200 100644
--- a/utils/request.ts
+++ b/utils/request.ts
@@ -1,5 +1,5 @@
import { Uni } from '@dcloudio/uni-app'
-declare const uni: Uni
+declare const uni : Uni
// 定义请求方法的类型
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
@@ -9,14 +9,9 @@ interface RequestOptions {
data ?: any; // 请求体
}
-//请求头
-const DEFAULT_HEADERS = {
- 'Content-Type': 'application/json',
- 'Authorization': 'Bearer ' + uni.getStorageSync('token')
-};
// 将对象转换为查询字符串的辅助函数
-function objectToQueryString(obj: Record): string {
+function objectToQueryString(obj : Record) : string {
if (!obj) return '';
return Object.keys(obj)
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`)
@@ -30,14 +25,17 @@ function getBaseUrl() {
}
// 封装请求函数
-export const request = (endpoint: string, options: RequestOptions = {}) => {
+export const request = (endpoint : string, options : RequestOptions = {}) => {
const url = `${endpoint}`;
return new Promise((resolve, reject) => {
uni.request({
url,
method: options.method || 'GET',
data: options.data || {},
- header: DEFAULT_HEADERS,
+ header: {
+ 'Content-Type': 'application/json',
+ 'Authorization': 'Bearer ' + uni.$store.state.token
+ },
success: (response) => {
if (response.statusCode >= 200 && response.statusCode < 300) {
if (response.data.code == 500) {
@@ -59,22 +57,22 @@ export const request = (endpoint: string, options: RequestOptions = {}) => {
};
// 封装 GET 请求
-export const get = (endpoint: string, params?: any) => {
+export const get = (endpoint : string, params ?: any) => {
const queryString = params ? `?${objectToQueryString(params)}` : '';
return request(`${getBaseUrl()}${endpoint}${queryString}`, { method: 'GET' });
};
// 封装 POST 请求
-export const post = (endpoint: string, data?: any) => {
+export const post = (endpoint : string, data ?: any) => {
return request(`${getBaseUrl()}${endpoint}`, { method: 'POST', data });
};
// 封装 PUT 请求
-export const put = (endpoint: string, data?: any) => {
+export const put = (endpoint : string, data ?: any) => {
return request(`${getBaseUrl()}${endpoint}`, { method: 'PUT', data });
};
// 封装 DELETE 请求
-export const del = (endpoint: string, data?: any) => {
+export const del = (endpoint : string, data ?: any) => {
return request(`${getBaseUrl()}${endpoint}`, { method: 'DELETE', data });
};
\ No newline at end of file