Browse Source

/deep/替换为::v-deep

master
1747191978@qq.com 2 months ago
parent
commit
f3d7fb909e
  1. 17
      大唐会议前台1/App.vue
  2. 81
      大唐会议前台1/pages/components/MeetingList.vue
  3. 75
      大唐会议前台1/pages/index/details.vue
  4. 75
      大唐会议前台1/pages/index/index.vue
  5. 97
      大唐会议前台1/pages/index/pdf.vue
  6. 89
      大唐会议前台1/pages/index/pdf平铺.vue
  7. 222
      大唐会议前台1/pages/user/login.vue
  8. 78
      大唐会议前台1/uni_modules/uview-ui/components/u-input/props.js
  9. 76
      大唐会议前台1/uni_modules/uview-ui/components/u-input/u-input.vue
  10. 54
      大唐会议前台1/uni_modules/uview-ui/components/u-textarea/props.js
  11. 68
      大唐会议前台1/uni_modules/uview-ui/components/u-textarea/u-textarea.vue

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

@ -1,8 +1,5 @@
<script> <script>
import { import { mapState, mapMutations } from 'vuex';
mapState,
mapMutations
} from 'vuex';
export default { export default {
data() { data() {
return { return {
@ -29,10 +26,10 @@
span { span {
font-size: 16px; font-size: 16px;
} }
/deep/.u-modal{ ::v-deep.u-modal {
background: #ffffff; background: #ffffff;
} }
/deep/.u-modal__content__text span{ ::v-deep.u-modal__content__text span {
font-size: 20px; font-size: 20px;
} }
.avatarobx { .avatarobx {
@ -59,7 +56,7 @@
.out { .out {
width: 30px; width: 30px;
height: 30px height: 30px;
} }
} }
@ -84,8 +81,8 @@
} }
} }
/deep/.u-toast__content__text--error, ::v-deep.u-toast__content__text--error,
/deep/.u-toast__content__text--success { ::v-deep.u-toast__content__text--success {
max-width: 500px !important; max-width: 500px !important;
} }
.back { .back {
@ -122,7 +119,7 @@
text-align: center; text-align: center;
} }
/deep/.uni-pagination__num-tag { ::v-deep.uni-pagination__num-tag {
width: 30px !important; width: 30px !important;
min-width: 30px !important; min-width: 30px !important;
height: 30px !important; height: 30px !important;

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

@ -5,7 +5,8 @@
<view class="li-title">{{ item.title }}</view> <view class="li-title">{{ item.title }}</view>
</view> </view>
<view class="li-item" v-if="item.type == 'file-pdf'"> <view class="li-item" v-if="item.type == 'file-pdf'">
<view class="li-pdf" @click="handlePdf(item)"> {{item.filePdfName}} <view class="li-pdf" @click="handlePdf(item)">
{{ item.filePdfName }}
<span style="color: blue"> 预览</span> <span style="color: blue"> 预览</span>
</view> </view>
</view> </view>
@ -13,47 +14,71 @@
<view class="li-text">{{ item.richtext }}</view> <view class="li-text">{{ item.richtext }}</view>
</view> </view>
<view class="view-ul" v-if="item.infos && item.infos.length"> <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>
</view> </view>
<u-popup :show="show" @close="handleClose" mode="center"> <u-popup :show="show" @close="handleClose" mode="center">
<view class="popup-close" @click='handleClose'> <view class="popup-close" @click="handleClose">
<uni-icons class="popup-icons" type="closeempty" size="30"></uni-icons> <uni-icons
class="popup-icons"
type="closeempty"
size="30"
></uni-icons>
</view> </view>
<view class="popup-box"> <view class="popup-box">
<view class="view-pdf"> <view class="view-pdf">
<pdf v-if='show' ref="pdf" :page="pageNum" @progress="loadedRatio = $event" <pdf
@page-loaded="pageLoaded($event)" @num-pages="pageTotalNum=$event" @error="pdfError($event)" v-if="show"
@link-clicked="page = $event" :src="filePdfUrl"> 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> </pdf>
<div class="tools"> <div class="tools">
<button :theme="'default'" type="submit" @click.stop="prePage" class="mr10"> <button
:theme="'default'"
type="submit"
@click.stop="prePage"
class="mr10"
>
上一页 上一页
</button> </button>
<div class="page">{{ pageNum }}/{{ pageTotalNum }}</div> <div class="page">{{ pageNum }}/{{ pageTotalNum }}</div>
<button :theme="'default'" type="submit" @click.stop="nextPage" class="mr10"> <button
:theme="'default'"
type="submit"
@click.stop="nextPage"
class="mr10"
>
下一页 下一页
</button> </button>
</div> </div>
</view> </view>
</view> </view>
</u-popup> </u-popup>
</view> </view>
</template> </template>
<script> <script>
import pdf from 'vue-pdf' import pdf from 'vue-pdf';
export default { export default {
name: 'MeetingList', name: 'MeetingList',
props: ['infos', 'detailsId'], props: ['infos', 'detailsId'],
components: { components: {
pdf pdf,
}, },
data() { data() {
return { return {
show: false, show: false,
filePdfUrl: "", filePdfUrl: '',
pageNum: 1, pageNum: 1,
pageTotalNum: 1, pageTotalNum: 1,
// //
@ -63,34 +88,33 @@
}; };
}, },
onShow() { onShow() {
console.log('infos', infos) console.log('infos', infos);
}, },
methods: { methods: {
// //
handleClose() { handleClose() {
this.pdfId = '' this.pdfId = '';
this.show = false this.show = false;
}, },
// //
prePage() { prePage() {
var page = this.pageNum var page = this.pageNum;
page = page > 1 ? page - 1 : this.pageTotalNum page = page > 1 ? page - 1 : this.pageTotalNum;
this.pageNum = page this.pageNum = page;
}, },
// //
nextPage() { nextPage() {
var page = this.pageNum var page = this.pageNum;
page = page < this.pageTotalNum ? page + 1 : 1 page = page < this.pageTotalNum ? page + 1 : 1;
this.pageNum = page this.pageNum = page;
}, },
// e // e
pageLoaded(e) { pageLoaded(e) {
this.curPageNum = e this.curPageNum = e;
}, },
// //
pdfError(error) { pdfError(error) {
console.error(error) console.error(error);
}, },
// pdf // pdf
handlePdf(_item) { handlePdf(_item) {
@ -113,13 +137,13 @@
top: 20px; top: 20px;
z-index: 9999; z-index: 9999;
/deep/.uni-icons { ::v-deep.uni-icons {
font-size: 40px !important; font-size: 40px !important;
color: #fff !important; color: #fff !important;
} }
} }
/deep/.u-popup__content{ ::v-deep.u-popup__content {
position: relative; position: relative;
.tools { .tools {
position: absolute; position: absolute;
@ -158,7 +182,7 @@
font-size: 18px; font-size: 18px;
line-height: 44px; line-height: 44px;
height: 44px; height: 44px;
flex: 1 flex: 1;
} }
.page { .page {
@ -225,7 +249,6 @@
} }
} }
.li-title { .li-title {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;

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

@ -1,19 +1,34 @@
<template> <template>
<view class="box"> <view class="box">
<!-- <image class="back" src='../../imgs/back.png' mode="widthFix" @click="handleBack"></image> --> <!-- <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-cent">
<view class="box-cent1"> <view class="box-cent1">
<view class="view-box"> <view class="view-box">
<view style="text-align: center;"> <view style="text-align: center">
<span class="view-title"> {{ listData.title }}</span> <span class="view-title"> {{ listData.title }}</span>
</view> </view>
<view class="view-ul"> <view class="view-ul">
<MeetingList :detailsId='detailsId' :infos='listData.infos'></MeetingList> <MeetingList
:detailsId="detailsId"
:infos="listData.infos"
></MeetingList>
</view> </view>
</view> </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>
<!-- 底部背景图 --> <!-- 底部背景图 -->
<view class="view-backimg"> <view class="view-backimg">
@ -23,31 +38,36 @@
<!-- 头像 - 头像 --> <!-- 头像 - 头像 -->
<view class="avatarobx"> <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
<image @click="show = true" class="avatar" src='../../imgs/out.png' mode="widthFix"></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>
</view> </view>
</template> </template>
<script> <script>
import { import { queryMeeting, meetingDetails } from '@/common/api';
queryMeeting, import { mapMutations } from 'vuex';
meetingDetails import MeetingList from '../components/MeetingList.vue';
} from "@/common/api";
import {
mapMutations
} from 'vuex';
import MeetingList from "../components/MeetingList.vue"
export default { export default {
components: { components: {
MeetingList MeetingList,
}, },
data() { data() {
return { return {
listData: [], listData: [],
data: [], data: [],
userName: uni.getStorageSync("userName"), userName: uni.getStorageSync('userName'),
show: false, show: false,
detailsId: '', detailsId: '',
}; };
@ -56,9 +76,9 @@
created() { created() {
let routes = getCurrentPages(); // let routes = getCurrentPages(); //
let curParam = routes[routes.length - 1].options; // let curParam = routes[routes.length - 1].options; //
this.detailsId = curParam.id this.detailsId = curParam.id;
console.log('curParam', this.detailsId) console.log('curParam', this.detailsId);
this.getMeetingDetails(curParam.id) // this.getMeetingDetails(curParam.id); //
}, },
methods: { methods: {
// 退 // 退
@ -80,7 +100,7 @@
// //
handleItemClaick(_item) { handleItemClaick(_item) {
// enable false // enable false
if (!_item.enable) return if (!_item.enable) return;
uni.navigateTo({ uni.navigateTo({
url: `/pages/index/details?id=${_item.id}`, url: `/pages/index/details?id=${_item.id}`,
}); });
@ -90,16 +110,12 @@
const res = await meetingDetails({ const res = await meetingDetails({
param: { param: {
meetingId, meetingId,
} },
}); });
const { const { code, data, msg } = res;
code,
data,
msg
} = res;
if (code === 200) { if (code === 200) {
this.listData = data this.listData = data;
console.log(this.listData) console.log(this.listData);
} }
}, },
}, },
@ -109,7 +125,7 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .u-modal__content{ ::v-deep .u-modal__content {
text-align: center; text-align: center;
} }
.avatar { .avatar {
@ -125,7 +141,6 @@
.view-li { .view-li {
font-size: 18px; font-size: 18px;
line-height: 26px; line-height: 26px;
} }
} }

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

@ -1,23 +1,41 @@
<template> <template>
<view class="box"> <view class="box">
<!-- <image class="back" src='../../imgs/back.png' mode="widthFix" @click='handleBack'></image> --> <!-- <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-cent">
<view class="box-cent1"> <view class="box-cent1">
<view class="view-box" v-for="(item, index) in listData" :key="index"> <view
<view style="text-align: center;"> class="view-box"
v-for="(item, index) in listData"
:key="index"
>
<view style="text-align: center">
<span class="view-title"> {{ item.dateTitle }}</span> <span class="view-title"> {{ item.dateTitle }}</span>
</view> </view>
<view class="view-ul"> <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>
</view> </view>
<view v-if="!listData.length" class="view-none"> 暂无会议 </view> <view v-if="!listData.length" class="view-none">
暂无会议
</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>
<!-- 底部背景图 --> <!-- 底部背景图 -->
<view class="view-backimg"> <view class="view-backimg">
@ -28,34 +46,33 @@
<view class="avatarobx"> <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='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>
</view> </view>
</template> </template>
<script> <script>
import { import { queryMeeting, meetingDetails } from '@/common/api';
queryMeeting, import { mapMutations } from 'vuex';
meetingDetails
} from "@/common/api";
import {
mapMutations
} from 'vuex';
export default { export default {
data() { data() {
return { return {
listData: [], listData: [],
userName: uni.getStorageSync("userName"), userName: uni.getStorageSync('userName'),
show: false show: false,
}; };
}, },
created() { created() {
this.getQueryMeeting() // this.getQueryMeeting(); //
}, },
onShow() { onShow() {
this.userName = uni.getStorageSync("userName") this.userName = uni.getStorageSync('userName');
console.log('this.userName',this.userName) console.log('this.userName', this.userName);
}, },
methods: { methods: {
// logo // logo
@ -77,7 +94,7 @@
// //
handleItemClaick(_item, _row) { handleItemClaick(_item, _row) {
// enable false // enable false
if (!_item.enable) return if (!_item.enable) return;
uni.navigateTo({ uni.navigateTo({
url: `/pages/index/details?id=${_row.id}`, url: `/pages/index/details?id=${_row.id}`,
}); });
@ -85,15 +102,11 @@
// //
async getQueryMeeting() { async getQueryMeeting() {
const res = await queryMeeting({ const res = await queryMeeting({
param: {} param: {},
}); });
const { const { code, data, msg } = res;
code,
data,
msg
} = res;
if (code === 200) { if (code === 200) {
this.listData = data this.listData = data;
} }
}, },
}, },
@ -103,8 +116,7 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .u-modal__content {
/deep/ .u-modal__content{
text-align: center; text-align: center;
} }
.view-box { .view-box {
@ -127,7 +139,6 @@
font-size: 20px; font-size: 20px;
line-height: 40px; line-height: 40px;
} }
} }
} }

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

@ -1,17 +1,31 @@
<template> <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="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-cent">
<view class="box-cent1"> <view class="box-cent1">
<view class="view-pdf"> <view class="view-pdf">
<pdf ref="pdf" :page="pageNum" @progress="loadedRatio = $event" @page-loaded="pageLoaded($event)" <pdf
@num-pages="pageTotalNum=$event" @error="pdfError($event)" @link-clicked="page = $event" ref="pdf"
:src="filePdfUrl"> :page="pageNum"
@progress="loadedRatio = $event"
@page-loaded="pageLoaded($event)"
@num-pages="pageTotalNum = $event"
@error="pdfError($event)"
@link-clicked="page = $event"
:src="filePdfUrl"
>
</pdf> </pdf>
</view> </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>
<!-- 底部背景图 --> <!-- 底部背景图 -->
<view class="view-backimg"> <view class="view-backimg">
@ -19,12 +33,22 @@
<!-- <view class="view-backimg-bottom"></view> --> <!-- <view class="view-backimg-bottom"></view> -->
</view> </view>
<div class="tools"> <div class="tools">
<view style="width:50vw;display: flex;margin: auto;"> <view style="width: 50vw; display: flex; margin: auto">
<button :theme="'default'" type="submit" @click.stop="prePage" class="mr10"> <button
:theme="'default'"
type="submit"
@click.stop="prePage"
class="mr10"
>
上一页 上一页
</button> </button>
<div class="page">{{ pageNum }}/{{ pageTotalNum }}</div> <div class="page">{{ pageNum }}/{{ pageTotalNum }}</div>
<button :theme="'default'" type="submit" @click.stop="nextPage" class="mr10"> <button
:theme="'default'"
type="submit"
@click.stop="nextPage"
class="mr10"
>
下一页 下一页
</button> </button>
</view> </view>
@ -32,19 +56,29 @@
<!-- 头像 - 头像 --> <!-- 头像 - 头像 -->
<view class="avatarobx"> <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
<image @click="show = true" class="avatar" src='../../imgs/out.png' mode="widthFix"></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>
</view> </view>
</template> </template>
<script> <script>
import pdf from 'vue-pdf' import pdf from 'vue-pdf';
export default { export default {
name: 'MeetingList', name: 'MeetingList',
props: ['infos'], props: ['infos'],
components: { components: {
pdf pdf,
}, },
data() { data() {
return { return {
@ -54,7 +88,7 @@
loadedRatio: 0, loadedRatio: 0,
curPageNum: 0, curPageNum: 0,
filePdfUrl: '', filePdfUrl: '',
userName: uni.getStorageSync("userName"), userName: uni.getStorageSync('userName'),
show: false, show: false,
detailsId: '', detailsId: '',
}; };
@ -62,9 +96,9 @@
created() { created() {
let routes = getCurrentPages(); // let routes = getCurrentPages(); //
let curParam = routes[routes.length - 1].options; // let curParam = routes[routes.length - 1].options; //
this.detailsId = curParam.detailsId this.detailsId = curParam.detailsId;
console.log('this.detailsId ',this.detailsId) console.log('this.detailsId ', this.detailsId);
this.filePdfUrl = curParam.filePdfUrl this.filePdfUrl = curParam.filePdfUrl;
}, },
methods: { methods: {
// logo // logo
@ -92,28 +126,28 @@
// //
handleClose() { handleClose() {
this.pdfId = '' this.pdfId = '';
this.show = false this.show = false;
}, },
// //
prePage() { prePage() {
var page = this.pageNum var page = this.pageNum;
page = page > 1 ? page - 1 : this.pageTotalNum page = page > 1 ? page - 1 : this.pageTotalNum;
this.pageNum = page this.pageNum = page;
}, },
// //
nextPage() { nextPage() {
var page = this.pageNum var page = this.pageNum;
page = page < this.pageTotalNum ? page + 1 : 1 page = page < this.pageTotalNum ? page + 1 : 1;
this.pageNum = page this.pageNum = page;
}, },
// e // e
pageLoaded(e) { pageLoaded(e) {
this.curPageNum = e this.curPageNum = e;
}, },
// //
pdfError(error) { pdfError(error) {
console.error(error) console.error(error);
}, },
}, },
// //
@ -122,7 +156,7 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .u-modal__content{ ::v-deep .u-modal__content {
text-align: center; text-align: center;
} }
.popup-close { .popup-close {
@ -131,7 +165,7 @@
top: 20px; top: 20px;
z-index: 9999; z-index: 9999;
/deep/.uni-icons { ::v-deep.uni-icons {
font-size: 40px !important; font-size: 40px !important;
color: #fff !important; color: #fff !important;
} }
@ -163,7 +197,7 @@
font-size: 18px; font-size: 18px;
line-height: 44px; line-height: 44px;
height: 44px; height: 44px;
flex: 1 flex: 1;
} }
.page { .page {
@ -230,7 +264,6 @@
} }
} }
.li-title { .li-title {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
@ -259,7 +292,6 @@
font-size: 20px; font-size: 20px;
line-height: 40px; line-height: 40px;
} }
} }
} }
@ -295,7 +327,6 @@
left: 0; left: 0;
right: 0; right: 0;
overflow: auto; overflow: auto;
} }
} }
</style> </style>

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

@ -1,14 +1,26 @@
<template> <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="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-cent">
<view class="box-cent1"> <view class="box-cent1">
<view class="view-pdf"> <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>
</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>
<!-- 底部背景图 --> <!-- 底部背景图 -->
<view class="view-backimg"> <view class="view-backimg">
@ -29,44 +41,54 @@
<!-- 头像 - 头像 --> <!-- 头像 - 头像 -->
<view class="avatarobx"> <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
<image @click="show = true" class="avatar" src='../../imgs/out.png' mode="widthFix"></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>
</view> </view>
</template> </template>
<script> <script>
import pdf from 'vue-pdf' import pdf from 'vue-pdf';
export default { export default {
name: 'MeetingList', name: 'MeetingList',
props: ['infos'], props: ['infos'],
components: { components: {
pdf pdf,
}, },
data() { data() {
return { return {
filePdfUrl: '', filePdfUrl: '',
userName: uni.getStorageSync("userName"), userName: uni.getStorageSync('userName'),
detailsId: '', detailsId: '',
numPages: '', numPages: '',
show:false show: false,
}; };
}, },
created() { created() {
let routes = getCurrentPages(); // let routes = getCurrentPages(); //
let curParam = routes[routes.length - 1].options; // let curParam = routes[routes.length - 1].options; //
this.detailsId = curParam.detailsId this.detailsId = curParam.detailsId;
this.filePdfUrl = curParam.filePdfUrl this.filePdfUrl = curParam.filePdfUrl;
this.getNumPages(this.filePdfUrl ) this.getNumPages(this.filePdfUrl);
}, },
methods: { methods: {
getNumPages(url) { getNumPages(url) {
this.pdfSrc=url this.pdfSrc = url;
this.pdfSrc = pdf.createLoadingTask(this.pdfSrc) this.pdfSrc = pdf.createLoadingTask(this.pdfSrc);
this.pdfSrc.promise.then(pdf => { this.pdfSrc.promise.then((pdf) => {
this.numPages = pdf.numPages this.numPages = pdf.numPages;
console.log('this.numPages',this.numPages) console.log('this.numPages', this.numPages);
}) });
}, },
// logo // logo
handleBack() { handleBack() {
@ -93,28 +115,28 @@
// //
handleClose() { handleClose() {
this.pdfId = '' this.pdfId = '';
this.show = false this.show = false;
}, },
// //
prePage() { prePage() {
var page = this.pageNum var page = this.pageNum;
page = page > 1 ? page - 1 : this.pageTotalNum page = page > 1 ? page - 1 : this.pageTotalNum;
this.pageNum = page this.pageNum = page;
}, },
// //
nextPage() { nextPage() {
var page = this.pageNum var page = this.pageNum;
page = page < this.pageTotalNum ? page + 1 : 1 page = page < this.pageTotalNum ? page + 1 : 1;
this.pageNum = page this.pageNum = page;
}, },
// e // e
pageLoaded(e) { pageLoaded(e) {
this.curPageNum = e this.curPageNum = e;
}, },
// //
pdfError(error) { pdfError(error) {
console.error(error) console.error(error);
}, },
}, },
// //
@ -123,7 +145,7 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .u-modal__content{ ::v-deep .u-modal__content {
text-align: center; text-align: center;
} }
.popup-close { .popup-close {
@ -132,7 +154,7 @@
top: 20px; top: 20px;
z-index: 9999; z-index: 9999;
/deep/.uni-icons { ::v-deep.uni-icons {
font-size: 40px !important; font-size: 40px !important;
color: #fff !important; color: #fff !important;
} }
@ -164,7 +186,7 @@
font-size: 18px; font-size: 18px;
line-height: 44px; line-height: 44px;
height: 44px; height: 44px;
flex: 1 flex: 1;
} }
.page { .page {
@ -231,7 +253,6 @@
} }
} }
.li-title { .li-title {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
@ -260,7 +281,6 @@
font-size: 20px; font-size: 20px;
line-height: 40px; line-height: 40px;
} }
} }
} }
@ -296,7 +316,6 @@
left: 0; left: 0;
right: 0; right: 0;
overflow: auto; overflow: auto;
} }
} }
</style> </style>

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

@ -2,65 +2,111 @@
<div> <div>
<div class="divbox"> <div class="divbox">
<div class="div-left"> <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>
<div class="div-right"> <div class="div-right">
<h1 class="h1-title">内部会议系统</h1> <h1 class="h1-title">内部会议系统</h1>
<u-form :model="form" :rules="rules" ref="uForm" label-position="top" label-width="100" <u-form
class="view-form"> :model="form"
:rules="rules"
ref="uForm"
label-position="top"
label-width="100"
class="view-form"
>
<u-form-item label="" prop="username"> <u-form-item label="" prop="username">
<view class="form-item-box"> <view class="form-item-box">
<u-input autocomplete="new-password" class="form-item-input" v-model="form.username" <u-input
placeholder="请输入用户名" /> autocomplete="new-password"
class="form-item-input"
v-model="form.username"
placeholder="请输入用户名"
/>
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="" prop="password" class="form-item-pass" style="padding-bottom: 0"> <u-form-item
<view class="form-item-box" style="display: flex; align-items: center"> label=""
<u-input :type="!passShow ? 'password' : ''" class="form-item-input" prop="password"
autocomplete="new-password" v-model="form.password" placeholder="请输入密码" /> class="form-item-pass"
<image @click="passShow = !passShow" v-if="passShow" mode="aspectFit" class="form-item-img" style="padding-bottom: 0"
src="../../imgs/xyj.png" style="margin-right: 14px"></image> >
<image @click="passShow = !passShow" v-else mode="aspectFit" class="form-item-img" <view
src="../../imgs/xyj1.png" style="margin-right: 14px"></image> 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> </view>
</u-form-item> </u-form-item>
<u-form-item label="" prop="code"> <u-form-item label="" prop="code">
<view style="width:100%; display: flex;"> <view style="width: 100%; display: flex">
<view class="form-item-box" style="flex: 1"> <view class="form-item-box" style="flex: 1">
<u-input autocomplete="off" class="form-item-input" v-model="form.code" <u-input
placeholder="请输入验证码" /> autocomplete="off"
class="form-item-input"
v-model="form.code"
placeholder="请输入验证码"
/>
</view> </view>
<view class="code-imagebox" @click="getCaptchaImage()"> <view
<image class='code-image' :src="codeUrl" alt=""></image> class="code-imagebox"
@click="getCaptchaImage()"
>
<image
class="code-image"
:src="codeUrl"
alt=""
></image>
</view> </view>
</view> </view>
</u-form-item> </u-form-item>
<view @click="show = true" style="text-align: right;"> 忘记密码</view> <view @click="show = true" style="text-align: right">
忘记密码</view
>
</u-form> </u-form>
<view class="log-but" @click="handleLogin"> 登录 </view> <view class="log-but" @click="handleLogin"> 登录 </view>
</div> </div>
</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> <u-toast ref="uToast"></u-toast>
</div> </div>
</template> </template>
<script> <script>
import { import { mapMutations, mapState } from 'vuex';
mapMutations, import { login, captchaImage, config } from '@/common/userApi';
mapState
} from "vuex";
import {
login,
captchaImage,
config
} from "@/common/userApi";
export default { export default {
name: "SignIn", name: 'SignIn',
components: {}, components: {},
data() { data() {
return { return {
@ -68,70 +114,68 @@
codeUrl: '', // codeUrl: '', //
passShow: false, passShow: false,
form: { form: {
username: "", username: '',
password: "", password: '',
}, },
configData: '', configData: '',
rules: { rules: {
username: [{ username: [
{
required: true, required: true,
message: "请输入用户名", message: '请输入用户名',
trigger: ["blur"], trigger: ['blur'],
}], },
password: [{ ],
password: [
{
required: true, required: true,
message: "请输入密码", message: '请输入密码',
trigger: ["blur"], trigger: ['blur'],
}], },
code: [{ ],
code: [
{
required: true, required: true,
message: "请输入验证码", message: '请输入验证码',
trigger: ["blur"], trigger: ['blur'],
}], },
],
}, },
}; };
}, },
computed: { computed: {
...mapState("ht", ["reportId"]), ...mapState('ht', ['reportId']),
}, },
created() { created() {
this.getCaptchaImage() // this.getCaptchaImage(); //
this.getConfig() // this.getConfig(); //
this.keyEnter() this.keyEnter();
}, },
methods: { methods: {
...mapMutations(["setTrainPath"]), ...mapMutations(['setTrainPath']),
// //
keyEnter() { keyEnter() {
document.onkeydown = e =>{ document.onkeydown = (e) => {
if (e.keyCode == 13) { if (e.keyCode == 13) {
this.handleLogin() // this.handleLogin(); //
}
} }
};
}, },
// //
async getConfig() { async getConfig() {
const res = await config('sys.password.forget'); const res = await config('sys.password.forget');
const { const { code, rows, msg } = res;
code,
rows,
msg
} = res;
if (code === 200) { if (code === 200) {
this.configData = rows[0]?.configValue || '' this.configData = rows[0]?.configValue || '';
} }
}, },
// //
async getCaptchaImage() { async getCaptchaImage() {
const res = await captchaImage(); const res = await captchaImage();
const { const { code, data, msg } = res;
code,
data,
msg
} = res;
if (code === 200) { if (code === 200) {
this.codeUrl = "data:image/gif;base64," + res.img; this.codeUrl = 'data:image/gif;base64,' + res.img;
this.form.uuid = res.uuid this.form.uuid = res.uuid;
} }
}, },
// //
@ -144,16 +188,12 @@
uuid: this.form.uuid, uuid: this.form.uuid,
}; };
const res = await login(param); const res = await login(param);
const { const { code, data, msg } = res;
code,
data,
msg
} = res;
if (code === 200) { if (code === 200) {
uni.setStorageSync("userToken", res.token); uni.setStorageSync('userToken', res.token);
uni.setStorageSync("userName", this.form.username); uni.setStorageSync('userName', this.form.username);
uni.navigateTo({ uni.navigateTo({
url: "/pages/index/index", url: '/pages/index/index',
}); });
// //
var docElm = document.documentElement; var docElm = document.documentElement;
@ -166,17 +206,16 @@
} else if (elem.msRequestFullscreen) { } else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen(); elem.msRequestFullscreen();
} }
this.handleSuccess("登录成功"); this.handleSuccess('登录成功');
} else { } else {
this.handleError(msg || "登录失败"); this.handleError(msg || '登录失败');
} }
}) });
}, },
// //
handleError(_tips) { handleError(_tips) {
this.$refs.uToast.show({ this.$refs.uToast.show({
type: "error", type: 'error',
icon: false, icon: false,
message: _tips, message: _tips,
}); });
@ -184,7 +223,7 @@
// //
handleSuccess(_tips) { handleSuccess(_tips) {
this.$refs.uToast.show({ this.$refs.uToast.show({
type: "success", type: 'success',
icon: false, icon: false,
message: _tips, message: _tips,
}); });
@ -195,7 +234,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.view-form { .view-form {
width: 80% width: 80%;
} }
.code-imagebox { .code-imagebox {
@ -227,7 +266,7 @@
width: 440px; width: 440px;
} }
/deep/.u-checkbox__icon-wrap--square { ::v-deep.u-checkbox__icon-wrap--square {
width: 18px !important; width: 18px !important;
height: 18px !important; height: 18px !important;
} }
@ -242,7 +281,7 @@
} }
} }
/deep/ .u-checkbox-label--left span { ::v-deep .u-checkbox-label--left span {
font-size: 14px !important; font-size: 14px !important;
} }
@ -306,7 +345,7 @@
border: none; border: none;
} }
/deep/ .uni-input-input { ::v-deep .uni-input-input {
//font-size: 50px; //font-size: 50px;
} }
@ -323,24 +362,24 @@
border-left: 1px solid #d8d8d8; border-left: 1px solid #d8d8d8;
} }
/deep/ .u-form-item__body__left__content__label { ::v-deep .u-form-item__body__left__content__label {
width: 100px; width: 100px;
font-size: 22px; font-size: 22px;
color: #000000; color: #000000;
margin-bottom: 16px; margin-bottom: 16px;
} }
/deep/.u-input__content__field-wrapper__field { ::v-deep.u-input__content__field-wrapper__field {
height: 48px; height: 48px;
line-height: 48px; line-height: 48px;
font-size: 16px; font-size: 16px;
} }
/deep/.ant-input { ::v-deep.ant-input {
font-size: 22px; font-size: 22px;
} }
/deep/.ant-input-affix-wrapper .ant-input:not(:first-child) { ::v-deep.ant-input-affix-wrapper .ant-input:not(:first-child) {
padding-left: 40px; padding-left: 40px;
} }
@ -381,10 +420,9 @@
} }
.div-right { .div-right {
background:rgba(255, 255, 255, .6) ; background: rgba(255, 255, 255, 0.6);
width: 500px; width: 500px;
text-align: left; text-align: left;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;

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

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

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

@ -75,7 +75,7 @@
</template> </template>
<script> <script>
import props from "./props.js"; import props from './props.js';
/** /**
* Input 输入框 * Input 输入框
* @description 此组件为一个输入框默认没有边框和样式是专门为配合表单组件u-form而设计的利用它可以快速实现表单验证输入内容下拉选择等功能 * @description 此组件为一个输入框默认没有边框和样式是专门为配合表单组件u-form而设计的利用它可以快速实现表单验证输入内容下拉选择等功能
@ -89,7 +89,7 @@ import props from "./props.js";
* @property {Boolean} password 是否密码类型 默认 false * @property {Boolean} password 是否密码类型 默认 false
* @property {String | Number} maxlength 最大输入长度设置为 -1 的时候不限制最大长度 默认 -1 * @property {String | Number} maxlength 最大输入长度设置为 -1 的时候不限制最大长度 默认 -1
* @property {String} placeholder 输入框为空时的占位符 * @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 {String | Object} placeholderStyle 指定placeholder的样式字符串/对象形式"color: red;"
* @property {Boolean} showWordLimit 是否显示输入字数统计只在 type ="text"或type ="textarea"时有效 默认 false * @property {Boolean} showWordLimit 是否显示输入字数统计只在 type ="text"或type ="textarea"时有效 默认 false
* @property {String} confirmType 设置右下角按钮的文字兼容性详见uni-app文档 默认 'done' * @property {String} confirmType 设置右下角按钮的文字兼容性详见uni-app文档 默认 'done'
@ -119,12 +119,12 @@ import props from "./props.js";
* @example <u-input v-model="value" :password="true" suffix-icon="lock-fill" /> * @example <u-input v-model="value" :password="true" suffix-icon="lock-fill" />
*/ */
export default { export default {
name: "u-input", name: 'u-input',
mixins: [uni.$u.mpMixin, uni.$u.mixin, props], mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
data() { data() {
return { return {
// //
innerValue: "", innerValue: '',
// //
focused: false, focused: false,
// valuewatchimmediatevalue // valuewatchimmediatevalue
@ -132,7 +132,7 @@ export default {
// value // value
changeFromInner: false, changeFromInner: false,
// //
innerFormatter: value => value innerFormatter: (value) => value,
}; };
}, },
watch: { watch: {
@ -159,21 +159,21 @@ export default {
// //
isShowClear() { isShowClear() {
const { clearable, readonly, focused, innerValue } = this; const { clearable, readonly, focused, innerValue } = this;
return !!clearable && !readonly && !!focused && innerValue !== ""; return !!clearable && !readonly && !!focused && innerValue !== '';
}, },
// //
inputClass() { inputClass() {
let classes = [], let classes = [],
{ border, disabled, shape } = this; { border, disabled, shape } = this;
border === "surround" && border === 'surround' &&
(classes = classes.concat(["u-border", "u-input--radius"])); (classes = classes.concat(['u-border', 'u-input--radius']));
classes.push(`u-input--${shape}`); classes.push(`u-input--${shape}`);
border === "bottom" && border === 'bottom' &&
(classes = classes.concat([ (classes = classes.concat([
"u-border-bottom", 'u-border-bottom',
"u-input--no-radius", 'u-input--no-radius',
])); ]));
return classes.join(" "); return classes.join(' ');
}, },
// //
wrapperStyle() { wrapperStyle() {
@ -183,14 +183,14 @@ export default {
style.backgroundColor = this.disabledColor; style.backgroundColor = this.disabledColor;
} }
// //
if (this.border === "none") { if (this.border === 'none') {
style.padding = "0"; style.padding = '0';
} else { } else {
// uni-appiOS // uni-appiOS
style.paddingTop = "6px"; style.paddingTop = '6px';
style.paddingBottom = "6px"; style.paddingBottom = '6px';
style.paddingLeft = "9px"; style.paddingLeft = '9px';
style.paddingRight = "9px"; style.paddingRight = '9px';
} }
return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle)); return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle));
}, },
@ -199,7 +199,7 @@ export default {
const style = { const style = {
color: this.color, color: this.color,
fontSize: uni.$u.addUnit(this.fontSize), fontSize: uni.$u.addUnit(this.fontSize),
textAlign: this.inputAlign textAlign: this.inputAlign,
}; };
return style; return style;
}, },
@ -207,64 +207,64 @@ export default {
methods: { methods: {
// propsref // propsref
setFormatter(e) { setFormatter(e) {
this.innerFormatter = e this.innerFormatter = e;
}, },
// input // input
onInput(e) { onInput(e) {
let { value = "" } = e.detail || {}; let { value = '' } = e.detail || {};
// //
const formatter = this.formatter || this.innerFormatter const formatter = this.formatter || this.innerFormatter;
const formatValue = formatter(value) const formatValue = formatter(value);
// propsinnerValue$nextTick // propsinnerValue$nextTick
this.innerValue = value this.innerValue = value;
this.$nextTick(() => { this.$nextTick(() => {
this.innerValue = formatValue; this.innerValue = formatValue;
this.valueChange(); this.valueChange();
}) });
}, },
// //
onBlur(event) { onBlur(event) {
this.$emit("blur", event.detail.value); this.$emit('blur', event.detail.value);
// H5blurclickfocused // H5blurclickfocused
// false // false
uni.$u.sleep(50).then(() => { uni.$u.sleep(50).then(() => {
this.focused = false; this.focused = false;
}); });
// u-form // u-form
uni.$u.formValidate(this, "blur"); uni.$u.formValidate(this, 'blur');
}, },
// //
onFocus(event) { onFocus(event) {
this.focused = true; this.focused = true;
this.$emit("focus"); this.$emit('focus');
}, },
// //
onConfirm(event) { onConfirm(event) {
this.$emit("confirm", this.innerValue); this.$emit('confirm', this.innerValue);
}, },
// //
// 2.7.0+App 3.1.0+ // 2.7.0+App 3.1.0+
onkeyboardheightchange() { onkeyboardheightchange() {
this.$emit("keyboardheightchange"); this.$emit('keyboardheightchange');
}, },
// //
valueChange() { valueChange() {
const value = this.innerValue; const value = this.innerValue;
this.$nextTick(() => { this.$nextTick(() => {
this.$emit("input", value); this.$emit('input', value);
// value // value
this.changeFromInner = true; this.changeFromInner = true;
this.$emit("change", value); this.$emit('change', value);
// u-form // u-form
uni.$u.formValidate(this, "change"); uni.$u.formValidate(this, 'change');
}); });
}, },
// //
onClear() { onClear() {
this.innerValue = ""; this.innerValue = '';
this.$nextTick(() => { this.$nextTick(() => {
this.valueChange(); this.valueChange();
this.$emit("clear"); this.$emit('clear');
}); });
}, },
/** /**
@ -274,8 +274,8 @@ export default {
*/ */
clickHandler() { clickHandler() {
// #ifdef APP-NVUE // #ifdef APP-NVUE
if (uni.$u.os() === "android") { if (uni.$u.os() === 'android') {
const formItem = uni.$u.$parent.call(this, "u-form-item"); const formItem = uni.$u.$parent.call(this, 'u-form-item');
if (formItem) { if (formItem) {
formItem.clickHandler(); formItem.clickHandler();
} }
@ -287,7 +287,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../../libs/css/components.scss"; @import '../../libs/css/components.scss';
.u-input { .u-input {
@include flex(row); @include flex(row);

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

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

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

@ -41,7 +41,7 @@
</template> </template>
<script> <script>
import props from "./props.js"; import props from './props.js';
/** /**
* Textarea 文本域 * Textarea 文本域
* @description 文本域此组件满足了可能出现的表单信息补充编辑等实际逻辑的功能内置了字数校验等 * @description 文本域此组件满足了可能出现的表单信息补充编辑等实际逻辑的功能内置了字数校验等
@ -49,7 +49,7 @@ import props from "./props.js";
* *
* @property {String | Number} value 输入框的内容 * @property {String | Number} value 输入框的内容
* @property {String | Number} placeholder 输入框为空时占位符 * @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 | Object} placeholderStyle 指定placeholder的样式字符串/对象形式"color: red;"
* @property {String | Number} height 输入框高度默认 70 * @property {String | Number} height 输入框高度默认 70
* @property {String} confirmType 设置键盘右下角按钮的文字仅微信小程序App-vue和H5有效默认 'done' * @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> * @example <u--textarea v-model="value1" placeholder="请输入内容" ></u--textarea>
*/ */
export default { export default {
name: "u-textarea", name: 'u-textarea',
mixins: [uni.$u.mpMixin, uni.$u.mixin, props], mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
data() { data() {
return { return {
// //
innerValue: "", innerValue: '',
// //
focused: false, focused: false,
// valuewatchimmediatevalue // valuewatchimmediatevalue
@ -93,8 +93,8 @@ export default {
// value // value
changeFromInner: false, changeFromInner: false,
// //
innerFormatter: value => value innerFormatter: (value) => value,
} };
}, },
watch: { watch: {
value: { value: {
@ -121,26 +121,26 @@ export default {
textareaClass() { textareaClass() {
let classes = [], let classes = [],
{ border, disabled, shape } = this; { border, disabled, shape } = this;
border === "surround" && border === 'surround' &&
(classes = classes.concat(["u-border", "u-textarea--radius"])); (classes = classes.concat(['u-border', 'u-textarea--radius']));
border === "bottom" && border === 'bottom' &&
(classes = classes.concat([ (classes = classes.concat([
"u-border-bottom", 'u-border-bottom',
"u-textarea--no-radius", 'u-textarea--no-radius',
])); ]));
disabled && classes.push("u-textarea--disabled"); disabled && classes.push('u-textarea--disabled');
return classes.join(" "); return classes.join(' ');
}, },
// //
textareaStyle() { textareaStyle() {
const style = {}; const style = {};
// #ifdef APP-NVUE // #ifdef APP-NVUE
// textareanvue // textareanvue
if (uni.$u.os() === "android") { if (uni.$u.os() === 'android') {
style.paddingTop = "6px"; style.paddingTop = '6px';
style.paddingLeft = "9px"; style.paddingLeft = '9px';
style.paddingBottom = "3px"; style.paddingBottom = '3px';
style.paddingRight = "6px"; style.paddingRight = '6px';
} }
// #endif // #endif
return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle)); return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle));
@ -149,55 +149,55 @@ export default {
methods: { methods: {
// propsref // propsref
setFormatter(e) { setFormatter(e) {
this.innerFormatter = e this.innerFormatter = e;
}, },
onFocus(e) { onFocus(e) {
this.$emit("focus", e); this.$emit('focus', e);
}, },
onBlur(e) { onBlur(e) {
this.$emit("blur", e); this.$emit('blur', e);
// u-form // u-form
uni.$u.formValidate(this, "blur"); uni.$u.formValidate(this, 'blur');
}, },
onLinechange(e) { onLinechange(e) {
this.$emit("linechange", e); this.$emit('linechange', e);
}, },
onInput(e) { onInput(e) {
let { value = "" } = e.detail || {}; let { value = '' } = e.detail || {};
// //
const formatter = this.formatter || this.innerFormatter const formatter = this.formatter || this.innerFormatter;
const formatValue = formatter(value) const formatValue = formatter(value);
// propsinnerValue$nextTick // propsinnerValue$nextTick
this.innerValue = value this.innerValue = value;
this.$nextTick(() => { this.$nextTick(() => {
this.innerValue = formatValue; this.innerValue = formatValue;
this.valueChange(); this.valueChange();
}) });
}, },
// //
valueChange() { valueChange() {
const value = this.innerValue; const value = this.innerValue;
this.$nextTick(() => { this.$nextTick(() => {
this.$emit("input", value); this.$emit('input', value);
// value // value
this.changeFromInner = true; this.changeFromInner = true;
this.$emit("change", value); this.$emit('change', value);
// u-form // u-form
uni.$u.formValidate(this, "change"); uni.$u.formValidate(this, 'change');
}); });
}, },
onConfirm(e) { onConfirm(e) {
this.$emit("confirm", e); this.$emit('confirm', e);
}, },
onKeyboardheightchange(e) { onKeyboardheightchange(e) {
this.$emit("keyboardheightchange", e); this.$emit('keyboardheightchange', e);
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../../libs/css/components.scss"; @import '../../libs/css/components.scss';
.u-textarea { .u-textarea {
border-radius: 4px; border-radius: 4px;

Loading…
Cancel
Save