Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
Compass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zong
Compass
Commits
e9cffd77
Commit
e9cffd77
authored
Mar 08, 2020
by
biao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
55be83bd
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
88 additions
and
60 deletions
+88
-60
接口文档 V1.0.xls
doc/接口文档 V1.0.xls
+0
-0
ajax_get_user_message.php
src/user/if/ajax_get_user_message.php
+5
-4
app.js
src/wx/app.js
+1
-0
myNews.js
src/wx/pages/myNews/myNews.js
+49
-48
myNews.json
src/wx/pages/myNews/myNews.json
+3
-1
myNews.wxml
src/wx/pages/myNews/myNews.wxml
+9
-3
myNews.wxss
src/wx/pages/myNews/myNews.wxss
+20
-3
project.config.json
src/wx/project.config.json
+1
-1
No files found.
doc/接口文档 V1.0.xls
View file @
e9cffd77
No preview for this file type
src/user/if/ajax_get_user_message.php
View file @
e9cffd77
...
...
@@ -30,7 +30,7 @@ if(empty($userList)) {
$userId
=
$userList
[
0
]
->
id
;
//获取用户消息列表
$rowCount
=
1
0
;
$rowCount
=
1
5
;
$offset
=
$page
*
$rowCount
;
$param
=
array
();
...
...
@@ -42,14 +42,15 @@ if($readFlg == 2) {
$param
[
'is_read'
]
=
true
;
}
$param
[
'delete_flg'
]
=
false
;
$
userM
essageList
=
UserMessageDat
::
getList
(
$param
,
'id'
,
'desc'
,
$offset
,
$rowCount
);
$
m
essageList
=
UserMessageDat
::
getList
(
$param
,
'id'
,
'desc'
,
$offset
,
$rowCount
);
$allCount
=
UserMessageDat
::
getListCount
(
$param
);
$pageCount
=
ceil
(
$allCount
/
$rowCount
);
//接口返回数据
$result
[
"
allCount"
]
=
$all
Count
;
$result
[
"
pageCount"
]
=
$page
Count
;
$result
[
"page"
]
=
$page
;
$result
[
"rowCount"
]
=
$rowCount
;
$result
[
"
list"
]
=
$userM
essageList
;
$result
[
"
messageList"
]
=
$m
essageList
;
ErrorLogger
::
doOutput
(
"Compass...ajax_get_user_message.php....End."
,
0
);
...
...
src/wx/app.js
View file @
e9cffd77
...
...
@@ -5,6 +5,7 @@ App({
this
.
checkUser
();
var
config
=
wx
.
getStorageSync
(
'config'
);
var
that
=
this
;
//获取用户的经纬度信息
wx
.
getLocation
({
type
:
'wgs84'
,
success
:
function
(
res
)
{
...
...
src/wx/pages/myNews/myNews.js
View file @
e9cffd77
...
...
@@ -6,86 +6,87 @@ Page({
* 页面的初始数据
*/
data
:
{
list
:[]
page
:
0
,
pageCount
:
0
,
messageList
:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
var
that
=
this
;
var
config
=
wx
.
getStorageSync
(
'config'
);
wx
:
wx
.
request
({
url
:
app
.
url
+
'ajax_get_user_message.php'
,
header
:
{
'content-type'
:
'application/json'
},
data
:{
unionId
:
config
.
unionId
,
page
:
0
},
method
:
'GET'
,
dataType
:
'json'
,
success
:
function
(
res
)
{
console
.
log
(
res
.
data
)
if
(
res
.
statusCode
==
200
){
that
.
setData
({
list
:
res
.
data
.
result
.
list
})
}
},
fail
:
function
(
res
)
{},
complete
:
function
(
res
)
{},
})
this
.
getNewsList
();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
:
function
()
{
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
:
function
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
:
function
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
//触底以后加载更多
if
((
this
.
data
.
page
+
1
)
<
this
.
data
.
pageCount
)
{
var
pageIndex
=
this
.
data
.
page
+
1
this
.
setData
({
page
:
pageIndex
})
this
.
getNewsList
();
}
else
{
wx
.
showToast
({
title
:
'没有更多消息啦。'
,
icon
:
'success'
,
duration
:
2000
});
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
:
function
()
{
},
//获取用户消息列表
getNewsList
()
{
var
that
=
this
;
var
config
=
wx
.
getStorageSync
(
'config'
);
//获取用户消息列表
wx
.
request
({
url
:
app
.
url
+
'ajax_get_user_message.php'
,
header
:
{
'content-type'
:
'application/json'
},
data
:
{
unionId
:
config
.
unionId
,
page
:
that
.
data
.
page
,
readFlg
:
0
,
},
myNewsDetail
(){
method
:
'GET'
,
dataType
:
'json'
,
success
:
function
(
res
)
{
console
.
log
(
res
.
data
)
if
(
res
.
statusCode
==
200
)
{
that
.
setData
({
pageCount
:
res
.
data
.
result
.
pageCount
,
messageList
:
that
.
data
.
messageList
.
concat
(
res
.
data
.
result
.
messageList
)
})
}
},
fail
:
function
(
res
)
{
},
complete
:
function
(
res
)
{
},
})
},
//消息详细页面
newsDetail
(
e
){
wx
.
navigateTo
({
url
:
'../myNewsDetail/myNewsDetail'
,
})
...
...
src/wx/pages/myNews/myNews.json
View file @
e9cffd77
{
"usingComponents"
:
{}
"usingComponents"
:
{},
"onReachBottomDistance"
:
100
}
\ No newline at end of file
src/wx/pages/myNews/myNews.wxml
View file @
e9cffd77
<!--pages/myNews/myNews.wxml-->
<view class='myNews'>
<view bindtap='myNewsDetail' wx:for="{{list}}" wx:key="{{index}}">{{item.title}}</view>
</view>
<view class="myNews">
<view bindtap='newsDetail' wx:for="{{messageList}}" wx:if="{{!item.is_read}}" class="newsUnread" data-index="{{item.id}}">
{{item.title}}
</view>
<view bindtap='newsDetail' wx:for="{{messageList}}" wx:if="{{item.is_read}}" class="newsReaded" data-index="{{item.id}}">
{{item.title}}
</view>
</view>
src/wx/pages/myNews/myNews.wxss
View file @
e9cffd77
/* pages/myNews/myNews.wxss */
.myNews>view{
margin: 10px auto;
box-sizing: border-box;
.myNews{
margin: 1%;
width:98%;
white-space:nowrap;
padding: 10px;
}
.newsUnread{
height:35px;
line-height: 35px;
padding: 2px;
font-weight: bold;
border-bottom: 1rpx solid #F0F0F0;
}
.newsReaded{
height:35px;
line-height: 35px;
padding: 2px;
font-weight: normal;
border-bottom: 1rpx solid #F0F0F0;
}
src/wx/project.config.json
View file @
e9cffd77
...
...
@@ -15,7 +15,7 @@
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.10.0"
,
"appid"
:
"wxeef50c5d0ef117d1"
,
"projectname"
:
"
zhiNanZhen
"
,
"projectname"
:
"
Compass
"
,
"debugOptions"
:
{
"hidedInDevtools"
:
[]
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment