Commit 1c55c877 by 前端

Merge branch 'v1.0.1' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.1

2 parents 6c1db84c b394797c
import http from "../request/http"; import http from "../request/http";
module.exports = { module.exports = {
search(data) { search (data) {
return http.post({ return http.post({
method: "scrm.api.carlife.weapp.homeSearch.search", method: "scrm.api.carlife.weapp.homeSearch.search",
pageSize: 10, pageSize: 10,
...@@ -9,14 +9,14 @@ module.exports = { ...@@ -9,14 +9,14 @@ module.exports = {
}); });
}, },
// 查询接待素材 // 查询接待素材
findSoureList() { findSoureList () {
return http.post({ return http.post({
method: "dj.api.smartcarlife.recepiton.soure.findSoureList", method: "dj.api.smartcarlife.recepiton.soure.findSoureList",
projectName: "boutique", projectName: "boutique",
}); });
}, },
// 查询门店支付配置 // 查询门店支付配置
findPayInfo(data) { findPayInfo (data) {
return http.post({ return http.post({
method: method:
"dj.api.smartcarlife.recepiton.pay.findPayInfoConfigListByMerchantId", "dj.api.smartcarlife.recepiton.pay.findPayInfoConfigListByMerchantId",
...@@ -25,14 +25,14 @@ module.exports = { ...@@ -25,14 +25,14 @@ module.exports = {
}); });
}, },
// 查询门店支付配置 // 查询门店支付配置
saveRecCustomer(data) { saveRecCustomer (data) {
return http.post({ return http.post({
method: "dj.api.smartcarlife.recepiton.customer.saveRecCustomer", method: "dj.api.smartcarlife.recepiton.customer.saveRecCustomer",
projectName: "boutique", projectName: "boutique",
...data, ...data,
}); });
}, },
getToken(data) { getToken (data) {
return http.post( return http.post(
{ {
method: "dj.api.smartcarlife.recepiton.customer.oss.getToken", method: "dj.api.smartcarlife.recepiton.customer.oss.getToken",
...@@ -42,4 +42,12 @@ module.exports = { ...@@ -42,4 +42,12 @@ module.exports = {
"test" "test"
); );
}, },
/** 查询接待素材详情 */
getFindSoureDetail (data) {
return http.post({
method: 'dj.api.smartcarlife.recepiton.soure.findSoureDetailList',
projectName: 'boutique',
...data
});
},
}; };
...@@ -8,6 +8,8 @@ import GlsxImage from "./components/GlsxImage"; ...@@ -8,6 +8,8 @@ import GlsxImage from "./components/GlsxImage";
import MessageBox from "./components/MessageBox/index"; import MessageBox from "./components/MessageBox/index";
Vue.component("GlsxImage", GlsxImage); Vue.component("GlsxImage", GlsxImage);
Vue.component("MessageBox", MessageBox); Vue.component("MessageBox", MessageBox);
import wnCanvas from "./components/Canvas/wn-canvas";
Vue.component("wnCanvas", wnCanvas);
uni.$api = api; uni.$api = api;
uni.$storage = new Storage(); uni.$storage = new Storage();
Vue.config.productionTip = false; Vue.config.productionTip = false;
......
...@@ -4,6 +4,13 @@ ...@@ -4,6 +4,13 @@
}, },
"pages": [ "pages": [
{ {
"path": "pages/informationEntry/informationEntry",
"style": {
"navigationBarTitleText": "信息录入",
"enablePullDownRefresh": false
}
},
{
"path": "pages/common/login", "path": "pages/common/login",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
...@@ -20,8 +27,7 @@ ...@@ -20,8 +27,7 @@
{ {
"path": "pages/detail/detail", "path": "pages/detail/detail",
"style": { "style": {
"navigationBarTitleText": "", "navigationStyle": "custom"
"enablePullDownRefresh": false
} }
}, },
{ {
...@@ -31,13 +37,7 @@ ...@@ -31,13 +37,7 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/informationEntry/informationEntry",
"style": {
"navigationBarTitleText": "信息录入",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/common/nothing", "path": "pages/common/nothing",
"style": { "style": {
......
...@@ -72,8 +72,10 @@ export default { ...@@ -72,8 +72,10 @@ export default {
}; };
}, },
onLoad (options) { onLoad (options) {
uni.showLoading()
let userInfo = uni.$storage.get('userInfo') let userInfo = uni.$storage.get('userInfo')
uni.$api.userApi.getListSelectAccount().then(res => { uni.$api.userApi.getListSelectAccount().then(res => {
uni.hideLoading()
if (res.code == 0 && userInfo) uni.reLaunch({ if (res.code == 0 && userInfo) uni.reLaunch({
url: '/pages/home/home' url: '/pages/home/home'
}) })
......
<template> <template>
<div> <view class="nothing">
</div> 暂未绑定账号
</view>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { export default {
name: '', name: '',
data () { data () {
return { return {
}
},
mounted () {
},
methods: {
} }
},
mounted () {
},
methods: {
} }
}
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.nothing {
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="layout">
<view class="bg">
<glsx-image src="media/bg-1.png" />
</view>
<view class="content">
<view class="title">问界·交车告知书</view>
<view class="form">
<template v-for="(i,index) in formObject">
<view
class="form-item"
:key="index"
>
<view class="label">{{i.label}}</view>
<view class="value">
<template v-if="i.type == 'input'">
<input
:type="i.inputType"
:maxlength="i.maxlength"
/>
</template>
<template>
</template>
</view>
</view>
</template>
</view>
<template v-for="(i,index) in views">
<view
class="view"
:key="index"
>
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
drawStatus
></wnCanvas>
</view>
</template>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import Tabs from './Tabs.vue'
export default {
components: { Tabs },
props: {
views: Array
},
name: 'Media_1',
data () {
return {
formObject: [
{
label: '车主姓名',
key: '',
type: 'input',
inputType: 'text',
maxlength: 50
},
{
label: '车型',
key: '',
type: 'select'
},
{
label: '电话',
key: '',
type: 'input',
inputType: 'tel',
maxlength: 20
},
{
label: '销售姓名',
key: '',
type: 'select'
}
]
}
},
mounted () {
},
methods: {
changeView (index) {
},
}
}
</script>
<style scoped lang='scss'>
.layout {
padding-top: 272rpx;
position: relative;
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 864rpx;
background-color: #096;
}
.content {
border-radius: 40rpx 40rpx 0 0;
background: linear-gradient(180deg, #f7f9fc 0%, #f7f9fc 100%);
overflow: hidden;
position: relative;
z-index: 1;
.title {
font-weight: 500;
font-size: 48rpx;
color: #1a1a1a;
padding: 32rpx 0;
text-align: center;
}
.form{
display: flex;
flex-wrap: wrap;
gap: 28rpx 0;
&-item{
flex: 50%;
display: flex;
align-items: center;
.value{}
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<view class="tabs">
<template v-for="(item,index) in list">
<view
:class="['tab',{active:index == tabIndex}]"
:key="index"
@click="tabClick(index)"
>
{{item}}
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: 'Tabs',
props: {
list: Array
},
data () {
return {
tabIndex: 0
}
},
mounted () {
},
methods: {
tabClick (index) {
this.$emit('tabclick', index)
}
}
}
</script>
<style scoped lang='scss'>
.tabs {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
gap: 0 32rpx;
margin-bottom: 32rpx;
.tab {
width: 384rpx;
height: 80rpx;
background: #ffffff;
border: 2rpx solid #dce0e6;
font-size: 32rpx;
color: #292d33;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
}
.active {
border: 4rpx solid #292d33;
font-weight: 500;
color: #292d33;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -90,7 +90,6 @@ export default { ...@@ -90,7 +90,6 @@ export default {
}, },
methods: { methods: {
jump (item) { jump (item) {
console.log(item)
this.$emit('choose', item) this.$emit('choose', item)
}, },
finish () { finish () {
......
...@@ -6,14 +6,17 @@ ...@@ -6,14 +6,17 @@
* @LastEditTime: 2024-04-08 20:43:15 * @LastEditTime: 2024-04-08 20:43:15
--> -->
<template> <template>
<view> <view class="detail-box">
<view class="nav-bar">
<view class="back" @click="back">
</view>
</view>
<tool-box <tool-box
:type="type" :type="type"
@choose="choose" @choose="choose"
@finish="open" @finish="open"
/> />
详情页 <media_1 :views="mediaList" />
<button @click="open">完成接待</button>
<pay-pop ref="pay"></pay-pop> <pay-pop ref="pay"></pay-pop>
</view> </view>
</template> </template>
...@@ -21,16 +24,21 @@ ...@@ -21,16 +24,21 @@
import payPop from './components/payPop.vue'; import payPop from './components/payPop.vue';
import ToolBox from './components/ToolBox.vue' import ToolBox from './components/ToolBox.vue'
import myClick from "@/mixin/click"; import myClick from "@/mixin/click";
import Media_1 from './components/Media_1.vue'
export default { export default {
components: { ToolBox, payPop }, components: { ToolBox, payPop, Media_1 },
mixins: [myClick], mixins: [myClick],
data () { data () {
return { return {
type: 'preview' type: 'preview',
id: '',
mediaList: []
}; };
}, },
onLoad (options) { onLoad (options) {
this.type = options.type this.type = options.type
this.id = options.id
this.getFindSoureDetail(options.id)
}, },
methods: { methods: {
open () { open () {
...@@ -39,136 +47,34 @@ export default { ...@@ -39,136 +47,34 @@ export default {
/**切换素材 */ /**切换素材 */
choose (e) { choose (e) {
console.log(e) console.log(e)
},
async getFindSoureDetail (id) {
try {
this.mediaList = await uni.$api.commonApi.getFindSoureDetail({ id }) || []
} catch (error) {
}
},
back(){
uni.navigateBack()
} }
}, },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.popup-box { .nav-bar{
position: relative; position: fixed;
margin-top: 286rpx; width: 100%;
background-color: #f8f9f9; height: 96rpx;
height: 1160rpx; left: 0;
padding-bottom: 30rpx; top: 48rpx;
.payment-title { z-index: 2;
position: relative; .back{
width: 100%; height: 100%;
height: 96rpx; aspect-ratio: 1/1;
padding: 24rpx 0 26rpx;
text-align: center;
border-bottom: 1px solid #e8e8e8;
.icon-close {
position: absolute;
right: 0;
top: 0;
width: 160rpx;
height: 96rpx;
font-size: 50rpx;
text-align: right;
padding-right: 20rpx;
line-height: 96rpx;
}
}
}
.popup-content {
.tab-list {
display: flex;
justify-content: center;
margin-top: 40rpx;
.tab-item {
width: 320rpx;
padding: 24rpx 0 28rpx;
text-align: center;
background-color: #fff;
color: #666;
&.active {
background-color: #2c66f7;
color: #fff;
}
&:first-child {
border-radius: 200rpx 0 0 200rpx;
}
&:last-child {
border-radius: 0 48rpx 48rpx 0;
}
}
}
.payment-content {
width: 100%;
display: flex; display: flex;
align-items: center;
justify-content: center; justify-content: center;
margin-top: 40rpx;
.qr-code-content {
width: 538rpx;
background-color: #fff;
border-radius: 24rpx;
text-align: center;
padding: 59rpx 0 67rpx;
.qr-code-img {
width: 420rpx;
height: 420rpx;
}
.qr-code-info {
margin-top: 40rpx;
font-weight: 500;
font-size: 32rpx;
color: #1a1a1a;
}
}
.corporate-content {
width: 1080rpx;
background-color: #fff;
border-radius: 24rpx;
.bank-logo {
width: 100%;
height: 136rpx;
}
.bank-info {
font-weight: 500;
font-size: 32rpx;
padding: 27rpx 80rpx 39rpx;
.bank-item {
display: flex;
align-items: center;
margin-bottom: 16rpx;
&:last-child {
margin-bottom: 0;
}
.bank-label {
color: #6c6c70;
// line-height: 94rpx;
}
.bank-value {
box-sizing: border-box;
background-color: #f8f9f9;
border-radius: 8rpx;
width: 740rpx;
height: 80rpx;
line-height: 80rpx;
padding-left: 24rpx;
font-weight: 500;
font-size: 32rpx;
color: #1a1a1a;
letter-spacing: 0;
}
}
}
}
} }
} }
.payment-done {
position: absolute;
bottom: 30rpx;
left: 50%;
transform: translateX(-50%);
width: calc(100% - 240rpx);
height: 80rpx;
font-weight: 500;
font-size: 32rpx;
color: #ffffff;
text-align: center;
line-height: 80rpx;
background-color: #2c66f7;
border-radius: 40rpx;
}
</style> </style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-04-07 14:39:40 * @Date: 2024-04-07 14:39:40
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-09 14:34:41 * @LastEditTime: 2024-04-09 14:37:11
--> -->
<template> <template>
<view class="container"> <view class="container">
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<MessageBox <MessageBox
v-if="messageBoxVisible" v-if="messageBoxVisible"
@cancel="cancel" @cancel="cancel"
@confirm="confirm" @confirm="preview"
content="直接点击素材可进行预览,若面向车辆主展示,请点击页面下方的「开始接待」" content="直接点击素材可进行预览,若面向车辆主展示,请点击页面下方的「开始接待」"
confirmBtnText="预览" confirmBtnText="预览"
></MessageBox> ></MessageBox>
...@@ -79,16 +79,17 @@ export default { ...@@ -79,16 +79,17 @@ export default {
return { return {
messageBoxVisible: false, messageBoxVisible: false,
moduleList: [ moduleList: [
{ // {
id: 1, // id: 1,
sort: 1, // sort: 1,
thumbnail: // thumbnail:
"https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/11.png", // "https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/11.png",
title: "问界三包政策", // title: "问界三包政策",
type: 1, // type: 1,
}, // },
], ],
userInfo: {}, userInfo: {},
id: "",
}; };
}, },
onLoad(options) { onLoad(options) {
...@@ -121,15 +122,17 @@ export default { ...@@ -121,15 +122,17 @@ export default {
url: `../detail/detail?id=${item.id}&type=edit`, url: `../detail/detail?id=${item.id}&type=edit`,
}); });
} else { } else {
this.id = item.id;
this.messageBoxVisible = true; this.messageBoxVisible = true;
} }
}, },
cancel() { cancel() {
this.messageBoxVisible = false; this.messageBoxVisible = false;
}, },
confirm() { preview() {
let { id } = this;
uni.navigateTo({ uni.navigateTo({
url: `../detail/detail?type=preview`, url: `../detail/detail?type=preview&id=${id}`,
}); });
this.messageBoxVisible = false; this.messageBoxVisible = false;
}, },
......
...@@ -3,47 +3,168 @@ ...@@ -3,47 +3,168 @@
* @Author: huyue * @Author: huyue
* @Date: 2024-04-07 14:54:28 * @Date: 2024-04-07 14:54:28
* @LastEditors: huyue * @LastEditors: huyue
* @LastEditTime: 2024-04-08 20:39:44 * @LastEditTime: 2024-04-09 13:51:17
--> -->
<template> <template>
<view class="information-entry"> <view class="information-entry">
<view class="information-tips">建议同步采集资源,若接待工作单一可在提单初期再进行补充。</view> <view class="information-tips"
<button @tap="choose">调摄像头</button> >建议同步采集资源,若接待工作单一可在提单初期再进行补充。</view
<view>客户付款凭证</view> >
</view> <view class="information-box">
<view class="information-item" v-for="(item, index) in infoList" :key="item.title">
<view class="upload-img" v-if="item.imgUrl">
<image class="img" :src="item.imgUrl" mode="scaleToFill" />
<uni-icons class="upload-close" type="clear" :size="20" @click="close(index)"></uni-icons>
</view>
<view v-else class="icon" @tap="choose(index)">
<glsx-image class="icon-upload" src="detail/icon-upload.png" mode="scaleToFill"/>
</view>
<view class="information-title">{{item.title}} </view>
</view>
</view>
<view class="information-done" @click="done()">完成接待</view>
</view>
</template> </template>
<script> <script>
export default { import upload from "@/utils/ossUploadFile/uploadFile.js";
data() { const INFO_LIST = [
return { {
id: 1,
}; title: '客户付款凭证',
}, },
onLoad(options) { {
const text = options.text id: 2,
uni.setNavigationBarTitle({
title: text title: '客户购车发票',
}); },
}, {
id: 3,
title: '客户延保合同',
}
]
export default {
data() {
return {
infoList: INFO_LIST,
};
},
onLoad(options) {
const text = options.text;
uni.setNavigationBarTitle({
title: text,
});
},
methods: { methods: {
choose() { // 上传图
uni.chooseImage({ choose(index) {
count: 1, uni.chooseImage({
success: (res) => { count: 1,
console.log(res) success: async (res) => {
}, // await upload(res.tempFilePath)
fail: (err) => { this.$set(this.infoList[index], 'imgUrl', await upload(res.tempFilePaths[0]));
console.log(err) // this.infoList[index].imgUrl = await upload(res.tempFilePaths[0])
} console.log(this.infoList, '======')
}) },
} fail: (err) => {
console.log(err);
},
});
},
// 删除图
close(index) {
this.$set(this.infoList[index], 'imgUrl')
} }
} },
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.information-entry { .information-entry {
.information-tips { position: relative;
background-color: #fff;
} height: 100vh;
.information-tips {
background: rgba(44, 102, 247, 0.1);
color: #2c66f7;
padding: 32rpx 0 24rpx 80rpx;
font-size: 28rpx;
}
.information-box {
display: flex;
padding: 40rpx 80rpx;
.information-item {
display: flex;
flex-direction: column;
width: 264rpx;
margin-right: 48rpx;
.icon {
background-color: #f4f5f7;
border: 2rpx solid #eff0f2;
border-radius: 16rpx;
.icon-upload {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 128rpx;
height: 128rpx;
}
}
.icon, .upload-img {
position: relative;
width: 264rpx;
height: 264rpx;
}
.upload-img {
.img {
width: 100%;
height: 100%;
}
.upload-close {
position: absolute;
right: 0;
top: 0;
width: 40rpx;
height: 40rpx;
// transform: translate(50%, -50%);
// text-align: center;
// font-size: 36rpx;
// line-height: 40rpx;
// display: flex;
// align-items: center;
// justify-content: center;
// background-color: #3D3D3D;
// border-radius: 50%;
// color: #fff;
}
}
.information-title {
margin-top: 24rpx;
font-weight: 500;
font-size: 28rpx;
color: #222222;
letter-spacing: 0;
line-height: 48rpx;
text-align: center;
}
}
}
}
.information-done {
position: absolute;
bottom: 30rpx;
left: 50%;
transform: translateX(-50%);
width: calc(100% - 240rpx);
height: 80rpx;
font-weight: 500;
font-size: 32rpx;
color: #ffffff;
text-align: center;
line-height: 80rpx;
background-color: #2c66f7;
border-radius: 40rpx;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
## 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)
- 优化 size 支持其他单位
## 1.3.3(2022-01-17)
- 修复 nvue 有些图标不显示的bug,兼容老版本图标
## 1.3.2(2021-12-01)
- 优化 示例可复制图标名称
## 1.3.1(2021-11-23)
- 优化 兼容旧组件 type 值
## 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-icons](https://uniapp.dcloud.io/component/uniui/uni-icons)
## 1.1.7(2021-11-08)
## 1.2.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.1.5(2021-05-12)
- 新增 组件示例地址
## 1.1.4(2021-02-05)
- 调整为uni_modules目录规范
<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} 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: Object,
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="styleObj" class="uni-icons" @click="_onClick">{{unicode}}</text>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<text :style="styleObj" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick">
<slot></slot>
</text>
<!-- #endif -->
</template>
<script>
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;
}
// #ifdef APP-NVUE
var domModule = weex.requireModule('dom');
import iconUrl from './uniicons.ttf'
domModule.addRule('fontFace', {
'fontFamily': "uniicons",
'src': "url('" + iconUrl + "')"
});
// #endif
/**
* Icons 图标
* @description 用于展示 icons 图标
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
* @property {Number} size 图标大小
* @property {String} type 图标图案,参考示例
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标
* @event {Function} click 点击 Icon 触发事件
*/
export default {
name: 'UniIcons',
emits: ['click'],
props: {
type: {
type: String,
default: ''
},
color: {
type: String,
default: '#333333'
},
size: {
type: [Number, String],
default: 16
},
customPrefix: {
type: String,
default: ''
},
fontFamily: {
type: String,
default: ''
}
},
data() {
return {
icons: fontData
}
},
computed: {
unicode() {
let code = this.icons.find(v => v.font_class === this.type)
if (code) {
return code.unicode
}
return ''
},
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: {
_onClick() {
this.$emit('click')
}
}
}
</script>
<style lang="scss">
/* #ifndef APP-NVUE */
@import './uniicons.css';
@font-face {
font-family: uniicons;
src: url('./uniicons.ttf');
}
/* #endif */
.uni-icons {
font-family: uniicons;
text-decoration: none;
text-align: center;
}
</style>
.uniui-cart-filled:before {
content: "\e6d0";
}
.uniui-gift-filled:before {
content: "\e6c4";
}
.uniui-color:before {
content: "\e6cf";
}
.uniui-wallet:before {
content: "\e6b1";
}
.uniui-settings-filled:before {
content: "\e6ce";
}
.uniui-auth-filled:before {
content: "\e6cc";
}
.uniui-shop-filled:before {
content: "\e6cd";
}
.uniui-staff-filled:before {
content: "\e6cb";
}
.uniui-vip-filled:before {
content: "\e6c6";
}
.uniui-plus-filled:before {
content: "\e6c7";
}
.uniui-folder-add-filled:before {
content: "\e6c8";
}
.uniui-color-filled:before {
content: "\e6c9";
}
.uniui-tune-filled:before {
content: "\e6ca";
}
.uniui-calendar-filled:before {
content: "\e6c0";
}
.uniui-notification-filled:before {
content: "\e6c1";
}
.uniui-wallet-filled:before {
content: "\e6c2";
}
.uniui-medal-filled:before {
content: "\e6c3";
}
.uniui-fire-filled:before {
content: "\e6c5";
}
.uniui-refreshempty:before {
content: "\e6bf";
}
.uniui-location-filled:before {
content: "\e6af";
}
.uniui-person-filled:before {
content: "\e69d";
}
.uniui-personadd-filled:before {
content: "\e698";
}
.uniui-arrowthinleft:before {
content: "\e6d2";
}
.uniui-arrowthinup:before {
content: "\e6d3";
}
.uniui-arrowthindown:before {
content: "\e6d4";
}
.uniui-back:before {
content: "\e6b9";
}
.uniui-forward:before {
content: "\e6ba";
}
.uniui-arrow-right:before {
content: "\e6bb";
}
.uniui-arrow-left:before {
content: "\e6bc";
}
.uniui-arrow-up:before {
content: "\e6bd";
}
.uniui-arrow-down:before {
content: "\e6be";
}
.uniui-arrowthinright:before {
content: "\e6d1";
}
.uniui-down:before {
content: "\e6b8";
}
.uniui-bottom:before {
content: "\e6b8";
}
.uniui-arrowright:before {
content: "\e6d5";
}
.uniui-right:before {
content: "\e6b5";
}
.uniui-up:before {
content: "\e6b6";
}
.uniui-top:before {
content: "\e6b6";
}
.uniui-left:before {
content: "\e6b7";
}
.uniui-arrowup:before {
content: "\e6d6";
}
.uniui-eye:before {
content: "\e651";
}
.uniui-eye-filled:before {
content: "\e66a";
}
.uniui-eye-slash:before {
content: "\e6b3";
}
.uniui-eye-slash-filled:before {
content: "\e6b4";
}
.uniui-info-filled:before {
content: "\e649";
}
.uniui-reload:before {
content: "\e6b2";
}
.uniui-micoff-filled:before {
content: "\e6b0";
}
.uniui-map-pin-ellipse:before {
content: "\e6ac";
}
.uniui-map-pin:before {
content: "\e6ad";
}
.uniui-location:before {
content: "\e6ae";
}
.uniui-starhalf:before {
content: "\e683";
}
.uniui-star:before {
content: "\e688";
}
.uniui-star-filled:before {
content: "\e68f";
}
.uniui-calendar:before {
content: "\e6a0";
}
.uniui-fire:before {
content: "\e6a1";
}
.uniui-medal:before {
content: "\e6a2";
}
.uniui-font:before {
content: "\e6a3";
}
.uniui-gift:before {
content: "\e6a4";
}
.uniui-link:before {
content: "\e6a5";
}
.uniui-notification:before {
content: "\e6a6";
}
.uniui-staff:before {
content: "\e6a7";
}
.uniui-vip:before {
content: "\e6a8";
}
.uniui-folder-add:before {
content: "\e6a9";
}
.uniui-tune:before {
content: "\e6aa";
}
.uniui-auth:before {
content: "\e6ab";
}
.uniui-person:before {
content: "\e699";
}
.uniui-email-filled:before {
content: "\e69a";
}
.uniui-phone-filled:before {
content: "\e69b";
}
.uniui-phone:before {
content: "\e69c";
}
.uniui-email:before {
content: "\e69e";
}
.uniui-personadd:before {
content: "\e69f";
}
.uniui-chatboxes-filled:before {
content: "\e692";
}
.uniui-contact:before {
content: "\e693";
}
.uniui-chatbubble-filled:before {
content: "\e694";
}
.uniui-contact-filled:before {
content: "\e695";
}
.uniui-chatboxes:before {
content: "\e696";
}
.uniui-chatbubble:before {
content: "\e697";
}
.uniui-upload-filled:before {
content: "\e68e";
}
.uniui-upload:before {
content: "\e690";
}
.uniui-weixin:before {
content: "\e691";
}
.uniui-compose:before {
content: "\e67f";
}
.uniui-qq:before {
content: "\e680";
}
.uniui-download-filled:before {
content: "\e681";
}
.uniui-pyq:before {
content: "\e682";
}
.uniui-sound:before {
content: "\e684";
}
.uniui-trash-filled:before {
content: "\e685";
}
.uniui-sound-filled:before {
content: "\e686";
}
.uniui-trash:before {
content: "\e687";
}
.uniui-videocam-filled:before {
content: "\e689";
}
.uniui-spinner-cycle:before {
content: "\e68a";
}
.uniui-weibo:before {
content: "\e68b";
}
.uniui-videocam:before {
content: "\e68c";
}
.uniui-download:before {
content: "\e68d";
}
.uniui-help:before {
content: "\e679";
}
.uniui-navigate-filled:before {
content: "\e67a";
}
.uniui-plusempty:before {
content: "\e67b";
}
.uniui-smallcircle:before {
content: "\e67c";
}
.uniui-minus-filled:before {
content: "\e67d";
}
.uniui-micoff:before {
content: "\e67e";
}
.uniui-closeempty:before {
content: "\e66c";
}
.uniui-clear:before {
content: "\e66d";
}
.uniui-navigate:before {
content: "\e66e";
}
.uniui-minus:before {
content: "\e66f";
}
.uniui-image:before {
content: "\e670";
}
.uniui-mic:before {
content: "\e671";
}
.uniui-paperplane:before {
content: "\e672";
}
.uniui-close:before {
content: "\e673";
}
.uniui-help-filled:before {
content: "\e674";
}
.uniui-paperplane-filled:before {
content: "\e675";
}
.uniui-plus:before {
content: "\e676";
}
.uniui-mic-filled:before {
content: "\e677";
}
.uniui-image-filled:before {
content: "\e678";
}
.uniui-locked-filled:before {
content: "\e668";
}
.uniui-info:before {
content: "\e669";
}
.uniui-locked:before {
content: "\e66b";
}
.uniui-camera-filled:before {
content: "\e658";
}
.uniui-chat-filled:before {
content: "\e659";
}
.uniui-camera:before {
content: "\e65a";
}
.uniui-circle:before {
content: "\e65b";
}
.uniui-checkmarkempty:before {
content: "\e65c";
}
.uniui-chat:before {
content: "\e65d";
}
.uniui-circle-filled:before {
content: "\e65e";
}
.uniui-flag:before {
content: "\e65f";
}
.uniui-flag-filled:before {
content: "\e660";
}
.uniui-gear-filled:before {
content: "\e661";
}
.uniui-home:before {
content: "\e662";
}
.uniui-home-filled:before {
content: "\e663";
}
.uniui-gear:before {
content: "\e664";
}
.uniui-smallcircle-filled:before {
content: "\e665";
}
.uniui-map-filled:before {
content: "\e666";
}
.uniui-map:before {
content: "\e667";
}
.uniui-refresh-filled:before {
content: "\e656";
}
.uniui-refresh:before {
content: "\e657";
}
.uniui-cloud-upload:before {
content: "\e645";
}
.uniui-cloud-download-filled:before {
content: "\e646";
}
.uniui-cloud-download:before {
content: "\e647";
}
.uniui-cloud-upload-filled:before {
content: "\e648";
}
.uniui-redo:before {
content: "\e64a";
}
.uniui-images-filled:before {
content: "\e64b";
}
.uniui-undo-filled:before {
content: "\e64c";
}
.uniui-more:before {
content: "\e64d";
}
.uniui-more-filled:before {
content: "\e64e";
}
.uniui-undo:before {
content: "\e64f";
}
.uniui-images:before {
content: "\e650";
}
.uniui-paperclip:before {
content: "\e652";
}
.uniui-settings:before {
content: "\e653";
}
.uniui-search:before {
content: "\e654";
}
.uniui-redo-filled:before {
content: "\e655";
}
.uniui-list:before {
content: "\e644";
}
.uniui-mail-open-filled:before {
content: "\e63a";
}
.uniui-hand-down-filled:before {
content: "\e63c";
}
.uniui-hand-down:before {
content: "\e63d";
}
.uniui-hand-up-filled:before {
content: "\e63e";
}
.uniui-hand-up:before {
content: "\e63f";
}
.uniui-heart-filled:before {
content: "\e641";
}
.uniui-mail-open:before {
content: "\e643";
}
.uniui-heart:before {
content: "\e639";
}
.uniui-loop:before {
content: "\e633";
}
.uniui-pulldown:before {
content: "\e632";
}
.uniui-scan:before {
content: "\e62a";
}
.uniui-bars:before {
content: "\e627";
}
.uniui-checkbox:before {
content: "\e62b";
}
.uniui-checkbox-filled:before {
content: "\e62c";
}
.uniui-shop:before {
content: "\e62f";
}
.uniui-headphones:before {
content: "\e630";
}
.uniui-cart:before {
content: "\e631";
}
{
"id": "uni-icons",
"displayName": "uni-icons 图标",
"version": "2.0.9",
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
"keywords": [
"uni-ui",
"uniui",
"icon",
"图标"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.2.14"
},
"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"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y",
"app-uvue": "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",
"钉钉": "y",
"快手": "y",
"飞书": "y",
"京东": "y"
},
"快应用": {
"华为": "y",
"联盟": "y"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
## Icons 图标
> **组件名:uni-icons**
> 代码块: `uIcons`
用于展示 icons 图标 。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-icons)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!