parent
11478a31b2
commit
f3cb7b10ed
@ -0,0 +1,30 @@
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
data:Object
|
||||
},
|
||||
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
onTapBody(){
|
||||
let {options, page} = this.data.data;
|
||||
let query = Object.keys(options).map(i=>`${i}=${options[i]}`).join("&");
|
||||
let url = "/"+page + "?" + query;
|
||||
console.log(url)
|
||||
wx.navigateTo({
|
||||
url
|
||||
})
|
||||
},
|
||||
onTapKey(e){
|
||||
let {currentTarget:{dataset:{key}}} = e;
|
||||
console.log(e);
|
||||
let data = this.data.data[key];
|
||||
let detail = {[key]: data};
|
||||
console.log(detail);
|
||||
this.triggerEvent("condition", detail, {bubbles: true});
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
|
||||
<view class="history {{data.isCrawl?'crawl':''}}" bindtap="onTapBody">
|
||||
<view class="header" >
|
||||
<text>{{data.time_show}} </text> {{data.isCrawl?'爬虫访问':""}}
|
||||
</view>
|
||||
<view class="body">
|
||||
<text data-key="page" catchtap="onTapKey">{{data.page_show}} </text>
|
||||
<text data-key="options" catchtap="onTapKey"> {{data.options_show}}</text>
|
||||
</view>
|
||||
<view class="single-line" data-key="scene" catchtap="onTapKey">
|
||||
{{data.scene}} {{data.sceneDesc}}
|
||||
</view>
|
||||
<view class="detail" data-key="openid" catchtap="onTapKey">
|
||||
{{data.openid}}
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,19 @@
|
||||
|
||||
.history{
|
||||
background: white;
|
||||
padding: 12px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.history.crawl{
|
||||
border: 2px green solid;
|
||||
}
|
||||
.header,
|
||||
.detail{
|
||||
color: dimgray;
|
||||
font-size: 12px;
|
||||
}
|
||||
.single-line{
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"usingComponents": {
|
||||
"history-item":"./history-item/history-item"
|
||||
},
|
||||
"enablePullDownRefresh": true,
|
||||
"onReachBottomDistance": 260,
|
||||
"navigationBarTitleText": "访问记录"
|
||||
|
@ -1,21 +1,15 @@
|
||||
<view class="list">
|
||||
<view class="history {{item.isCrawl?'crawl':''}}" wx:for="{{data}}" wx:key="_id">
|
||||
<view class="header">
|
||||
{{item.time_show}} {{item.isCrawl?'爬虫访问':""}}
|
||||
</view>
|
||||
<view class="body">
|
||||
{{item.page_show}}
|
||||
{{item.options_show}}
|
||||
</view>
|
||||
<view class="single-line">
|
||||
{{item.scene}} {{item.sceneDesc}}
|
||||
</view>
|
||||
<view class="detail">
|
||||
{{item.openid}}
|
||||
<view class="top-sticky flex-row">
|
||||
<view class="item" wx:for="{{conditions}}" data-key="{{index}}" bindtap="deleteCondition">
|
||||
{{index}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="history-item-wrp" wx:for="{{data}}" bindcondition="onConditionChange">
|
||||
<history-item data="{{item}}"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sticky footer">
|
||||
<button type="main" bindtap="subscribe">订阅({{total}})</button>
|
||||
<view class="footer">
|
||||
<button wx:if="{{false}}" type="main" bindtap="subscribe">订阅({{total}})</button>
|
||||
<button type="main" bindtap="onPullDownRefresh">刷新({{total}})</button>
|
||||
<button type="secondary" bindtap="deleteMine">删除我的</button>
|
||||
</view>
|
@ -1,31 +1,31 @@
|
||||
page{
|
||||
height: 100%;
|
||||
}
|
||||
.list{
|
||||
min-height: 100vh;
|
||||
}
|
||||
.history{
|
||||
|
||||
.top-sticky{
|
||||
position: sticky;
|
||||
top: 0;
|
||||
overflow-x: scroll;
|
||||
background: white;
|
||||
padding: 12px;
|
||||
margin: 10px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.history.crawl{
|
||||
border: 2px green solid;
|
||||
}
|
||||
.header,
|
||||
.detail{
|
||||
color: dimgray;
|
||||
.top-sticky>.item{
|
||||
margin: 4px;
|
||||
padding: 4px 8px;
|
||||
background: #00b0f0;
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
border-radius: 50px;
|
||||
}
|
||||
.list{
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
.history-item-wrp{
|
||||
margin-bottom: 10px
|
||||
}
|
||||
.footer{
|
||||
display: flex;
|
||||
bottom: 0;
|
||||
position: fixed;
|
||||
}
|
||||
.footer>button{
|
||||
flex: 1;
|
||||
border-radius: 0;
|
||||
}
|
||||
.sticky{
|
||||
bottom: 0;
|
||||
position: sticky;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in new issue