123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- <template>
-
- <view class="doto-inner">
- <!-- <mescroll-body ref="mescrollRef" class="mescrollRef" @init="mescrollInit" top="0" bottom="0" :down="downOption" @down="downCallback" :up="upOption"
- @up="upCallback" @emptyclick="emptyClick"> -->
- <block v-for="(item,index) in listData" :key="index">
- <view class="cell">
- <view class="item">
- <view class="leftContent">
- <view class="top">
- <image class="icon" src="/static/images/home/thing_time.png"></image>
- <view class="content">{{ item.content }}</view>
- </view>
- <view class="date">{{ item.eventTime }}</view>
- </view>
- <view class="rightContent">
- <text v-if="item.status==0" class="state">未完成</text>
- <text v-else class="dstate">已完成</text>
- </view>
- </view>
- <u-line color="#eee" />
- </view>
- </block>
-
- <!-- </mescroll-body> -->
-
- <!-- <view>
- <view class="item">
- <view class="leftContent">
- <view class="top">
- <image class="icon" src="/static/images/home/thing_time.png"></image>
- <view class="content">打电话跟进20个意向客户</view>
- </view>
-
- <view class="date">2022-12-22</view>
- </view>
- <view class="rightContent">
- <text class="state">未完成</text>
- </view>
- </view>
- <u-line color="#eee" />
- </view> -->
-
-
- </view>
- </template>
- <script>
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- export default {
- mixins: [MescrollMixin],
- name:"todo-list",
- props: {
- listData: {
- type: Array,
- default: null
- },
- isHot: {
- type: Boolean,
- default: false
- },
- permission: {
- type: Object,
- default: function(){
- return {};
- }
- }
- },
- data() {
- return {
- downOption: {
- auto: false,
- use:false,
- },
- upOption: {
- auto: false, // 不自动加载
- use:false,
- page: {
- num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
- size: 10 // 每页数据的数量
- },
- noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
- toTop:{
- width:0,
- }
- },
- }
- },
- methods: {
- clickItem(e) {
- try {
- this.$Router.push({
- name: "newsDetail",
- query: e
- })
- } catch (er) {
- //TODO handle the exception
- console.error(er)
- }
-
- },
- formatTitle(title) {
- if (title != undefined) {
- var string = this.removeHTMLTag(title);
- string = this.escape2Html(string);
- return string;
- }
- return ''
- },
- /*移除HTML标签代码*/
- removeHTMLTag(str) {
- str = str.replace(/<\/?[^>]*>/g, ''); //去除HTML tag
- str = str.replace(/[ | ]*\n/g, ''); //去除行尾空白
- str = str.replace(/\n[\s| | ]*\r/g, ''); //去除多余空行
- str = str.replace(/ /ig, ''); //去掉空格
- return str;
- },
- //转意符换成普通字符
- escape2Html(str) {
- var arrEntities = {
- 'lt': '<',
- 'gt': '>',
- 'nbsp': ' ',
- 'amp': '&',
- 'quot': '"'
- };
- return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, t) {
- return arrEntities[t];
- });
- }
- }
-
- }
- </script>
- <style lang="scss">
-
- .doto-inner{
- margin: 0rpx 0;
- //display: flex;
- //flex-wrap: wrap; //flex-wrap 设置当项目在容器中一行无法显示的时候如何处理。 nowrap 不换行 wrap://正常换行 wrap-reverse:向上换行,第一行位于下方
-
- .cell{
- padding-top: 22rpx;
- // margin-bottom: 16rpx;
- }
- .item{
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- padding-bottom: 20rpx;
- .leftContent{
- width: calc(90% - 38rpx);
- .top{
- display: flex;
- flex-direction: row;
- }
- .icon{
- width: 28rpx;
- height: 28rpx;
- margin-left: 21rpx;
- margin-top: 10rpx;
- }
- .content{
- color: #111;
- font-size: 30rpx;
- margin-left: 20rpx;
- font-weight: 400;
- }
- .date{
- margin-top: 22rpx;
- font-size: 22rpx;
- color: #999;
- margin-left: 66rpx;
- }
-
- }
- .rightContent{
-
- display: flex;
- align-items: center;
- .state{
- // width: 92rpx;
- // height: 40rpx;
- // background-color: #eeeeee;
- // border-radius: 8rpx;
- font-size: 24rpx;
- text-align: center;
- color: #F79912;
- }
- .dstate{
- // width: 92rpx;
- // height: 40rpx;
- // background-color: #eeeeee;
- // border-radius: 8rpx;
- font-size: 24rpx;
- text-align: center;
- color: #FF5C03;
- }
- }
- }
- }
- </style>
|