提交 163ca6c3 authored 作者: lidongxu's avatar lidongxu

继续开发

上级 837cbfed
<script>
import config from './config'
import { getToken } from '@/utils/auth'
export default {
onLaunch: function() {
......@@ -11,18 +10,9 @@
initApp() {
// 初始化应用配置
this.initConfig()
// 检查用户登录状态
//#ifdef H5
// this.checkLogin()
//#endif
},
initConfig() {
this.globalData.config = config
},
checkLogin() {
if (!getToken()) {
this.$tab.reLaunch('/pages/login')
}
}
}
}
......
MIT License
Copyright (c) 2022 若依
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
<p align="center">
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-43e3941654fa3054c9684bf53d1b1d356a1.png">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v1.1.0</h1>
<h4 align="center">基于UniApp开发的轻量级移动端框架</h4>
<p align="center">
<a href="https://gitee.com/y_project/RuoYi-App/stargazers"><img src="https://gitee.com/y_project/RuoYi-App/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/y_project/RuoYi-App"><img src="https://img.shields.io/badge/RuoYi-v1.1.0-brightgreen.svg"></a>
<a href="https://gitee.com/y_project/RuoYi-App/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
</p>
## 平台简介
RuoYi App 移动解决方案,采用uniapp框架,一份代码多终端适配,同时支持APP、小程序、H5!实现了与[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)完美对接的移动解决方案!目前已经实现登录、我的、工作台、编辑资料、头像修改、密码修改、常见问题、关于我们等基础功能。
* 配套后端代码仓库地址[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)[RuoYi-Cloud](https://github.com/yangzongzhuan/RuoYi-Cloud) 版本。
* 应用框架基于[uniapp](https://uniapp.dcloud.net.cn/),支持小程序、H5、Android和IOS。
* 前端组件采用[uni-ui](https://github.com/dcloudio/uni-ui),全端兼容的高性能UI框架。
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)&nbsp;&nbsp;
* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)&nbsp;&nbsp;
## 技术文档
- 官网网站:[http://ruoyi.vip](http://ruoyi.vip)
- 文档地址:[http://doc.ruoyi.vip](http://doc.ruoyi.vip)
- H5页体验:[http://h5.ruoyi.vip](http://h5.ruoyi.vip)
- QQ交流群: ①133713780(满)、②146013835
- 小程序体验
<img src="https://oscimg.oschina.net/oscnet/up-26c76dc90b92acdbd9ac8cd5252f07c8ad9.jpg" alt="小程序演示"/>
## 演示图
<table>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-3ea20e447ac621a161e395fb53ccc683d84.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-a6f23cf9a371a30165e135eff6d9ae89a9d.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-ff5f62016bf6624c1ff27eee57499dccd44.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-b9a582fdb26ec69d407fabd044d2c8494df.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-96427ee08fca29d77934cfc8d1b1a637cef.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-5fdadc582d24cccd7727030d397b63185a3.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-0a36797b6bcc50c36d40c3c782665b89efc.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-d77995cc00687cedd00d5ac7d68a07ea276.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-fa8f5ab20becf59b4b38c1b92a9989e7109.png"/></td>
</tr>
</table>
......@@ -2,18 +2,16 @@ import request from '@/utils/request.js'
import {
mapBaseUrl,
mapKey,
coordtype
} from '@/config.js'
import { tansParams } from '@/utils/common.js'
// 所有服务均基于 百度地图
// 所有服务均基于腾讯地图
/**
* 逆地理位置编码
*/
export const reverseGeocoding = ({
params
}) => {
const urlParams = tansParams(params)
return request({
baseUrl: mapBaseUrl + `/reverse_geocoding/v3/?ak=${mapKey}&output=json&coordtype=${coordtype}&${urlParams}`
// baseUrl: mapBaseUrl + `/reverse_geocoding/v3/?ak=${mapKey}&output=json&coordtype=${coordtype}&${urlParams}`
baseUrl: mapBaseUrl + `/ws/geocoder/v1/?location=${params.location}&key=${mapKey}&poi_options=policy=5`
})
}
\ No newline at end of file
// 应用全局配置
module.exports = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
mapBaseUrl: 'https://api.map.baidu.com',
mapKey: 'mryaav7xyp0Z3ItwUT3oMssYAmG8sTSU',
coordtype: 'gcj02', // 坐标类型(小程序获取和百度地图 API 使用类型要对应上)
// baseUrl: 'http://localhost:8080',
baseUrl: 'http://promotion.wxl66.cn:8010', // 云 API 域名
wxAppId: 'wx5d89065bb4725557',
wxSecret: '7395e91baf6b49ca9b84b1301989f77e',
mapBaseUrl: 'https://apis.map.qq.com', // 腾讯地图 API 域名
mapKey: 'EOGBZ-US2RW-YF5RC-OKB5O-R6BUK-2LFVS', // 腾讯地图 API key(TODO:后期换成后台的)
coordtype: 'gcj02', // 坐标类型-国测局坐标(小程序使用的是这个,让百度地图也使用这个)
baseUrl: 'http://promotion.wxl66.cn:8010', // 云 API 域名(TODO: 后期要换个后台使用)
wxAppId: 'wx5d89065bb4725557', // 微信小程序 appId (TODO:后期换成后台的)
wxSecret: '7395e91baf6b49ca9b84b1301989f77e', // 微信小程序 appSecret(TODO:后期换成后台的)
// 应用信息
appInfo: {
// 应用名称
name: "ruoyi-app",
name: "小卤促销员平台",
// 应用版本
version: "1.1.0",
version: "1.0.0",
// 应用logo
logo: "/static/logo.png",
// 官方网站
site_url: "http://ruoyi.vip",
site_url: "http://www.wangxiaolu.com.cn/",
// 政策协议
agreements: [{
title: "隐私政策",
url: "https://ruoyi.vip/protocol.html"
},
{
title: "用户服务协议",
url: "https://ruoyi.vip/protocol.html"
}
]
// agreements: [{
// title: "隐私政策",
// url: "https://ruoyi.vip/protocol.html"
// },
// {
// title: "用户服务协议",
// url: "https://ruoyi.vip/protocol.html"
// }
// ]
}
}
差异被折叠。
差异被折叠。
import Vue from 'vue'
import App from './App'
import store from './store' // store
import plugins from './plugins' // plugins
import './permission' // permission
import * as auth from './utils/auth.js'
import store from './store'
import plugins from './plugins'
import './permission'
import config from './config.js'
import { setWxAccessToken } from './utils/auth.js'
Vue.use(plugins)
// 获取 access_token
// 发起请求
uni.request({
// TODO:将来 TOKEN 从后台获取,再看看如何判定过期与否是响应拦截器里统一处理吗?
url: `https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${config.wxAppId}&secret=${config.wxSecret}`,
success: function (res) {
auth.setAccessToken(res.data.access_token)
setWxAccessToken(res.data.access_token)
store.commit('SET_TOKEN', res.data.access_token)
},
fail: function () {
console.log('请求 access-token 失败');
}
});
// console.log(uni.getSystemInfoSync())
Vue.config.productionTip = false
Vue.prototype.$store = store
App.mpType = 'app'
const app = new Vue({
...App
})
......
{
"name" : "若依移动端",
"appid" : "__UNI__EF8B6D6",
"description" : "",
"versionName" : "1.1.0",
"name" : "小卤促销员平台",
"appid" : "wx5474d56c6eea0083",
"description" : "小卤促销员平台",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
......@@ -46,7 +46,9 @@
"urlCheck" : false,
"es6" : false,
"minified" : true,
"postcss" : true
"postcss" : true,
"ignoreDevUnusedFiles" : false,
"ignoreUploadUnusedFiles" : false
},
"optimization" : {
"subPackages" : true
......@@ -66,10 +68,13 @@
"port" : 9090,
"https" : false
},
"title" : "RuoYi-App",
"title" : "小卤促销员平台",
"router" : {
"mode" : "hash",
"base" : "./"
},
"sdkConfigs" : {
"maps" : {}
}
}
}
{
"dependencies": {
"await-to-js": "^3.0.0"
"await-to-js": "^3.0.0",
"cos-wx-sdk-v5": "^1.7.2",
"qqmap-wx-jssdk": "^1.0.0"
}
}
......@@ -7,21 +7,21 @@
}
},
{
"path": "pages/login",
"path": "pages/index",
"style": {
"navigationBarTitleText": "登录"
"navigationBarTitleText": "今日打卡"
}
},
{
"path": "pages/register",
"path": "pages/login",
"style": {
"navigationBarTitleText": "促销员提交"
"navigationBarTitleText": "登录"
}
},
{
"path": "pages/index",
"path": "pages/register",
"style": {
"navigationStyle": "custom"
"navigationBarTitleText": "促销员提交"
}
},
{
......@@ -98,14 +98,6 @@
}
}
],
"subPackages": [
{
"root": "page_subject",
"pages": [
]
}
],
"tabBar": {
"color": "#000000",
"selectedColor": "#000000",
......@@ -114,21 +106,15 @@
"list": [
{
"pagePath": "pages/index",
"iconPath": "static/images/tabbar/home.png",
"selectedIconPath": "static/images/tabbar/home_.png",
"text": "首页"
"iconPath": "static/images/tabbar/clock.png",
"selectedIconPath": "static/images/tabbar/clock_active.png",
"text": "打卡"
},
{
"pagePath": "pages/work/index",
"iconPath": "static/images/tabbar/work.png",
"selectedIconPath": "static/images/tabbar/work_.png",
"text": "工作台"
},
{
"pagePath": "pages/mine/index",
"iconPath": "static/images/tabbar/mine.png",
"selectedIconPath": "static/images/tabbar/mine_.png",
"text": "我的"
"iconPath": "static/images/tabbar/upload.png",
"selectedIconPath": "static/images/tabbar/upload_active.png",
"text": "上传推广照片"
}
]
},
......@@ -137,6 +123,5 @@
"navigationBarTitleText": "RuoYi",
"navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor": "#FFFFFF"
},
"entryPagePath": "pages/start"
}
}
\ No newline at end of file
差异被折叠。
......@@ -36,7 +36,7 @@
</template>
<script>
import { getAccessToken } from '../utils/auth';
import { getWxAccessToken } from '@/utils/auth';
import storage from '../utils/storage'
import constant from '../utils/constant';
......@@ -52,7 +52,7 @@ export default {
this.$modal.loading("登录中,请耐心等待...")
// 通过微信小程序 API 获取手机号
const [,phoneRes] = await uni.request({
url: `https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=${getAccessToken()}`,
url: `https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=${getWxAccessToken()}`,
method: 'POST',
data: {
code: e.detail.code
......@@ -94,10 +94,10 @@ export default {
// this.$tab.reLaunch('/pages/index')
// },
// 登录成功后,开始获取各种权限
async getAuth() {
// 获取地址位置
return this.$store.dispatch('GetLocation')
}
// async getAuth() {
// // 获取地址位置
// return this.$store.dispatch('GetLocation')
// }
}
</script>
......
......@@ -38,7 +38,7 @@
@select="selectIdenPhotoFn"></uni-file-picker>
</view>
</uni-forms-item>
<button type="primary"
<button class="bg-blue"
@click="submit('valiForm')">提交信息</button>
</uni-forms>
</view>
......@@ -47,6 +47,8 @@
<script>
import { mapGetters } from 'vuex'
import { submitUserInfo } from '../api/login'
import storage from '../utils/storage'
import constant from '../utils/constant'
export default {
data() {
return {
......@@ -84,14 +86,27 @@ export default {
},
// 选择了身份证
selectIdenPhotoFn(obj) {
// console.log(obj.tempFiles[0]) // 文件对象-需要自己上传 OSS
// console.log(obj.tempFiles[0]) // TODO:文件对象-需要自己上传 OSS
},
submit(ref) {
this.$refs[ref].validate().then(res => {
this.$refs[ref].validate().then(async res => {
console.log('success', res);
// TODO: 后面需要后台提供促销员信息注册接口
// const result = await submitUserInfo({
// avatarUrl: this.formData.avatarUrl,
// openId: storage.get(constant.loginOpenId),
// name: this.formData.name,
// idenFrontPhotoUrl: this.formData.idenFrontPhotoUrl[0]?.url,
// idenReversePhotoUrl: this.formData.idenReversePhotoUrl[0]?.url,
// phone: storage.get(constant.loginPhone)
// })
// console.log(result)
uni.showToast({
title: `校验通过`
title: `注册成功`
})
await this.$store.dispatch('GetLocation')
this.$tab.switchTab('/pages/index')
}).catch(err => {
console.log('err', err);
})
......
<template>
<image src="https://6c6f-lowcode-6gzlaqs9e1bbd9c1-1325462268.tcb.qcloud.la/muban/%E5%B0%8F%E7%A8%8B%E5%BA%8F-%E7%99%BB%E5%BD%95%E6%B5%B7%E6%8A%A5.jpeg?sign=6edb65e761a2d01c1427aed47a7a2d74&t=1730958952" alt="" class="start_img"/>
<image
src="https://6c6f-lowcode-6gzlaqs9e1bbd9c1-1325462268.tcb.qcloud.la/muban/%E5%B0%8F%E7%A8%8B%E5%BA%8F-%E7%99%BB%E5%BD%95%E6%B5%B7%E6%8A%A5.jpeg?sign=6edb65e761a2d01c1427aed47a7a2d74&t=1730958952"
alt=""
class="start_img" />
</template>
<script>
import storage from '../utils/storage.js'
import constant from '../utils/constant.js'
export default {
mounted(){
mounted() {
setTimeout(() => {
// this.$tab.redirectTo('/page_subject/pages/login')
console.log(storage.get(constant.loginPhone))
// TODO:下面重写:有手机号,判断注册信息填过没有,有就去首页,没有就去注册页
if (storage.get(constant.loginPhone)) {
// 有存储过之前的登录手机号+openId 也不对,需要注册成功,再去首页
// this.$tab.switchTab('/pages/index')
this.$tab.redirectTo('/pages/register')
} else {
// 跳转到登录页面
this.$tab.redirectTo('/pages/login')
}
}, 2500)
}, 1500)
}
}
</script>
<style scoped>
.start_img{
.start_img {
width: 100%;
height: 100vh;
}
}
</style>
import { getToken } from '@/utils/auth'
import storage from './utils/storage'
import constant from './utils/constant'
......@@ -22,15 +21,19 @@ list.forEach(item => {
// 全局添加 API 属性等(拦截路由)
uni.addInterceptor(item, {
invoke(to) {
// 之前是否已经登录过TODO:应该是提交完注册信息后才会有token
if (storage.get(constant.loginPhone)) {
// 如果已经登录了,还想去登录页面直接跳转到首页
if (to.url === loginPage) {
uni.reLaunch({ url: "/" })
uni.reLaunch({ url: "/pages/index" })
}
return true
} else {
// 未登录,是否去白名单页面
if (checkWhite(to.url)) {
return true
}
// 未登录,第一次去登录页面
uni.reLaunch({ url: loginPage })
return false
}
......
{
"appid": "wx5474d56c6eea0083",
"compileType": "miniprogram",
"libVersion": "3.6.4",
"libVersion": "1.0.0",
"packOptions": {
"ignore": [],
"include": []
......
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "ruoyi-uni",
"projectname": "小卤促销员平台",
"setting": {
"compileHotReLoad": true
}
......
......@@ -24,14 +24,8 @@ const location = {
return new Promise((resolve, reject) => {
uni.getLocation({
success: async (res) => {
// 经纬度调 百度 逆地理编码获取省市区名字
const { result } = await reverseGeocoding({
params: {
location: res.latitude + "," + res.longitude
}
})
commit('SET_LOCATION', result)
resolve(result)
commit('SET_LOCATION', res)
resolve(res)
},
fail: (err) => {
$modal.msgError("请允许获取位置权限");
......
......@@ -2,13 +2,13 @@ import config from '@/config'
import storage from '@/utils/storage'
import constant from '@/utils/constant'
import { login, logout, getInfo } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth'
import { getWxAccessToken, setWxAccessToken, removeWxAccessToken } from '@/utils/auth'
const baseUrl = config.baseUrl
const user = {
state: {
token: getToken(),
token: getWxAccessToken(),
name: storage.get(constant.name),
avatar: storage.get(constant.avatar),
roles: storage.get(constant.roles),
......@@ -51,7 +51,6 @@ const user = {
const uuid = userInfo.uuid
return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => {
setToken(res.data.access_token)
commit('SET_TOKEN', res.data.access_token)
resolve()
}).catch(error => {
......@@ -65,7 +64,7 @@ const user = {
return new Promise((resolve, reject) => {
getInfo().then(res => {
const user = res.user
const avatar = (user == null || user.avatar == "" || user.avatar == null) ? require("@/static/images/profile.jpg") : baseUrl + user.avatar
const avatar = ''
const username = (user == null || user.userName == "" || user.userName == null) ? "" : user.userName
if (res.roles && res.roles.length > 0) {
commit('SET_ROLES', res.roles)
......@@ -91,7 +90,7 @@ const user = {
commit('SET_ROLES', [])
commit('SET_PERMISSIONS', [])
commit('SET_USER', {})
removeToken()
removeWxAccessToken()
storage.clean()
resolve()
}).catch(error => {
......
## 2.0.10(2024-06-07)
- 优化 uni-app x 中,size 属性的类型
## 2.0.9(2024-01-12)
fix: 修复图标大小默认值错误的问题
## 2.0.8(2023-12-14)
- 修复 项目未使用 ts 情况下,打包报错的bug
## 2.0.7(2023-12-14)
- 修复 size 属性为 string 时,不加单位导致尺寸异常的bug
## 2.0.6(2023-12-11)
- 优化 兼容老版本icon类型,如 top ,bottom 等
## 2.0.5(2023-12-11)
- 优化 兼容老版本icon类型,如 top ,bottom 等
## 2.0.4(2023-12-06)
- 优化 uni-app x 下示例项目图标排序
## 2.0.3(2023-12-06)
- 修复 nvue下引入组件报错的bug
## 2.0.2(2023-12-05)
-优化 size 属性支持单位
## 2.0.1(2023-12-05)
- 新增 uni-app x 支持定义图标
## 1.3.5(2022-01-24)
- 优化 size 属性可以传入不带单位的字符串数值
## 1.3.4(2022-01-24)
......
<template>
<text class="uni-icons" :style="styleObj">
<slot>{{unicode}}</slot>
</text>
</template>
<script>
import { fontData, IconsDataItem } from './uniicons_file'
/**
* Icons 图标
* @description 用于展示 icon 图标
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
* @property {Number,String} size 图标大小
* @property {String} type 图标图案,参考示例
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标
* @event {Function} click 点击 Icon 触发事件
*/
export default {
name: "uni-icons",
props: {
type: {
type: String,
default: ''
},
color: {
type: String,
default: '#333333'
},
size: {
type: [Number, String],
default: 16
},
fontFamily: {
type: String,
default: ''
}
},
data() {
return {};
},
computed: {
unicode() : string {
let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
if (codes !== null) {
return codes.unicode
}
return ''
},
iconSize() : string {
const size = this.size
if (typeof size == 'string') {
const reg = /^[0-9]*$/g
return reg.test(size as string) ? '' + size + 'px' : '' + size;
// return '' + this.size
}
return this.getFontSize(size as number)
},
styleObj() : UTSJSONObject {
if (this.fontFamily !== '') {
return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
}
return { color: this.color, fontSize: this.iconSize }
}
},
created() { },
methods: {
/**
* 字体大小
*/
getFontSize(size : number) : string {
return size + 'px';
},
},
}
</script>
<style scoped>
@font-face {
font-family: UniIconsFontFamily;
src: url('./uniicons.ttf');
}
.uni-icons {
font-family: UniIconsFontFamily;
font-size: 18px;
font-style: normal;
color: #333;
}
</style>
<template>
<!-- #ifdef APP-NVUE -->
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" @click="_onClick">{{unicode}}</text>
<text :style="styleObj" class="uni-icons" @click="_onClick">{{unicode}}</text>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick"></text>
<text :style="styleObj" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick">
<slot></slot>
</text>
<!-- #endif -->
</template>
<script>
import icons from './icons.js';
import { fontData } from './uniicons_file_vue.js';
const getVal = (val) => {
const reg = /^[0-9]*$/g
return (typeof val === 'number' || reg.test(val) )? val + 'px' : val;
return (typeof val === 'number' || reg.test(val)) ? val + 'px' : val;
}
// #ifdef APP-NVUE
var domModule = weex.requireModule('dom');
import iconUrl from './uniicons.ttf'
domModule.addRule('fontFace', {
'fontFamily': "uniicons",
'src': "url('"+iconUrl+"')"
'src': "url('" + iconUrl + "')"
});
// #endif
......@@ -34,7 +38,7 @@
*/
export default {
name: 'UniIcons',
emits:['click'],
emits: ['click'],
props: {
type: {
type: String,
......@@ -48,26 +52,36 @@
type: [Number, String],
default: 16
},
customPrefix:{
customPrefix: {
type: String,
default: ''
},
fontFamily: {
type: String,
default: ''
}
},
data() {
return {
icons: icons.glyphs
icons: fontData
}
},
computed:{
unicode(){
let code = this.icons.find(v=>v.font_class === this.type)
if(code){
return unescape(`%u${code.unicode}`)
computed: {
unicode() {
let code = this.icons.find(v => v.font_class === this.type)
if (code) {
return code.unicode
}
return ''
},
iconSize(){
iconSize() {
return getVal(this.size)
},
styleObj() {
if (this.fontFamily !== '') {
return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`
}
return `color: ${this.color}; font-size: ${this.iconSize};`
}
},
methods: {
......@@ -81,9 +95,10 @@
<style lang="scss">
/* #ifndef APP-NVUE */
@import './uniicons.css';
@font-face {
font-family: uniicons;
src: url('./uniicons.ttf') format('truetype');
src: url('./uniicons.ttf');
}
/* #endif */
......@@ -92,5 +107,4 @@
text-decoration: none;
text-align: center;
}
</style>
.uniui-cart-filled:before {
content: "\e6d0";
}
.uniui-gift-filled:before {
content: "\e6c4";
}
.uniui-color:before {
content: "\e6cf";
}
......@@ -58,10 +67,6 @@
content: "\e6c3";
}
.uniui-gift-filled:before {
content: "\e6c4";
}
.uniui-fire-filled:before {
content: "\e6c5";
}
......@@ -82,6 +87,18 @@
content: "\e698";
}
.uniui-arrowthinleft:before {
content: "\e6d2";
}
.uniui-arrowthinup:before {
content: "\e6d3";
}
.uniui-arrowthindown:before {
content: "\e6d4";
}
.uniui-back:before {
content: "\e6b9";
}
......@@ -94,55 +111,43 @@
content: "\e6bb";
}
.uniui-arrowthinright:before {
content: "\e6bb";
}
.uniui-arrow-left:before {
content: "\e6bc";
}
.uniui-arrowthinleft:before {
content: "\e6bc";
}
.uniui-arrow-up:before {
content: "\e6bd";
}
.uniui-arrowthinup:before {
content: "\e6bd";
}
.uniui-arrow-down:before {
content: "\e6be";
}
.uniui-arrowthindown:before {
content: "\e6be";
.uniui-arrowthinright:before {
content: "\e6d1";
}
.uniui-bottom:before {
.uniui-down:before {
content: "\e6b8";
}
.uniui-arrowdown:before {
.uniui-bottom:before {
content: "\e6b8";
}
.uniui-right:before {
content: "\e6b5";
.uniui-arrowright:before {
content: "\e6d5";
}
.uniui-arrowright:before {
.uniui-right:before {
content: "\e6b5";
}
.uniui-top:before {
.uniui-up:before {
content: "\e6b6";
}
.uniui-arrowup:before {
.uniui-top:before {
content: "\e6b6";
}
......@@ -150,8 +155,8 @@
content: "\e6b7";
}
.uniui-arrowleft:before {
content: "\e6b7";
.uniui-arrowup:before {
content: "\e6d6";
}
.uniui-eye:before {
......@@ -638,10 +643,6 @@
content: "\e627";
}
.uniui-cart-filled:before {
content: "\e629";
}
.uniui-checkbox:before {
content: "\e62b";
}
......
{
"id": "uni-icons",
"displayName": "uni-icons 图标",
"version": "1.3.5",
"version": "2.0.10",
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
"keywords": [
"uni-ui",
......@@ -16,11 +16,7 @@
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
......@@ -37,7 +33,8 @@
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": ["uni-scss"],
......@@ -45,12 +42,14 @@
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
"aliyun": "y",
"alipay": "n"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
"app-nvue": "y",
"app-uvue": "y"
},
"H5-mobile": {
"Safari": "y",
......@@ -70,11 +69,15 @@
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
"QQ": "y",
"钉钉": "y",
"快手": "y",
"飞书": "y",
"京东": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
"华为": "y",
"联盟": "y"
},
"Vue": {
"vue2": "y",
......
// 用户的 Token 值
const TokenKey = 'App-Token'
export function getToken() {
return uni.getStorageSync(TokenKey)
}
export function setToken(token) {
return uni.setStorageSync(TokenKey, token)
}
export function removeToken() {
return uni.removeStorageSync(TokenKey)
}
// 小程序的 AccessToken 值
const AccessTokenKey = 'App-AccessToken'
export function getAccessToken() {
return uni.getStorageSync(AccessTokenKey)
const WxAccessTokenKey = 'WeChat-AccessToken'
export function getWxAccessToken() {
return uni.getStorageSync(WxAccessTokenKey)
}
export function setAccessToken(token) {
return uni.setStorageSync(AccessTokenKey, token)
export function setWxAccessToken(token) {
return uni.setStorageSync(WxAccessTokenKey, token)
}
export function removeAccessToken() {
return uni.removeStorageSync(AccessTokenKey)
export function removeWxAccessToken() {
return uni.removeStorageSync(WxAccessTokenKey)
}
import store from '@/store'
import config from '@/config'
import { getToken } from '@/utils/auth'
// import { getToken } from '@/utils/auth'
import errorCode from '@/utils/errorCode'
import { toast, showConfirm, tansParams } from '@/utils/common'
......@@ -11,9 +11,9 @@ const request = config => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
config.header = config.header || {}
if (getToken() && !isToken) {
config.header['Authorization'] = 'Bearer ' + getToken()
}
// if (getToken() && !isToken) {
// config.header['Authorization'] = 'Bearer ' + getToken()
// }
// get请求映射params参数
if (config.params) {
let url = config.url + '?' + tansParams(config.params)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论