Browse Source

no message

featrue/v4.5
xpz2018 4 years ago
parent
commit
cf059a22a2
16 changed files with 74 additions and 9 deletions
  1. 35
      components/highlight-text/index.js
  2. 3
      components/highlight-text/index.json
  3. 6
      components/highlight-text/index.wxml
  4. 3
      components/highlight-text/index.wxss
  5. 4
      components/popup/index.wxss
  6. 1
      pages/agent/order-item/index.js
  7. 1
      pages/agent/order-item/index.json
  8. 2
      pages/agent/order-item/index.wxml
  9. 3
      pages/index/index.wxml
  10. 9
      pages/mall/search-list/index.js
  11. 5
      pages/mall/search-list/index.json
  12. 6
      pages/mall/search-list/index.wxml
  13. 1
      pages/moment/info-item/index.js
  14. 1
      pages/moment/info-item/index.json
  15. 2
      pages/moment/info-item/index.wxml
  16. 1
      pages/moment/moment-item/index.json

35
components/highlight-text/index.js

@ -0,0 +1,35 @@
Component({
options: {
addGlobalClass: true,
multipleSlots: true
},
properties: {
content: { type: String, value: '' },
keyword: { type: String, value: '' },
keywordColor: { type: String, value: '#008aff' }
},
observers: {
'keyword': function () {
this.setContent()
}
},
data: {
contain: false
},
methods: {
setContent: function () {
if(this.data.keyword == null || '' == this.data.keyword || this.data.keyword.length == 0){
this.setData({contain: false})
return
}
var index = this.data.content.indexOf(this.data.keyword)
if(index < 0){
this.setData({contain: false})
} else {
var textstrA = this.data.content.substring(0, index)
var textstrB = this.data.content.substring(index + this.data.keyword.length)
this.setData({contain: true, textstrA, textstrB})
}
}
}
})

3
components/highlight-text/index.json

@ -0,0 +1,3 @@
{
"component": true
}

6
components/highlight-text/index.wxml

@ -0,0 +1,6 @@
<text wx:if="{{contain}}">
<text>{{textstrA}}</text>
<text class="keyword" style="color: {{keywordColor}};">{{keyword}}</text>
<text>{{textstrB}}</text>
</text>
<text wx:else="">{{content}}</text>

3
components/highlight-text/index.wxss

@ -0,0 +1,3 @@
.keyword {
color: #008aff;
}

4
components/popup/index.wxss

@ -9,7 +9,7 @@
transform: translate(-50%,-50%)
}
.wux-popup-position.wux-popup-position--center .wux-popup__content {
border-radius: 6rpx
border-radius: 24rpx
}
.wux-popup-position.wux-popup-position--center .wux-popup__hd {
padding: 1.3em 1.6em .5em
@ -72,7 +72,7 @@
height: 100%;
text-align: center;
overflow: hidden;
border-radius: 12rpx 12rpx 0rpx 0rpx;
border-radius: 24rpx 24rpx 0rpx 0rpx;
}
.wux-popup__title {
font-weight: 400;

1
pages/agent/order-item/index.js

@ -5,6 +5,7 @@ Component({
multipleSlots: true
},
properties: {
keyword: { type: String, value: null },
item: { type: Object, value: null }
},
methods: {

1
pages/agent/order-item/index.json

@ -1,6 +1,7 @@
{
"component": true,
"usingComponents": {
"highlight-text": "/components/highlight-text/index",
"wux-button": "/components/button/index",
"wux-image": "/components/image/index",
"wux-timeline": "/components/timeline/index",

2
pages/agent/order-item/index.wxml

@ -7,7 +7,7 @@
<image class="image-load" slot="loading" src="/assets/image/def_image.png"></image>
<image class="image-load" slot="error" src="/assets/image/def_image.png"></image>
</wux-image>
<text class="text-sg text-bold" style="margin-left:8rpx">{{item.paperMillName}}</text>
<highlight-text content="{{item.paperMillName}}" keyword="{{keyword}}" class="text-sg text-bold" style="margin-left:8rpx"/>
</view>
<view class="page-name" style="color:#8992A3">{{item.orderItems.length}}辆车</view>
</view>

3
pages/index/index.wxml

@ -13,8 +13,7 @@
</swiper-item>
</swiper>
<view class="cu-bar tabbar bg-white shadow foot"
style="height:{{100 + safeBottom}}rpx;padding-bottom:{{safeBottom}}rpx">
<view class="cu-bar tabbar bg-white shadow foot" style="height:{{100 + safeBottom}}rpx;padding-bottom:{{safeBottom}}rpx">
<view wx:for="{{TabList}}" wx:key="index" class="action" bindtap="onNavChange" data-tab="{{item.index}}">
<view class="cuIcon-cu-image">
<image mode="aspectFill" src="{{tabImage(pageIndex, item.index)}}"></image>

9
pages/mall/search-list/index.js

@ -18,6 +18,13 @@ Page({
pageSize: 10,
pageNum: 1
},
taskList: [
['极客小寨小程序开发_百度百科',
'极客小寨微信小程序正式上线',
'极客小寨微信小程序有哪些?关注极客小寨微信公众号获取微信小程序最全汇总?',
'公众号出售-公众号价格-公众号买卖-A5公众号交易平台',
'如何运营出一个有吸引力的微信公众号? - 微信公众平台号 - 知乎']
]
},
/**
* 生命周期函数--监听页面加载
@ -60,7 +67,7 @@ Page({
if(!util.isEmpty(this.data.form.name) && strList.indexOf(this.data.form.name) < 0){
strList.splice(0, 0, this.data.form.name)
}
this.setData({ rearchStringList: strList.slice(0, 24), focus: false })
this.setData({ rearchStringList: strList.slice(0, 24), focus: false, ['form.name']: detail.value })
},
tagClick: function(e){
this.setData({ ['form.name']: this.data.rearchStringList[e.currentTarget.dataset.index] })

5
pages/mall/search-list/index.json

@ -2,6 +2,9 @@
"usingComponents": {
"free-input":"/components/free-input/index",
"wux-divider": "/components/divider/index",
"wux-tabi": "/components/tabi/index"
"wux-tabi": "/components/tabi/index",
"info-item": "/pages/moment/info-item/index",
"order-item": "/pages/agent/order-item/index",
"moment-item": "/pages/moment/moment-item/index"
}
}

6
pages/mall/search-list/index.wxml

@ -34,7 +34,11 @@
<view class="bg-white" style="padding:0rpx 32rpx" wx:if="{{pageIndex>0}}">
<view style="height:2rpx;background-color:#f3f3f3"></view>
</view>
<page-list dataList="{{pageItem}}"></page-list>
<view wx:for="{{pageItem}}" wx:key="index">
<view data-page="{{pageIndex}}" data-index="{{index}}" style="padding: 12rpx;">
<highlight-text content="{{item}}" keyword="{{form.name}}" class="text-sm"></highlight-text>
</view>
</view>
</view>
<!--加载更多的UI-->
<van-divider content-position="center" wx:if="{{ form.pageNum > 1}}" custom-style="padding:0rpx 120rpx">

1
pages/moment/info-item/index.js

@ -8,6 +8,7 @@ Component({
},
properties: {
item: { type: Object, value: null },
keyword: { type: String, value: '第二轮' },
mclick: { type: Boolean, value: true }
},
methods: {

1
pages/moment/info-item/index.json

@ -1,6 +1,7 @@
{
"component": true,
"usingComponents": {
"highlight-text": "/components/highlight-text/index",
"wux-image": "/components/image/index"
}
}

2
pages/moment/info-item/index.wxml

@ -1,7 +1,7 @@
<!--pages/main/index.wxml-->
<view class="bg-white flex flex-justify" style="padding:18rpx 24rpx;border-bottom: 1rpx solid #f3f3f3;">
<view style="height: 180rpx;padding-right: 16rpx;flex: 1;position: relative;">
<view class="text-title">市生态环境局召开动员会,迎接第二轮第四批中央生态环境市生态环境局召开动员会,迎接第二轮第四批中央生态环</view>
<highlight-text content="{{'市生态环境局召开动员会,迎接第二轮第四批中央生态环境市生态环境局召开动员会,迎接第二轮第四批中央生态环'}}" keyword="{{keyword}}" class="text-title"></highlight-text>
<view class="flex flex-justify" style="position: absolute;bottom: 0;">
<view class="attention-bg">
<text class="text-blue">境局召开动</text>

1
pages/moment/moment-item/index.json

@ -1,6 +1,7 @@
{
"component": true,
"usingComponents": {
"highlight-text": "/components/highlight-text/index",
"wux-divider": "/components/divider/index",
"wux-button": "/components/button/index"
}
Loading…
Cancel
Save