diff --git a/changelog.md b/changelog.md
index a2ed193..87b4b9e 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,7 @@
+## v0.16.9
+ * A 管理界面浏览历史查看
+ * A 使用一些功能时登录校验
+
## v0.16.8
* A 支持填入微信个人信息
* F 使用用户名登录时账号判断错误而无法登录
diff --git a/miniprogram/admin/pages/page_history/history-item/history-item.js b/miniprogram/admin/pages/page_history/history-item/history-item.js
new file mode 100644
index 0000000..4df6cd7
--- /dev/null
+++ b/miniprogram/admin/pages/page_history/history-item/history-item.js
@@ -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});
+ }
+ }
+})
diff --git a/miniprogram/admin/pages/page_history/history-item/history-item.json b/miniprogram/admin/pages/page_history/history-item/history-item.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/miniprogram/admin/pages/page_history/history-item/history-item.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/miniprogram/admin/pages/page_history/history-item/history-item.wxml b/miniprogram/admin/pages/page_history/history-item/history-item.wxml
new file mode 100644
index 0000000..b13a660
--- /dev/null
+++ b/miniprogram/admin/pages/page_history/history-item/history-item.wxml
@@ -0,0 +1,16 @@
+
+
+
+
+ {{data.page_show}}
+ {{data.options_show}}
+
+
+ {{data.scene}} {{data.sceneDesc}}
+
+
+ {{data.openid}}
+
+
\ No newline at end of file
diff --git a/miniprogram/admin/pages/page_history/history-item/history-item.wxss b/miniprogram/admin/pages/page_history/history-item/history-item.wxss
new file mode 100644
index 0000000..587a28c
--- /dev/null
+++ b/miniprogram/admin/pages/page_history/history-item/history-item.wxss
@@ -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;
+}
diff --git a/miniprogram/admin/pages/page_history/page_history.js b/miniprogram/admin/pages/page_history/page_history.js
index 1bcad23..7c69852 100644
--- a/miniprogram/admin/pages/page_history/page_history.js
+++ b/miniprogram/admin/pages/page_history/page_history.js
@@ -49,7 +49,17 @@ Page({
let {page,limit} = this.options;
let skip = (page-1)*limit;
console.log(skip, limit);
- let res = await pageHistoryCollection.orderBy("time", "desc").skip(skip).limit(limit).get();
+ let query = pageHistoryCollection;
+ if(this.data.conditions){
+ query = query.where(this.data.conditions);
+ }
+ if(refresh){
+ query.count().then(res=>{
+ console.log(res);
+ this.setData({total: res.total});
+ })
+ }
+ let res = await query.orderBy("time", "desc").skip(skip).limit(limit).get();
let data = res.data.map(i=>{
i.time_show = getFormatDatetime(i.time);
i.options_show = JSON.stringify(i.options);
@@ -77,6 +87,31 @@ Page({
})
})
},
+ onConditionChange(e){
+ let {detail} = e;
+ console.log(e);
+ console.log(detail);
+ let conditions = {...this.data.conditions, ...detail};
+ this.setData({conditions});
+ this.refresh({refresh:1})
+ .then(res=>{
+ wx.showToast({
+ title:"筛选成功"
+ })
+ })
+ },
+ deleteCondition(e){
+ console.log(e);
+ let {currentTarget:{dataset:{key}}} = e;
+ let conditions = this.data.conditions;
+ delete conditions[key];
+ this.setData({conditions});
+ this.refresh({refresh:1}).then(res=>{
+ wx.showToast({
+ title: '去除成功'
+ })
+ })
+ },
onReady: function () {
},
@@ -94,6 +129,7 @@ Page({
},
onPullDownRefresh: function () {
+ this.conditions = null;
this.refresh({refresh:1});
},
diff --git a/miniprogram/admin/pages/page_history/page_history.json b/miniprogram/admin/pages/page_history/page_history.json
index 09f295e..7de6c0d 100644
--- a/miniprogram/admin/pages/page_history/page_history.json
+++ b/miniprogram/admin/pages/page_history/page_history.json
@@ -1,5 +1,7 @@
{
- "usingComponents": {},
+ "usingComponents": {
+ "history-item":"./history-item/history-item"
+ },
"enablePullDownRefresh": true,
"onReachBottomDistance": 260,
"navigationBarTitleText": "访问记录"
diff --git a/miniprogram/admin/pages/page_history/page_history.wxml b/miniprogram/admin/pages/page_history/page_history.wxml
index 9ae9cb6..a29bd80 100644
--- a/miniprogram/admin/pages/page_history/page_history.wxml
+++ b/miniprogram/admin/pages/page_history/page_history.wxml
@@ -1,21 +1,15 @@
-
-
-
-
- {{item.page_show}}
- {{item.options_show}}
-
-
- {{item.scene}} {{item.sceneDesc}}
-
-
- {{item.openid}}
+
+
+ {{index}}
+
+
+
+
-