提交 bc5c1577 编写于 作者: 刘英杰's avatar 刘英杰

v20240416 添加护照校验

上级 3ec27180
default:
before_script:
- chcp 65001
stages:
- publish
build:
stage: publish
script:
- remove-item -Force -Recurse D:\ASC_web\A00051\qth5*
- xcopy "unpackage/dist/build/h5" "D:\ASC_web\A00051\qth5\" /s/e/y/
only:
- wx
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"default" :
{
"launchtype" : "local"
},
"mp-weixin" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
]
}
......@@ -6,10 +6,10 @@ import './uni.promisify.adaptor'
import uView from 'uview-ui'
import hooks from "./hooks/index.js"
Vue.use(uView)
// import Vconsole from 'vconsole'
//
// let vConsole = new Vconsole()
// Vue.use(vConsole)
import Vconsole from 'vconsole'
let vConsole = new Vconsole()
Vue.use(vConsole)
// 如此配置即可
uni.$u.config.unit = 'rpx'
// 调用setConfig方法,方法内部会进行对象属性深度合并,可以放心嵌套配置
......
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path" : "pages/403/403",
"style" :
{
"navigationBarTitleText": "博物馆预约",
"enablePullDownRefresh": false
}
},
"pages": [
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path" : "pages/getWxCode/InitInfo",
"style" :
......@@ -16,13 +9,13 @@
"navigationBarTitleText": "博物馆预约"
}
},
{
"path" : "pages/getWxCode/teamCode",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
},
{
"path" : "pages/getWxCode/teamCode",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
},
{
"path" : "pages/SSO/index",
"style" :
......@@ -37,92 +30,102 @@
}
}
,{
"path" : "pages/tourist-appointment/index",
"style" :
{
"path" : "pages/tourist-appointment/index",
"style" :
{
"navigationStyle":"custom",// 去除顶部 导航栏
"enablePullDownRefresh": false
"enablePullDownRefresh": false
// "navigationBarBackgroundColor": "#F1EDE8"
}
}
,{
"path" : "pages/team-appointment/index",
"style" :
{
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/official-appointment/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
,{
"path" : "pages/record-appointment/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
,{
"path" : "pages/showQRcode/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
}
,{
"path" : "pages/team-appointment/index",
"style" :
{
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/official-appointment/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
,{
"path" : "pages/record-appointment/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
,{
"path" : "pages/showQRcode/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
,{
"path" : "pages/approvalEnqueue/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
,{
"path" : "pages/share/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
,{
"path" : "pages/approvalEnqueue/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
,{
"path" : "pages/share/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
,{
"path" : "pages/login/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
,{
"path" : "pages/login/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
},
{
"path" : "pages/loginPC/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
},
{
"path" : "pages/getWechatCallbackCode/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
},
{
"path" : "pages/loginPC/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
},
{
"path" : "pages/getWechatCallbackCode/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
,{
"path" : "pages/passthroughDetail/index",
"style" :
{
,{
"path" : "pages/passthroughDetail/index",
"style" :
{
"navigationStyle":"custom"// 去除顶部 导航栏
"navigationStyle":"custom"// 去除顶部 导航栏
}
}
}
},
{
"path" : "pages/403/403",
"style" :
{
// "navigationBarTitleText": "博物馆预约",
"navigationStyle":"custom",// 去除顶部 导航栏
"enablePullDownRefresh": false
}
}
],
"easycom": {
"autoscan": true,
......
<template>
<view style="display: flex;justify-content: center;align-items: center;width: 100vw;height: 100vh;">
<h3>系统正在维护中...</h3>
</view>
<view style="width: 100vw;height: calc(100vh - 20px);">
<view style="margin-top: 20px;"></view>
<view style="padding: 10px;overflow-y: scroll; box-sizing: border-box;" v-html="text"></view>
</view>
</template>
<script>
export default {
data() {
return {
text:'<p style="text-align:center"><strong><span style="font-size:29px;font-family:宋体">关于琼台书院博物馆继续维修闭馆的公告</span></strong></p><p style="margin-bottom:8px;text-indent:28px"><span style="font-family:宋体;color:#333333">&nbsp;</span></p><p style="margin-bottom:8px;text-indent:37px;line-height:250%"><span style="font-size:19px;line-height:250%;font-family:宋体;color:#333333">琼台书院博物馆自2024年2月27日起闭馆,继续对书院建筑外立面开展“书院博物馆部分场所维修项目”,维修室外损坏的涂料、漆面等,开馆时间另行通知。闭馆期间咨询服务电话: 李老师13086025370、孙老师13647579765</span></p><p style="margin-bottom:8px;text-indent:37px;line-height:250%"><span style="font-size:19px;line-height:250%;font-family:宋体;color:#333333">由此带来的不便,敬请谅解。</span></p><p style="margin-bottom:8px;text-align:justify;text-justify:inter-ideograph"><span style="font-family:宋体;color:#333333">&nbsp;</span></p><p style="margin-bottom:8px;text-align:right"><span style="font-size:19px;font-family: 宋体;color:#333333">琼台师范学院琼台书院博物馆 保卫处 (社会治安综合治理办公室)</span></p><p style="margin-bottom:8px;text-align:right"><span style="font-size:19px;font-family:宋体;color:#333333">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2024</span><span style="font-size:19px;font-family:宋体;color:#333333">年2月24日</span></p><p><span style="font-size:16px">&nbsp;</span></p><p><br/></p>'
}
},
methods: {
}
}
</script>
<style>
<style scoped>
body{
width: 100vw;
height: 100vh;
}
</style>
......@@ -45,6 +45,25 @@
export default {
data() {
return {
list1: [{
name: '关注',
}, {
name: '推荐',
}, {
name: '电影'
}, {
name: '科技'
}, {
name: '音乐'
}, {
name: '美食'
}, {
name: '文化'
}, {
name: '财经'
}, {
name: '手工'
}],
key:1,
checkboxValue7:[],
timer:'',
......
......@@ -62,7 +62,7 @@
.c-container-content-top-left,.c-container-content-top-right{
width: 47%;
height: 100%;
background: url('../../static/images/0203_3.png');
background: url('../../static/images/0203_2.png');
background-size: 100% 100%;
box-sizing: border-box;
border-radius: 5%;
......
......@@ -37,30 +37,30 @@
</view>
</u-popup>
</view>
<view class="c-container-content">
<!-- <view class="c-container-content-top">-->
<!-- <view class="c-container-content-top-left" @click="tourist">-->
<!-- <view class="c-container-content-top-left-container">-->
<!-- <view class="c-container-content-top-left-text">-->
<!-- <span style="font-size: 21px">散客预约</span>-->
<!-- </view>-->
<!-- <view class="c-container-content-top-left-icon">-->
<!-- <image src="../../static/images/arrow.png" style="width: 70%;height: 50%;"></image>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="c-container-content-top-right" @click="team">-->
<!-- <view class="c-container-content-top-right-container">-->
<!-- <view class="c-container-content-top-right-text">-->
<!-- <span style="font-size: 21px">团队预约</span>-->
<!-- </view>-->
<!-- <view class="c-container-content-top-right-icon">-->
<!-- <image src="../../static/images/arrow.png" style="width: 70%;height: 50%;"></image>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<view class="c-container-content-center" @click="tourist" style="margin-bottom: 20px;margin-top: 20px;">
<view class="c-container-content" >
<view class="c-container-content-top " style="margin-bottom: 15px">
<view class="c-container-content-top-left" @click="tourist">
<view class="c-container-content-top-left-container">
<view class="c-container-content-top-left-text">
<span style="font-size: 21px">散客预约</span>
</view>
<view class="c-container-content-top-left-icon">
<image src="../../static/images/0203_1.png" style="width: 70%;height: 50%;"></image>
</view>
</view>
</view>
<view class="c-container-content-top-right" @click="team">
<view class="c-container-content-top-right-container">
<view class="c-container-content-top-right-text">
<span style="font-size: 21px">团队预约</span>
</view>
<view class="c-container-content-top-right-icon">
<image src="../../static/images/0203_1.png" style="width: 70%;height: 50%;"></image>
</view>
</view>
</view>
</view>
<!-- <view class="c-container-content-center" @click="tourist" style="margin-bottom: 20px;margin-top: 20px;">
<view class="c-container-content-center-container">
<view class="c-container-content-center-text">
<span style="font-size: 21px">
......@@ -71,21 +71,21 @@
<image src="../../static/images/0203_1.png" style="width: 30%;height: 50%;"></image>
</view>
</view>
</view>
<!-- <view class="c-container-content-center" @click="office">-->
<!-- <view class="c-container-content-center-container">-->
<!-- <view class="c-container-content-center-text">-->
<!-- <span style="font-size: 21px">-->
<!-- 公务接待预约-->
<!-- </span>-->
<!-- </view>-->
<!-- <view class="c-container-content-center-icon">-->
<!-- <image src="../../static/images/arrow.png" style="width: 30%;height: 50%;"></image>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<view class="c-container-content-footer" @click="record">
<view class="c-container-content-footer-container">
</view> -->
<view class="c-container-content-center" @click="office" style="margin-bottom: 15px">
<view class="c-container-content-center-container" >
<view class="c-container-content-center-text">
<span style="font-size: 21px">
公务接待预约
</span>
</view>
<view class="c-container-content-center-icon">
<image src="../../static/images/0203_1.png" style="width: 30%;height: 50%;"></image>
</view>
</view>
</view>
<view class="c-container-content-footer" @click="record" >
<view class="c-container-content-footer-container" >
<view class="c-container-content-footer-text">
<span style="font-size: 21px">
预约记录
......@@ -124,7 +124,6 @@
document.body.style.overflow = 'hidden'
},
onLoad() {
setTimeout(()=>{
//获取须知节点
const element = document.getElementById('notice');
......@@ -135,7 +134,6 @@
this.noticeFlag = true
}
},1000)
this.GetUseCarouselList()
this.GetSysconfigurationInfoByWX()
},
......
......@@ -84,7 +84,6 @@
}
strategicObject[String(name)](value)
},
checkboxChange(e){
console.log("🚀🚀🚀,",e)
},
......@@ -101,6 +100,7 @@
);
},
async login() {
if(!!this.checkbox.length && this.init.phone) api.PCLogin({phone:this.init.phone}).then((res)=>{
this.strategicObject(res.response.login,res)
})
......
......@@ -25,12 +25,12 @@
border-radius: 10px;
width: 100%;
height: 35%;
/*height: 35%;*/
background-color: white;
/*border-radius: 2vw;*/
/*padding: 3vw;*/
box-sizing: border-box;
min-height: 220px;
/*min-height: 220px;*/
}
.content-header-header{
......@@ -54,8 +54,8 @@
}
.content-header-content-header,.content-header-content-footer{
width: 100%;
height: 50%;
/*height: 50%;*/
height: 100px;
}
.content-header-content-footer-content{
width: 100%;
......
......@@ -62,7 +62,7 @@
</view>
</view>
<view class="content-header-content-footer">
<view v-if="false" class="content-header-content-footer">
<view class="content-header-content-footer-hearder">
<span style="color: #574f44;">参观场次</span>
</view>
......@@ -101,30 +101,34 @@
<view class="c-f-f" style="background-color: #F4ECE6">
<view class="c-f-f-i">
<view class="c-f-f-i-t">
姓名
<span style="color: red">*</span>姓名
</view>
<view class="c-f-f-i-f">
<u-input v-model="formDateValidate.name" class="input"></u-input>
<u-input @blur="leaderInformation('zzName')" v-model="formDateValidate.name" class="input"></u-input>
</view>
</view>
<span style="color: red" v-if="zzName">*{{zzName}}</span>
</view>
<view class="c-f-f-i" :key="aaa">
<view class="c-f-f-i-t">
身份证号
<span style="color: red">*</span>身份证号/护照号码
</view>
<view class="c-f-f-i-f">
<u-input @blur="myFunction1" v-model="formDateValidate.identity_num" class="input"></u-input>
<u-input @blur="leaderInformation('zzIdentity_num')" v-model="formDateValidate.identity_num" class="input"></u-input>
</view>
<span style="color: red" v-if="zzIdentity_num">*{{zzIdentity_num}}</span>
</view>
<view class="c-f-f-i">
<view class="c-f-f-i-t">
手机号码
<span style="color: red">*</span>手机号码
</view>
<view class="c-f-f-i-f">
<u-input v-model="formDateValidate.mobile" class="input"></u-input>
<u-input @blur="leaderInformation('zzMobile')" v-model="formDateValidate.mobile" class="input"></u-input>
</view>
</view>
<span style="color: red" v-if="zzMobile">*{{zzMobile}}</span>
</view>
<view class="c-f-f-i">
<view class="c-f-f-i-t">
车辆信息
......@@ -231,6 +235,8 @@
export default {
data() {
return {
zzName:'',
zzMobile:'',
zzIdentity_num:'',
aaa:1,
loading2:false,
......@@ -275,8 +281,52 @@
}
},
methods: {
leaderInformation(key){
//验证领队信息
let object = {
'zzIdentity_num':()=>{
function isPassPortCard(passportNumber) {
let a = /^[a-zA-Z0-9]{1}\d{8}$/
return a.test(passportNumber)
}
const card15 =
/^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$/;
const card18 =
/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (card15.test(this.formDateValidate.identity_num) || card18.test(this.formDateValidate.identity_num)||isPassPortCard(this.formDateValidate.identity_num)) {
this[key] = ''
}
if (!(card15.test(this.formDateValidate.identity_num) || card18.test(this.formDateValidate.identity_num) ||isPassPortCard(this.formDateValidate.identity_num))) {
this[key] = '身份证/护照号码格式异常,请检查身份证号码'
}
},
'zzMobile':()=>{
if (!/^1[3-9]\d{9}$/.test(this.formDateValidate.mobile)) {
this.zzMobile = '手机号格式异常'
}else {
this.zzMobile = ''
}
},
'zzName':()=>{
if (!(this.validateName(this.formDateValidate.name))) {
this.zzName = '姓名格式异常'
}else {
this.zzName = ''
}
}
}
object[key]()
this.aaa ++
},
validateName(name){
//姓名正则验证
var regex = /^[\u4E00-\u9FA5a-zA-Z]+$/;
return regex.test(name);
},
myFunction1(){
console.log("🚀🚀🚀,",123)
//输入框失焦点触发
const card15 =
/^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$/;
......@@ -286,7 +336,7 @@
this.zzIdentity_num = ''
}
if (!(card15.test(this.formDateValidate.identity_num) || card18.test(this.formDateValidate.identity_num))) {
this.zzIdentity_num = '身份证格式异常,请检查身份证号码'
this.zzIdentity_num = '身份证/护照号码格式异常,请检查身份证号码'
}
this.aaa ++
},
......@@ -294,15 +344,20 @@
//输入框失焦点触发
let object = {
'identity_num':()=>{
function isPassPortCard(card) {
let a = /^[a-zA-Z0-9]{1}\d{8}$/
return a.test(card)
}
const card15 =
/^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$/;
const card18 =
/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (card15.test(this.peopleList[index].identity_num) || card18.test(this.peopleList[index].identity_num)) {
if (card15.test(this.peopleList[index].identity_num) || card18.test(this.peopleList[index].identity_num) || isPassPortCard(this.peopleList[index].identity_num)) {
this.peopleList[index].zzIdentity_num = ''
}
if (!(card15.test(this.peopleList[index].identity_num) || card18.test(this.peopleList[index].identity_num))) {
this.peopleList[index].zzIdentity_num = '身份证格式异常,请检查身份证号码'
if (!(card15.test(this.peopleList[index].identity_num) || card18.test(this.peopleList[index].identity_num) || isPassPortCard(this.peopleList[index].identity_num)) ) {
this.peopleList[index].zzIdentity_num = '身份证/护照号码格式异常,请检查身份证号码'
}
},
'mobile':()=>{
......@@ -322,20 +377,27 @@
...this.formDateValidate,
type : 2,
museum_date:this.itemObject.initDate,
moment: this.lastAndAfternoonStatus === 3 ? '1' : '2',
// moment: this.lastAndAfternoonStatus === 3 ? '1' : '2',
moment:0,
users:this.peopleList
}
let object = {
bookNow:async () => {
this.loading2 = true;
api.TeamOrOfficialCreate(this.formDateValidate).then((res)=>{
this.$u.toast(res.msg);
if (res.code === 1){
this.$u.toast(res.msg);
setTimeout(()=>{
uni.navigateTo({
url:'/pages/record-appointment/index'
})
},1000)
}else{
this.$u.toast(res.msg_detail);
}
this.loading2 = false;
setTimeout(()=>{
uni.navigateTo({
url:'/pages/record-appointment/index'
})
},1000)
}) //立即预约
}
}
......@@ -357,9 +419,12 @@
if(cur.date === dayjs(day.date).format('MM月DD日') && cur.state === 0)
{
day.bottomInfo = '可订'
}else if( cur.date === dayjs(day.date).format('MM月DD日') && cur.state === 0){
}else if( cur.date === dayjs(day.date).format('MM月DD日') && cur.state === 1){
day.disabled = true
}
}else if (!this.dateList.map(cur=>cur.date).includes(dayjs(day.date).format('MM月DD日'))){
//日期数据不包含也移除
day.disabled = true
}
})
return day
},
......@@ -401,6 +466,7 @@
this.lastAndAfternoonStatus = '' //选择日期时 初始化 上下午状态
this.dateList[index].OkState = 3 // 选中日期 显示打勾 通过 OkState === 3 则打勾
if(index) this.zhidingriqi = true
this.$forceUpdate()
}
},
deleteAddPeole(index){
......
......@@ -75,3 +75,133 @@
}
.container-superclass{
width: 100vw;
height: calc( 100vh - 44px);
background: #F2EEE9;
overflow-y: auto;
max-width: 430px;
max-height:1000px;
margin-left: auto;
margin-right: auto;
}
.container1{
width: 100%;
height: 65%;
padding: 15px;
box-sizing: border-box;
}
.top{
width: 100%;
height: 2%;
background: #D89A7C;
border-top-left-radius:15px ;
border-top-right-radius:15px ;
}
.content-top{
width: 100%;
height: 28%;
background: #FFFBF7;
min-height: 150px;
}
.content-footer{
width: 100%;
height: 4%;
background: #D89A7C;
box-sizing: border-box;
display: flex;
justify-content: space-between;
position: relative;
border: none;
}
.c-f-l{
width: 15px;
height: 100%;
border-radius: 0 50px 50px 0;
background: #F2EEE9;
position: absolute;
left: 0;
border: none;
}
.c-f-r{
width: 15px;
height: 100%;
border-radius: 50px 0 0 50px;
background: #F2EEE9;
position: absolute;
right: 0;
border: none;
}
.footer1{
width: 100%;
height: 64%;
background: url("../../static/images/home-bg.png");
background-size: cover;
min-height: 340px;
border: #F7CFCB 1px solid;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
display: flex;
align-items: center;
justify-content: center;
}
.c-item{
width: 100%;
height: 23%;
min-height: 160px;
border-radius:10px;
background: #FFFBF7;
margin-bottom: 20px;
padding: 15px;
box-sizing: border-box;
}
.c-h{
width: 100%;
height: 30%;
display: flex;
align-items: center;
box-sizing: border-box;
font-size: 25px;
font-family: '宋体';
font-weight: bolder;
color: #574f44;
border-bottom: #F2EEE9 1.5px solid;
margin-bottom: 15px;
}
.c-c{
width: 100%;
height: 75%;
box-sizing: border-box;
position: relative;
}
.c-c-text-container{
display: flex;
width: 100%;
height: 20%;
color: #574f44;
font-size: 20px;
font-family: '宋体';
margin-top: 5px;
}
.c-c-t-right{
width: 30%;
height: 100%;
display: flex;
align-items: center;
}
.c-c-t-left{
width: 70%;
height: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
}
<template>
<view class="container">
<view class="header">
<view style="width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;">通行凭证</view>
<!-- <u-navbar-->
<!-- title="通行凭证"-->
<!-- @leftClick="leftClick"-->
<!-- :autoBack="true"-->
<!-- leftText="返回"-->
<!-- bgColor="#f6f3f3"-->
<!-- style="background: #f6f3f3;"-->
<!-- >-->
<!-- </u-navbar>-->
</view>
<view class="contentFather">
<!-- <view style="width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;">通行凭证</view>-->
<u-tabs lineWidth="45"
:scrollable="false" lineColor="#942119" :lineWidth="80" :lineHeight="8" :list="list1" @change="change"></u-tabs>
</view>
<view v-if="showValue==='1'" class="contentFather">
<view class="content">
<view class="c-header-radius-icon">
<span class="c-header-radius-icon-text">
......@@ -58,18 +52,19 @@
<view style="display: flex;align-items: center;width: 10%;height: 100%"><u-icon color="#942119" name="account-fill"></u-icon></view>
<view style="display: flex;align-items: center;width: 90%;height: 100%">{{item.name}}</view>
</view>
<view style="width: 100%;min-height: 30px;display: flex; ">
<view style="width: 100%;min-height: 30px;display: flex; " v-if="valueData.type !== 2">
<view style="display: flex;align-items: center;width: 10%;height: 100%"><u-icon color="#942119" name="coupon-fill"></u-icon></view>
<view style="display: flex;align-items: center;width: 90%;height: 100%">{{item.identity_num}}</view>
</view>
<!-- <view style="width: 100%;min-height: 50px;display: flex; padding: 10px">-->
<!-- <view style="width: 30%;height: 100%">职位</view>-->
<!-- <view style="width: 70%;height: 100%">{{item.position}}</view>-->
<!-- </view>-->
<view style="width: 100%;min-height: 30px;display: flex; ">
<view style="width: 100%;min-height: 30px;display: flex; " v-if="valueData.type !== 2">
<view style="display: flex;align-items: center;width: 10%;height: 100%"><u-icon color="#942119" name="phone-fill"></u-icon></view>
<view style="display: flex;align-items: center;width: 90%;height: 100%">{{item.mobile}}</view>
</view>
<view style="width: 100%;min-height: 30px;display: flex; " v-if="valueData.type === 2">
<view style="display: flex;align-items: center;width: 10%;height: 100%"><u-icon color="#942119" name="man-add-fill"></u-icon></view>
<view style="display: flex;align-items: center;width: 90%;height: 100%">{{item.position}}</view>
</view>
<view style="width: 100%;background: #F6F3F3;height: 30px;"></view>
</view>
......@@ -110,11 +105,69 @@
<!-- </view>-->
</view>
<view class="footer">
<view v-if="showValue==='1'" class="footer">
<u-button color="#942119" shape="circle" @click="leftClick" type="primary" style="width: 130px" text="返回"></u-button>
</view>
<view v-if="showValue==='0'" class="container-superclass">
<view class="container1" v-if="formDataValidate">
<view class="top"></view>
<view class="content-top" >
<view class="c-item">
<view class="c-h">
<span> {{['散客预约','团队预约','公务预约接待'][formDataValidate.type]}}</span>
</view>
<view class="c-c">
<view class="c-c-text-container">
<view class="c-c-t-right">
<span>姓名</span>
</view>
<view class="c-c-t-left">
<span>张三</span>
</view>
</view>
<view class="c-c-text-container">
<view class="c-c-t-right">
<span>参观日期</span>
</view>
<view class="c-c-t-left">
<span>{{formDataValidate.museum_date}} </span>
</view>
</view>
<!-- <view class="c-c-text-container">-->
<!-- <view class="c-c-t-right">-->
<!-- <span>预约时间</span>-->
<!-- </view>-->
<!-- <view class="c-c-t-left">-->
<!-- <span>{{formDataValidate.createtime}}</span>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="c-c-text-container">-->
<!-- <view class="c-c-t-right">-->
<!-- <span>人数</span>-->
<!-- </view>-->
<!-- <view class="c-c-t-left">-->
<!-- <span>{{formDataValidate.num}}人</span>-->
<!-- </view>-->
<!-- </view>-->
</view>
</view>
</view>
<view class="content-footer">
<view class="c-f-l"></view>
<view class="c-f-r"></view>
</view>
<view class="footer1" style="background-color:#FFFBF7 ">
<view style="border-radius: 10px; width: 65%;height: 70%;background-color: #F9F3EF;display: flex;align-items: center;justify-content: center">
<u--image :showLoading="true" :src="formDataValidate.qrcode" width="400" height="400" ></u--image>
</view>
</view>
</view>
</view>
<!-- <view style="width: 100%;height: 54px;">-->
<!-- <uni-pagination :total="50" title="标题文字" />-->
<!-- </view>-->
</view>
</template>
......@@ -126,6 +179,23 @@ import dayjs from "dayjs";
export default {
data() {
return {
valueData:{},
showValue:'1',
formDataValidate:{},
qrcode:'',
appointmentId:'',
list1: [
{
name: '预约信息通行凭证',
value:'1',
},
{
name: '二维码通行凭证',
value:'0',
disabled : true
},
],
timer:'',
time:'',
array:[],
......@@ -133,53 +203,77 @@ import dayjs from "dayjs";
}
},
methods: {
change(e){
//tabs改变
let strategey = {
'0':()=>{
this.getAppointmentQRcode()
},
'1':()=>{
this.getAppointmentInfo()
}
}
this.showValue = String(e.value)
strategey[String(e.value)]()
},
leftClick() {
uni.navigateTo({
url:'/pages/record-appointment/index'
})
}
},
onHide(){
clearInterval(this.timer)
},
onLoad(e){
this.timer = setInterval(()=>{
this.time = dayjs().format('YYYY年MM月DD日 HH:mm:ss ')
},1000)
console.log("🚀🚀🚀,",)
// be648888-5f1b-4d88-a76c-b41a2bced4d6
api.GetAppointmentInfo({appointmentid:e.appointmentid}).then(res=>{
this.array = [
{title:'领队名称',value:res.response.name,icon:'account-fill'},
{title:'身份证号码',value:res.response.identity_num,icon:'coupon-fill'},
{title:'手机号码',value:res.response.mobile,icon:'phone-fill'},
{title:'入馆时间',value:res.response.museum_date,icon:'calendar-fill'},
{title:'参观场次',value:['','上午','下午'][res.response.moment]+' '+(res.response.begin_time.split(' ')[1]||'无')+'-'+(res.response.end_time.split(' ')[1]||'无'),icon:'clock-fill'},
// {title:'时段',value:['','上午','下午'][res.response.moment],icon:'clock-fill'},
// {title:'开始时间',value:res.response.begin_time,icon:'clock-fill'},
// {title:'结束时间',value:res.response.end_time,icon:'clock-fill'},
// {title:'入馆状态',value:['未入馆','已入馆'][res.response.museum_state]},
// {title:'使用状态',value:['已取消','待使用','已使用','预约变更'][res.response.employ_state]},
},
{title:'同行人数量',value:res.response.num+'人',icon:'man-add-fill'},
{title:'预约类型',value:['散客预约','团队预约','公务预约'][res.response.type],icon:'bookmark-fill'},
getAppointmentQRcode(){
//获取预约二维码
api.GetAppointmentInfoByWX({appointmentid: this.appointmentId}).then(res=>this.formDataValidate = res.response)
},
getAppointmentInfo(){
//获取预约基础信息
this.timer = setInterval(()=>{
this.time = dayjs().format('YYYY年MM月DD日 HH:mm:ss ')
},1000)
// be648888-5f1b-4d88-a76c-b41a2bced4d6
api.GetAppointmentInfo({appointmentid:this.appointmentId}).then(res=>{
this.valueData = res.response
let strategy = {
'0':()=>this.array = [
{title:'领队名称',value:res.response.name,icon:'account-fill'},
{title:'身份证号码',value:res.response.identity_num,icon:'coupon-fill'},
{title:'手机号码',value:res.response.mobile,icon:'phone-fill'},
{title:'入馆时间',value:res.response.museum_date,icon:'calendar-fill'},
{title:'入场时间',value:['','上午','下午'][res.response.moment]+' '+(res.response.begin_time.split(' ')[1]||'无')+'-'+(res.response.end_time.split(' ')[1]||'无'),icon:'clock-fill'},
{title:'同行人数量',value:res.response.num+'人',icon:'man-add-fill'},
{title:'预约类型',value:['散客预约','团队预约','公务预约'][res.response.type],icon:'bookmark-fill'},
{title:'参观事由',value:res.response.reason,icon:'edit-pen-fill'},
],
'1':()=>this.array = [
{title:'单位名称',value:res.response.unit,icon:'edit-pen-fill'},//团队
{title:'领队名称',value:res.response.name,icon:'account-fill'},
{title:'身份证号码',value:res.response.identity_num,icon:'coupon-fill'},
{title:'手机号码',value:res.response.mobile,icon:'phone-fill'},
{title:'车辆信息',value:res.response.plate_number,icon:'edit-pen-fill'},
// {title:'审批状态',value:['不通过','待审批','已审批'][res.response.approval_state]},
// {title:'审批意见',value:res.response.approval_remark},
// {title:'单位名称',value:res.response.unit},
// {title:'变更原因',value:res.response.change_remark},
{title:'参观事由',value:res.response.reason,icon:'edit-pen-fill'},
]
this.userArray = res.response.users
{title:'入馆时间',value:res.response.museum_date,icon:'calendar-fill'},
{title:'入场时间',value:['','上午','下午'][res.response.moment]+' '+(res.response.begin_time.split(' ')[1]||'无')+'-'+(res.response.end_time.split(' ')[1]||'无'),icon:'clock-fill'},
{title:'同行人数量',value:res.response.num+'人',icon:'man-add-fill'},
{title:'预约类型',value:['散客预约','团队预约','公务预约'][res.response.type],icon:'bookmark-fill'},
{title:'参观事由',value:res.response.reason,icon:'edit-pen-fill'},
],
'2':()=>this.array = [
{title:'领队名称',value:res.response.name,icon:'account-fill'},
{title:'身份证号码',value:res.response.identity_num,icon:'coupon-fill'},
{title:'手机号码',value:res.response.mobile,icon:'phone-fill'},
{title:'车辆信息',value:res.response.plate_number,icon:'edit-pen-fill'},
{title:'入馆时间',value:res.response.museum_date,icon:'calendar-fill'},
{title:'入场时间',value:['','上午','下午'][res.response.moment]+' '+(res.response.begin_time.split(' ')[1]||'无')+'-'+(res.response.end_time.split(' ')[1]||'无'),icon:'clock-fill'},
{title:'同行人数量',value:res.response.num+'人',icon:'man-add-fill'},
{title:'预约类型',value:['散客预约','团队预约','公务预约'][res.response.type],icon:'bookmark-fill'},
{title:'参观事由',value:res.response.reason,icon:'edit-pen-fill'},
]
}
strategy[String(res.response.type)]()
this.userArray = res.response.users
// let object = {
// '0':()=>this.array = [
// {title:'领队名称',value:res.response.name},
......@@ -230,19 +324,29 @@ import dayjs from "dayjs";
// "users": [
// {
// "userid": "b3d53d1c-98e2-431f-bdfa-faeaf574871c",
// "appointment_id": "be648888-5f1b-4d88-a76c-b41a2bced4d6",
// "name": "刘英杰",
// "identity_num": "460000********0000",
// "position": null,
// "mobile": "17000000000",
// "createtime": "2023-09-18 00:00"
// }
// ]
})
// "users": [
// {
// "userid": "b3d53d1c-98e2-431f-bdfa-faeaf574871c",
// "appointment_id": "be648888-5f1b-4d88-a76c-b41a2bced4d6",
// "name": "刘英杰",
// "identity_num": "460000********0000",
// "position": null,
// "mobile": "17000000000",
// "createtime": "2023-09-18 00:00"
// }
// ]
})
}
},
onHide(){
clearInterval(this.timer)
},
onLoad(e){
this.appointmentId = e.appointmentid
// this.getAppointmentQRcode()
this.getAppointmentInfo()
}
}
......
<template>
<view class="content-footer" >
<view ref="people-list" class="content-footer-container" >
<view ref="people-list" class="content-footer-container">
<view class="c-f-h">
参观人员
</view>
<view class="c-f-f" style="background-color: #F4ECE6;">
<view class="c-f-f-i">
<view class="c-f-f-i" :key="aaa">
<view class="c-f-f-i-t">
姓名
<span style="color: red">*</span>姓名
</view>
<view class="c-f-f-i-f">
<u-input v-model="formDataValiedate.name" class="input"></u-input>
<u-input @blur="leaderInformation('zzName')" v-model="formDataValiedate.name" class="input"></u-input>
</view>
<span style="color: red" v-if="zzName">*{{zzName}}</span>
</view>
<view class="c-f-f-i" v-if="init.type === '1'">
<view class="c-f-f-i" v-if="init.type === '1'" :key="aaa">
<view class="c-f-f-i-t">
身份证号
<span style="color: red">*</span>身份证号/护照号码
</view>
<view class="c-f-f-i-f">
<u-input v-model="formDataValiedate.identity_num" class="input"></u-input>
<u-input @blur="leaderInformation('zzIdentity_num')" v-model="formDataValiedate.identity_num" class="input"></u-input>
</view>
<span style="color: red" v-if="zzIdentity_num">*{{zzIdentity_num}}</span>
</view>
<view class="c-f-f-i" v-if="init.type === '2'">
<view class="c-f-f-i-t">
......@@ -46,6 +49,11 @@
export default {
data() {
return {
aaa:1,
zzIdentity_num:'',
zzMobile:'',
zzName:'',
code:this.getUrlKey('code'),
init:{
appointmentid:'',
......@@ -61,6 +69,46 @@
}
},
methods: {
leaderInformation(key){
//验证领队信息
let object = {
'zzIdentity_num':()=>{
console.log("🚀🚀🚀,",this.formDataValiedate.identity_num, this.zzIdentity_num)
function isPassPortCard(passportNumber) {
let a = /^[a-zA-Z0-9]{1}\d{8}$/
return a.test(passportNumber)
}
const card15 =
/^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$/;
const card18 =
/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (card15.test(this.formDataValiedate.identity_num) || card18.test(this.formDataValiedate.identity_num)||isPassPortCard(this.formDataValiedate.identity_num)) {
this.zzIdentity_num = ''
}
if (!(card15.test(this.formDataValiedate.identity_num) || card18.test(this.formDataValiedate.identity_num) ||isPassPortCard(this.formDataValiedate.identity_num))) {
this.zzIdentity_num = '身份证/护照号码格式异常,请检查身份证号码'
}
},
'zzMobile':()=>{
if (!/^1[3-9]\d{9}$/.test(this.formDataValiedate.mobile)) {
this.zzMobile = '手机号格式异常'
}else {
this.zzMobile = ''
}
},
'zzName':()=>{
console.log("🚀🚀🚀,",this.formDataValiedate.name, this.zzName)
if (!(this.validateName(this.formDataValiedate.name))) {
this.zzName = '姓名格式异常'
}else {
this.zzName = ''
}
}
}
console.log("🚀🚀key🚀,",key)
object[String(key)]()
this.aaa ++
},
// 截取url中的token
getUrlKey(name) {
return (
......@@ -71,6 +119,11 @@
) || null
);
},
validateName(name){
//姓名正则验证
var regex = /^[\u4E00-\u9FA5a-zA-Z]+$/;
return regex.test(name);
},
addPeople(){
this.formDataValiedate.appointment_id = this.init.appointmentid
api.ChangeCommitSave(this.formDataValiedate).then(res=> this.$u.toast(res.msg))
......
......@@ -24,12 +24,12 @@
width: 100%;
height: 35%;
/*height: 35%;*/
background-color: white;
/*border-radius: 2vw;*/
/*padding: 3vw;*/
box-sizing: border-box;
min-height: 220px;
/*min-height: 220px;*/
}
.content-header-header{
width: 100%;
......@@ -50,8 +50,8 @@
}
.content-header-content-header,.content-header-content-footer{
width: 100%;
height: 50%;
/*height: 50%;*/
height: 100px;
}
.content-header-content-footer-content{
width: 100%;
......
......@@ -45,7 +45,6 @@
<u-icon name="arrow-right"></u-icon>
</view>
<u-calendar
defaultDate=""
title="请选择参观日期"
:formatter="formatter"
......@@ -61,7 +60,7 @@
</view>
</view>
</view>
<view class="content-header-content-footer">
<view v-if="false" class="content-header-content-footer">
<view class="content-header-content-footer-hearder">
<span style="color: #574f44;font-size: 21px">参观场次</span>
</view>
......@@ -108,31 +107,35 @@
</view>
<view class="c-f-f-i">
<view class="c-f-f-i-t">
领队真实信息
<span style="color: red">*</span>领队真实信息
</view>
<view class="c-f-f-i-f">
<u-input v-model="formDateValidate.name" class="input"></u-input>
<u-input @blur="leaderInformation('zzName')" v-model="formDateValidate.name" class="input"></u-input>
</view>
</view>
<span style="color: red" v-if="zzName">*{{zzName}}</span>
</view>
<view class="c-f-f-i" :key="aaa">
<view class="c-f-f-i-t">
领队身份证号
<span style="color:red">*</span>领队身份证号/护照号码
</view>
<view class="c-f-f-i-f">
<u-input @blur="myFunction1" v-model="formDateValidate.identity_num" class="input"></u-input>
<u-input @blur="leaderInformation('zzIdentity_num')" v-model="formDateValidate.identity_num" class="input"></u-input>
</view>
<span style="color: red" v-if="zzIdentity_num">*{{zzIdentity_num}}</span>
</view>
<view class="c-f-f-i">
<view class="c-f-f-i-t">
手机号码
<span style="color: red">*</span>手机号码
</view>
<view class="c-f-f-i-f">
<u-input v-model="formDateValidate.mobile" class="input"></u-input>
<u-input @blur="leaderInformation('zzMobile')" v-model="formDateValidate.mobile" class="input"></u-input>
</view>
<span style="color: red" v-if="zzMobile">*{{zzMobile}}</span>
</view>
<view class="c-f-f-i">
<view class="c-f-f-i-t">
<!-- <span style="color: red">*</span>-->
车辆信息
</view>
<view class="c-f-f-i-f">
......@@ -170,15 +173,16 @@
<view class="c-f-f" style="background-color: #F4ECE6;">
<view class="c-f-f-i">
<view class="c-f-f-i-t">
姓名
<span style="color: red">*</span>姓名
</view>
<view class="c-f-f-i-f">
<u-input v-model="item.name" class="input"></u-input>
<u-input @blur="myFunction(index,'name')" v-model="item.name" class="input"></u-input>
</view>
<view v-if="item.zzName" style="color: red">*{{item.zzName}}</view>
</view>
<view class="c-f-f-i" :key="aaa">
<view class="c-f-f-i-t">
身份证号
<span style="color: red">*</span>身份证号/护照号码
</view>
<view class="c-f-f-i-f">
<u-input @blur="myFunction(index,'identity_num')" v-model="item.identity_num" class="input"></u-input>
......@@ -248,6 +252,8 @@
return {
aaa:1,
zzIdentity_num:'',
zzMobile:'',
zzName:'',
loading1:false,
loading2:false,
formDateValidate:{
......@@ -262,8 +268,8 @@
value:0,
zhidingriqi:true,
watchDateListState:'',
maxDate: `${year}-${month}-${date + 6}`,
mode: 'single',
maxDate: `${year}-${month}-${date + 6}`,
mode: 'single',
calendar:false,
specifyDateState:'',// 指定日期打勾状态
dateState:'', // 日期打勾状态
......@@ -292,6 +298,43 @@
}
},
methods: {
leaderInformation(key){
//验证领队信息
let object = {
'zzIdentity_num':()=>{
function isPassPortCard(passportNumber) {
let a = /^[a-zA-Z0-9]{1}\d{8}$/
return a.test(passportNumber)
}
const card15 =
/^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$/;
const card18 =
/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (card15.test(this.formDateValidate.identity_num) || card18.test(this.formDateValidate.identity_num)||isPassPortCard(this.formDateValidate.identity_num)) {
this[key] = ''
}
if (!(card15.test(this.formDateValidate.identity_num) || card18.test(this.formDateValidate.identity_num) ||isPassPortCard(this.formDateValidate.identity_num))) {
this[key] = '身份证/护照号码格式异常,请检查身份证号码'
}
},
'zzMobile':()=>{
if (!/^1[3-9]\d{9}$/.test(this.formDateValidate.mobile)) {
this.zzMobile = '手机号格式异常'
}else {
this.zzMobile = ''
}
},
'zzName':()=>{
if (!(this.validateName(this.formDateValidate.name))) {
this.zzName = '姓名格式异常'
}else {
this.zzName = ''
}
}
}
object[key]()
this.aaa ++
},
myFunction1(){
//输入框失焦点触发
const card15 =
......@@ -302,23 +345,29 @@
this.zzIdentity_num = ''
}
if (!(card15.test(this.formDateValidate.identity_num) || card18.test(this.formDateValidate.identity_num))) {
this.zzIdentity_num = '身份证格式异常,请检查身份证号码'
this.zzIdentity_num = '身份证/护照号码格式异常,请检查身份证号码'
}
this.aaa ++
},
myFunction(index,key){
//输入框失焦点触发
let object = {
'identity_num':()=>{
function isPassPortCard(card) {
let a = /^[a-zA-Z0-9]{1}\d{8}$/
return a.test(card)
}
const card15 =
/^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$/;
const card18 =
/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (card15.test(this.peopleList[index].identity_num) || card18.test(this.peopleList[index].identity_num)) {
if (card15.test(this.peopleList[index].identity_num) || card18.test(this.peopleList[index].identity_num) || isPassPortCard(this.peopleList[index].identity_num)) {
this.peopleList[index].zzIdentity_num = ''
}
if (!(card15.test(this.peopleList[index].identity_num) || card18.test(this.peopleList[index].identity_num))) {
this.peopleList[index].zzIdentity_num = '身份证格式异常,请检查身份证号码'
if (!(card15.test(this.peopleList[index].identity_num) || card18.test(this.peopleList[index].identity_num) || isPassPortCard(this.peopleList[index].identity_num)) ) {
this.peopleList[index].zzIdentity_num = '身份证/护照号码格式异常,请检查身份证号码'
}
},
'mobile':()=>{
......@@ -327,17 +376,30 @@
}else {
this.peopleList[index].zzMobile = ''
}
},
'name':()=>{
if (!(this.validateName(this.peopleList[index].name))) {
this.peopleList[index].zzName = '姓名格式异常'
}else {
this.peopleList[index].zzName = ''
}
}
}
object[key]()
this.aaa ++
},
validateName(name){
//姓名正则验证
var regex = /^[\u4E00-\u9FA5a-zA-Z]+$/;
return regex.test(name);
},
teamMuseum(e){
this.formDateValidate = {
...this.formDateValidate,
type : 1,
museum_date:this.itemObject.initDate,
moment: this.lastAndAfternoonStatus === 3 ? '1' : '2',
// moment: this.lastAndAfternoonStatus === 3 ? '1' : '2',
moment: 0,
users:this.peopleList
}
let object = {
......@@ -396,9 +458,12 @@
if(cur.date === dayjs(day.date).format('MM月DD日') && cur.state === 0)
{
day.bottomInfo = '可订'
}else if( cur.date === dayjs(day.date).format('MM月DD日') && cur.state === 0){
}else if( cur.date === dayjs(day.date).format('MM月DD日') && cur.state === 1){
day.disabled = true
}
}else if (!this.dateList.map(cur=>cur.date).includes(dayjs(day.date).format('MM月DD日'))){
//日期数据不包含也移除
day.disabled = true
}
})
return day
},
......@@ -430,7 +495,7 @@
}
},
selectAppointmentDate(item,index){
console.log(item,1111111111111);
if(item.state !== 1){
// 选择日期时遍历数组去除打勾状态 避免打勾多个日期
this.dateList.map((cur,index)=>{
......@@ -440,6 +505,7 @@
this.lastAndAfternoonStatus = '' //选择日期时 初始化 上下午状态
this.dateList[index].OkState = 3 // 选中日期 显示打勾 通过 OkState === 3 则打勾
if(index) this.zhidingriqi = true
this.$forceUpdate()
}
},
deleteAddPeole(index){
......
......@@ -29,13 +29,11 @@
border-radius: 10px;
width: 100%;
height: 35%;
/*height: 35%;*/
background-color: white;
/*padding: 3vw;*/
box-sizing: border-box;
min-height: 220px;
/*min-height: 220px;*/
}
.content-header-header{
width: 100%;
......@@ -58,8 +56,8 @@
}
.content-header-content-header,.content-header-content-footer{
width: 100%;
height: 50%;
/*height: 50%;*/
height: 100px;
}
.content-header-content-footer-content{
width: 100%;
......
......@@ -11,6 +11,7 @@
<span style="color: #574f44;">参观日期</span>
</view>
<view class="content-header-content-header-footer">
<view ref="selectAppointmentDate" v-for="(item,index) in dateList" :key="index" v-if="index < 3" @click="selectAppointmentDate(item,index)"
:class="['content-header-content-header-footer-leftItem','content-header-content-header-footer-leftItem1'][item.state]">
<view class="content-header-content-header-footer-leftItem-top">
......@@ -61,7 +62,7 @@
</view>
</view>
</view>
<view class="content-header-content-footer">
<view v-if="false" class="content-header-content-footer">
<view class="content-header-content-footer-hearder">
<span style="color: #574f44;">参观场次</span>
</view>
......@@ -105,7 +106,7 @@
<!-- <u-form-item label-style="{'color':'red'}" label-position="top" label="姓名" prop="name">-->
<!-- <u-input class="c-f-f-i-t input" v-model="item.name" />-->
<!-- </u-form-item>-->
<!-- <u-form-item label-style="{'color':'red'}" label-position="top" label="身份证号" prop="identify_num">-->
<!-- <u-form-item label-style="{'color':'red'}" label-position="top" label="身份证号/护照号码" prop="identify_num">-->
<!-- <u-input class="c-f-f-i-t input" v-model="item.identify_num" />-->
<!-- </u-form-item>-->
<!-- <u-form-item label-style="{'color':'red'}" label-position="top" label="手机号码" prop="mobile">-->
......@@ -117,12 +118,13 @@
<span style="color: red">*</span>姓名
</view>
<view class="c-f-f-i-f">
<u-input v-model="item.name" class="input"></u-input>
</view>
<u-input @blur="myFunction(index,'name')" v-model="item.name" class="input"></u-input>
<view v-if="item.zzName" style="color: red">*{{item.zzName}}</view>
</view>
</view>
<view class="c-f-f-i" :key="aaa">
<view class="c-f-f-i-t">
<span style="color: red">*</span>身份证号
<span style="color: red">*</span>身份证号/护照号码
</view>
<view class="c-f-f-i-f">
......@@ -260,20 +262,31 @@
},
methods: {
validateName(name){
//姓名正则验证
var regex = /^[\u4E00-\u9FA5a-zA-Z]+$/;
return regex.test(name);
},
myFunction(index,key){
//输入框失焦点触发
let object = {
'identity_num':()=>{
function isPassPortCard(passportNumber) {
let a = /^[a-zA-Z0-9]{1}\d{8}$/
return a.test(passportNumber)
}
const card15 =
/^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]$/;
const card18 =
/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (card15.test(this.peopleList[index].identity_num) || card18.test(this.peopleList[index].identity_num)) {
if (card15.test(this.peopleList[index].identity_num) || card18.test(this.peopleList[index].identity_num) || isPassPortCard(this.peopleList[index].identity_num)) {
this.peopleList[index].zzIdentity_num = ''
}
if (!(card15.test(this.peopleList[index].identity_num) || card18.test(this.peopleList[index].identity_num))) {
this.peopleList[index].zzIdentity_num = '身份证格式异常,请检查身份证号码'
if (!(card15.test(this.peopleList[index].identity_num) || card18.test(this.peopleList[index].identity_num) || isPassPortCard(this.peopleList[index].identity_num)) ) {
this.peopleList[index].zzIdentity_num = '身份证/护照号码格式异常,请检查身份证号码'
}
},
'mobile':()=>{
......@@ -282,7 +295,14 @@
}else {
this.peopleList[index].zzMobile = ''
}
}
},
'name':()=>{
if (!(this.validateName(this.peopleList[index].name))) {
this.peopleList[index].zzName = '姓名格式异常'
}else {
this.peopleList[index].zzName = ''
}
}
}
object[key]()
......@@ -292,21 +312,29 @@
// moment 1 上午 2 下午 class ->string
async bookNow() {
var a = false;
let validateForm = this.peopleList.some((cur,index)=>{
//验证表单异常文字是否存在异常项
return cur.zzName || cur.zzIdentity_num || cur.zzMobile
})
this.peopleList.forEach((cur,index)=>{
//验证表单是否存在空值
if(cur.name==='' || cur.identity_num===''|| cur.mobile==='') a = true
})
if (a){
this.$u.toast('表单存在未填写数据')
if (a || validateForm){
this.$u.toast('预约表单存在未填写数据或填写异常')
}else {
this.loading = true
let data = {
moment: this.lastAndAfternoonStatus === 3 ? '1' : '2',
// moment: this.lastAndAfternoonStatus === 3 ? '1' : '2',
moment: 0, //0全天 1 上午 2 下午
museum_date: this.itemObject.initDate,
num: this.peopleList.length,
users: this.peopleList,
}
const res = await api.GuestCreate(data)
this.$u.toast(res.msg)
if (res.code === 1) this.$u.toast(res.msg)
else this.$u.toast(res.msg_detail)
this.loading = false
if (res.code === 1) setTimeout(() => {
uni.navigateTo({
......@@ -356,7 +384,7 @@
}
},
selectAppointmentDate(item,index){
console.log(item);
console.log(item,11);
if(item.state !== 1){
// 选择日期时遍历数组去除打勾状态 避免打勾多个日期
this.dateList.map((cur,index)=>{
......@@ -366,6 +394,7 @@
this.lastAndAfternoonStatus = '' //选择日期时 初始化 上下午状态
this.dateList[index].OkState = 3 // 选中日期 显示打勾 通过 OkState === 3 则打勾
if(index) this.zhidingriqi = true
this.$forceUpdate()
}
},
deleteAddPeole(index){
......
## 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";
}
export type IconsData = {
id : string
name : string
font_family : string
css_prefix_text : string
description : string
glyphs : Array<IconsDataItem>
}
export type IconsDataItem = {
font_class : string
unicode : string
}
export const fontData = [
{
"font_class": "arrow-down",
"unicode": "\ue6be"
},
{
"font_class": "arrow-left",
"unicode": "\ue6bc"
},
{
"font_class": "arrow-right",
"unicode": "\ue6bb"
},
{
"font_class": "arrow-up",
"unicode": "\ue6bd"
},
{
"font_class": "auth",
"unicode": "\ue6ab"
},
{
"font_class": "auth-filled",
"unicode": "\ue6cc"
},
{
"font_class": "back",
"unicode": "\ue6b9"
},
{
"font_class": "bars",
"unicode": "\ue627"
},
{
"font_class": "calendar",
"unicode": "\ue6a0"
},
{
"font_class": "calendar-filled",
"unicode": "\ue6c0"
},
{
"font_class": "camera",
"unicode": "\ue65a"
},
{
"font_class": "camera-filled",
"unicode": "\ue658"
},
{
"font_class": "cart",
"unicode": "\ue631"
},
{
"font_class": "cart-filled",
"unicode": "\ue6d0"
},
{
"font_class": "chat",
"unicode": "\ue65d"
},
{
"font_class": "chat-filled",
"unicode": "\ue659"
},
{
"font_class": "chatboxes",
"unicode": "\ue696"
},
{
"font_class": "chatboxes-filled",
"unicode": "\ue692"
},
{
"font_class": "chatbubble",
"unicode": "\ue697"
},
{
"font_class": "chatbubble-filled",
"unicode": "\ue694"
},
{
"font_class": "checkbox",
"unicode": "\ue62b"
},
{
"font_class": "checkbox-filled",
"unicode": "\ue62c"
},
{
"font_class": "checkmarkempty",
"unicode": "\ue65c"
},
{
"font_class": "circle",
"unicode": "\ue65b"
},
{
"font_class": "circle-filled",
"unicode": "\ue65e"
},
{
"font_class": "clear",
"unicode": "\ue66d"
},
{
"font_class": "close",
"unicode": "\ue673"
},
{
"font_class": "closeempty",
"unicode": "\ue66c"
},
{
"font_class": "cloud-download",
"unicode": "\ue647"
},
{
"font_class": "cloud-download-filled",
"unicode": "\ue646"
},
{
"font_class": "cloud-upload",
"unicode": "\ue645"
},
{
"font_class": "cloud-upload-filled",
"unicode": "\ue648"
},
{
"font_class": "color",
"unicode": "\ue6cf"
},
{
"font_class": "color-filled",
"unicode": "\ue6c9"
},
{
"font_class": "compose",
"unicode": "\ue67f"
},
{
"font_class": "contact",
"unicode": "\ue693"
},
{
"font_class": "contact-filled",
"unicode": "\ue695"
},
{
"font_class": "down",
"unicode": "\ue6b8"
},
{
"font_class": "bottom",
"unicode": "\ue6b8"
},
{
"font_class": "download",
"unicode": "\ue68d"
},
{
"font_class": "download-filled",
"unicode": "\ue681"
},
{
"font_class": "email",
"unicode": "\ue69e"
},
{
"font_class": "email-filled",
"unicode": "\ue69a"
},
{
"font_class": "eye",
"unicode": "\ue651"
},
{
"font_class": "eye-filled",
"unicode": "\ue66a"
},
{
"font_class": "eye-slash",
"unicode": "\ue6b3"
},
{
"font_class": "eye-slash-filled",
"unicode": "\ue6b4"
},
{
"font_class": "fire",
"unicode": "\ue6a1"
},
{
"font_class": "fire-filled",
"unicode": "\ue6c5"
},
{
"font_class": "flag",
"unicode": "\ue65f"
},
{
"font_class": "flag-filled",
"unicode": "\ue660"
},
{
"font_class": "folder-add",
"unicode": "\ue6a9"
},
{
"font_class": "folder-add-filled",
"unicode": "\ue6c8"
},
{
"font_class": "font",
"unicode": "\ue6a3"
},
{
"font_class": "forward",
"unicode": "\ue6ba"
},
{
"font_class": "gear",
"unicode": "\ue664"
},
{
"font_class": "gear-filled",
"unicode": "\ue661"
},
{
"font_class": "gift",
"unicode": "\ue6a4"
},
{
"font_class": "gift-filled",
"unicode": "\ue6c4"
},
{
"font_class": "hand-down",
"unicode": "\ue63d"
},
{
"font_class": "hand-down-filled",
"unicode": "\ue63c"
},
{
"font_class": "hand-up",
"unicode": "\ue63f"
},
{
"font_class": "hand-up-filled",
"unicode": "\ue63e"
},
{
"font_class": "headphones",
"unicode": "\ue630"
},
{
"font_class": "heart",
"unicode": "\ue639"
},
{
"font_class": "heart-filled",
"unicode": "\ue641"
},
{
"font_class": "help",
"unicode": "\ue679"
},
{
"font_class": "help-filled",
"unicode": "\ue674"
},
{
"font_class": "home",
"unicode": "\ue662"
},
{
"font_class": "home-filled",
"unicode": "\ue663"
},
{
"font_class": "image",
"unicode": "\ue670"
},
{
"font_class": "image-filled",
"unicode": "\ue678"
},
{
"font_class": "images",
"unicode": "\ue650"
},
{
"font_class": "images-filled",
"unicode": "\ue64b"
},
{
"font_class": "info",
"unicode": "\ue669"
},
{
"font_class": "info-filled",
"unicode": "\ue649"
},
{
"font_class": "left",
"unicode": "\ue6b7"
},
{
"font_class": "link",
"unicode": "\ue6a5"
},
{
"font_class": "list",
"unicode": "\ue644"
},
{
"font_class": "location",
"unicode": "\ue6ae"
},
{
"font_class": "location-filled",
"unicode": "\ue6af"
},
{
"font_class": "locked",
"unicode": "\ue66b"
},
{
"font_class": "locked-filled",
"unicode": "\ue668"
},
{
"font_class": "loop",
"unicode": "\ue633"
},
{
"font_class": "mail-open",
"unicode": "\ue643"
},
{
"font_class": "mail-open-filled",
"unicode": "\ue63a"
},
{
"font_class": "map",
"unicode": "\ue667"
},
{
"font_class": "map-filled",
"unicode": "\ue666"
},
{
"font_class": "map-pin",
"unicode": "\ue6ad"
},
{
"font_class": "map-pin-ellipse",
"unicode": "\ue6ac"
},
{
"font_class": "medal",
"unicode": "\ue6a2"
},
{
"font_class": "medal-filled",
"unicode": "\ue6c3"
},
{
"font_class": "mic",
"unicode": "\ue671"
},
{
"font_class": "mic-filled",
"unicode": "\ue677"
},
{
"font_class": "micoff",
"unicode": "\ue67e"
},
{
"font_class": "micoff-filled",
"unicode": "\ue6b0"
},
{
"font_class": "minus",
"unicode": "\ue66f"
},
{
"font_class": "minus-filled",
"unicode": "\ue67d"
},
{
"font_class": "more",
"unicode": "\ue64d"
},
{
"font_class": "more-filled",
"unicode": "\ue64e"
},
{
"font_class": "navigate",
"unicode": "\ue66e"
},
{
"font_class": "navigate-filled",
"unicode": "\ue67a"
},
{
"font_class": "notification",
"unicode": "\ue6a6"
},
{
"font_class": "notification-filled",
"unicode": "\ue6c1"
},
{
"font_class": "paperclip",
"unicode": "\ue652"
},
{
"font_class": "paperplane",
"unicode": "\ue672"
},
{
"font_class": "paperplane-filled",
"unicode": "\ue675"
},
{
"font_class": "person",
"unicode": "\ue699"
},
{
"font_class": "person-filled",
"unicode": "\ue69d"
},
{
"font_class": "personadd",
"unicode": "\ue69f"
},
{
"font_class": "personadd-filled",
"unicode": "\ue698"
},
{
"font_class": "personadd-filled-copy",
"unicode": "\ue6d1"
},
{
"font_class": "phone",
"unicode": "\ue69c"
},
{
"font_class": "phone-filled",
"unicode": "\ue69b"
},
{
"font_class": "plus",
"unicode": "\ue676"
},
{
"font_class": "plus-filled",
"unicode": "\ue6c7"
},
{
"font_class": "plusempty",
"unicode": "\ue67b"
},
{
"font_class": "pulldown",
"unicode": "\ue632"
},
{
"font_class": "pyq",
"unicode": "\ue682"
},
{
"font_class": "qq",
"unicode": "\ue680"
},
{
"font_class": "redo",
"unicode": "\ue64a"
},
{
"font_class": "redo-filled",
"unicode": "\ue655"
},
{
"font_class": "refresh",
"unicode": "\ue657"
},
{
"font_class": "refresh-filled",
"unicode": "\ue656"
},
{
"font_class": "refreshempty",
"unicode": "\ue6bf"
},
{
"font_class": "reload",
"unicode": "\ue6b2"
},
{
"font_class": "right",
"unicode": "\ue6b5"
},
{
"font_class": "scan",
"unicode": "\ue62a"
},
{
"font_class": "search",
"unicode": "\ue654"
},
{
"font_class": "settings",
"unicode": "\ue653"
},
{
"font_class": "settings-filled",
"unicode": "\ue6ce"
},
{
"font_class": "shop",
"unicode": "\ue62f"
},
{
"font_class": "shop-filled",
"unicode": "\ue6cd"
},
{
"font_class": "smallcircle",
"unicode": "\ue67c"
},
{
"font_class": "smallcircle-filled",
"unicode": "\ue665"
},
{
"font_class": "sound",
"unicode": "\ue684"
},
{
"font_class": "sound-filled",
"unicode": "\ue686"
},
{
"font_class": "spinner-cycle",
"unicode": "\ue68a"
},
{
"font_class": "staff",
"unicode": "\ue6a7"
},
{
"font_class": "staff-filled",
"unicode": "\ue6cb"
},
{
"font_class": "star",
"unicode": "\ue688"
},
{
"font_class": "star-filled",
"unicode": "\ue68f"
},
{
"font_class": "starhalf",
"unicode": "\ue683"
},
{
"font_class": "trash",
"unicode": "\ue687"
},
{
"font_class": "trash-filled",
"unicode": "\ue685"
},
{
"font_class": "tune",
"unicode": "\ue6aa"
},
{
"font_class": "tune-filled",
"unicode": "\ue6ca"
},
{
"font_class": "undo",
"unicode": "\ue64f"
},
{
"font_class": "undo-filled",
"unicode": "\ue64c"
},
{
"font_class": "up",
"unicode": "\ue6b6"
},
{
"font_class": "top",
"unicode": "\ue6b6"
},
{
"font_class": "upload",
"unicode": "\ue690"
},
{
"font_class": "upload-filled",
"unicode": "\ue68e"
},
{
"font_class": "videocam",
"unicode": "\ue68c"
},
{
"font_class": "videocam-filled",
"unicode": "\ue689"
},
{
"font_class": "vip",
"unicode": "\ue6a8"
},
{
"font_class": "vip-filled",
"unicode": "\ue6c6"
},
{
"font_class": "wallet",
"unicode": "\ue6b1"
},
{
"font_class": "wallet-filled",
"unicode": "\ue6c2"
},
{
"font_class": "weibo",
"unicode": "\ue68b"
},
{
"font_class": "weixin",
"unicode": "\ue691"
}
] as IconsDataItem[]
// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)
export const fontData = [
{
"font_class": "arrow-down",
"unicode": "\ue6be"
},
{
"font_class": "arrow-left",
"unicode": "\ue6bc"
},
{
"font_class": "arrow-right",
"unicode": "\ue6bb"
},
{
"font_class": "arrow-up",
"unicode": "\ue6bd"
},
{
"font_class": "auth",
"unicode": "\ue6ab"
},
{
"font_class": "auth-filled",
"unicode": "\ue6cc"
},
{
"font_class": "back",
"unicode": "\ue6b9"
},
{
"font_class": "bars",
"unicode": "\ue627"
},
{
"font_class": "calendar",
"unicode": "\ue6a0"
},
{
"font_class": "calendar-filled",
"unicode": "\ue6c0"
},
{
"font_class": "camera",
"unicode": "\ue65a"
},
{
"font_class": "camera-filled",
"unicode": "\ue658"
},
{
"font_class": "cart",
"unicode": "\ue631"
},
{
"font_class": "cart-filled",
"unicode": "\ue6d0"
},
{
"font_class": "chat",
"unicode": "\ue65d"
},
{
"font_class": "chat-filled",
"unicode": "\ue659"
},
{
"font_class": "chatboxes",
"unicode": "\ue696"
},
{
"font_class": "chatboxes-filled",
"unicode": "\ue692"
},
{
"font_class": "chatbubble",
"unicode": "\ue697"
},
{
"font_class": "chatbubble-filled",
"unicode": "\ue694"
},
{
"font_class": "checkbox",
"unicode": "\ue62b"
},
{
"font_class": "checkbox-filled",
"unicode": "\ue62c"
},
{
"font_class": "checkmarkempty",
"unicode": "\ue65c"
},
{
"font_class": "circle",
"unicode": "\ue65b"
},
{
"font_class": "circle-filled",
"unicode": "\ue65e"
},
{
"font_class": "clear",
"unicode": "\ue66d"
},
{
"font_class": "close",
"unicode": "\ue673"
},
{
"font_class": "closeempty",
"unicode": "\ue66c"
},
{
"font_class": "cloud-download",
"unicode": "\ue647"
},
{
"font_class": "cloud-download-filled",
"unicode": "\ue646"
},
{
"font_class": "cloud-upload",
"unicode": "\ue645"
},
{
"font_class": "cloud-upload-filled",
"unicode": "\ue648"
},
{
"font_class": "color",
"unicode": "\ue6cf"
},
{
"font_class": "color-filled",
"unicode": "\ue6c9"
},
{
"font_class": "compose",
"unicode": "\ue67f"
},
{
"font_class": "contact",
"unicode": "\ue693"
},
{
"font_class": "contact-filled",
"unicode": "\ue695"
},
{
"font_class": "down",
"unicode": "\ue6b8"
},
{
"font_class": "bottom",
"unicode": "\ue6b8"
},
{
"font_class": "download",
"unicode": "\ue68d"
},
{
"font_class": "download-filled",
"unicode": "\ue681"
},
{
"font_class": "email",
"unicode": "\ue69e"
},
{
"font_class": "email-filled",
"unicode": "\ue69a"
},
{
"font_class": "eye",
"unicode": "\ue651"
},
{
"font_class": "eye-filled",
"unicode": "\ue66a"
},
{
"font_class": "eye-slash",
"unicode": "\ue6b3"
},
{
"font_class": "eye-slash-filled",
"unicode": "\ue6b4"
},
{
"font_class": "fire",
"unicode": "\ue6a1"
},
{
"font_class": "fire-filled",
"unicode": "\ue6c5"
},
{
"font_class": "flag",
"unicode": "\ue65f"
},
{
"font_class": "flag-filled",
"unicode": "\ue660"
},
{
"font_class": "folder-add",
"unicode": "\ue6a9"
},
{
"font_class": "folder-add-filled",
"unicode": "\ue6c8"
},
{
"font_class": "font",
"unicode": "\ue6a3"
},
{
"font_class": "forward",
"unicode": "\ue6ba"
},
{
"font_class": "gear",
"unicode": "\ue664"
},
{
"font_class": "gear-filled",
"unicode": "\ue661"
},
{
"font_class": "gift",
"unicode": "\ue6a4"
},
{
"font_class": "gift-filled",
"unicode": "\ue6c4"
},
{
"font_class": "hand-down",
"unicode": "\ue63d"
},
{
"font_class": "hand-down-filled",
"unicode": "\ue63c"
},
{
"font_class": "hand-up",
"unicode": "\ue63f"
},
{
"font_class": "hand-up-filled",
"unicode": "\ue63e"
},
{
"font_class": "headphones",
"unicode": "\ue630"
},
{
"font_class": "heart",
"unicode": "\ue639"
},
{
"font_class": "heart-filled",
"unicode": "\ue641"
},
{
"font_class": "help",
"unicode": "\ue679"
},
{
"font_class": "help-filled",
"unicode": "\ue674"
},
{
"font_class": "home",
"unicode": "\ue662"
},
{
"font_class": "home-filled",
"unicode": "\ue663"
},
{
"font_class": "image",
"unicode": "\ue670"
},
{
"font_class": "image-filled",
"unicode": "\ue678"
},
{
"font_class": "images",
"unicode": "\ue650"
},
{
"font_class": "images-filled",
"unicode": "\ue64b"
},
{
"font_class": "info",
"unicode": "\ue669"
},
{
"font_class": "info-filled",
"unicode": "\ue649"
},
{
"font_class": "left",
"unicode": "\ue6b7"
},
{
"font_class": "link",
"unicode": "\ue6a5"
},
{
"font_class": "list",
"unicode": "\ue644"
},
{
"font_class": "location",
"unicode": "\ue6ae"
},
{
"font_class": "location-filled",
"unicode": "\ue6af"
},
{
"font_class": "locked",
"unicode": "\ue66b"
},
{
"font_class": "locked-filled",
"unicode": "\ue668"
},
{
"font_class": "loop",
"unicode": "\ue633"
},
{
"font_class": "mail-open",
"unicode": "\ue643"
},
{
"font_class": "mail-open-filled",
"unicode": "\ue63a"
},
{
"font_class": "map",
"unicode": "\ue667"
},
{
"font_class": "map-filled",
"unicode": "\ue666"
},
{
"font_class": "map-pin",
"unicode": "\ue6ad"
},
{
"font_class": "map-pin-ellipse",
"unicode": "\ue6ac"
},
{
"font_class": "medal",
"unicode": "\ue6a2"
},
{
"font_class": "medal-filled",
"unicode": "\ue6c3"
},
{
"font_class": "mic",
"unicode": "\ue671"
},
{
"font_class": "mic-filled",
"unicode": "\ue677"
},
{
"font_class": "micoff",
"unicode": "\ue67e"
},
{
"font_class": "micoff-filled",
"unicode": "\ue6b0"
},
{
"font_class": "minus",
"unicode": "\ue66f"
},
{
"font_class": "minus-filled",
"unicode": "\ue67d"
},
{
"font_class": "more",
"unicode": "\ue64d"
},
{
"font_class": "more-filled",
"unicode": "\ue64e"
},
{
"font_class": "navigate",
"unicode": "\ue66e"
},
{
"font_class": "navigate-filled",
"unicode": "\ue67a"
},
{
"font_class": "notification",
"unicode": "\ue6a6"
},
{
"font_class": "notification-filled",
"unicode": "\ue6c1"
},
{
"font_class": "paperclip",
"unicode": "\ue652"
},
{
"font_class": "paperplane",
"unicode": "\ue672"
},
{
"font_class": "paperplane-filled",
"unicode": "\ue675"
},
{
"font_class": "person",
"unicode": "\ue699"
},
{
"font_class": "person-filled",
"unicode": "\ue69d"
},
{
"font_class": "personadd",
"unicode": "\ue69f"
},
{
"font_class": "personadd-filled",
"unicode": "\ue698"
},
{
"font_class": "personadd-filled-copy",
"unicode": "\ue6d1"
},
{
"font_class": "phone",
"unicode": "\ue69c"
},
{
"font_class": "phone-filled",
"unicode": "\ue69b"
},
{
"font_class": "plus",
"unicode": "\ue676"
},
{
"font_class": "plus-filled",
"unicode": "\ue6c7"
},
{
"font_class": "plusempty",
"unicode": "\ue67b"
},
{
"font_class": "pulldown",
"unicode": "\ue632"
},
{
"font_class": "pyq",
"unicode": "\ue682"
},
{
"font_class": "qq",
"unicode": "\ue680"
},
{
"font_class": "redo",
"unicode": "\ue64a"
},
{
"font_class": "redo-filled",
"unicode": "\ue655"
},
{
"font_class": "refresh",
"unicode": "\ue657"
},
{
"font_class": "refresh-filled",
"unicode": "\ue656"
},
{
"font_class": "refreshempty",
"unicode": "\ue6bf"
},
{
"font_class": "reload",
"unicode": "\ue6b2"
},
{
"font_class": "right",
"unicode": "\ue6b5"
},
{
"font_class": "scan",
"unicode": "\ue62a"
},
{
"font_class": "search",
"unicode": "\ue654"
},
{
"font_class": "settings",
"unicode": "\ue653"
},
{
"font_class": "settings-filled",
"unicode": "\ue6ce"
},
{
"font_class": "shop",
"unicode": "\ue62f"
},
{
"font_class": "shop-filled",
"unicode": "\ue6cd"
},
{
"font_class": "smallcircle",
"unicode": "\ue67c"
},
{
"font_class": "smallcircle-filled",
"unicode": "\ue665"
},
{
"font_class": "sound",
"unicode": "\ue684"
},
{
"font_class": "sound-filled",
"unicode": "\ue686"
},
{
"font_class": "spinner-cycle",
"unicode": "\ue68a"
},
{
"font_class": "staff",
"unicode": "\ue6a7"
},
{
"font_class": "staff-filled",
"unicode": "\ue6cb"
},
{
"font_class": "star",
"unicode": "\ue688"
},
{
"font_class": "star-filled",
"unicode": "\ue68f"
},
{
"font_class": "starhalf",
"unicode": "\ue683"
},
{
"font_class": "trash",
"unicode": "\ue687"
},
{
"font_class": "trash-filled",
"unicode": "\ue685"
},
{
"font_class": "tune",
"unicode": "\ue6aa"
},
{
"font_class": "tune-filled",
"unicode": "\ue6ca"
},
{
"font_class": "undo",
"unicode": "\ue64f"
},
{
"font_class": "undo-filled",
"unicode": "\ue64c"
},
{
"font_class": "up",
"unicode": "\ue6b6"
},
{
"font_class": "top",
"unicode": "\ue6b6"
},
{
"font_class": "upload",
"unicode": "\ue690"
},
{
"font_class": "upload-filled",
"unicode": "\ue68e"
},
{
"font_class": "videocam",
"unicode": "\ue68c"
},
{
"font_class": "videocam-filled",
"unicode": "\ue689"
},
{
"font_class": "vip",
"unicode": "\ue6a8"
},
{
"font_class": "vip-filled",
"unicode": "\ue6c6"
},
{
"font_class": "wallet",
"unicode": "\ue6b1"
},
{
"font_class": "wallet-filled",
"unicode": "\ue6c2"
},
{
"font_class": "weibo",
"unicode": "\ue68b"
},
{
"font_class": "weixin",
"unicode": "\ue691"
}
]
// export const fontData = JSON.parse<IconsDataItem>(fontDataJson)
{
"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
## 1.2.4(2022-09-19)
- 修复,未对主题色设置默认色,导致未引入 uni-scss 变量文件报错。
- 修复,未对移动端当前页文字做主题色适配。
## 1.2.3(2022-09-15)
- 修复未使用 uni-scss 主题色的 bug。
## 1.2.2(2022-07-06)
- 修复 es 语言 i18n 错误
## 1.2.1(2021-11-22)
- 修复 vue3中某些scss变量无法找到的问题
## 1.2.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-pagination](https://uniapp.dcloud.io/component/uniui/uni-pagination)
## 1.1.2(2021-10-08)
- 修复 current 、value 属性未监听,导致高亮样式失效的 bug
## 1.1.1(2021-08-20)
- 新增 支持国际化
## 1.1.0(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.0.7(2021-05-12)
- 新增 组件示例地址
## 1.0.6(2021-04-12)
- 新增 PC 和 移动端适配不同的 ui
## 1.0.5(2021-02-05)
- 优化 组件引用关系,通过uni_modules引用组件
## 1.0.4(2021-02-05)
- 调整为uni_modules目录规范
{
"uni-pagination.prevText": "prev",
"uni-pagination.nextText": "next",
"uni-pagination.piecePerPage": "piece/page"
}
{
"uni-pagination.prevText": "anterior",
"uni-pagination.nextText": "prxima",
"uni-pagination.piecePerPage": "Art¨ªculo/P¨¢gina"
}
{
"uni-pagination.prevText": "précédente",
"uni-pagination.nextText": "suivante",
"uni-pagination.piecePerPage": "Articles/Pages"
}
import en from './en.json'
import es from './es.json'
import fr from './fr.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
en,
es,
fr,
'zh-Hans': zhHans,
'zh-Hant': zhHant
}
{
"uni-pagination.prevText": "上一页",
"uni-pagination.nextText": "下一页",
"uni-pagination.piecePerPage": "条/页"
}
{
"uni-pagination.prevText": "上一頁",
"uni-pagination.nextText": "下一頁",
"uni-pagination.piecePerPage": "條/頁"
}
<template>
<view class="uni-pagination">
<!-- #ifndef MP -->
<picker v-if="showPageSize === true || showPageSize === 'true'" class="select-picker" mode="selector"
:value="pageSizeIndex" :range="pageSizeRange" @change="pickerChange" @cancel="pickerClick"
@click.native="pickerClick">
<button type="default" size="mini" :plain="true">
<text>{{pageSizeRange[pageSizeIndex]}} {{piecePerPage}}</text>
<uni-icons class="select-picker-icon" type="arrowdown" size="12" color="#999"></uni-icons>
</button>
</picker>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<view class="uni-pagination__total is-phone-hide">共 {{ total }} 条</view>
<!-- #endif -->
<view class="uni-pagination__btn"
:class="currentIndex === 1 ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
:hover-class="currentIndex === 1 ? '' : 'uni-pagination--hover'" :hover-start-time="20"
:hover-stay-time="70" @click="clickLeft">
<template v-if="showIcon === true || showIcon === 'true'">
<uni-icons color="#666" size="16" type="left" />
</template>
<template v-else>
<text class="uni-pagination__child-btn">{{ prevPageText }}</text>
</template>
</view>
<view class="uni-pagination__num uni-pagination__num-flex-none">
<view class="uni-pagination__num-current">
<text class="uni-pagination__num-current-text is-pc-hide current-index-text">{{ currentIndex }}</text>
<text class="uni-pagination__num-current-text is-pc-hide">/{{ maxPage || 0 }}</text>
<!-- #ifndef APP-NVUE -->
<view v-for="(item, index) in paper" :key="index" :class="{ 'page--active': item === currentIndex }"
class="uni-pagination__num-tag tag--active is-phone-hide" @click.top="selectPage(item, index)">
<text>{{ item }}</text>
</view>
<!-- #endif -->
</view>
</view>
<view class="uni-pagination__btn"
:class="currentIndex >= maxPage ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
:hover-class="currentIndex === maxPage ? '' : 'uni-pagination--hover'" :hover-start-time="20"
:hover-stay-time="70" @click="clickRight">
<template v-if="showIcon === true || showIcon === 'true'">
<uni-icons color="#666" size="16" type="right" />
</template>
<template v-else>
<text class="uni-pagination__child-btn">{{ nextPageText }}</text>
</template>
</view>
</view>
</template>
<script>
/**
* Pagination 分页器
* @description 分页器组件,用于展示页码、请求数据等
* @tutorial https://ext.dcloud.net.cn/plugin?id=32
* @property {String} prevText 左侧按钮文字
* @property {String} nextText 右侧按钮文字
* @property {String} piecePerPageText 条/页文字
* @property {Number} current 当前页
* @property {Number} total 数据总量
* @property {Number} pageSize 每页数据量
* @property {Boolean} showIcon = [true|false] 是否以 icon 形式展示按钮
* @property {Boolean} showPageSize = [true|false] 是否展示每页条数
* @property {Array} pageSizeRange = [20, 50, 100, 500] 每页条数选框
* @event {Function} change 点击页码按钮时触发 ,e={type,current} current为当前页,type值为:next/prev,表示点击的是上一页还是下一个
* * @event {Function} pageSizeChange 当前每页条数改变时触发 ,e={pageSize} pageSize 为当前所选的每页条数
*/
import {
initVueI18n
} from '@dcloudio/uni-i18n'
import messages from './i18n/index.js'
const {
t
} = initVueI18n(messages)
export default {
name: 'UniPagination',
emits: ['update:modelValue', 'input', 'change', 'pageSizeChange'],
props: {
value: {
type: [Number, String],
default: 1
},
modelValue: {
type: [Number, String],
default: 1
},
prevText: {
type: String,
},
nextText: {
type: String,
},
piecePerPageText: {
type: String
},
current: {
type: [Number, String],
default: 1
},
total: {
// 数据总量
type: [Number, String],
default: 0
},
pageSize: {
// 每页数据量
type: [Number, String],
default: 10
},
showIcon: {
// 是否以 icon 形式展示按钮
type: [Boolean, String],
default: false
},
showPageSize: {
// 是否以 icon 形式展示按钮
type: [Boolean, String],
default: false
},
pagerCount: {
type: Number,
default: 7
},
pageSizeRange: {
type: Array,
default: () => [20, 50, 100, 500]
}
},
data() {
return {
pageSizeIndex: 0,
currentIndex: 1,
paperData: [],
pickerShow: false
}
},
computed: {
piecePerPage() {
return this.piecePerPageText || t('uni-pagination.piecePerPage')
},
prevPageText() {
return this.prevText || t('uni-pagination.prevText')
},
nextPageText() {
return this.nextText || t('uni-pagination.nextText')
},
maxPage() {
let maxPage = 1
let total = Number(this.total)
let pageSize = Number(this.pageSize)
if (total && pageSize) {
maxPage = Math.ceil(total / pageSize)
}
return maxPage
},
paper() {
const num = this.currentIndex
// TODO 最大页数
const pagerCount = this.pagerCount
// const total = 181
const total = this.total
const pageSize = this.pageSize
let totalArr = []
let showPagerArr = []
let pagerNum = Math.ceil(total / pageSize)
for (let i = 0; i < pagerNum; i++) {
totalArr.push(i + 1)
}
showPagerArr.push(1)
const totalNum = totalArr[totalArr.length - (pagerCount + 1) / 2]
totalArr.forEach((item, index) => {
if ((pagerCount + 1) / 2 >= num) {
if (item < pagerCount + 1 && item > 1) {
showPagerArr.push(item)
}
} else if (num + 2 <= totalNum) {
if (item > num - (pagerCount + 1) / 2 && item < num + (pagerCount + 1) / 2) {
showPagerArr.push(item)
}
} else {
if ((item > num - (pagerCount + 1) / 2 || pagerNum - pagerCount < item) && item < totalArr[
totalArr.length - 1]) {
showPagerArr.push(item)
}
}
})
if (pagerNum > pagerCount) {
if ((pagerCount + 1) / 2 >= num) {
showPagerArr[showPagerArr.length - 1] = '...'
} else if (num + 2 <= totalNum) {
showPagerArr[1] = '...'
showPagerArr[showPagerArr.length - 1] = '...'
} else {
showPagerArr[1] = '...'
}
showPagerArr.push(totalArr[totalArr.length - 1])
} else {
if ((pagerCount + 1) / 2 >= num) {} else if (num + 2 <= totalNum) {} else {
showPagerArr.shift()
showPagerArr.push(totalArr[totalArr.length - 1])
}
}
return showPagerArr
}
},
watch: {
current: {
immediate: true,
handler(val, old) {
if (val < 1) {
this.currentIndex = 1
} else {
this.currentIndex = val
}
}
},
value: {
immediate: true,
handler(val) {
if (Number(this.current) !== 1) return
if (val < 1) {
this.currentIndex = 1
} else {
this.currentIndex = val
}
}
},
pageSizeIndex(val) {
this.$emit('pageSizeChange', this.pageSizeRange[val])
}
},
methods: {
pickerChange(e) {
this.pageSizeIndex = e.detail.value
this.pickerClick()
},
pickerClick() {
// #ifdef H5
const body = document.querySelector('body')
if (!body) return
const className = 'uni-pagination-picker-show'
this.pickerShow = !this.pickerShow
if (this.pickerShow) {
body.classList.add(className)
} else {
setTimeout(() => body.classList.remove(className), 300)
}
// #endif
},
// 选择标签
selectPage(e, index) {
if (parseInt(e)) {
this.currentIndex = e
this.change('current')
} else {
let pagerNum = Math.ceil(this.total / this.pageSize)
// let pagerNum = Math.ceil(181 / this.pageSize)
// 上一页
if (index <= 1) {
if (this.currentIndex - 5 > 1) {
this.currentIndex -= 5
} else {
this.currentIndex = 1
}
return
}
// 下一页
if (index >= 6) {
if (this.currentIndex + 5 > pagerNum) {
this.currentIndex = pagerNum
} else {
this.currentIndex += 5
}
return
}
}
},
clickLeft() {
if (Number(this.currentIndex) === 1) {
return
}
this.currentIndex -= 1
this.change('prev')
},
clickRight() {
if (Number(this.currentIndex) >= this.maxPage) {
return
}
this.currentIndex += 1
this.change('next')
},
change(e) {
this.$emit('input', this.currentIndex)
this.$emit('update:modelValue', this.currentIndex)
this.$emit('change', {
type: e,
current: this.currentIndex
})
}
}
}
</script>
<style lang="scss" scoped>
$uni-primary: #2979ff !default;
.uni-pagination {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
position: relative;
overflow: hidden;
flex-direction: row;
justify-content: center;
align-items: center;
}
.uni-pagination__total {
font-size: 14px;
color: #999;
margin-right: 15px;
}
.uni-pagination__btn {
/* #ifndef APP-NVUE */
display: flex;
cursor: pointer;
/* #endif */
padding: 0 8px;
line-height: 30px;
font-size: 12px;
position: relative;
background-color: #F0F0F0;
flex-direction: row;
justify-content: center;
align-items: center;
text-align: center;
border-radius: 5px;
// border-width: 1px;
// border-style: solid;
// border-color: $uni-border-color;
}
.uni-pagination__child-btn {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
font-size: 12px;
position: relative;
flex-direction: row;
justify-content: center;
align-items: center;
text-align: center;
color: #666;
font-size: 12px;
}
.uni-pagination__num {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
justify-content: center;
align-items: center;
height: 30px;
line-height: 30px;
font-size: 12px;
color: #666;
margin: 0 5px;
}
.uni-pagination__num-tag {
/* #ifdef H5 */
cursor: pointer;
min-width: 30px;
/* #endif */
margin: 0 5px;
height: 30px;
text-align: center;
line-height: 30px;
// border: 1px red solid;
color: #999;
border-radius: 4px;
// border-width: 1px;
// border-style: solid;
// border-color: $uni-border-color;
}
.uni-pagination__num-current {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
}
.uni-pagination__num-current-text {
font-size: 15px;
}
.current-index-text{
color: $uni-primary;
}
.uni-pagination--enabled {
color: #333333;
opacity: 1;
}
.uni-pagination--disabled {
opacity: 0.5;
/* #ifdef H5 */
cursor: default;
/* #endif */
}
.uni-pagination--hover {
color: rgba(0, 0, 0, 0.6);
background-color: #eee;
}
.tag--active:hover {
color: $uni-primary;
}
.page--active {
color: #fff;
background-color: $uni-primary;
}
.page--active:hover {
color: #fff;
}
/* #ifndef APP-NVUE */
.is-pc-hide {
display: block;
}
.is-phone-hide {
display: none;
}
@media screen and (min-width: 450px) {
.is-pc-hide {
display: none;
}
.is-phone-hide {
display: block;
}
.uni-pagination__num-flex-none {
flex: none;
}
}
/* #endif */
</style>
{
"id": "uni-pagination",
"displayName": "uni-pagination 分页器",
"version": "1.2.4",
"description": "Pagination 分页器组件,用于展示页码、请求数据等。",
"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","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"
}
}
}
}
}
\ No newline at end of file
## Pagination 分页器
> **组件名:uni-pagination**
> 代码块: `uPagination`
分页器组件,用于展示页码、请求数据等。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-pagination)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
## 1.0.3(2022-01-21)
- 优化 组件示例
## 1.0.2(2021-11-22)
- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题
## 1.0.1(2021-11-22)
- 修复 vue3中scss语法兼容问题
## 1.0.0(2021-11-18)
- init
@import './styles/index.scss';
{
"id": "uni-scss",
"displayName": "uni-scss 辅助样式",
"version": "1.0.3",
"description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。",
"keywords": [
"uni-scss",
"uni-ui",
"辅助样式"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"JS SDK",
"通用 SDK"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "u"
},
"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"
},
"快应用": {
"华为": "n",
"联盟": "n"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
`uni-sass` 是 `uni-ui`提供的一套全局样式 ,通过一些简单的类名和`sass`变量,实现简单的页面布局操作,比如颜色、边距、圆角等。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-sass)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
\ No newline at end of file
@import './setting/_variables.scss';
@import './setting/_border.scss';
@import './setting/_color.scss';
@import './setting/_space.scss';
@import './setting/_radius.scss';
@import './setting/_text.scss';
@import './setting/_styles.scss';
.uni-border {
border: 1px $uni-border-1 solid;
}
\ No newline at end of file
// TODO 暂时不需要 class ,需要用户使用变量实现 ,如果使用类名其实并不推荐
// @mixin get-styles($k,$c) {
// @if $k == size or $k == weight{
// font-#{$k}:#{$c}
// }@else{
// #{$k}:#{$c}
// }
// }
$uni-ui-color:(
// 主色
primary: $uni-primary,
primary-disable: $uni-primary-disable,
primary-light: $uni-primary-light,
// 辅助色
success: $uni-success,
success-disable: $uni-success-disable,
success-light: $uni-success-light,
warning: $uni-warning,
warning-disable: $uni-warning-disable,
warning-light: $uni-warning-light,
error: $uni-error,
error-disable: $uni-error-disable,
error-light: $uni-error-light,
info: $uni-info,
info-disable: $uni-info-disable,
info-light: $uni-info-light,
// 中性色
main-color: $uni-main-color,
base-color: $uni-base-color,
secondary-color: $uni-secondary-color,
extra-color: $uni-extra-color,
// 背景色
bg-color: $uni-bg-color,
// 边框颜色
border-1: $uni-border-1,
border-2: $uni-border-2,
border-3: $uni-border-3,
border-4: $uni-border-4,
// 黑色
black:$uni-black,
// 白色
white:$uni-white,
// 透明
transparent:$uni-transparent
) !default;
@each $key, $child in $uni-ui-color {
.uni-#{"" + $key} {
color: $child;
}
.uni-#{"" + $key}-bg {
background-color: $child;
}
}
.uni-shadow-sm {
box-shadow: $uni-shadow-sm;
}
.uni-shadow-base {
box-shadow: $uni-shadow-base;
}
.uni-shadow-lg {
box-shadow: $uni-shadow-lg;
}
.uni-mask {
background-color:$uni-mask;
}
@mixin radius($r,$d:null ,$important: false){
$radius-value:map-get($uni-radius, $r) if($important, !important, null);
// Key exists within the $uni-radius variable
@if (map-has-key($uni-radius, $r) and $d){
@if $d == t {
border-top-left-radius:$radius-value;
border-top-right-radius:$radius-value;
}@else if $d == r {
border-top-right-radius:$radius-value;
border-bottom-right-radius:$radius-value;
}@else if $d == b {
border-bottom-left-radius:$radius-value;
border-bottom-right-radius:$radius-value;
}@else if $d == l {
border-top-left-radius:$radius-value;
border-bottom-left-radius:$radius-value;
}@else if $d == tl {
border-top-left-radius:$radius-value;
}@else if $d == tr {
border-top-right-radius:$radius-value;
}@else if $d == br {
border-bottom-right-radius:$radius-value;
}@else if $d == bl {
border-bottom-left-radius:$radius-value;
}
}@else{
border-radius:$radius-value;
}
}
@each $key, $child in $uni-radius {
@if($key){
.uni-radius-#{"" + $key} {
@include radius($key)
}
}@else{
.uni-radius {
@include radius($key)
}
}
}
@each $direction in t, r, b, l,tl, tr, br, bl {
@each $key, $child in $uni-radius {
@if($key){
.uni-radius-#{"" + $direction}-#{"" + $key} {
@include radius($key,$direction,false)
}
}@else{
.uni-radius-#{$direction} {
@include radius($key,$direction,false)
}
}
}
}
@mixin fn($space,$direction,$size,$n) {
@if $n {
#{$space}-#{$direction}: #{$size*$uni-space-root}px
} @else {
#{$space}-#{$direction}: #{-$size*$uni-space-root}px
}
}
@mixin get-styles($direction,$i,$space,$n){
@if $direction == t {
@include fn($space, top,$i,$n);
}
@if $direction == r {
@include fn($space, right,$i,$n);
}
@if $direction == b {
@include fn($space, bottom,$i,$n);
}
@if $direction == l {
@include fn($space, left,$i,$n);
}
@if $direction == x {
@include fn($space, left,$i,$n);
@include fn($space, right,$i,$n);
}
@if $direction == y {
@include fn($space, top,$i,$n);
@include fn($space, bottom,$i,$n);
}
@if $direction == a {
@if $n {
#{$space}:#{$i*$uni-space-root}px;
} @else {
#{$space}:#{-$i*$uni-space-root}px;
}
}
}
@each $orientation in m,p {
$space: margin;
@if $orientation == m {
$space: margin;
} @else {
$space: padding;
}
@for $i from 0 through 16 {
@each $direction in t, r, b, l, x, y, a {
.uni-#{$orientation}#{$direction}-#{$i} {
@include get-styles($direction,$i,$space,true);
}
.uni-#{$orientation}#{$direction}-n#{$i} {
@include get-styles($direction,$i,$space,false);
}
}
}
}
\ No newline at end of file
/* #ifndef APP-NVUE */
$-color-white:#fff;
$-color-black:#000;
@mixin base-style($color) {
color: #fff;
background-color: $color;
border-color: mix($-color-black, $color, 8%);
&:not([hover-class]):active {
background: mix($-color-black, $color, 10%);
border-color: mix($-color-black, $color, 20%);
color: $-color-white;
outline: none;
}
}
@mixin is-color($color) {
@include base-style($color);
&[loading] {
@include base-style($color);
&::before {
margin-right:5px;
}
}
&[disabled] {
&,
&[loading],
&:not([hover-class]):active {
color: $-color-white;
border-color: mix(darken($color,10%), $-color-white);
background-color: mix($color, $-color-white);
}
}
}
@mixin base-plain-style($color) {
color:$color;
background-color: mix($-color-white, $color, 90%);
border-color: mix($-color-white, $color, 70%);
&:not([hover-class]):active {
background: mix($-color-white, $color, 80%);
color: $color;
outline: none;
border-color: mix($-color-white, $color, 50%);
}
}
@mixin is-plain($color){
&[plain] {
@include base-plain-style($color);
&[loading] {
@include base-plain-style($color);
&::before {
margin-right:5px;
}
}
&[disabled] {
&,
&:active {
color: mix($-color-white, $color, 40%);
background-color: mix($-color-white, $color, 90%);
border-color: mix($-color-white, $color, 80%);
}
}
}
}
.uni-btn {
margin: 5px;
color: #393939;
border:1px solid #ccc;
font-size: 16px;
font-weight: 200;
background-color: #F9F9F9;
// TODO 暂时处理边框隐藏一边的问题
overflow: visible;
&::after{
border: none;
}
&:not([type]),&[type=default] {
color: #999;
&[loading] {
background: none;
&::before {
margin-right:5px;
}
}
&[disabled]{
color: mix($-color-white, #999, 60%);
&,
&[loading],
&:active {
color: mix($-color-white, #999, 60%);
background-color: mix($-color-white,$-color-black , 98%);
border-color: mix($-color-white, #999, 85%);
}
}
&[plain] {
color: #999;
background: none;
border-color: $uni-border-1;
&:not([hover-class]):active {
background: none;
color: mix($-color-white, $-color-black, 80%);
border-color: mix($-color-white, $-color-black, 90%);
outline: none;
}
&[disabled]{
&,
&[loading],
&:active {
background: none;
color: mix($-color-white, #999, 60%);
border-color: mix($-color-white, #999, 85%);
}
}
}
}
&:not([hover-class]):active {
color: mix($-color-white, $-color-black, 50%);
}
&[size=mini] {
font-size: 16px;
font-weight: 200;
border-radius: 8px;
}
&.uni-btn-small {
font-size: 14px;
}
&.uni-btn-mini {
font-size: 12px;
}
&.uni-btn-radius {
border-radius: 999px;
}
&[type=primary] {
@include is-color($uni-primary);
@include is-plain($uni-primary)
}
&[type=success] {
@include is-color($uni-success);
@include is-plain($uni-success)
}
&[type=error] {
@include is-color($uni-error);
@include is-plain($uni-error)
}
&[type=warning] {
@include is-color($uni-warning);
@include is-plain($uni-warning)
}
&[type=info] {
@include is-color($uni-info);
@include is-plain($uni-info)
}
}
/* #endif */
@mixin get-styles($k,$c) {
@if $k == size or $k == weight{
font-#{$k}:#{$c}
}@else{
#{$k}:#{$c}
}
}
@each $key, $child in $uni-headings {
/* #ifndef APP-NVUE */
.uni-#{$key} {
@each $k, $c in $child {
@include get-styles($k,$c)
}
}
/* #endif */
/* #ifdef APP-NVUE */
.container .uni-#{$key} {
@each $k, $c in $child {
@include get-styles($k,$c)
}
}
/* #endif */
}
// @use "sass:math";
@import '../tools/functions.scss';
// 间距基础倍数
$uni-space-root: 2 !default;
// 边框半径默认值
$uni-radius-root:5px !default;
$uni-radius: () !default;
// 边框半径断点
$uni-radius: map-deep-merge(
(
0: 0,
// TODO 当前版本暂时不支持 sm 属性
// 'sm': math.div($uni-radius-root, 2),
null: $uni-radius-root,
'lg': $uni-radius-root * 2,
'xl': $uni-radius-root * 6,
'pill': 9999px,
'circle': 50%
),
$uni-radius
);
// 字体家族
$body-font-family: 'Roboto', sans-serif !default;
// 文本
$heading-font-family: $body-font-family !default;
$uni-headings: () !default;
$letterSpacing: -0.01562em;
$uni-headings: map-deep-merge(
(
'h1': (
size: 32px,
weight: 300,
line-height: 50px,
// letter-spacing:-0.01562em
),
'h2': (
size: 28px,
weight: 300,
line-height: 40px,
// letter-spacing: -0.00833em
),
'h3': (
size: 24px,
weight: 400,
line-height: 32px,
// letter-spacing: normal
),
'h4': (
size: 20px,
weight: 400,
line-height: 30px,
// letter-spacing: 0.00735em
),
'h5': (
size: 16px,
weight: 400,
line-height: 24px,
// letter-spacing: normal
),
'h6': (
size: 14px,
weight: 500,
line-height: 18px,
// letter-spacing: 0.0125em
),
'subtitle': (
size: 12px,
weight: 400,
line-height: 20px,
// letter-spacing: 0.00937em
),
'body': (
font-size: 14px,
font-weight: 400,
line-height: 22px,
// letter-spacing: 0.03125em
),
'caption': (
'size': 12px,
'weight': 400,
'line-height': 20px,
// 'letter-spacing': 0.03333em,
// 'text-transform': false
)
),
$uni-headings
);
// 主色
$uni-primary: #2979ff !default;
$uni-primary-disable:lighten($uni-primary,20%) !default;
$uni-primary-light: lighten($uni-primary,25%) !default;
// 辅助色
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
$uni-success: #18bc37 !default;
$uni-success-disable:lighten($uni-success,20%) !default;
$uni-success-light: lighten($uni-success,25%) !default;
$uni-warning: #f3a73f !default;
$uni-warning-disable:lighten($uni-warning,20%) !default;
$uni-warning-light: lighten($uni-warning,25%) !default;
$uni-error: #e43d33 !default;
$uni-error-disable:lighten($uni-error,20%) !default;
$uni-error-light: lighten($uni-error,25%) !default;
$uni-info: #8f939c !default;
$uni-info-disable:lighten($uni-info,20%) !default;
$uni-info-light: lighten($uni-info,25%) !default;
// 中性色
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
$uni-main-color: #3a3a3a !default; // 主要文字
$uni-base-color: #6a6a6a !default; // 常规文字
$uni-secondary-color: #909399 !default; // 次要文字
$uni-extra-color: #c7c7c7 !default; // 辅助说明
// 边框颜色
$uni-border-1: #F0F0F0 !default;
$uni-border-2: #EDEDED !default;
$uni-border-3: #DCDCDC !default;
$uni-border-4: #B9B9B9 !default;
// 常规色
$uni-black: #000000 !default;
$uni-white: #ffffff !default;
$uni-transparent: rgba($color: #000000, $alpha: 0) !default;
// 背景色
$uni-bg-color: #f7f7f7 !default;
/* 水平间距 */
$uni-spacing-sm: 8px !default;
$uni-spacing-base: 15px !default;
$uni-spacing-lg: 30px !default;
// 阴影
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5) !default;
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2) !default;
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5) !default;
// 蒙版
$uni-mask: rgba($color: #000000, $alpha: 0.4) !default;
// 合并 map
@function map-deep-merge($parent-map, $child-map){
$result: $parent-map;
@each $key, $child in $child-map {
$parent-has-key: map-has-key($result, $key);
$parent-value: map-get($result, $key);
$parent-type: type-of($parent-value);
$child-type: type-of($child);
$parent-is-map: $parent-type == map;
$child-is-map: $child-type == map;
@if (not $parent-has-key) or ($parent-type != $child-type) or (not ($parent-is-map and $child-is-map)){
$result: map-merge($result, ( $key: $child ));
}@else {
$result: map-merge($result, ( $key: map-deep-merge($parent-value, $child) ));
}
}
@return $result;
};
// 间距基础倍数
$uni-space-root: 2;
// 边框半径默认值
$uni-radius-root:5px;
// 主色
$uni-primary: #2979ff;
// 辅助色
$uni-success: #4cd964;
// 警告色
$uni-warning: #f0ad4e;
// 错误色
$uni-error: #dd524d;
// 描述色
$uni-info: #909399;
// 中性色
$uni-main-color: #303133;
$uni-base-color: #606266;
$uni-secondary-color: #909399;
$uni-extra-color: #C0C4CC;
// 背景色
$uni-bg-color: #f5f5f5;
// 边框颜色
$uni-border-1: #DCDFE6;
$uni-border-2: #E4E7ED;
$uni-border-3: #EBEEF5;
$uni-border-4: #F2F6FC;
// 常规色
$uni-black: #000000;
$uni-white: #ffffff;
$uni-transparent: rgba($color: #000000, $alpha: 0);
@import './styles/setting/_variables.scss';
// 间距基础倍数
$uni-space-root: 2;
// 边框半径默认值
$uni-radius-root:5px;
// 主色
$uni-primary: #2979ff;
$uni-primary-disable:mix(#fff,$uni-primary,50%);
$uni-primary-light: mix(#fff,$uni-primary,80%);
// 辅助色
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
$uni-success: #18bc37;
$uni-success-disable:mix(#fff,$uni-success,50%);
$uni-success-light: mix(#fff,$uni-success,80%);
$uni-warning: #f3a73f;
$uni-warning-disable:mix(#fff,$uni-warning,50%);
$uni-warning-light: mix(#fff,$uni-warning,80%);
$uni-error: #e43d33;
$uni-error-disable:mix(#fff,$uni-error,50%);
$uni-error-light: mix(#fff,$uni-error,80%);
$uni-info: #8f939c;
$uni-info-disable:mix(#fff,$uni-info,50%);
$uni-info-light: mix(#fff,$uni-info,80%);
// 中性色
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
$uni-main-color: #3a3a3a; // 主要文字
$uni-base-color: #6a6a6a; // 常规文字
$uni-secondary-color: #909399; // 次要文字
$uni-extra-color: #c7c7c7; // 辅助说明
// 边框颜色
$uni-border-1: #F0F0F0;
$uni-border-2: #EDEDED;
$uni-border-3: #DCDCDC;
$uni-border-4: #B9B9B9;
// 常规色
$uni-black: #000000;
$uni-white: #ffffff;
$uni-transparent: rgba($color: #000000, $alpha: 0);
// 背景色
$uni-bg-color: #f7f7f7;
/* 水平间距 */
$uni-spacing-sm: 8px;
$uni-spacing-base: 15px;
$uni-spacing-lg: 30px;
// 阴影
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5);
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2);
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5);
// 蒙版
$uni-mask: rgba($color: #000000, $alpha: 0.4);
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或