Browse Source

/deep/替换为::v-deep

master
1747191978@qq.com 2 months ago
parent
commit
f3d7fb909e
  1. 345
      大唐会议前台1/App.vue
  2. 371
      大唐会议前台1/pages/components/MeetingList.vue
  3. 265
      大唐会议前台1/pages/index/details.vue
  4. 265
      大唐会议前台1/pages/index/index.vue
  5. 521
      大唐会议前台1/pages/index/pdf.vue
  6. 505
      大唐会议前台1/pages/index/pdf平铺.vue
  7. 700
      大唐会议前台1/pages/user/login.vue
  8. 78
      大唐会议前台1/uni_modules/uview-ui/components/u-input/props.js
  9. 552
      大唐会议前台1/uni_modules/uview-ui/components/u-input/u-input.vue
  10. 54
      大唐会议前台1/uni_modules/uview-ui/components/u-textarea/props.js
  11. 318
      大唐会议前台1/uni_modules/uview-ui/components/u-textarea/u-textarea.vue

345
大唐会议前台1/App.vue

@ -1,213 +1,210 @@
<script>
import {
mapState,
mapMutations
} from 'vuex';
export default {
data() {
return {
isAudio: true,
};
},
methods: {
...mapMutations(['setTrainPath']),
},
mounted() {},
//
onLoad() {},
onLaunch() {},
};
import { mapState, mapMutations } from 'vuex';
export default {
data() {
return {
isAudio: true,
};
},
methods: {
...mapMutations(['setTrainPath']),
},
mounted() {},
//
onLoad() {},
onLaunch() {},
};
</script>
<style lang="scss">
/*每个页面公共css */
@import '@/uni_modules/uview-ui/index.scss';
@import 'common/demo.scss';
uni-view,
p,
span {
font-size: 16px;
/*每个页面公共css */
@import '@/uni_modules/uview-ui/index.scss';
@import 'common/demo.scss';
uni-view,
p,
span {
font-size: 16px;
}
::v-deep.u-modal {
background: #ffffff;
}
::v-deep.u-modal__content__text span {
font-size: 20px;
}
.avatarobx {
top: 16px;
right: 16px;
position: fixed;
display: flex;
align-items: center;
color: #fff;
.name {
font-size: 18px;
}
/deep/.u-modal{
background: #ffffff;
.view-out {
margin-right: 10px;
// border-bottom:1px solid #fff;
}
/deep/.u-modal__content__text span{
font-size: 20px;
.avatar {
border-radius: 6px;
width: 30px;
height: 30px;
margin-left: 18px;
}
.avatarobx {
top: 16px;
right: 16px;
position: fixed;
display: flex;
align-items: center;
color: #fff;
.name{
font-size: 18px;
}
.view-out {
margin-right: 10px;
// border-bottom:1px solid #fff;
}
.avatar {
border-radius: 6px;
width: 30px;
height: 30px;
margin-left: 18px;
}
.out {
width: 30px;
height: 30px
}
.out {
width: 30px;
height: 30px;
}
}
.view-backimg {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
.view-backimg {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
.view-backimg-top {
height: 50vh;
background-image: url('./imgs/bg-top.png');
background-size: 100% 100%;
}
.view-backimg-bottom {
height: 50vh;
background-image: url('./imgs/left.png');
background-size: 100% 100%;
}
.view-backimg-top {
height: 50vh;
background-image: url('./imgs/bg-top.png');
background-size: 100% 100%;
}
/deep/.u-toast__content__text--error,
/deep/.u-toast__content__text--success {
max-width: 500px !important;
.view-backimg-bottom {
height: 50vh;
background-image: url('./imgs/left.png');
background-size: 100% 100%;
}
.back{
width:40px;
}
::v-deep.u-toast__content__text--error,
::v-deep.u-toast__content__text--success {
max-width: 500px !important;
}
.back {
width: 40px;
position: fixed !important;
top: 16px;
left: 16px;
}
.logo {
width: 500px;
position: fixed !important;
top: 16px;
left: 16px;
}
.logo {
width: 500px;
position: fixed !important;
top:16px;
left: 16px;
}
//
.statusGray {
color: #c0c4cc;
}
//
.statusGray {
color: #c0c4cc;
}
.statusGreen {
color: #10b884;
}
.statusGreen {
color: #10b884;
}
.statusRed {
color: red;
}
.statusRed {
color: red;
}
.view-none {
width: 100%;
font-size: 16px !important;
line-height: 50px;
color: #909399;
text-align: center;
}
.view-none {
width: 100%;
font-size: 16px !important;
line-height: 50px;
color: #909399;
text-align: center;
}
/deep/.uni-pagination__num-tag {
width: 30px !important;
min-width: 30px !important;
height: 30px !important;
font-size: 16px !important;
}
::v-deep.uni-pagination__num-tag {
width: 30px !important;
min-width: 30px !important;
height: 30px !important;
font-size: 16px !important;
}
.width-60 {
min-width: 60px !important;
}
.width-60 {
min-width: 60px !important;
}
.width-100 {
min-width: 100px !important;
}
.width-100 {
min-width: 100px !important;
}
.width-160 {
min-width: 160px !important;
}
.width-160 {
min-width: 160px !important;
}
.width-250 {
min-width: 250px !important;
}
.width-250 {
min-width: 250px !important;
}
.uni-select__input-box,
.uni-select {
height: 40px !important;
}
.uni-select__input-box,
.uni-select {
height: 40px !important;
}
.uni-select {
font-size: 16px !important;
}
.uni-select {
font-size: 16px !important;
}
.uni-select__input-placeholder {
font-size: 16px !important;
}
.uni-select__input-placeholder {
font-size: 16px !important;
}
.uni-input-input,
uni-input {
border-radius: 5px;
height: 38px !important;
font-size: 16px !important;
}
.uni-input-input,
uni-input {
border-radius: 5px;
height: 38px !important;
font-size: 16px !important;
}
uni-input {
padding: 0 10px;
}
uni-input {
padding: 0 10px;
}
.uni-icons {
font-size: 24px !important;
}
.uni-icons {
font-size: 24px !important;
}
.u-popup__content {
background-color: rgba(0, 0, 0, 0) !important;
}
.u-popup__content {
background-color: rgba(0, 0, 0, 0) !important;
}
.uni-input-placeholder {
font-size: 16px;
line-height: 40px;
}
.uni-input-placeholder {
font-size: 16px;
line-height: 40px;
}
.u-input--square {
height: 28px !important;
padding: 6px 9px !important;
}
.u-input--square {
height: 28px !important;
padding: 6px 9px !important;
}
.u-input__content__field-wrapper__field {
font-size: 16px !important;
}
.u-input__content__field-wrapper__field {
font-size: 16px !important;
}
uni-video {
width: 100% !important;
height: 100% !important;
}
uni-video {
width: 100% !important;
height: 100% !important;
}
.u-toast {
font-size: 30px !important;
}
.u-toast {
font-size: 30px !important;
}
//
.u-picker {
background: #fff;
}
//
.u-picker {
background: #fff;
}
.u-toolbar__wrapper__cancel,
.u-toolbar__wrapper__confirm,
.u-toolbar__title {
font-size: 26px !important;
}
</style>
.u-toolbar__wrapper__cancel,
.u-toolbar__wrapper__confirm,
.u-toolbar__title {
font-size: 26px !important;
}
</style>

371
大唐会议前台1/pages/components/MeetingList.vue

@ -2,235 +2,258 @@
<view>
<view class="view-li" v-for="(item, index) in infos" :key="index">
<view class="li-item" v-if="item.type == 'title'">
<view class="li-title">{{item.title}}</view>
<view class="li-title">{{ item.title }}</view>
</view>
<view class="li-item " v-if="item.type == 'file-pdf'">
<view class="li-pdf" @click="handlePdf(item)"> {{item.filePdfName}}
<span style="color:blue"> 预览</span>
<view class="li-item" v-if="item.type == 'file-pdf'">
<view class="li-pdf" @click="handlePdf(item)">
{{ item.filePdfName }}
<span style="color: blue"> 预览</span>
</view>
</view>
<view class="li-item" v-if="item.type == 'richtext'">
<view class="li-text">{{item.richtext}}</view>
<view class="li-text">{{ item.richtext }}</view>
</view>
<view class="view-ul" v-if="item.infos && item.infos.length">
<MeetingList :detailsId='detailsId' :infos='item.infos'></MeetingList>
<MeetingList
:detailsId="detailsId"
:infos="item.infos"
></MeetingList>
</view>
</view>
<u-popup :show="show" @close="handleClose" mode="center">
<view class="popup-close" @click='handleClose'>
<uni-icons class="popup-icons" type="closeempty" size="30"></uni-icons>
<view class="popup-close" @click="handleClose">
<uni-icons
class="popup-icons"
type="closeempty"
size="30"
></uni-icons>
</view>
<view class="popup-box">
<view class="view-pdf">
<pdf v-if='show' ref="pdf" :page="pageNum" @progress="loadedRatio = $event"
@page-loaded="pageLoaded($event)" @num-pages="pageTotalNum=$event" @error="pdfError($event)"
@link-clicked="page = $event" :src="filePdfUrl">
<pdf
v-if="show"
ref="pdf"
:page="pageNum"
@progress="loadedRatio = $event"
@page-loaded="pageLoaded($event)"
@num-pages="pageTotalNum = $event"
@error="pdfError($event)"
@link-clicked="page = $event"
:src="filePdfUrl"
>
</pdf>
<div class="tools">
<button :theme="'default'" type="submit" @click.stop="prePage" class="mr10">
<button
:theme="'default'"
type="submit"
@click.stop="prePage"
class="mr10"
>
上一页
</button>
<div class="page">{{pageNum}}/{{pageTotalNum}}</div>
<button :theme="'default'" type="submit" @click.stop="nextPage" class="mr10">
<div class="page">{{ pageNum }}/{{ pageTotalNum }}</div>
<button
:theme="'default'"
type="submit"
@click.stop="nextPage"
class="mr10"
>
下一页
</button>
</div>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import pdf from 'vue-pdf'
export default {
name: 'MeetingList',
props: ['infos','detailsId'],
components: {
pdf
import pdf from 'vue-pdf';
export default {
name: 'MeetingList',
props: ['infos', 'detailsId'],
components: {
pdf,
},
data() {
return {
show: false,
filePdfUrl: '',
pageNum: 1,
pageTotalNum: 1,
//
loadedRatio: 0,
curPageNum: 0,
pdfId: '',
};
},
onShow() {
console.log('infos', infos);
},
methods: {
//
handleClose() {
this.pdfId = '';
this.show = false;
},
//
prePage() {
var page = this.pageNum;
page = page > 1 ? page - 1 : this.pageTotalNum;
this.pageNum = page;
},
//
nextPage() {
var page = this.pageNum;
page = page < this.pageTotalNum ? page + 1 : 1;
this.pageNum = page;
},
data() {
return {
show: false,
filePdfUrl: "",
pageNum: 1,
pageTotalNum: 1,
//
loadedRatio: 0,
curPageNum: 0,
pdfId: '',
};
// e
pageLoaded(e) {
this.curPageNum = e;
},
onShow() {
console.log('infos', infos)
//
pdfError(error) {
console.error(error);
},
methods: {
//
handleClose() {
this.pdfId = ''
this.show = false
},
//
prePage() {
var page = this.pageNum
page = page > 1 ? page - 1 : this.pageTotalNum
this.pageNum = page
},
//
nextPage() {
var page = this.pageNum
page = page < this.pageTotalNum ? page + 1 : 1
this.pageNum = page
},
// e
pageLoaded(e) {
this.curPageNum = e
},
//
pdfError(error) {
console.error(error)
},
// pdf
handlePdf(_item) {
// this.filePdfUrl = _item.filePdfUrl
// this.show = true
uni.navigateTo({
url: `/pages/index/pdf?filePdfUrl=${_item.filePdfUrl}&detailsId=${this.detailsId}`,
});
},
// pdf
handlePdf(_item) {
// this.filePdfUrl = _item.filePdfUrl
// this.show = true
uni.navigateTo({
url: `/pages/index/pdf?filePdfUrl=${_item.filePdfUrl}&detailsId=${this.detailsId}`,
});
},
//
onLoad() {},
};
},
//
onLoad() {},
};
</script>
<style lang="scss" scoped>
.popup-close {
position: fixed;
right: 20px;
top: 20px;
z-index: 9999;
/deep/.uni-icons {
font-size: 40px !important;
color: #fff !important;
}
.popup-close {
position: fixed;
right: 20px;
top: 20px;
z-index: 9999;
::v-deep.uni-icons {
font-size: 40px !important;
color: #fff !important;
}
/deep/.u-popup__content{
}
::v-deep.u-popup__content {
position: relative;
.tools {
position: absolute;
left:10px;
right:10px;
bottom:0px;
background:#fff;
padding-top:10px;
padding-bottom:10px;
left: 10px;
right: 10px;
bottom: 0px;
background: #fff;
padding-top: 10px;
padding-bottom: 10px;
}
}
.popup-box {
max-height: 80vh;
overflow: auto;
}
.popup-box {
max-height: 80vh;
overflow: auto;
}
.view-gb {
max-width: 100px;
margin-left: 16px;
}
.view-gb {
max-width: 100px;
margin-left: 16px;
}
.view-li {
// padding-left: 10px;
}
.view-li {
// padding-left: 10px;
}
.view-pdf {
width: 50vw;
padding: 16px 16px 50px 16px;
border: 1px solid #ededed;
background: #fff;
.tools {
display: flex;
uni-button {
font-size: 18px;
line-height: 44px;
height: 44px;
flex: 1
}
.page {
line-height: 44px;
height: 44px;
width: 100px;
text-align: center;
}
.view-pdf {
width: 50vw;
padding: 16px 16px 50px 16px;
border: 1px solid #ededed;
background: #fff;
.tools {
display: flex;
uni-button {
font-size: 18px;
line-height: 44px;
height: 44px;
flex: 1;
}
}
.pathsName {
color: #fff;
font-size: 12px;
.page {
line-height: 44px;
height: 44px;
width: 100px;
text-align: center;
}
}
}
.pdfBox .el-button {
background: rgba(255, 255, 255, 0);
border: none;
/* width: 30px; */
}
.pathsName {
color: #fff;
font-size: 12px;
}
.pdfBox>>>.el-icon-arrow-left,
.pdfBox>>>.el-icon-arrow-right {
font-size: 18px;
color: #000;
}
.pdfBox .el-button {
background: rgba(255, 255, 255, 0);
border: none;
/* width: 30px; */
}
.pdfBox .page {
margin: 0 10px;
}
.pdfBox >>> .el-icon-arrow-left,
.pdfBox >>> .el-icon-arrow-right {
font-size: 18px;
color: #000;
}
.pdfBox .el-button-group {
width: 100%;
justify-content: center;
display: flex;
align-items: center;
padding-top: 20px;
}
.pdfBox .page {
margin: 0 10px;
}
.pdfBox {
padding-bottom: 20px;
margin-top: 20px;
background: #fff;
min-height: 300px;
}
.pdfBox .el-button-group {
width: 100%;
justify-content: center;
display: flex;
align-items: center;
padding-top: 20px;
}
.contLeft-pane>>>.el-form-item__label {
text-align: right;
margin-right: 10px !important;
padding: 0 !important;
}
.pdfBox {
padding-bottom: 20px;
margin-top: 20px;
background: #fff;
min-height: 300px;
}
.contLeft-pane>>>.el-form-item--medium .el-form-item__content {
flex: 1;
}
.contLeft-pane >>> .el-form-item__label {
text-align: right;
margin-right: 10px !important;
padding: 0 !important;
}
.li-item {
uni-view {
font-size: 20px;
line-height: 40px;
span{
font-size: 20px;
}
}
.contLeft-pane >>> .el-form-item--medium .el-form-item__content {
flex: 1;
}
.li-title {
.li-item {
uni-view {
font-size: 20px;
line-height: 40px;
span {
font-size: 20px;
font-weight: bold;
line-height: 30px;
}
}
.li-title {
font-size: 20px;
font-weight: bold;
line-height: 30px;
}
}
</style>
<style></style>
<style></style>

265
大唐会议前台1/pages/index/details.vue

@ -1,19 +1,34 @@
<template>
<view class="box">
<!-- <image class="back" src='../../imgs/back.png' mode="widthFix" @click="handleBack"></image> -->
<image class="logo" src='../../imgs/logo.png' alt="" mode="widthFix" ></image>
<image
class="logo"
src="../../imgs/logo.png"
alt=""
mode="widthFix"
></image>
<view class="box-cent">
<view class="box-cent1">
<view class="view-box">
<view style="text-align: center;">
<span class="view-title"> {{listData.title}}</span>
<view style="text-align: center">
<span class="view-title"> {{ listData.title }}</span>
</view>
<view class="view-ul">
<MeetingList :detailsId='detailsId' :infos='listData.infos'></MeetingList>
<MeetingList
:detailsId="detailsId"
:infos="listData.infos"
></MeetingList>
</view>
</view>
</view>
<u-modal v-if="show" :show="show" @cancel="show = false" :showCancelButton="true" content='是否确认退出登录?' @confirm="handleOut"></u-modal>
<u-modal
v-if="show"
:show="show"
@cancel="show = false"
:showCancelButton="true"
content="是否确认退出登录?"
@confirm="handleOut"
></u-modal>
</view>
<!-- 底部背景图 -->
<view class="view-backimg">
@ -22,145 +37,145 @@
</view>
<!-- 头像 - 头像 -->
<view class="avatarobx">
<view class="name">{{userName}}</view>
<image @click='handleBack' class="avatar" src='../../imgs/arrow-left.png' mode="widthFix"></image>
<image @click="show = true" class="avatar" src='../../imgs/out.png' mode="widthFix"></image>
<view class="name">{{ userName }}</view>
<image
@click="handleBack"
class="avatar"
src="../../imgs/arrow-left.png"
mode="widthFix"
></image>
<image
@click="show = true"
class="avatar"
src="../../imgs/out.png"
mode="widthFix"
></image>
</view>
</view>
</template>
<script>
import {
queryMeeting,
meetingDetails
} from "@/common/api";
import {
mapMutations
} from 'vuex';
import MeetingList from "../components/MeetingList.vue"
import { queryMeeting, meetingDetails } from '@/common/api';
import { mapMutations } from 'vuex';
import MeetingList from '../components/MeetingList.vue';
export default {
components: {
MeetingList
export default {
components: {
MeetingList,
},
data() {
return {
listData: [],
data: [],
userName: uni.getStorageSync('userName'),
show: false,
detailsId: '',
};
},
created() {
let routes = getCurrentPages(); //
let curParam = routes[routes.length - 1].options; //
this.detailsId = curParam.id;
console.log('curParam', this.detailsId);
this.getMeetingDetails(curParam.id); //
},
methods: {
// 退
handleOut() {
uni.clearStorage();
uni.reLaunch({
url: '/pages/user/login',
});
},
data() {
return {
listData: [],
data: [],
userName: uni.getStorageSync("userName"),
show: false,
detailsId:'',
};
// logo
handleBack() {
uni.navigateTo({
url: `/pages/index/index`,
});
// uni.navigateBack({
// delta: 1
// });
},
created() {
let routes = getCurrentPages(); //
let curParam = routes[routes.length - 1].options; //
this.detailsId = curParam.id
console.log('curParam', this.detailsId)
this.getMeetingDetails(curParam.id) //
//
handleItemClaick(_item) {
// enable false
if (!_item.enable) return;
uni.navigateTo({
url: `/pages/index/details?id=${_item.id}`,
});
},
methods: {
// 退
handleOut(){
uni.clearStorage();
uni.reLaunch({
url: '/pages/user/login',
});
},
// logo
handleBack() {
uni.navigateTo({
url: `/pages/index/index`,
});
// uni.navigateBack({
// delta: 1
// });
},
//
handleItemClaick(_item) {
// enable false
if (!_item.enable) return
uni.navigateTo({
url: `/pages/index/details?id=${_item.id}`,
});
},
//
async getMeetingDetails(meetingId) {
const res = await meetingDetails({
param: {
meetingId,
}
});
const {
code,
data,
msg
} = res;
if (code === 200) {
this.listData = data
console.log(this.listData)
}
},
//
async getMeetingDetails(meetingId) {
const res = await meetingDetails({
param: {
meetingId,
},
});
const { code, data, msg } = res;
if (code === 200) {
this.listData = data;
console.log(this.listData);
}
},
//
onLoad() {},
};
},
//
onLoad() {},
};
</script>
<style lang="scss" scoped>
/deep/ .u-modal__content{
text-align: center;
}
.avatar{
}
.view-box {
margin-top: 50px;
}
.view-ul {
text-align: left;
margin-bottom: 16px;
::v-deep .u-modal__content {
text-align: center;
}
.avatar {
}
.view-box {
margin-top: 50px;
}
.view-li {
font-size: 18px;
line-height: 26px;
.view-ul {
text-align: left;
margin-bottom: 16px;
}
.view-li {
font-size: 18px;
line-height: 26px;
}
}
.view-title {
display: inline-block;
border: 1px solid #000;
padding: 0 14px;
margin-bottom: 30px;
line-height: 50px;
border-radius: 6px;
font-size: 20px;
font-weight: bold;
}
.view-title {
display: inline-block;
border: 1px solid #000;
padding: 0 14px;
margin-bottom: 30px;
line-height: 50px;
border-radius: 6px;
font-size: 20px;
font-weight: bold;
}
.box {
height: 100vh;
box-sizing: border-box;
padding: 20px 100px;
display: flex;
flex-direction: column;
.box {
height: 100vh;
box-sizing: border-box;
padding: 20px 100px;
display: flex;
flex-direction: column;
.box-cent {
flex: 1;
margin-top: 70px;
position: relative;
}
.box-cent {
flex: 1;
margin-top: 70px;
position: relative;
}
.box-cent1 {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: auto;
}
.box-cent1 {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: auto;
}
}
</style>
<style></style>
<style></style>

265
大唐会议前台1/pages/index/index.vue

@ -1,23 +1,41 @@
<template>
<view class="box">
<!-- <image class="back" src='../../imgs/back.png' mode="widthFix" @click='handleBack'></image> -->
<image class="logo" src='../../imgs/logo.png' mode="widthFix" ></image>
<image class="logo" src="../../imgs/logo.png" mode="widthFix"></image>
<view class="box-cent">
<view class="box-cent1">
<view class="view-box" v-for="(item, index) in listData" :key="index">
<view style="text-align: center;">
<span class="view-title"> {{item.dateTitle}}</span>
<view
class="view-box"
v-for="(item, index) in listData"
:key="index"
>
<view style="text-align: center">
<span class="view-title"> {{ item.dateTitle }}</span>
</view>
<view class="view-ul">
<view class="view-li" v-for="(row, rind) in item.meetingList" :key="rind"
<view
class="view-li"
v-for="(row, rind) in item.meetingList"
:key="rind"
>
<span @click="handleItemClaick(item, row)"
>{{ rind + 1 }}. {{ row.title }}</span
>
<span @click="handleItemClaick(item,row)">{{rind + 1}}. {{row.title}}</span>
</view>
</view>
</view>
<view v-if="!listData.length" class="view-none"> 暂无会议 </view>
<view v-if="!listData.length" class="view-none">
暂无会议
</view>
</view>
<u-modal v-if="show" :show="show" @cancel="show = false" :showCancelButton="true" content='是否确认退出登录?' @confirm="handleOut"></u-modal>
<u-modal
v-if="show"
:show="show"
@cancel="show = false"
:showCancelButton="true"
content="是否确认退出登录?"
@confirm="handleOut"
></u-modal>
</view>
<!-- 底部背景图 -->
<view class="view-backimg">
@ -26,144 +44,137 @@
</view>
<!-- 头像 - 头像 -->
<view class="avatarobx">
<view class="name">{{userName}}</view>
<view class="name">{{ userName }}</view>
<!-- <image @click='handleBack' class="avatar" src='../../imgs/arrow-left.png' mode="widthFix"></image> -->
<image @click="show = true" class="avatar" src='../../imgs/out.png' mode="widthFix"></image>
<image
@click="show = true"
class="avatar"
src="../../imgs/out.png"
mode="widthFix"
></image>
</view>
</view>
</template>
<script>
import {
queryMeeting,
meetingDetails
} from "@/common/api";
import {
mapMutations
} from 'vuex';
export default {
data() {
return {
listData: [],
userName: uni.getStorageSync("userName"),
show: false
};
import { queryMeeting, meetingDetails } from '@/common/api';
import { mapMutations } from 'vuex';
export default {
data() {
return {
listData: [],
userName: uni.getStorageSync('userName'),
show: false,
};
},
created() {
this.getQueryMeeting(); //
},
onShow() {
this.userName = uni.getStorageSync('userName');
console.log('this.userName', this.userName);
},
methods: {
// logo
handleBack() {
uni.navigateTo({
url: `/pages/user/login`,
});
// uni.navigateBack({
// delta: 1
// });
},
created() {
this.getQueryMeeting() //
// 退
handleOut() {
uni.clearStorage();
uni.reLaunch({
url: '/pages/user/login',
});
},
onShow(){
this.userName = uni.getStorageSync("userName")
console.log('this.userName',this.userName)
//
handleItemClaick(_item, _row) {
// enable false
if (!_item.enable) return;
uni.navigateTo({
url: `/pages/index/details?id=${_row.id}`,
});
},
methods: {
// logo
handleBack() {
uni.navigateTo({
url: `/pages/user/login`,
});
// uni.navigateBack({
// delta: 1
// });
},
// 退
handleOut(){
uni.clearStorage();
uni.reLaunch({
url: '/pages/user/login',
});
},
//
handleItemClaick(_item, _row) {
// enable false
if (!_item.enable) return
uni.navigateTo({
url: `/pages/index/details?id=${_row.id}`,
});
},
//
async getQueryMeeting() {
const res = await queryMeeting({
param: {}
});
const {
code,
data,
msg
} = res;
if (code === 200) {
this.listData = data
}
},
//
async getQueryMeeting() {
const res = await queryMeeting({
param: {},
});
const { code, data, msg } = res;
if (code === 200) {
this.listData = data;
}
},
//
onLoad() {},
};
},
//
onLoad() {},
};
</script>
<style lang="scss" scoped>
/deep/ .u-modal__content{
text-align: center;
}
.view-box{
margin-top:50px ;
}
.view-none{
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 40px !important;
}
.view-ul {
text-align: left;
margin-bottom: 16px;
::v-deep .u-modal__content {
text-align: center;
}
.view-box {
margin-top: 50px;
}
.view-li {
span{
font-size: 20px;
line-height: 40px;
}
.view-none {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 40px !important;
}
.view-ul {
text-align: left;
margin-bottom: 16px;
.view-li {
span {
font-size: 20px;
line-height: 40px;
}
}
}
.view-title {
display: inline-block;
border: 1px solid #000;
padding: 0 14px;
margin-bottom: 30px;
line-height: 50px;
border-radius: 6px;
font-size: 20px;
font-weight: bold;
}
.view-title {
display: inline-block;
border: 1px solid #000;
padding: 0 14px;
margin-bottom: 30px;
line-height: 50px;
border-radius: 6px;
font-size: 20px;
font-weight: bold;
}
.box {
height: 100vh;
background-size: cover;
box-sizing: border-box;
padding: 20px 100px;
display: flex;
flex-direction: column;
.box {
height: 100vh;
background-size: cover;
box-sizing: border-box;
padding: 20px 100px;
display: flex;
flex-direction: column;
.box-cent {
flex: 1;
margin-top: 70px;
position: relative;
}
.box-cent {
flex: 1;
margin-top: 70px;
position: relative;
}
.box-cent1 {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: auto;
}
.box-cent1 {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: auto;
}
}
</style>
<style></style>
<style></style>

521
大唐会议前台1/pages/index/pdf.vue

@ -1,17 +1,31 @@
<template>
<view class="box" style="position: relative;">
<view class="box" style="position: relative">
<!-- <image class="back" src='../../imgs/back.png' mode="widthFix" @click="handleBack"></image> -->
<image class="logo" src='../../imgs/logo.png' mode="widthFix" ></image>
<image class="logo" src="../../imgs/logo.png" mode="widthFix"></image>
<view class="box-cent">
<view class="box-cent1">
<view class="view-pdf">
<pdf ref="pdf" :page="pageNum" @progress="loadedRatio = $event" @page-loaded="pageLoaded($event)"
@num-pages="pageTotalNum=$event" @error="pdfError($event)" @link-clicked="page = $event"
:src="filePdfUrl">
<pdf
ref="pdf"
:page="pageNum"
@progress="loadedRatio = $event"
@page-loaded="pageLoaded($event)"
@num-pages="pageTotalNum = $event"
@error="pdfError($event)"
@link-clicked="page = $event"
:src="filePdfUrl"
>
</pdf>
</view>
</view>
<u-modal v-if="show" :show="show" @cancel="show = false" :showCancelButton="true" content='是否确认退出登录?' @confirm="handleOut"></u-modal>
<u-modal
v-if="show"
:show="show"
@cancel="show = false"
:showCancelButton="true"
content="是否确认退出登录?"
@confirm="handleOut"
></u-modal>
</view>
<!-- 底部背景图 -->
<view class="view-backimg">
@ -19,284 +33,301 @@
<!-- <view class="view-backimg-bottom"></view> -->
</view>
<div class="tools">
<view style="width:50vw;display: flex;margin: auto;">
<button :theme="'default'" type="submit" @click.stop="prePage" class="mr10">
<view style="width: 50vw; display: flex; margin: auto">
<button
:theme="'default'"
type="submit"
@click.stop="prePage"
class="mr10"
>
上一页
</button>
<div class="page">{{pageNum}}/{{pageTotalNum}}</div>
<button :theme="'default'" type="submit" @click.stop="nextPage" class="mr10">
<div class="page">{{ pageNum }}/{{ pageTotalNum }}</div>
<button
:theme="'default'"
type="submit"
@click.stop="nextPage"
class="mr10"
>
下一页
</button>
</view>
</div>
<!-- 头像 - 头像 -->
<view class="avatarobx">
<view class="name">{{userName}}</view>
<image @click='handleBack' class="avatar" src='../../imgs/arrow-left.png' mode="widthFix"></image>
<image @click="show = true" class="avatar" src='../../imgs/out.png' mode="widthFix"></image>
<view class="name">{{ userName }}</view>
<image
@click="handleBack"
class="avatar"
src="../../imgs/arrow-left.png"
mode="widthFix"
></image>
<image
@click="show = true"
class="avatar"
src="../../imgs/out.png"
mode="widthFix"
></image>
</view>
</view>
</template>
<script>
import pdf from 'vue-pdf'
export default {
name: 'MeetingList',
props: ['infos'],
components: {
pdf
import pdf from 'vue-pdf';
export default {
name: 'MeetingList',
props: ['infos'],
components: {
pdf,
},
data() {
return {
pageNum: 1,
pageTotalNum: 1,
//
loadedRatio: 0,
curPageNum: 0,
filePdfUrl: '',
userName: uni.getStorageSync('userName'),
show: false,
detailsId: '',
};
},
created() {
let routes = getCurrentPages(); //
let curParam = routes[routes.length - 1].options; //
this.detailsId = curParam.detailsId;
console.log('this.detailsId ', this.detailsId);
this.filePdfUrl = curParam.filePdfUrl;
},
methods: {
// logo
handleBack() {
uni.navigateTo({
url: `/pages/index/details?id=${this.detailsId}`,
});
// uni.navigateBack({
// delta: 1
// });
},
data() {
return {
pageNum: 1,
pageTotalNum: 1,
//
loadedRatio: 0,
curPageNum: 0,
filePdfUrl: '',
userName: uni.getStorageSync("userName"),
show: false,
detailsId:'',
};
// 退
handleOut() {
uni.clearStorage();
uni.reLaunch({
url: '/pages/user/login',
});
},
created() {
let routes = getCurrentPages(); //
let curParam = routes[routes.length - 1].options; //
this.detailsId = curParam.detailsId
console.log('this.detailsId ',this.detailsId)
this.filePdfUrl = curParam.filePdfUrl
// logo
handleLogo() {
uni.navigateTo({
url: `/pages/index/index`,
});
},
methods: {
// logo
handleBack() {
uni.navigateTo({
url: `/pages/index/details?id=${this.detailsId}`,
});
// uni.navigateBack({
// delta: 1
// });
},
// 退
handleOut() {
uni.clearStorage();
uni.reLaunch({
url: '/pages/user/login',
});
},
// logo
handleLogo() {
uni.navigateTo({
url: `/pages/index/index`,
});
},
//
handleClose() {
this.pdfId = ''
this.show = false
},
//
prePage() {
var page = this.pageNum
page = page > 1 ? page - 1 : this.pageTotalNum
this.pageNum = page
},
//
nextPage() {
var page = this.pageNum
page = page < this.pageTotalNum ? page + 1 : 1
this.pageNum = page
},
// e
pageLoaded(e) {
this.curPageNum = e
},
//
pdfError(error) {
console.error(error)
},
//
handleClose() {
this.pdfId = '';
this.show = false;
},
//
onLoad() {},
};
//
prePage() {
var page = this.pageNum;
page = page > 1 ? page - 1 : this.pageTotalNum;
this.pageNum = page;
},
//
nextPage() {
var page = this.pageNum;
page = page < this.pageTotalNum ? page + 1 : 1;
this.pageNum = page;
},
// e
pageLoaded(e) {
this.curPageNum = e;
},
//
pdfError(error) {
console.error(error);
},
},
//
onLoad() {},
};
</script>
<style lang="scss" scoped>
/deep/ .u-modal__content{
text-align: center;
}
.popup-close {
position: fixed;
right: 20px;
top: 20px;
z-index: 9999;
/deep/.uni-icons {
font-size: 40px !important;
color: #fff !important;
}
}
.view-gb {
max-width: 100px;
margin-left: 16px;
}
.view-li {
// padding-left: 10px;
}
.view-pdf {
width: 60vw;
margin: auto;
}
.tools {
display: flex;
align-items: center;
position: absolute;
bottom: 26px;
left:16px;
right:16px;
uni-button {
font-size: 18px;
line-height: 44px;
height: 44px;
flex: 1
}
.page {
line-height: 44px;
height: 44px;
width: 100px;
text-align: center;
}
}
.pathsName {
color: #fff;
font-size: 12px;
}
.pdfBox .el-button {
background: rgba(255, 255, 255, 0);
border: none;
/* width: 30px; */
::v-deep .u-modal__content {
text-align: center;
}
.popup-close {
position: fixed;
right: 20px;
top: 20px;
z-index: 9999;
::v-deep.uni-icons {
font-size: 40px !important;
color: #fff !important;
}
.pdfBox>>>.el-icon-arrow-left,
.pdfBox>>>.el-icon-arrow-right {
}
.view-gb {
max-width: 100px;
margin-left: 16px;
}
.view-li {
// padding-left: 10px;
}
.view-pdf {
width: 60vw;
margin: auto;
}
.tools {
display: flex;
align-items: center;
position: absolute;
bottom: 26px;
left: 16px;
right: 16px;
uni-button {
font-size: 18px;
color: #000;
}
.pdfBox .page {
margin: 0 10px;
}
.pdfBox .el-button-group {
width: 100%;
justify-content: center;
display: flex;
align-items: center;
padding-top: 20px;
}
.pdfBox {
padding-bottom: 20px;
margin-top: 20px;
background: #fff;
min-height: 300px;
}
.contLeft-pane>>>.el-form-item__label {
text-align: right;
margin-right: 10px !important;
padding: 0 !important;
}
.contLeft-pane>>>.el-form-item--medium .el-form-item__content {
line-height: 44px;
height: 44px;
flex: 1;
}
.li-item {
uni-view {
font-size: 20px;
line-height: 40px;
span {
font-size: 20px;
}
}
.page {
line-height: 44px;
height: 44px;
width: 100px;
text-align: center;
}
}
.pathsName {
color: #fff;
font-size: 12px;
}
.pdfBox .el-button {
background: rgba(255, 255, 255, 0);
border: none;
/* width: 30px; */
}
.pdfBox >>> .el-icon-arrow-left,
.pdfBox >>> .el-icon-arrow-right {
font-size: 18px;
color: #000;
}
.pdfBox .page {
margin: 0 10px;
}
.pdfBox .el-button-group {
width: 100%;
justify-content: center;
display: flex;
align-items: center;
padding-top: 20px;
}
.pdfBox {
padding-bottom: 20px;
margin-top: 20px;
background: #fff;
min-height: 300px;
}
.contLeft-pane >>> .el-form-item__label {
text-align: right;
margin-right: 10px !important;
padding: 0 !important;
}
.contLeft-pane >>> .el-form-item--medium .el-form-item__content {
flex: 1;
}
.li-item {
uni-view {
font-size: 20px;
line-height: 40px;
.li-title {
span {
font-size: 20px;
font-weight: bold;
line-height: 30px;
}
}
.view-box {
margin-top: 50px;
.li-title {
font-size: 20px;
font-weight: bold;
line-height: 30px;
}
}
.view-none {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 40px !important;
}
.view-box {
margin-top: 50px;
}
.view-ul {
text-align: left;
margin-bottom: 16px;
.view-none {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 40px !important;
}
.view-li {
span {
font-size: 20px;
line-height: 40px;
}
.view-ul {
text-align: left;
margin-bottom: 16px;
.view-li {
span {
font-size: 20px;
line-height: 40px;
}
}
.view-title {
display: inline-block;
border: 1px solid #000;
padding: 0 14px;
margin-bottom: 30px;
line-height: 50px;
border-radius: 6px;
font-size: 20px;
font-weight: bold;
}
.view-title {
display: inline-block;
border: 1px solid #000;
padding: 0 14px;
margin-bottom: 30px;
line-height: 50px;
border-radius: 6px;
font-size: 20px;
font-weight: bold;
}
.box {
height: 100vh;
background-size: cover;
box-sizing: border-box;
padding: 20px 100px;
display: flex;
flex-direction: column;
.box-cent {
flex: 1;
margin-top: 70px;
position: relative;
}
.box {
height: 100vh;
background-size: cover;
box-sizing: border-box;
padding: 20px 100px;
display: flex;
flex-direction: column;
.box-cent {
flex: 1;
margin-top: 70px;
position: relative;
}
.box-cent1 {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: auto;
}
.box-cent1 {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: auto;
}
}
</style>
<style></style>
<style></style>

505
大唐会议前台1/pages/index/pdf平铺.vue

@ -1,14 +1,26 @@
<template>
<view class="box" style="position: relative;">
<view class="box" style="position: relative">
<!-- <image class="back" src='../../imgs/back.png' mode="widthFix" @click="handleBack"></image> -->
<image class="logo" src='../../imgs/logo.png' mode="widthFix" ></image>
<image class="logo" src="../../imgs/logo.png" mode="widthFix"></image>
<view class="box-cent">
<view class="box-cent1">
<view class="view-pdf">
<pdf v-for="i in numPages" :key="i" :src="filePdfUrl" :page="i"></pdf>
<pdf
v-for="i in numPages"
:key="i"
:src="filePdfUrl"
:page="i"
></pdf>
</view>
</view>
<u-modal v-if="show" :show="show" @cancel="show = false" :showCancelButton="true" content='是否确认退出登录?' @confirm="handleOut"></u-modal>
<u-modal
v-if="show"
:show="show"
@cancel="show = false"
:showCancelButton="true"
content="是否确认退出登录?"
@confirm="handleOut"
></u-modal>
</view>
<!-- 底部背景图 -->
<view class="view-backimg">
@ -28,276 +40,283 @@
</div> -->
<!-- 头像 - 头像 -->
<view class="avatarobx">
<view class="name">{{userName}}</view>
<image @click='handleBack' class="avatar" src='../../imgs/arrow-left.png' mode="widthFix"></image>
<image @click="show = true" class="avatar" src='../../imgs/out.png' mode="widthFix"></image>
<view class="name">{{ userName }}</view>
<image
@click="handleBack"
class="avatar"
src="../../imgs/arrow-left.png"
mode="widthFix"
></image>
<image
@click="show = true"
class="avatar"
src="../../imgs/out.png"
mode="widthFix"
></image>
</view>
</view>
</template>
<script>
import pdf from 'vue-pdf'
export default {
name: 'MeetingList',
props: ['infos'],
components: {
pdf
import pdf from 'vue-pdf';
export default {
name: 'MeetingList',
props: ['infos'],
components: {
pdf,
},
data() {
return {
filePdfUrl: '',
userName: uni.getStorageSync('userName'),
detailsId: '',
numPages: '',
show: false,
};
},
created() {
let routes = getCurrentPages(); //
let curParam = routes[routes.length - 1].options; //
this.detailsId = curParam.detailsId;
this.filePdfUrl = curParam.filePdfUrl;
this.getNumPages(this.filePdfUrl);
},
methods: {
getNumPages(url) {
this.pdfSrc = url;
this.pdfSrc = pdf.createLoadingTask(this.pdfSrc);
this.pdfSrc.promise.then((pdf) => {
this.numPages = pdf.numPages;
console.log('this.numPages', this.numPages);
});
},
data() {
return {
filePdfUrl: '',
userName: uni.getStorageSync("userName"),
detailsId:'',
numPages:'',
show:false
};
// logo
handleBack() {
uni.navigateTo({
url: `/pages/index/details?id=${this.detailsId}`,
});
// uni.navigateBack({
// delta: 1
// });
},
created() {
let routes = getCurrentPages(); //
let curParam = routes[routes.length - 1].options; //
this.detailsId = curParam.detailsId
this.filePdfUrl = curParam.filePdfUrl
this.getNumPages(this.filePdfUrl )
// 退
handleOut() {
uni.clearStorage();
uni.reLaunch({
url: '/pages/user/login',
});
},
// logo
handleLogo() {
uni.navigateTo({
url: `/pages/index/index`,
});
},
methods: {
getNumPages(url) {
this.pdfSrc=url
this.pdfSrc = pdf.createLoadingTask(this.pdfSrc)
this.pdfSrc.promise.then(pdf => {
this.numPages = pdf.numPages
console.log('this.numPages',this.numPages)
})
},
// logo
handleBack() {
uni.navigateTo({
url: `/pages/index/details?id=${this.detailsId}`,
});
// uni.navigateBack({
// delta: 1
// });
},
// 退
handleOut() {
uni.clearStorage();
uni.reLaunch({
url: '/pages/user/login',
});
},
// logo
handleLogo() {
uni.navigateTo({
url: `/pages/index/index`,
});
},
//
handleClose() {
this.pdfId = ''
this.show = false
},
//
prePage() {
var page = this.pageNum
page = page > 1 ? page - 1 : this.pageTotalNum
this.pageNum = page
},
//
nextPage() {
var page = this.pageNum
page = page < this.pageTotalNum ? page + 1 : 1
this.pageNum = page
},
// e
pageLoaded(e) {
this.curPageNum = e
},
//
pdfError(error) {
console.error(error)
},
//
handleClose() {
this.pdfId = '';
this.show = false;
},
//
prePage() {
var page = this.pageNum;
page = page > 1 ? page - 1 : this.pageTotalNum;
this.pageNum = page;
},
//
nextPage() {
var page = this.pageNum;
page = page < this.pageTotalNum ? page + 1 : 1;
this.pageNum = page;
},
// e
pageLoaded(e) {
this.curPageNum = e;
},
//
onLoad() {},
};
//
pdfError(error) {
console.error(error);
},
},
//
onLoad() {},
};
</script>
<style lang="scss" scoped>
/deep/ .u-modal__content{
text-align: center;
}
.popup-close {
position: fixed;
right: 20px;
top: 20px;
z-index: 9999;
/deep/.uni-icons {
font-size: 40px !important;
color: #fff !important;
}
}
.view-gb {
max-width: 100px;
margin-left: 16px;
}
.view-li {
// padding-left: 10px;
}
.view-pdf {
width: 60vw;
margin: auto;
}
.tools {
display: flex;
align-items: center;
position: absolute;
bottom: 26px;
left:16px;
right:16px;
uni-button {
font-size: 18px;
line-height: 44px;
height: 44px;
flex: 1
}
.page {
line-height: 44px;
height: 44px;
width: 100px;
text-align: center;
}
}
.pathsName {
color: #fff;
font-size: 12px;
}
.pdfBox .el-button {
background: rgba(255, 255, 255, 0);
border: none;
/* width: 30px; */
::v-deep .u-modal__content {
text-align: center;
}
.popup-close {
position: fixed;
right: 20px;
top: 20px;
z-index: 9999;
::v-deep.uni-icons {
font-size: 40px !important;
color: #fff !important;
}
.pdfBox>>>.el-icon-arrow-left,
.pdfBox>>>.el-icon-arrow-right {
}
.view-gb {
max-width: 100px;
margin-left: 16px;
}
.view-li {
// padding-left: 10px;
}
.view-pdf {
width: 60vw;
margin: auto;
}
.tools {
display: flex;
align-items: center;
position: absolute;
bottom: 26px;
left: 16px;
right: 16px;
uni-button {
font-size: 18px;
color: #000;
}
.pdfBox .page {
margin: 0 10px;
}
.pdfBox .el-button-group {
width: 100%;
justify-content: center;
display: flex;
align-items: center;
padding-top: 20px;
}
.pdfBox {
padding-bottom: 20px;
margin-top: 20px;
background: #fff;
min-height: 300px;
}
.contLeft-pane>>>.el-form-item__label {
text-align: right;
margin-right: 10px !important;
padding: 0 !important;
}
.contLeft-pane>>>.el-form-item--medium .el-form-item__content {
line-height: 44px;
height: 44px;
flex: 1;
}
.li-item {
uni-view {
font-size: 20px;
line-height: 40px;
span {
font-size: 20px;
}
}
.page {
line-height: 44px;
height: 44px;
width: 100px;
text-align: center;
}
}
.pathsName {
color: #fff;
font-size: 12px;
}
.pdfBox .el-button {
background: rgba(255, 255, 255, 0);
border: none;
/* width: 30px; */
}
.pdfBox >>> .el-icon-arrow-left,
.pdfBox >>> .el-icon-arrow-right {
font-size: 18px;
color: #000;
}
.pdfBox .page {
margin: 0 10px;
}
.pdfBox .el-button-group {
width: 100%;
justify-content: center;
display: flex;
align-items: center;
padding-top: 20px;
}
.pdfBox {
padding-bottom: 20px;
margin-top: 20px;
background: #fff;
min-height: 300px;
}
.contLeft-pane >>> .el-form-item__label {
text-align: right;
margin-right: 10px !important;
padding: 0 !important;
}
.contLeft-pane >>> .el-form-item--medium .el-form-item__content {
flex: 1;
}
.li-item {
uni-view {
font-size: 20px;
line-height: 40px;
.li-title {
span {
font-size: 20px;
font-weight: bold;
line-height: 30px;
}
}
.view-box {
margin-top: 50px;
.li-title {
font-size: 20px;
font-weight: bold;
line-height: 30px;
}
}
.view-none {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 40px !important;
}
.view-box {
margin-top: 50px;
}
.view-ul {
text-align: left;
margin-bottom: 16px;
.view-none {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 40px !important;
}
.view-li {
span {
font-size: 20px;
line-height: 40px;
}
.view-ul {
text-align: left;
margin-bottom: 16px;
.view-li {
span {
font-size: 20px;
line-height: 40px;
}
}
.view-title {
display: inline-block;
border: 1px solid #000;
padding: 0 14px;
margin-bottom: 30px;
line-height: 50px;
border-radius: 6px;
font-size: 20px;
font-weight: bold;
}
.view-title {
display: inline-block;
border: 1px solid #000;
padding: 0 14px;
margin-bottom: 30px;
line-height: 50px;
border-radius: 6px;
font-size: 20px;
font-weight: bold;
}
.box {
height: 100vh;
background-size: cover;
box-sizing: border-box;
padding: 20px 100px;
display: flex;
flex-direction: column;
.box-cent {
flex: 1;
margin-top: 70px;
position: relative;
}
.box {
height: 100vh;
background-size: cover;
box-sizing: border-box;
padding: 20px 100px;
display: flex;
flex-direction: column;
.box-cent {
flex: 1;
margin-top: 70px;
position: relative;
}
.box-cent1 {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: auto;
}
.box-cent1 {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: auto;
}
}
</style>
<style></style>
<style></style>

700
大唐会议前台1/pages/user/login.vue

@ -2,398 +2,436 @@
<div>
<div class="divbox">
<div class="div-left">
<image class="logo" src='../../imgs/logo.png' mode="widthFix"></image>
<image
class="logo"
src="../../imgs/logo.png"
mode="widthFix"
></image>
</div>
<div class="div-right">
<h1 class="h1-title">内部会议系统</h1>
<u-form :model="form" :rules="rules" ref="uForm" label-position="top" label-width="100"
class="view-form">
<u-form
:model="form"
:rules="rules"
ref="uForm"
label-position="top"
label-width="100"
class="view-form"
>
<u-form-item label="" prop="username">
<view class="form-item-box">
<u-input autocomplete="new-password" class="form-item-input" v-model="form.username"
placeholder="请输入用户名" />
<u-input
autocomplete="new-password"
class="form-item-input"
v-model="form.username"
placeholder="请输入用户名"
/>
</view>
</u-form-item>
<u-form-item label="" prop="password" class="form-item-pass" style="padding-bottom: 0">
<view class="form-item-box" style="display: flex; align-items: center">
<u-input :type="!passShow ? 'password' : ''" class="form-item-input"
autocomplete="new-password" v-model="form.password" placeholder="请输入密码" />
<image @click="passShow = !passShow" v-if="passShow" mode="aspectFit" class="form-item-img"
src="../../imgs/xyj.png" style="margin-right: 14px"></image>
<image @click="passShow = !passShow" v-else mode="aspectFit" class="form-item-img"
src="../../imgs/xyj1.png" style="margin-right: 14px"></image>
<u-form-item
label=""
prop="password"
class="form-item-pass"
style="padding-bottom: 0"
>
<view
class="form-item-box"
style="display: flex; align-items: center"
>
<u-input
:type="!passShow ? 'password' : ''"
class="form-item-input"
autocomplete="new-password"
v-model="form.password"
placeholder="请输入密码"
/>
<image
@click="passShow = !passShow"
v-if="passShow"
mode="aspectFit"
class="form-item-img"
src="../../imgs/xyj.png"
style="margin-right: 14px"
></image>
<image
@click="passShow = !passShow"
v-else
mode="aspectFit"
class="form-item-img"
src="../../imgs/xyj1.png"
style="margin-right: 14px"
></image>
</view>
</u-form-item>
<u-form-item label="" prop="code">
<view style="width:100%; display: flex;">
<view class="form-item-box" style="flex:1">
<u-input autocomplete="off" class="form-item-input" v-model="form.code"
placeholder="请输入验证码" />
<view style="width: 100%; display: flex">
<view class="form-item-box" style="flex: 1">
<u-input
autocomplete="off"
class="form-item-input"
v-model="form.code"
placeholder="请输入验证码"
/>
</view>
<view class="code-imagebox" @click="getCaptchaImage()">
<image class='code-image' :src="codeUrl" alt=""></image>
<view
class="code-imagebox"
@click="getCaptchaImage()"
>
<image
class="code-image"
:src="codeUrl"
alt=""
></image>
</view>
</view>
</u-form-item>
<view @click="show = true" style="text-align: right;"> 忘记密码</view>
<view @click="show = true" style="text-align: right">
忘记密码</view
>
</u-form>
<view class="log-but" @click="handleLogin"> 登录 </view>
</div>
</div>
<u-modal :show="show" :content='configData' @confirm="show = false"></u-modal>
<u-modal
:show="show"
:content="configData"
@confirm="show = false"
></u-modal>
<u-toast ref="uToast"></u-toast>
</div>
</template>
<script>
import {
mapMutations,
mapState
} from "vuex";
import {
login,
captchaImage,
config
} from "@/common/userApi";
export default {
name: "SignIn",
components: {},
data() {
return {
show:false,
codeUrl: '', //
passShow: false,
form: {
username: "",
password: "",
},
configData:'',
rules: {
username: [{
import { mapMutations, mapState } from 'vuex';
import { login, captchaImage, config } from '@/common/userApi';
export default {
name: 'SignIn',
components: {},
data() {
return {
show: false,
codeUrl: '', //
passShow: false,
form: {
username: '',
password: '',
},
configData: '',
rules: {
username: [
{
required: true,
message: "请输入用户名",
trigger: ["blur"],
}],
password: [{
message: '请输入用户名',
trigger: ['blur'],
},
],
password: [
{
required: true,
message: "请输入密码",
trigger: ["blur"],
}],
code: [{
message: '请输入密码',
trigger: ['blur'],
},
],
code: [
{
required: true,
message: "请输入验证码",
trigger: ["blur"],
}],
},
message: '请输入验证码',
trigger: ['blur'],
},
],
},
};
},
computed: {
...mapState('ht', ['reportId']),
},
created() {
this.getCaptchaImage(); //
this.getConfig(); //
this.keyEnter();
},
methods: {
...mapMutations(['setTrainPath']),
//
keyEnter() {
document.onkeydown = (e) => {
if (e.keyCode == 13) {
this.handleLogin(); //
}
};
},
computed: {
...mapState("ht", ["reportId"]),
//
async getConfig() {
const res = await config('sys.password.forget');
const { code, rows, msg } = res;
if (code === 200) {
this.configData = rows[0]?.configValue || '';
}
},
created() {
this.getCaptchaImage() //
this.getConfig() //
this.keyEnter()
//
async getCaptchaImage() {
const res = await captchaImage();
const { code, data, msg } = res;
if (code === 200) {
this.codeUrl = 'data:image/gif;base64,' + res.img;
this.form.uuid = res.uuid;
}
},
methods: {
...mapMutations(["setTrainPath"]),
//
keyEnter(){
document.onkeydown = e =>{
if(e.keyCode == 13){
this.handleLogin() //
}
}
},
//
async getConfig() {
const res = await config('sys.password.forget');
const {
code,
rows,
msg
} = res;
//
async handleLogin() {
this.$refs.uForm.validate().then(async (formRes) => {
const param = {
username: this.form.username,
password: this.form.password,
code: this.form.code, // 456
uuid: this.form.uuid,
};
const res = await login(param);
const { code, data, msg } = res;
if (code === 200) {
this.configData = rows[0]?.configValue || ''
}
},
//
async getCaptchaImage() {
const res = await captchaImage();
const {
code,
data,
msg
} = res;
if (code === 200) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.form.uuid = res.uuid
}
},
//
async handleLogin() {
this.$refs.uForm.validate().then(async (formRes) => {
const param = {
username: this.form.username,
password: this.form.password,
code: this.form.code, // 456
uuid: this.form.uuid,
};
const res = await login(param);
const {
code,
data,
msg
} = res;
if (code === 200) {
uni.setStorageSync("userToken", res.token);
uni.setStorageSync("userName", this.form.username);
uni.navigateTo({
url: "/pages/index/index",
});
//
var docElm = document.documentElement;
if (docElm.requestFullscreen) {
docElm.requestFullscreen();
} else if (docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen();
} else if (docElm.webkitRequestFullScreen) {
docElm.webkitRequestFullScreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}
this.handleSuccess("登录成功");
} else {
this.handleError(msg || "登录失败");
uni.setStorageSync('userToken', res.token);
uni.setStorageSync('userName', this.form.username);
uni.navigateTo({
url: '/pages/index/index',
});
//
var docElm = document.documentElement;
if (docElm.requestFullscreen) {
docElm.requestFullscreen();
} else if (docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen();
} else if (docElm.webkitRequestFullScreen) {
docElm.webkitRequestFullScreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}
})
},
//
handleError(_tips) {
this.$refs.uToast.show({
type: "error",
icon: false,
message: _tips,
});
},
//
handleSuccess(_tips) {
this.$refs.uToast.show({
type: "success",
icon: false,
message: _tips,
});
},
this.handleSuccess('登录成功');
} else {
this.handleError(msg || '登录失败');
}
});
},
//
handleError(_tips) {
this.$refs.uToast.show({
type: 'error',
icon: false,
message: _tips,
});
},
};
//
handleSuccess(_tips) {
this.$refs.uToast.show({
type: 'success',
icon: false,
message: _tips,
});
},
},
};
</script>
<style lang="scss" scoped>
.view-form {
width: 80%
}
.view-form {
width: 80%;
}
.code-imagebox {
width: 100px;
margin-left: 12px;
.code-imagebox {
width: 100px;
margin-left: 12px;
.code-image {
width: 100px;
height: 48px;
}
.code-image {
width: 100px;
height: 48px;
}
.log-but {
width: 400px;
line-height: 48px;
background: #3d78ff;
border-radius: 4px;
font-size: 20px;
color: #ffffff;
text-align: center;
margin-top: 36px;
}
.log-but {
width: 400px;
line-height: 48px;
background: #3d78ff;
border-radius: 4px;
font-size: 20px;
color: #ffffff;
text-align: center;
margin-top: 36px;
}
.checkbox-box {
display: flex;
}
.view-yd {
width: 440px;
}
::v-deep.u-checkbox__icon-wrap--square {
width: 18px !important;
height: 18px !important;
}
.pawss {
display: flex;
justify-content: space-between;
color: #3d78ff;
.forget {
font-size: 14px !important;
}
}
.checkbox-box {
display: flex;
}
::v-deep .u-checkbox-label--left span {
font-size: 14px !important;
}
.view-yd {
width: 440px;
}
.form-fg {
height: 30px;
}
/deep/.u-checkbox__icon-wrap--square {
width: 18px !important;
height: 18px !important;
}
.form-item-img {
width: 20px;
height: 30px;
}
.pawss {
display: flex;
justify-content: space-between;
color: #3d78ff;
.ipt-box {
width: 380px;
margin: 0 100px;
}
.forget {
font-size: 14px !important;
}
}
.code-wrap {
display: flex;
/deep/ .u-checkbox-label--left span {
font-size: 14px !important;
.code-field {
flex: 1;
}
.form-fg {
height: 30px;
.code-btn {
margin-left: 10px;
}
.form-item-img {
width: 20px;
height: 30px;
i {
position: absolute;
top: 30px;
right: 15px;
cursor: pointer;
}
}
.ipt-box {
width: 380px;
margin: 0 100px;
}
.forgetPassword {
cursor: pointer;
color: rgba(0, 0, 0, 0.54);
}
.code-wrap {
.forgetPassword:hover {
text-decoration: underline;
color: rgba(0, 0, 0, 0.87);
}
</style>
<style scoped lang="scss">
.form-item-box {
width: 100%;
border-radius: 4px 4px 4px 4px;
border: 1px solid #dcdfe6;
height: 46px;
}
.form-item-input {
height: 46px !important;
border-radius: 23px;
padding: 0 14px !important;
color: #333333;
box-sizing: border-box;
border: none;
}
::v-deep .uni-input-input {
//font-size: 50px;
}
.form-item-input:placeholder {
font-size: 16px;
color: #000;
}
.form-item-codebut {
font-size: 12px;
color: #888888;
width: 100px;
text-align: center;
border-left: 1px solid #d8d8d8;
}
::v-deep .u-form-item__body__left__content__label {
width: 100px;
font-size: 22px;
color: #000000;
margin-bottom: 16px;
}
::v-deep.u-input__content__field-wrapper__field {
height: 48px;
line-height: 48px;
font-size: 16px;
}
::v-deep.ant-input {
font-size: 22px;
}
::v-deep.ant-input-affix-wrapper .ant-input:not(:first-child) {
padding-left: 40px;
}
.h1-title {
text-align: center;
font-weight: bold;
font-size: 36px;
width: 100%;
margin-bottom: 20px;
}
.divbox {
display: flex;
background-image: url('../../imgs/left.png');
background-position: left bottom;
background-repeat: no-repeat;
background-size: 100%;
.div-left {
position: relative;
flex: 1;
display: flex;
.code-field {
flex: 1;
}
.code-btn {
margin-left: 10px;
}
i {
justify-content: center;
align-items: center;
.equipment {
position: absolute;
top: 30px;
right: 15px;
cursor: pointer;
bottom: 4px;
color: #6fcd9d;
}
}
.forgetPassword {
cursor: pointer;
color: rgba(0, 0, 0, 0.54);
}
.forgetPassword:hover {
text-decoration: underline;
color: rgba(0, 0, 0, 0.87);
}
</style>
<style scoped lang="scss">
.form-item-box {
width: 100%;
border-radius: 4px 4px 4px 4px;
border: 1px solid #dcdfe6;
height: 46px;
}
.form-item-input {
height: 46px !important;
border-radius: 23px;
padding: 0 14px !important;
color: #333333;
box-sizing: border-box;
border: none;
}
/deep/ .uni-input-input {
//font-size: 50px;
}
.form-item-input:placeholder {
font-size: 16px;
color: #000;
}
.form-item-codebut {
font-size: 12px;
color: #888888;
width: 100px;
text-align: center;
border-left: 1px solid #d8d8d8;
}
/deep/ .u-form-item__body__left__content__label {
width: 100px;
font-size: 22px;
color: #000000;
margin-bottom: 16px;
}
/deep/.u-input__content__field-wrapper__field {
height: 48px;
line-height: 48px;
font-size: 16px;
}
/deep/.ant-input {
font-size: 22px;
}
/deep/.ant-input-affix-wrapper .ant-input:not(:first-child) {
padding-left: 40px;
}
.divbox {
width: 100%;
height: 100vh;
display: flex;
.div-left {
flex: 2;
}
.h1-title {
text-align: center;
font-weight: bold;
font-size: 36px;
width: 100%;
margin-bottom: 20px;
}
.div-right {
background: rgba(255, 255, 255, 0.6);
width: 500px;
.divbox {
display: flex;
background-image: url('../../imgs/left.png');
background-position: left bottom;
background-repeat: no-repeat;
background-size: 100% ;
.div-left {
position: relative;
flex: 1;
display: flex;
justify-content: center;
align-items: center;
.equipment {
position: absolute;
bottom: 4px;
color: #6fcd9d;
}
}
}
.divbox {
width: 100%;
height: 100vh;
text-align: left;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-content: center;
.div-left {
flex: 2;
}
.div-right {
background:rgba(255, 255, 255, .6) ;
width: 500px;
text-align: left;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-content: center;
.p-note {
color: #10b884;
}
.p-note {
color: #10b884;
}
}
</style>
}
</style>

78
大唐会议前台1/uni_modules/uview-ui/components/u-input/props.js

@ -3,7 +3,7 @@ export default {
// 输入的值
value: {
type: [String, Number],
default: uni.$u.props.input.value
default: uni.$u.props.input.value,
},
// 输入框类型
// number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数
@ -12,176 +12,176 @@ export default {
// text-文本输入键盘
type: {
type: String,
default: uni.$u.props.input.type
default: uni.$u.props.input.type,
},
// 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,
// 兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序
fixed: {
type: Boolean,
default: uni.$u.props.input.fixed
default: uni.$u.props.input.fixed,
},
// 是否禁用输入框
disabled: {
type: Boolean,
default: uni.$u.props.input.disabled
default: uni.$u.props.input.disabled,
},
// 禁用状态时的背景色
disabledColor: {
type: String,
default: uni.$u.props.input.disabledColor
default: uni.$u.props.input.disabledColor,
},
// 是否显示清除控件
clearable: {
type: Boolean,
default: uni.$u.props.input.clearable
default: uni.$u.props.input.clearable,
},
// 是否密码类型
password: {
type: Boolean,
default: uni.$u.props.input.password
default: uni.$u.props.input.password,
},
// 最大输入长度,设置为 -1 的时候不限制最大长度
maxlength: {
type: [String, Number],
default: uni.$u.props.input.maxlength
default: uni.$u.props.input.maxlength,
},
// 输入框为空时的占位符
placeholder: {
type: String,
default: uni.$u.props.input.placeholder
default: uni.$u.props.input.placeholder,
},
// 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
// 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写::v-deep
placeholderClass: {
type: String,
default: uni.$u.props.input.placeholderClass
default: uni.$u.props.input.placeholderClass,
},
// 指定placeholder的样式
placeholderStyle: {
type: [String, Object],
default: uni.$u.props.input.placeholderStyle
default: uni.$u.props.input.placeholderStyle,
},
// 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效
showWordLimit: {
type: Boolean,
default: uni.$u.props.input.showWordLimit
default: uni.$u.props.input.showWordLimit,
},
// 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档
// https://uniapp.dcloud.io/component/input
// https://uniapp.dcloud.io/component/textarea
confirmType: {
type: String,
default: uni.$u.props.input.confirmType
default: uni.$u.props.input.confirmType,
},
// 点击键盘右下角按钮时是否保持键盘不收起,H5无效
confirmHold: {
type: Boolean,
default: uni.$u.props.input.confirmHold
default: uni.$u.props.input.confirmHold,
},
// focus时,点击页面的时候不收起键盘,微信小程序有效
holdKeyboard: {
type: Boolean,
default: uni.$u.props.input.holdKeyboard
default: uni.$u.props.input.holdKeyboard,
},
// 自动获取焦点
// 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
focus: {
type: Boolean,
default: uni.$u.props.input.focus
default: uni.$u.props.input.focus,
},
// 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
autoBlur: {
type: Boolean,
default: uni.$u.props.input.autoBlur
default: uni.$u.props.input.autoBlur,
},
// 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效
disableDefaultPadding: {
type: Boolean,
default: uni.$u.props.input.disableDefaultPadding
default: uni.$u.props.input.disableDefaultPadding,
},
// 指定focus时光标的位置
cursor: {
type: [String, Number],
default: uni.$u.props.input.cursor
default: uni.$u.props.input.cursor,
},
// 输入框聚焦时底部与键盘的距离
cursorSpacing: {
type: [String, Number],
default: uni.$u.props.input.cursorSpacing
default: uni.$u.props.input.cursorSpacing,
},
// 光标起始位置,自动聚集时有效,需与selection-end搭配使用
selectionStart: {
type: [String, Number],
default: uni.$u.props.input.selectionStart
default: uni.$u.props.input.selectionStart,
},
// 光标结束位置,自动聚集时有效,需与selection-start搭配使用
selectionEnd: {
type: [String, Number],
default: uni.$u.props.input.selectionEnd
default: uni.$u.props.input.selectionEnd,
},
// 键盘弹起时,是否自动上推页面
adjustPosition: {
type: Boolean,
default: uni.$u.props.input.adjustPosition
default: uni.$u.props.input.adjustPosition,
},
// 输入框内容对齐方式,可选值为:left|center|right
inputAlign: {
type: String,
default: uni.$u.props.input.inputAlign
default: uni.$u.props.input.inputAlign,
},
// 输入框字体的大小
fontSize: {
type: [String, Number],
default: uni.$u.props.input.fontSize
default: uni.$u.props.input.fontSize,
},
// 输入框字体颜色
color: {
type: String,
default: uni.$u.props.input.color
default: uni.$u.props.input.color,
},
// 输入框前置图标
prefixIcon: {
type: String,
default: uni.$u.props.input.prefixIcon
default: uni.$u.props.input.prefixIcon,
},
// 前置图标样式,对象或字符串
prefixIconStyle: {
type: [String, Object],
default: uni.$u.props.input.prefixIconStyle
default: uni.$u.props.input.prefixIconStyle,
},
// 输入框后置图标
suffixIcon: {
type: String,
default: uni.$u.props.input.suffixIcon
default: uni.$u.props.input.suffixIcon,
},
// 后置图标样式,对象或字符串
suffixIconStyle: {
type: [String, Object],
default: uni.$u.props.input.suffixIconStyle
default: uni.$u.props.input.suffixIconStyle,
},
// 边框类型,surround-四周边框,bottom-底部边框,none-无边框
border: {
type: String,
default: uni.$u.props.input.border
default: uni.$u.props.input.border,
},
// 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
readonly: {
type: Boolean,
default: uni.$u.props.input.readonly
default: uni.$u.props.input.readonly,
},
// 输入框形状,circle-圆形,square-方形
shape: {
type: String,
default: uni.$u.props.input.shape
default: uni.$u.props.input.shape,
},
// 用于处理或者过滤输入框内容的方法
formatter: {
type: [Function, null],
default: uni.$u.props.input.formatter
default: uni.$u.props.input.formatter,
},
// 是否忽略组件内对文本合成系统事件的处理
ignoreCompositionEvent: {
type: Boolean,
default: true
}
}
}
default: true,
},
},
};

552
大唐会议前台1/uni_modules/uview-ui/components/u-input/u-input.vue

@ -1,81 +1,81 @@
<template>
<view class="u-input" :class="inputClass" :style="[wrapperStyle]">
<view class="u-input__content">
<view
class="u-input__content__prefix-icon"
v-if="prefixIcon || $slots.prefix"
>
<slot name="prefix">
<u-icon
:name="prefixIcon"
size="18"
:customStyle="prefixIconStyle"
></u-icon>
</slot>
</view>
<view class="u-input__content__field-wrapper" @tap="clickHandler">
<view class="u-input" :class="inputClass" :style="[wrapperStyle]">
<view class="u-input__content">
<view
class="u-input__content__prefix-icon"
v-if="prefixIcon || $slots.prefix"
>
<slot name="prefix">
<u-icon
:name="prefixIcon"
size="18"
:customStyle="prefixIconStyle"
></u-icon>
</slot>
</view>
<view class="u-input__content__field-wrapper" @tap="clickHandler">
<!-- 根据uni-app的input组件文档H5和APP中只要声明了password参数(无论true还是false)type均失效此时
为了防止type=number时又存在password属性type无效此时需要设置password为undefined
-->
<input
class="u-input__content__field-wrapper__field"
:style="[inputStyle]"
:type="type"
:focus="focus"
:cursor="cursor"
:value="innerValue"
:auto-blur="autoBlur"
:disabled="disabled || readonly"
:maxlength="maxlength"
:placeholder="placeholder"
:placeholder-style="placeholderStyle"
:placeholder-class="placeholderClass"
:confirm-type="confirmType"
:confirm-hold="confirmHold"
:hold-keyboard="holdKeyboard"
:cursor-spacing="cursorSpacing"
:adjust-position="adjustPosition"
:selection-end="selectionEnd"
:selection-start="selectionStart"
:password="password || type === 'password' || false"
:ignoreCompositionEvent="ignoreCompositionEvent"
@input="onInput"
@blur="onBlur"
@focus="onFocus"
@confirm="onConfirm"
@keyboardheightchange="onkeyboardheightchange"
/>
</view>
<view
class="u-input__content__clear"
v-if="isShowClear"
@tap="onClear"
>
<u-icon
name="close"
size="11"
color="#ffffff"
customStyle="line-height: 12px"
></u-icon>
</view>
<view
class="u-input__content__subfix-icon"
v-if="suffixIcon || $slots.suffix"
>
<slot name="suffix">
<u-icon
:name="suffixIcon"
size="18"
:customStyle="suffixIconStyle"
></u-icon>
</slot>
</view>
</view>
</view>
<input
class="u-input__content__field-wrapper__field"
:style="[inputStyle]"
:type="type"
:focus="focus"
:cursor="cursor"
:value="innerValue"
:auto-blur="autoBlur"
:disabled="disabled || readonly"
:maxlength="maxlength"
:placeholder="placeholder"
:placeholder-style="placeholderStyle"
:placeholder-class="placeholderClass"
:confirm-type="confirmType"
:confirm-hold="confirmHold"
:hold-keyboard="holdKeyboard"
:cursor-spacing="cursorSpacing"
:adjust-position="adjustPosition"
:selection-end="selectionEnd"
:selection-start="selectionStart"
:password="password || type === 'password' || false"
:ignoreCompositionEvent="ignoreCompositionEvent"
@input="onInput"
@blur="onBlur"
@focus="onFocus"
@confirm="onConfirm"
@keyboardheightchange="onkeyboardheightchange"
/>
</view>
<view
class="u-input__content__clear"
v-if="isShowClear"
@tap="onClear"
>
<u-icon
name="close"
size="11"
color="#ffffff"
customStyle="line-height: 12px"
></u-icon>
</view>
<view
class="u-input__content__subfix-icon"
v-if="suffixIcon || $slots.suffix"
>
<slot name="suffix">
<u-icon
:name="suffixIcon"
size="18"
:customStyle="suffixIconStyle"
></u-icon>
</slot>
</view>
</view>
</view>
</template>
<script>
import props from "./props.js";
import props from './props.js';
/**
* Input 输入框
* @description 此组件为一个输入框默认没有边框和样式是专门为配合表单组件u-form而设计的利用它可以快速实现表单验证输入内容下拉选择等功能
@ -89,7 +89,7 @@ import props from "./props.js";
* @property {Boolean} password 是否密码类型 默认 false
* @property {String | Number} maxlength 最大输入长度设置为 -1 的时候不限制最大长度 默认 -1
* @property {String} placeholder 输入框为空时的占位符
* @property {String} placeholderClass 指定placeholder的样式类注意页面或组件的style中写了scoped时需要在类名前写/deep/ 默认 'input-placeholder'
* @property {String} placeholderClass 指定placeholder的样式类注意页面或组件的style中写了scoped时需要在类名前写::v-deep 默认 'input-placeholder'
* @property {String | Object} placeholderStyle 指定placeholder的样式字符串/对象形式"color: red;"
* @property {Boolean} showWordLimit 是否显示输入字数统计只在 type ="text"或type ="textarea"时有效 默认 false
* @property {String} confirmType 设置右下角按钮的文字兼容性详见uni-app文档 默认 'done'
@ -119,207 +119,207 @@ import props from "./props.js";
* @example <u-input v-model="value" :password="true" suffix-icon="lock-fill" />
*/
export default {
name: "u-input",
mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
data() {
return {
//
innerValue: "",
//
focused: false,
// valuewatchimmediatevalue
firstChange: true,
// value
changeFromInner: false,
name: 'u-input',
mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
data() {
return {
//
innerValue: '',
//
focused: false,
// valuewatchimmediatevalue
firstChange: true,
// value
changeFromInner: false,
//
innerFormatter: value => value
};
},
watch: {
value: {
immediate: true,
handler(newVal, oldVal) {
this.innerValue = newVal;
/* #ifdef H5 */
// H5valueinput@input
if (
this.firstChange === false &&
this.changeFromInner === false
) {
this.valueChange();
}
/* #endif */
this.firstChange = false;
// changeFromInnerfalse
this.changeFromInner = false;
},
},
},
computed: {
//
isShowClear() {
const { clearable, readonly, focused, innerValue } = this;
return !!clearable && !readonly && !!focused && innerValue !== "";
},
//
inputClass() {
let classes = [],
{ border, disabled, shape } = this;
border === "surround" &&
(classes = classes.concat(["u-border", "u-input--radius"]));
classes.push(`u-input--${shape}`);
border === "bottom" &&
(classes = classes.concat([
"u-border-bottom",
"u-input--no-radius",
]));
return classes.join(" ");
},
//
wrapperStyle() {
const style = {};
//
if (this.disabled) {
style.backgroundColor = this.disabledColor;
}
//
if (this.border === "none") {
style.padding = "0";
} else {
// uni-appiOS
style.paddingTop = "6px";
style.paddingBottom = "6px";
style.paddingLeft = "9px";
style.paddingRight = "9px";
}
return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle));
},
//
inputStyle() {
const style = {
color: this.color,
fontSize: uni.$u.addUnit(this.fontSize),
textAlign: this.inputAlign
};
return style;
},
},
methods: {
innerFormatter: (value) => value,
};
},
watch: {
value: {
immediate: true,
handler(newVal, oldVal) {
this.innerValue = newVal;
/* #ifdef H5 */
// H5valueinput@input
if (
this.firstChange === false &&
this.changeFromInner === false
) {
this.valueChange();
}
/* #endif */
this.firstChange = false;
// changeFromInnerfalse
this.changeFromInner = false;
},
},
},
computed: {
//
isShowClear() {
const { clearable, readonly, focused, innerValue } = this;
return !!clearable && !readonly && !!focused && innerValue !== '';
},
//
inputClass() {
let classes = [],
{ border, disabled, shape } = this;
border === 'surround' &&
(classes = classes.concat(['u-border', 'u-input--radius']));
classes.push(`u-input--${shape}`);
border === 'bottom' &&
(classes = classes.concat([
'u-border-bottom',
'u-input--no-radius',
]));
return classes.join(' ');
},
//
wrapperStyle() {
const style = {};
//
if (this.disabled) {
style.backgroundColor = this.disabledColor;
}
//
if (this.border === 'none') {
style.padding = '0';
} else {
// uni-appiOS
style.paddingTop = '6px';
style.paddingBottom = '6px';
style.paddingLeft = '9px';
style.paddingRight = '9px';
}
return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle));
},
//
inputStyle() {
const style = {
color: this.color,
fontSize: uni.$u.addUnit(this.fontSize),
textAlign: this.inputAlign,
};
return style;
},
},
methods: {
// propsref
setFormatter(e) {
this.innerFormatter = e
this.innerFormatter = e;
},
// input
onInput(e) {
let { value = '' } = e.detail || {};
//
const formatter = this.formatter || this.innerFormatter;
const formatValue = formatter(value);
// propsinnerValue$nextTick
this.innerValue = value;
this.$nextTick(() => {
this.innerValue = formatValue;
this.valueChange();
});
},
//
onBlur(event) {
this.$emit('blur', event.detail.value);
// H5blurclickfocused
// false
uni.$u.sleep(50).then(() => {
this.focused = false;
});
// u-form
uni.$u.formValidate(this, 'blur');
},
// input
onInput(e) {
let { value = "" } = e.detail || {};
//
const formatter = this.formatter || this.innerFormatter
const formatValue = formatter(value)
// propsinnerValue$nextTick
this.innerValue = value
this.$nextTick(() => {
this.innerValue = formatValue;
this.valueChange();
})
},
//
onBlur(event) {
this.$emit("blur", event.detail.value);
// H5blurclickfocused
// false
uni.$u.sleep(50).then(() => {
this.focused = false;
});
// u-form
uni.$u.formValidate(this, "blur");
},
//
onFocus(event) {
this.focused = true;
this.$emit("focus");
},
//
onConfirm(event) {
this.$emit("confirm", this.innerValue);
},
//
// 2.7.0+App 3.1.0+
//
onFocus(event) {
this.focused = true;
this.$emit('focus');
},
//
onConfirm(event) {
this.$emit('confirm', this.innerValue);
},
//
// 2.7.0+App 3.1.0+
onkeyboardheightchange() {
this.$emit("keyboardheightchange");
},
//
valueChange() {
const value = this.innerValue;
this.$nextTick(() => {
this.$emit("input", value);
// value
this.changeFromInner = true;
this.$emit("change", value);
// u-form
uni.$u.formValidate(this, "change");
});
},
//
onClear() {
this.innerValue = "";
this.$nextTick(() => {
this.valueChange();
this.$emit("clear");
});
},
/**
* 在安卓nvue上事件无法冒泡
* 在某些时间我们希望监听u-from-item的点击事件此时会导致点击u-form-item内的u-input后
* 无法触发u-form-item的点击事件这里通过手动调用u-form-item的方法进行触发
*/
clickHandler() {
// #ifdef APP-NVUE
if (uni.$u.os() === "android") {
const formItem = uni.$u.$parent.call(this, "u-form-item");
if (formItem) {
formItem.clickHandler();
}
}
// #endif
},
},
this.$emit('keyboardheightchange');
},
//
valueChange() {
const value = this.innerValue;
this.$nextTick(() => {
this.$emit('input', value);
// value
this.changeFromInner = true;
this.$emit('change', value);
// u-form
uni.$u.formValidate(this, 'change');
});
},
//
onClear() {
this.innerValue = '';
this.$nextTick(() => {
this.valueChange();
this.$emit('clear');
});
},
/**
* 在安卓nvue上事件无法冒泡
* 在某些时间我们希望监听u-from-item的点击事件此时会导致点击u-form-item内的u-input后
* 无法触发u-form-item的点击事件这里通过手动调用u-form-item的方法进行触发
*/
clickHandler() {
// #ifdef APP-NVUE
if (uni.$u.os() === 'android') {
const formItem = uni.$u.$parent.call(this, 'u-form-item');
if (formItem) {
formItem.clickHandler();
}
}
// #endif
},
},
};
</script>
<style lang="scss" scoped>
@import "../../libs/css/components.scss";
@import '../../libs/css/components.scss';
.u-input {
@include flex(row);
align-items: center;
justify-content: space-between;
flex: 1;
@include flex(row);
align-items: center;
justify-content: space-between;
flex: 1;
&--radius,
&--square {
border-radius: 4px;
}
&--radius,
&--square {
border-radius: 4px;
}
&--no-radius {
border-radius: 0;
}
&--no-radius {
border-radius: 0;
}
&--circle {
border-radius: 100px;
}
&--circle {
border-radius: 100px;
}
&__content {
flex: 1;
@include flex(row);
align-items: center;
justify-content: space-between;
&__content {
flex: 1;
@include flex(row);
align-items: center;
justify-content: space-between;
&__field-wrapper {
position: relative;
@include flex(row);
margin: 0;
flex: 1;
&__field-wrapper {
position: relative;
@include flex(row);
margin: 0;
flex: 1;
&__field {
line-height: 26px;
text-align: left;
@ -328,27 +328,27 @@ export default {
font-size: 15px;
flex: 1;
}
}
}
&__clear {
width: 20px;
height: 20px;
border-radius: 100px;
background-color: #c6c7cb;
@include flex(row);
align-items: center;
justify-content: center;
transform: scale(0.82);
margin-left: 4px;
}
&__clear {
width: 20px;
height: 20px;
border-radius: 100px;
background-color: #c6c7cb;
@include flex(row);
align-items: center;
justify-content: center;
transform: scale(0.82);
margin-left: 4px;
}
&__subfix-icon {
margin-left: 4px;
}
&__subfix-icon {
margin-left: 4px;
}
&__prefix-icon {
margin-right: 4px;
}
}
&__prefix-icon {
margin-right: 4px;
}
}
}
</style>

54
大唐会议前台1/uni_modules/uview-ui/components/u-textarea/props.js

@ -3,117 +3,117 @@ export default {
// 输入框的内容
value: {
type: [String, Number],
default: uni.$u.props.textarea.value
default: uni.$u.props.textarea.value,
},
// 输入框为空时占位符
placeholder: {
type: [String, Number],
default: uni.$u.props.textarea.placeholder
default: uni.$u.props.textarea.placeholder,
},
// 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
// 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写::v-deep
placeholderClass: {
type: String,
default: uni.$u.props.input.placeholderClass
default: uni.$u.props.input.placeholderClass,
},
// 指定placeholder的样式
placeholderStyle: {
type: [String, Object],
default: uni.$u.props.input.placeholderStyle
default: uni.$u.props.input.placeholderStyle,
},
// 输入框高度
height: {
type: [String, Number],
default: uni.$u.props.textarea.height
default: uni.$u.props.textarea.height,
},
// 设置键盘右下角按钮的文字,仅微信小程序,App-vue和H5有效
confirmType: {
type: String,
default: uni.$u.props.textarea.confirmType
default: uni.$u.props.textarea.confirmType,
},
// 是否禁用
disabled: {
type: Boolean,
default: uni.$u.props.textarea.disabled
default: uni.$u.props.textarea.disabled,
},
// 是否显示统计字数
count: {
type: Boolean,
default: uni.$u.props.textarea.count
default: uni.$u.props.textarea.count,
},
// 是否自动获取焦点,nvue不支持,H5取决于浏览器的实现
focus: {
type: Boolean,
default: uni.$u.props.textarea.focus
default: uni.$u.props.textarea.focus,
},
// 是否自动增加高度
autoHeight: {
type: Boolean,
default: uni.$u.props.textarea.autoHeight
default: uni.$u.props.textarea.autoHeight,
},
// 如果textarea是在一个position:fixed的区域,需要显示指定属性fixed为true
fixed: {
type: Boolean,
default: uni.$u.props.textarea.fixed
default: uni.$u.props.textarea.fixed,
},
// 指定光标与键盘的距离
cursorSpacing: {
type: Number,
default: uni.$u.props.textarea.cursorSpacing
default: uni.$u.props.textarea.cursorSpacing,
},
// 指定focus时的光标位置
cursor: {
type: [String, Number],
default: uni.$u.props.textarea.cursor
default: uni.$u.props.textarea.cursor,
},
// 是否显示键盘上方带有”完成“按钮那一栏,
showConfirmBar: {
type: Boolean,
default: uni.$u.props.textarea.showConfirmBar
default: uni.$u.props.textarea.showConfirmBar,
},
// 光标起始位置,自动聚焦时有效,需与selection-end搭配使用
selectionStart: {
type: Number,
default: uni.$u.props.textarea.selectionStart
default: uni.$u.props.textarea.selectionStart,
},
// 光标结束位置,自动聚焦时有效,需与selection-start搭配使用
selectionEnd: {
type: Number,
default: uni.$u.props.textarea.selectionEnd
default: uni.$u.props.textarea.selectionEnd,
},
// 键盘弹起时,是否自动上推页面
adjustPosition: {
type: Boolean,
default: uni.$u.props.textarea.adjustPosition
default: uni.$u.props.textarea.adjustPosition,
},
// 是否去掉 iOS 下的默认内边距,只微信小程序有效
disableDefaultPadding: {
type: Boolean,
default: uni.$u.props.textarea.disableDefaultPadding
default: uni.$u.props.textarea.disableDefaultPadding,
},
// focus时,点击页面的时候不收起键盘,只微信小程序有效
holdKeyboard: {
type: Boolean,
default: uni.$u.props.textarea.holdKeyboard
default: uni.$u.props.textarea.holdKeyboard,
},
// 最大输入长度,设置为 -1 的时候不限制最大长度
maxlength: {
type: [String, Number],
default: uni.$u.props.textarea.maxlength
default: uni.$u.props.textarea.maxlength,
},
// 边框类型,surround-四周边框,bottom-底部边框
border: {
type: String,
default: uni.$u.props.textarea.border
default: uni.$u.props.textarea.border,
},
// 用于处理或者过滤输入框内容的方法
formatter: {
type: [Function, null],
default: uni.$u.props.textarea.formatter
default: uni.$u.props.textarea.formatter,
},
// 是否忽略组件内对文本合成系统事件的处理
ignoreCompositionEvent: {
type: Boolean,
default: true
}
}
}
default: true,
},
},
};

318
大唐会议前台1/uni_modules/uview-ui/components/u-textarea/u-textarea.vue

@ -1,47 +1,47 @@
<template>
<view class="u-textarea" :class="textareaClass" :style="[textareaStyle]">
<textarea
class="u-textarea__field"
:value="innerValue"
:style="{ height: $u.addUnit(height) }"
:placeholder="placeholder"
:placeholder-style="$u.addStyle(placeholderStyle, 'string')"
:placeholder-class="placeholderClass"
:disabled="disabled"
:focus="focus"
:autoHeight="autoHeight"
:fixed="fixed"
:cursorSpacing="cursorSpacing"
:cursor="cursor"
:showConfirmBar="showConfirmBar"
:selectionStart="selectionStart"
:selectionEnd="selectionEnd"
:adjustPosition="adjustPosition"
:disableDefaultPadding="disableDefaultPadding"
:holdKeyboard="holdKeyboard"
:maxlength="maxlength"
:confirmType="confirmType"
:ignoreCompositionEvent="ignoreCompositionEvent"
@focus="onFocus"
@blur="onBlur"
@linechange="onLinechange"
@input="onInput"
@confirm="onConfirm"
@keyboardheightchange="onKeyboardheightchange"
></textarea>
<text
class="u-textarea__count"
:style="{
'background-color': disabled ? 'transparent' : '#fff',
}"
v-if="count"
>{{ innerValue.length }}/{{ maxlength }}</text
>
</view>
<view class="u-textarea" :class="textareaClass" :style="[textareaStyle]">
<textarea
class="u-textarea__field"
:value="innerValue"
:style="{ height: $u.addUnit(height) }"
:placeholder="placeholder"
:placeholder-style="$u.addStyle(placeholderStyle, 'string')"
:placeholder-class="placeholderClass"
:disabled="disabled"
:focus="focus"
:autoHeight="autoHeight"
:fixed="fixed"
:cursorSpacing="cursorSpacing"
:cursor="cursor"
:showConfirmBar="showConfirmBar"
:selectionStart="selectionStart"
:selectionEnd="selectionEnd"
:adjustPosition="adjustPosition"
:disableDefaultPadding="disableDefaultPadding"
:holdKeyboard="holdKeyboard"
:maxlength="maxlength"
:confirmType="confirmType"
:ignoreCompositionEvent="ignoreCompositionEvent"
@focus="onFocus"
@blur="onBlur"
@linechange="onLinechange"
@input="onInput"
@confirm="onConfirm"
@keyboardheightchange="onKeyboardheightchange"
></textarea>
<text
class="u-textarea__count"
:style="{
'background-color': disabled ? 'transparent' : '#fff',
}"
v-if="count"
>{{ innerValue.length }}/{{ maxlength }}</text
>
</view>
</template>
<script>
import props from "./props.js";
import props from './props.js';
/**
* Textarea 文本域
* @description 文本域此组件满足了可能出现的表单信息补充编辑等实际逻辑的功能内置了字数校验等
@ -49,7 +49,7 @@ import props from "./props.js";
*
* @property {String | Number} value 输入框的内容
* @property {String | Number} placeholder 输入框为空时占位符
* @property {String} placeholderClass 指定placeholder的样式类注意页面或组件的style中写了scoped时需要在类名前写/deep/ 默认 'input-placeholder'
* @property {String} placeholderClass 指定placeholder的样式类注意页面或组件的style中写了scoped时需要在类名前写::v-deep 默认 'input-placeholder'
* @property {String | Object} placeholderStyle 指定placeholder的样式字符串/对象形式"color: red;"
* @property {String | Number} height 输入框高度默认 70
* @property {String} confirmType 设置键盘右下角按钮的文字仅微信小程序App-vue和H5有效默认 'done'
@ -80,12 +80,12 @@ import props from "./props.js";
* @example <u--textarea v-model="value1" placeholder="请输入内容" ></u--textarea>
*/
export default {
name: "u-textarea",
mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
name: 'u-textarea',
mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
data() {
return {
//
innerValue: "",
innerValue: '',
//
focused: false,
// valuewatchimmediatevalue
@ -93,147 +93,147 @@ export default {
// value
changeFromInner: false,
//
innerFormatter: value => value
}
innerFormatter: (value) => value,
};
},
watch: {
value: {
immediate: true,
handler(newVal, oldVal) {
this.innerValue = newVal;
/* #ifdef H5 */
// H5valueinput@input
if (
this.firstChange === false &&
this.changeFromInner === false
) {
this.valueChange();
}
/* #endif */
this.firstChange = false;
// changeFromInnerfalse
this.changeFromInner = false;
},
},
value: {
immediate: true,
handler(newVal, oldVal) {
this.innerValue = newVal;
/* #ifdef H5 */
// H5valueinput@input
if (
this.firstChange === false &&
this.changeFromInner === false
) {
this.valueChange();
}
/* #endif */
this.firstChange = false;
// changeFromInnerfalse
this.changeFromInner = false;
},
},
},
computed: {
//
textareaClass() {
let classes = [],
{ border, disabled, shape } = this;
border === 'surround' &&
(classes = classes.concat(['u-border', 'u-textarea--radius']));
border === 'bottom' &&
(classes = classes.concat([
'u-border-bottom',
'u-textarea--no-radius',
]));
disabled && classes.push('u-textarea--disabled');
return classes.join(' ');
},
//
textareaStyle() {
const style = {};
// #ifdef APP-NVUE
// textareanvue
if (uni.$u.os() === 'android') {
style.paddingTop = '6px';
style.paddingLeft = '9px';
style.paddingBottom = '3px';
style.paddingRight = '6px';
}
// #endif
return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle));
},
},
computed: {
//
textareaClass() {
let classes = [],
{ border, disabled, shape } = this;
border === "surround" &&
(classes = classes.concat(["u-border", "u-textarea--radius"]));
border === "bottom" &&
(classes = classes.concat([
"u-border-bottom",
"u-textarea--no-radius",
]));
disabled && classes.push("u-textarea--disabled");
return classes.join(" ");
},
//
textareaStyle() {
const style = {};
// #ifdef APP-NVUE
// textareanvue
if (uni.$u.os() === "android") {
style.paddingTop = "6px";
style.paddingLeft = "9px";
style.paddingBottom = "3px";
style.paddingRight = "6px";
}
// #endif
return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle));
},
},
methods: {
methods: {
// propsref
setFormatter(e) {
this.innerFormatter = e
this.innerFormatter = e;
},
onFocus(e) {
this.$emit('focus', e);
},
onBlur(e) {
this.$emit('blur', e);
// u-form
uni.$u.formValidate(this, 'blur');
},
onFocus(e) {
this.$emit("focus", e);
},
onBlur(e) {
this.$emit("blur", e);
// u-form
uni.$u.formValidate(this, "blur");
},
onLinechange(e) {
this.$emit("linechange", e);
},
onInput(e) {
let { value = "" } = e.detail || {};
onLinechange(e) {
this.$emit('linechange', e);
},
onInput(e) {
let { value = '' } = e.detail || {};
//
const formatter = this.formatter || this.innerFormatter
const formatValue = formatter(value)
const formatter = this.formatter || this.innerFormatter;
const formatValue = formatter(value);
// propsinnerValue$nextTick
this.innerValue = value
this.innerValue = value;
this.$nextTick(() => {
this.innerValue = formatValue;
this.valueChange();
})
},
});
},
//
valueChange() {
const value = this.innerValue;
this.$nextTick(() => {
this.$emit("input", value);
// value
this.changeFromInner = true;
this.$emit("change", value);
// u-form
uni.$u.formValidate(this, "change");
});
const value = this.innerValue;
this.$nextTick(() => {
this.$emit('input', value);
// value
this.changeFromInner = true;
this.$emit('change', value);
// u-form
uni.$u.formValidate(this, 'change');
});
},
onConfirm(e) {
this.$emit("confirm", e);
},
onKeyboardheightchange(e) {
this.$emit("keyboardheightchange", e);
},
},
onConfirm(e) {
this.$emit('confirm', e);
},
onKeyboardheightchange(e) {
this.$emit('keyboardheightchange', e);
},
},
};
</script>
<style lang="scss" scoped>
@import "../../libs/css/components.scss";
@import '../../libs/css/components.scss';
.u-textarea {
border-radius: 4px;
background-color: #fff;
position: relative;
@include flex;
flex: 1;
border-radius: 4px;
background-color: #fff;
position: relative;
@include flex;
flex: 1;
padding: 9px;
&--radius {
border-radius: 4px;
}
&--radius {
border-radius: 4px;
}
&--no-radius {
border-radius: 0;
}
&--no-radius {
border-radius: 0;
}
&--disabled {
background-color: #f5f7fa;
}
&--disabled {
background-color: #f5f7fa;
}
&__field {
flex: 1;
font-size: 15px;
color: $u-content-color;
&__field {
flex: 1;
font-size: 15px;
color: $u-content-color;
width: 100%;
}
}
&__count {
position: absolute;
right: 5px;
bottom: 2px;
font-size: 12px;
color: $u-tips-color;
background-color: #ffffff;
padding: 1px 4px;
}
&__count {
position: absolute;
right: 5px;
bottom: 2px;
font-size: 12px;
color: $u-tips-color;
background-color: #ffffff;
padding: 1px 4px;
}
}
</style>

Loading…
Cancel
Save