Skip to content

Commit 3274772

Browse files
committed
增加微信端和小程序端
1 parent 8de971f commit 3274772

File tree

405 files changed

+78645
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

405 files changed

+78645
-0
lines changed

uni-app/.hbuilderx/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
2+
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
3+
"version": "0.0",
4+
"configurations": [{
5+
"default" :
6+
{
7+
"launchtype" : "local"
8+
},
9+
"mp-weixin" :
10+
{
11+
"launchtype" : "local"
12+
},
13+
"type" : "uniCloud"
14+
}
15+
]
16+
}

uni-app/App.vue

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<script>
2+
import systemInfo from '@/utils/systemInfo.js'
3+
import store from '@/store'
4+
import {
5+
getToken
6+
} from '@/utils/auth.js'
7+
import {
8+
setRoles
9+
} from '@/utils/roles.js'
10+
11+
export default {
12+
async onLaunch() {
13+
let info = systemInfo.info()
14+
this.$store.commit('SET_WIDTH', info.windowWidth)
15+
this.$store.commit('SET_HEIGHT', info.windowHeight)
16+
if (getToken()) {
17+
store.commit("SET_TOKEN", uni.getStorageSync('token'))
18+
store.commit("SET_AVATAR", uni.getStorageSync('avatar'))
19+
store.commit("SET_NICKNAME", uni.getStorageSync('nickname'))
20+
store.commit("SET_PHONE", uni.getStorageSync('phone'))
21+
}
22+
},
23+
onShow: function() {
24+
},
25+
onHide: function() {
26+
}
27+
}
28+
</script>
29+
30+
<style lang="scss">
31+
@import "uview-ui/index.scss";
32+
// @import url("static/icon/iconfont.css");
33+
/*每个页面公共css */
34+
</style>

uni-app/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 www.uviewui.com
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

uni-app/README.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<p align="center">
2+
<img alt="logo" src="https://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;">
3+
</p>
4+
<h3 align="center" style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView</h3>
5+
<h3 align="center">多平台快速开发的UI框架</h3>
6+
7+
[![star](https://gitee.com/xuqu/uView/badge/star.svg?theme=gvp)](https://gitee.com/xuqu/uView/stargazers)
8+
[![fork](https://gitee.com/xuqu/uView/badge/fork.svg?theme=gvp)](https://gitee.com/xuqu/uView/members)
9+
[![stars](https://img.shields.io/github/stars/YanxinNet/uView?style=flat-square&logo=GitHub)](https://github.com/YanxinNet/uView)
10+
[![forks](https://img.shields.io/github/forks/YanxinNet/uView?style=flat-square&logo=GitHub)](https://github.com/YanxinNet/uView)
11+
[![issues](https://img.shields.io/github/issues/YanxinNet/uView?style=flat-square&logo=GitHub)](https://github.com/YanxinNet/uView/issues)
12+
[![Website](https://img.shields.io/badge/uView-up-blue?style=flat-square)](https://uviewui.com)
13+
[![release](https://img.shields.io/github/v/release/YanxinNet/uView?style=flat-square)](https://gitee.com/xuqu/uView/releases)
14+
[![license](https://img.shields.io/github/license/YanxinNet/uView?style=flat-square)](https://en.wikipedia.org/wiki/MIT_License)
15+
16+
## 说明
17+
18+
uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水
19+
20+
## [官方文档:https://www.uviewui.com](https://www.uviewui.com)
21+
22+
### 官方1群:1042987248(已满)
23+
### 官方2群:249718512(已满)
24+
### 官方3群:1129077272(已满)
25+
### 官方4群:1084514613(已满)
26+
### 官方5群:863820668(已满)
27+
### [点击加6群交流反馈:745721078](https://qm.qq.com/cgi-bin/qm/qr?k=nSvu1k6AFqHVvZhgN9FEavJPXIMyYCxY&jump_from=webapi)
28+
29+
## 特性
30+
31+
- 兼容安卓,iOS,微信小程序,H5,QQ小程序,百度小程序,支付宝小程序,头条小程序
32+
- 60+精选组件,功能丰富,多端兼容,让您快速集成,开箱即用
33+
- 众多贴心的JS利器,让您飞镖在手,召之即来,百步穿杨
34+
- 众多的常用页面和布局,让您专注逻辑,事半功倍
35+
- 详尽的文档支持,现代化的演示效果
36+
- 按需引入,精简打包体积
37+
38+
39+
## 预览
40+
41+
您可以通过**微信**扫码,查看最佳的演示效果。
42+
<br>
43+
<br>
44+
<img src="https://uviewui.com/common/weixin_mini_qrcode.png" width="220" height="220" >
45+
46+
47+
## 友情链接
48+
49+
#### **vue-admin-beautiful** —— [企业级、通用型中后台前端解决方案(基于vue/cli 4 最新版,同时支持电脑,手机,平板)](https://github.com/chuzhixin/vue-admin-beautiful)
50+
51+
#### **vue-admin-beautiful** —— [在线演示](http://beautiful.panm.cn/vue-admin-beautiful/#/index)
52+
53+
#### **pl-table** —— [ 完美解决 element 万级表格数据渲染卡顿问题](https://github.com/livelyPeng/pl-table)
54+
55+
#### **luch-request** —— [基于 Promise 开发的 uni-app 跨平台、项目级别的请求库,它有更小的体积,易用的 api,方便简单的自定义能力](https://www.quanzhan.co/luch-request/)
56+
<br>
57+
58+
## 链接
59+
60+
- [官方文档](https://uviewui.com/)
61+
- [更新日志](https://uviewui.com/components/changelog.html)
62+
- [升级指南](https://uviewui.com/components/changelog.html)
63+
- [关于我们](https://uviewui.com/cooperation/about.html)
64+
65+
## 交流反馈
66+
67+
欢迎加入我们的QQ群交流反馈:[点此跳转](https://www.uviewui.com/components/addQQGroup.html)
68+
69+
## 安装
70+
71+
#### **下载地址** —— [https://ext.dcloud.net.cn/plugin?id=1593](https://ext.dcloud.net.cn/plugin?id=1593)
72+
73+
## 快速上手
74+
75+
1. `main.js`引入uView库
76+
```js
77+
// main.js
78+
import uView from 'uview-ui';
79+
Vue.use(uView);
80+
```
81+
82+
2. `App.vue`引入基础样式(注意style标签需声明scss属性支持)
83+
```css
84+
/* App.vue */
85+
<style lang="scss">
86+
@import "uview-ui/index.scss";
87+
</style>
88+
```
89+
90+
3. `uni.scss`引入全局scss变量文件
91+
```css
92+
/* uni.scss */
93+
@import "uview-ui/theme.scss";
94+
```
95+
96+
4. `pages.json`配置easycom规则(按需引入)
97+
98+
```js
99+
// pages.json
100+
{
101+
"easycom": {
102+
// 下载安装的方式需要前面的"@/",npm安装的方式无需"@/"
103+
// 下载安装方式
104+
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
105+
// npm安装方式
106+
// "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
107+
},
108+
// 此为本身已有的内容
109+
"pages": [
110+
// ......
111+
]
112+
}
113+
```
114+
115+
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
116+
117+
## 使用方法
118+
配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。
119+
120+
```html
121+
<template>
122+
<u-button>按钮</u-button>
123+
</template>
124+
```
125+
126+
请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容
127+
128+
129+
## 捐赠uView的研发
130+
131+
uView文档内容和框架源码全部开源免费,如果您认为uView帮到了您的开发工作,您可以捐赠uView的研发工作,捐赠无门槛,哪怕是一杯可乐也好(相信这比打赏主播更有意义)。
132+
133+
<img src="https://uviewui.com/common/wechat.png" width="220" >
134+
<img style="margin-left: 100px;" src="https://uviewui.com/common/alipay.png" width="220" >
135+
136+
## 版权信息
137+
uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。

uni-app/api/api.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// export const baseUrl = 'http://api.yuxicloud.test'
2+
export const baseUrl = 'https://api.halian.net'

uni-app/api/app.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {baseUrl} from './api.js'
2+
3+
export function getShareInfo() {
4+
return new Promise((resolve,reject)=>{
5+
uni.request({
6+
url: `${baseUrl}/api/mp/share/info`,
7+
method: 'GET',
8+
success: res => {
9+
resolve(res.data)
10+
},
11+
fail: () => {
12+
reject()
13+
},
14+
complete: () => {}
15+
});
16+
})
17+
}
18+
19+
20+
21+

uni-app/api/exchange.js

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
import {baseUrl} from './api.js'
2+
import {getToken} from '@/utils/auth.js'
3+
4+
export function getMsgById(id) {
5+
return new Promise((resolve, reject)=>{
6+
uni.request({
7+
url: `${baseUrl}/api/mp/exchanges/`+id,
8+
method: 'GET',
9+
header: {
10+
'Authorization': `Bearer ` + getToken()
11+
},
12+
success: res => {
13+
resolve(res.data)
14+
},
15+
fail: (error) => {
16+
reject(error)
17+
},
18+
complete: () => {}
19+
});
20+
})
21+
}
22+
23+
export function store(data) {
24+
return new Promise((resolve, reject)=>{
25+
uni.request({
26+
url: `${baseUrl}/api/mp/exchanges`,
27+
method: 'POST',
28+
data,
29+
header: {
30+
'Authorization': `Bearer ` + getToken()
31+
},
32+
success: res => {
33+
if (res.statusCode >=400 && res.statusCode <= 600) {
34+
reject(res)
35+
}
36+
if (res.statusCode >= 200 && res.statusCode <= 300) {
37+
resolve(res.data)
38+
}
39+
},
40+
fail: () => {
41+
reject()
42+
},
43+
complete: () => {}
44+
});
45+
})
46+
}
47+
48+
49+
export function revoke(id) {
50+
return new Promise((resolve, reject)=>{
51+
uni.request({
52+
url: `${baseUrl}/api/mp/exchanges/${id}`,
53+
method: 'DELETE',
54+
header: {
55+
'Authorization': `Bearer ` + getToken()
56+
},
57+
success: res => {
58+
if (res.statusCode >=400 && res.statusCode <= 600) {
59+
reject(res)
60+
}
61+
if (res.statusCode >= 200 && res.statusCode <= 300) {
62+
resolve(res.data)
63+
}
64+
},
65+
fail: () => {
66+
reject()
67+
},
68+
complete: () => {}
69+
});
70+
})
71+
}
72+
73+
74+
export function update(data) {
75+
return new Promise((resolve, reject)=>{
76+
uni.request({
77+
url: `${baseUrl}/api/mp/exchanges/${data.id}`,
78+
method: 'PUT',
79+
data,
80+
header: {
81+
'Authorization': `Bearer ` + getToken()
82+
},
83+
success: res => {
84+
if (res.statusCode >=500 && res.statusCode <= 600) {
85+
reject(res)
86+
}
87+
if (res.statusCode >= 200 && res.statusCode < 500) {
88+
resolve(res)
89+
}
90+
},
91+
fail: (error) => {
92+
reject()
93+
},
94+
complete: () => {}
95+
});
96+
})
97+
}
98+
export function add(data) {
99+
return new Promise((resolve, reject)=>{
100+
uni.request({
101+
url: `${baseUrl}/api/mp/exchanges`,
102+
method: 'POST',
103+
data,
104+
header: {
105+
'Authorization': `Bearer ` + getToken()
106+
},
107+
success: res => {
108+
if (res.statusCode >=400 && res.statusCode <= 600) {
109+
reject(res)
110+
}
111+
if (res.statusCode >= 200 && res.statusCode <= 300) {
112+
resolve(res.data)
113+
}
114+
},
115+
fail: () => {
116+
reject()
117+
},
118+
complete: () => {}
119+
});
120+
})
121+
}
122+

0 commit comments

Comments
 (0)