Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
nyx
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
发现
nyx
Commits
8a2edc15
Commit
8a2edc15
authored
Nov 23, 2020
by
jscat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nyx weapp: 功能更新
1. 新增redis 更新/查询操作 2. input框focus时候,小键盘不会让页面弹起
parent
85e38785
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
114 行增加
和
9 行删除
+114
-9
app/nyx-dev/config.js
+3
-0
app/nyx-dev/pages/share/share.js
+108
-6
app/nyx-dev/pages/share/share.wxml
+3
-3
没有找到文件。
app/nyx-dev/config.js
查看文件 @
8a2edc15
...
...
@@ -80,5 +80,7 @@ var config={
pay_callback_url
:
host_key
+
"/api/nyx/wx/pay/notify"
,
upload_url
:
host_key
+
"/api/nyx/upload/pic"
,
image_url
:
host_key
+
"/images/"
,
redis_update_like_url
:
host_key
+
"/api/nyx/redis/update/like"
,
redis_query_like_url
:
host_key
+
"/api/nyx/redis/search/like"
,
}
module
.
exports
=
config
;
\ No newline at end of file
app/nyx-dev/pages/share/share.js
查看文件 @
8a2edc15
...
...
@@ -91,6 +91,8 @@ Page({
like
:
40
}
],
bottom_val
:
0
,
},
...
...
@@ -176,15 +178,19 @@ Page({
emotionHost
:
app
.
globalData
.
emotionHost
})
//构建榜单数据
var
raw
=
_this
.
__data__
.
rankData_raw_like
_this
.
genRankData
(
raw
,
'@'
)
//构建榜单数据
_this
.
onGetRedisLike
()
//var raw = _this.__data__.rankData_raw_like
//_this.genRankData(raw, '@')
},
// 初始化socket, 监听socket
onShow
:
function
()
{
var
_this
=
this
;
var
_this
=
this
;
//构建榜单数据
_this
.
onGetRedisLike
()
console
.
log
(
"===onShow_readyState_"
,
app
.
globalData
.
socketTask
.
readyState
)
var
uid
=
wx
.
getStorageSync
(
'nyxCode'
)
if
(
app
.
globalData
.
socketTask
.
readyState
!=
1
&&
app
.
globalData
.
socketTask
.
readyState
!=
0
&&
uid
!=
""
)
{
...
...
@@ -354,6 +360,22 @@ Page({
console
.
log
(
'===onUnload webSocket 连接关闭事件。'
)
},
//聚焦
inputFocus
:
function
(
e
)
{
console
.
log
(
e
)
var
_this
=
this
;
_this
.
setData
({
bottom_val
:
e
.
detail
.
height
==
0
?
0
:
e
.
detail
.
height
-
80
})
},
inputBlur
:
function
(
e
){
console
.
log
(
e
)
var
_this
=
this
;
_this
.
setData
({
bottom_val
:
0
})
},
//发送消息
messageSend
:
function
()
{
...
...
@@ -527,6 +549,7 @@ Page({
'type'
:
type
})
_this
.
sendSocketMessage
(
msg
)
_this
.
onUpdateRedisLike
(
inputValue
)
}
},
...
...
@@ -710,7 +733,7 @@ Page({
{
if
(
raw
.
hasOwnProperty
(
newVal
[
i
]))
{
raw
[
newVal
[
i
]]
=
raw
[
newVal
[
i
]]
+
1
raw
[
newVal
[
i
]]
=
parseInt
(
raw
[
newVal
[
i
]])
+
1
}
else
{
...
...
@@ -840,7 +863,86 @@ Page({
}
_this
.
setData
({
rankData
})
}
},
updateRedisLike
:
function
(
strUrl
)
{
var
_this
=
this
;
wx
.
request
({
url
:
strUrl
,
method
:
'GET'
,
header
:
{
'Cookie'
:
wx
.
getStorageSync
(
'cookieKey'
),
},
success
:
function
(
res
)
{
if
(
res
.
data
.
resultCode
==
200
)
{
//表示query成功
console
.
log
(
"===updateRedisLike完成"
);
}
},
fail
:
function
(
res
)
{
console
.
log
(
"===updateRedisLike失败"
)
}
})
},
//调用java接口, 同步更新redis的like数据
onUpdateRedisLike
:
function
(
text
)
{
var
_this
=
this
;
var
reg
=
/
(
@|#
)\S
.+
?(\s
+|$
)
/g
;
let
newList
=
text
.
match
(
reg
);
if
(
newList
!=
null
)
{
var
str
=
uniqueList
(
newList
).
join
(
"::"
).
replace
(
/#/g
,
"%23"
)
var
strUrl
=
config
.
redis_update_like_url
+
"?keyString="
+
str
config
.
debug
==
1
?
console
.
log
(
"===updateRedisLike strUrl "
+
strUrl
):
""
_this
.
updateRedisLike
(
strUrl
)
}
},
//调用java接口, 同步查询redis的like数据
getRedisLike
:
function
(
strUrl
)
{
var
_this
=
this
;
wx
.
request
({
url
:
strUrl
,
method
:
'GET'
,
header
:
{
'Cookie'
:
wx
.
getStorageSync
(
'cookieKey'
),
},
success
:
function
(
res
)
{
if
(
res
.
data
.
resultCode
==
200
)
{
//表示query成功
console
.
log
(
"===updateRedisLike完成"
);
var
rankData_raw_like
=
res
.
data
.
data
_this
.
setData
({
rankData_raw_like
})
_this
.
genRankData
(
rankData_raw_like
,
'@'
)
}
},
fail
:
function
(
res
)
{
console
.
log
(
"===updateRedisLike失败"
)
}
})
},
//调用java接口, 同步get redis的like数据
onGetRedisLike
:
function
(){
var
_this
=
this
;
var
strUrl
=
config
.
redis_query_like_url
config
.
debug
==
1
?
console
.
log
(
"===getRedisLike strUrl "
+
strUrl
):
""
_this
.
getRedisLike
(
strUrl
)
},
})
...
...
app/nyx-dev/pages/share/share.wxml
查看文件 @
8a2edc15
<!--pages/share/share.wxml-->
<view class="page">
<!-- start key view -->
<view class="
tab
">
<view class="
page__hd" style="position:fixed; top:0;width: 750rpx;
">
<view class="tab-title">
<view class="{{selected=='@'?'border-tottom':'default'}}" id="@" bindtap="selected">热度商家榜</view>
<view class="{{selected=='#'?'border-tottom':'default'}}" id="#" bindtap="selected">活跃主播榜</view>
...
...
@@ -54,8 +54,8 @@
</view>
<!-- 消息输入 -->
<view class="message-input">
<input class="{{isShowAdd?'':'showSend'}}" placeholder="请输入内容" type="text" value="{{messageInputVal}}" cursor-spacing="10" bindinput='messageInput' confirm-type="send" bindconfirm="messageSend" />
<view class="message-input"
style="position:fixed; bottom:{{bottom_val}}px"
>
<input class="{{isShowAdd?'':'showSend'}}" placeholder="请输入内容" type="text" value="{{messageInputVal}}" cursor-spacing="10" bindinput='messageInput' confirm-type="send" bindconfirm="messageSend"
bindfocus="inputFocus" bindblur="inputBlur" adjust-position="{{false}}"
/>
<button bindtap="messageSend" wx:if="{{!isShowAdd}}">发送</button>
<image mode="widthFix" class="input-img {{isShowAdd?'':'showAdd'}}" src='../../icon/chat/face1.png' id="face" bindtap="openEmotion"></image>
<image mode="widthFix" class="input-img" wx:if="{{isShowAdd}}" src='../../icon/chat/add1.png' id="add" bindtap="openMedia"></image>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论