1
This commit is contained in:
parent
5e018143b7
commit
ee7142b0ee
135
components/fuck-textarea/fuck-textarea.vue
Normal file
135
components/fuck-textarea/fuck-textarea.vue
Normal file
@ -0,0 +1,135 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="fuck-textarea-edit-content" :class="{'hidden':EditMode,'border':border}" :style="[getStyle]" @tap="TapView">
|
||||
{{Content}}
|
||||
<view class="fuck-textarea-edit-placeholder" v-if="Content===''">
|
||||
{{placeholder}}
|
||||
</view>
|
||||
</view>
|
||||
<textarea class="fuck-textarea-edit-content" :class="{'hidden':!EditMode,'border':border}" :style="[getStyle]" :value="value"
|
||||
:maxlength="maxlength==''?-1:maxlength" :show-confirm-bar="false" :disabled="disabled" :focus="EditMode" @blur="EditBlur"
|
||||
@input="handleInput" />
|
||||
<view class="inputlength" v-if="maxlength != '' && maxlength >= 0">
|
||||
<text class="current">{{CurrentLength}}</text><text style="margin: 0 6rpx;">/</text><text>{{maxlength}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'FuckTextarea',
|
||||
props: {
|
||||
width: {
|
||||
type: String,
|
||||
default: 'calc(100% - 40rpx)'
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '200rpx'
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
border: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
customStyle: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type:String,
|
||||
default: ""
|
||||
},
|
||||
placeholder:{
|
||||
type:String,
|
||||
default:""
|
||||
},
|
||||
maxlength:{
|
||||
type:[Number, String],
|
||||
default:-1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
Content:"",
|
||||
EditMode:false,
|
||||
ShowBorder:true
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
CurrentLength(){
|
||||
return this.Content.length;
|
||||
},
|
||||
getStyle() {
|
||||
let style = {
|
||||
height: `${ this.height }`,
|
||||
width:`${ this.width }`,
|
||||
};
|
||||
style.pointerEvents = this.disabled ? 'none' : 'auto';
|
||||
style = Object.assign(style, this.customStyle);
|
||||
return style;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
value(v){
|
||||
this.Content = v
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
TapView(){
|
||||
this.EditMode = true;
|
||||
},
|
||||
EditBlur(e){
|
||||
this.EditMode = false;
|
||||
this.Content = e.target.value;
|
||||
},
|
||||
handleInput(e){
|
||||
var that = this;
|
||||
this.$emit('input',e.target.value);
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.Content = this.value
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.hidden{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fuck-textarea-edit-content{
|
||||
padding: 20rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 1.6em;
|
||||
white-space: pre-wrap;
|
||||
text-align: justify;
|
||||
text-justify: inter-ideograph;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.fuck-textarea-edit-content.border{
|
||||
border: 2rpx solid #DDDDDD;
|
||||
}
|
||||
|
||||
.fuck-textarea-edit-placeholder{
|
||||
color:#999999;
|
||||
}
|
||||
|
||||
.inputlength{
|
||||
font-size: 26rpx;
|
||||
padding: 10rpx;
|
||||
text-align: right;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.inputlength .current{
|
||||
color: #999999;
|
||||
}
|
||||
</style>
|
@ -8,11 +8,9 @@
|
||||
<view class="left-search">
|
||||
<view class="left-search-box" style="width: 90%;" @click="goSeach">
|
||||
<uni-search-bar radius="20" style="width: 100%;" placeholder="VIP极速搜索" clearButton="auto"
|
||||
cancelButton="none" @confirm="search" @clear="clear">
|
||||
cancelButton="none" :readonly="!canSearch" :focus="focus" @confirm="search" @clear="clear">
|
||||
</uni-search-bar>
|
||||
<image class="dl-vip" src="@/static/index/vip.png" mode="aspectFit"></image>
|
||||
<!-- 遮罩层 -->
|
||||
<!-- <view v-if="!canSearch" class="dl-zhezhao" @click="goSeach"></view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-text">
|
||||
@ -57,16 +55,6 @@
|
||||
</view>
|
||||
<!-- 主体内容区域 -->
|
||||
<view class="dl-body">
|
||||
<!-- 会员开通 -->
|
||||
<!-- <view class="dl-member-box">
|
||||
<view class="dl-left">
|
||||
<image class="dl-icon" src="@/static/index/zuanshi.png" mode="aspectFit"></image>
|
||||
<text>开通会员 解锁更多权益</text>
|
||||
</view>
|
||||
<view class="dl-right">
|
||||
<image class="dl-go-view" src="@/static/index/go-view.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 随手转发 -->
|
||||
<view class="dl-public-box">
|
||||
<view class="dl-left">
|
||||
@ -211,6 +199,7 @@
|
||||
dataList: [],
|
||||
//每条赚多少积分
|
||||
point: 10,
|
||||
focus: false,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@ -428,7 +417,13 @@
|
||||
async goSeach() {
|
||||
//鉴权
|
||||
if (!await this.checkIfHasRights(rightsCode.searchNotice)) {
|
||||
this.canSearch = false
|
||||
return
|
||||
} else {
|
||||
this.canSearch = true
|
||||
if (!this.focus) {
|
||||
this.focus = true
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
@ -140,7 +140,7 @@
|
||||
.dl-notice-box {
|
||||
font-size: 29rpx;
|
||||
width: 100%;
|
||||
padding: 30rpx 18rpx 10rpx 18rpx;
|
||||
padding: 38rpx 18rpx 10rpx 18rpx;
|
||||
background-color: white;
|
||||
border-radius: 25rpx;
|
||||
margin-bottom: 20rpx;
|
||||
@ -150,7 +150,7 @@
|
||||
position: absolute;
|
||||
color: white;
|
||||
background-color: #FC1F3E;
|
||||
padding: 6rpx 25rpx;
|
||||
padding: 5rpx 25rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 0 25rpx 0 25rpx;
|
||||
top: 0;
|
||||
@ -268,4 +268,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
@ -3,7 +3,7 @@
|
||||
<!-- 主体区域 -->
|
||||
<view class="content-body">
|
||||
<!-- 通告列表页 -->
|
||||
<notice-index style="height: 100%;" v-if="'home'==menuCode" @openVip="openVip"></notice-index>
|
||||
<notice-index v-if="'home'==menuCode" @openVip="openVip"></notice-index>
|
||||
<mine-index :key="nowUserType" :nowUserType="nowUserType" v-if="'my'==menuCode"
|
||||
@refreshUserType="refreshUserType()"></mine-index>
|
||||
<subscribe v-if="'dingyue'==menuCode"></subscribe>
|
||||
|
Loading…
Reference in New Issue
Block a user