Commit aefe14be by jscat

nyx update

1. 调整版面设计
1) live页为:  人气, 热度, 关注
2) info页为:  热度话题榜, 活跃用户榜
3) share页为: 热度话题榜, 活跃聊天室
parent a74f12de
.agora-bg {
width: 100%;
height: 100%;
position: absolute;
background: linear-gradient(to bottom, #8FD3F5, #D3FDFF);
color: #5083AA;
}
.h1{
font-size: 32rpx;
}
.h2{
font-size: 24rpx;
}
.flex-center-column{
display: flex;
flex-direction: column;
align-items: center;
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
var config = wx.getStorageSync("config"); var config = wx.getStorageSync("config");
var app = getApp(); var app = getApp();
var util = require('./../../../utils/util.js') var util = require('./../../../utils/util.js')
Page({ Page({
...@@ -200,6 +199,7 @@ Page({ ...@@ -200,6 +199,7 @@ Page({
keyHeight = 16*3+8*(3+2) // 16: font-size; 8: padding: 16rpx keyHeight = 16*3+8*(3+2) // 16: font-size; 8: padding: 16rpx
var chatHeight = windowHeight - keyHeight - 60 // in px var chatHeight = windowHeight - keyHeight - 60 // in px
_this.setData({ _this.setData({
systemInfo:systemInfo,
keyHeight: keyHeight * pxToRpxScale, //in rpx for compatible keyHeight: keyHeight * pxToRpxScale, //in rpx for compatible
chatHeight: chatHeight * pxToRpxScale, // in rpx for compatible chatHeight: chatHeight * pxToRpxScale, // in rpx for compatible
}) })
...@@ -268,8 +268,8 @@ Page({ ...@@ -268,8 +268,8 @@ Page({
_this.sendSocketMessage(sendMsg) _this.sendSocketMessage(sendMsg)
} }
for (var i = 0; i < app.globalData.socketMsgQueue.length; i++) { for (let ij = 0; ij < app.globalData.socketMsgQueue.length; ij++) {
_this.sendSocketMessage(app.globalData.socketMsgQueue[i]) _this.sendSocketMessage(app.globalData.socketMsgQueue[ij])
} }
app.globalData.socketMsgQueue = [] app.globalData.socketMsgQueue = []
app.startHeartBeat(); app.startHeartBeat();
...@@ -1286,8 +1286,8 @@ function face(obj) { ...@@ -1286,8 +1286,8 @@ function face(obj) {
let emotion = emotionFun(); let emotion = emotionFun();
let emotionHost = "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/emoji/"; let emotionHost = "https://930-test-sh.oss-cn-shanghai.aliyuncs.com/emoji/";
let face = {}; let face = {};
for (let i = 0; i < emotion.length; i++) { for (let ij = 0; ij < emotion.length; ij++) {
face[emotion[i].text] = '<img src="' + emotionHost + emotion[i].name + '.png" style="widht:20px;height:20px;vertical-align: middle;"/>' face[emotion[ij].text] = '<img src="' + emotionHost + emotion[ij].name + '.png" style="widht:20px;height:20px;vertical-align: middle;"/>'
} }
return face[obj]; return face[obj];
} }
...@@ -1295,9 +1295,9 @@ function face(obj) { ...@@ -1295,9 +1295,9 @@ function face(obj) {
function uniqueList(arr) { function uniqueList(arr) {
var res = []; var res = [];
var json = {}; var json = {};
var r = /\s+/g; var rr = /\s+/g;
for(var i = 0; i < arr.length; i++){ for(let ij = 0; ij < arr.length; ij++){
var str = arr[i].replace(r,'') var str = arr[ij].replace(rr,'')
if(!json[str]){ if(!json[str]){
res.push(str); res.push(str);
json[str] = 1; json[str] = 1;
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<!-- start key view --> <!-- start key view -->
<view class="page__hd" style="position:fixed; top:0;width: 100%;"> <view class="page__hd" style="position:fixed; top:0;width: 100%;">
<view class="tab-title"> <view class="tab-title">
<view class="{{selected=='@'?'border-tottom':'default'}}" id="@" bindtap="selected">周贡榜</view> <view class="{{selected=='@'?'border-tottom':'default'}}" id="@" bindtap="selected">话题榜</view>
<view class="{{selected=='#'?'border-tottom':'default'}}" id="#" bindtap="selected">粉丝榜</view> <view class="{{selected=='#'?'border-tottom':'default'}}" id="#" bindtap="selected">活跃榜</view>
</view> </view>
<!-- start_of_tab-content --> <!-- start_of_tab-content -->
<scroll-view scroll-y="true" scroll-top="0"> <scroll-view scroll-y="true" scroll-top="0">
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
</scroll-view> </scroll-view>
<!-- end_of_tab-content --> <!-- end_of_tab-content -->
</view> </view>
<!--end key view --> <!--end key view -->
<!--公屏view--> <!--公屏view-->
...@@ -49,7 +48,7 @@ ...@@ -49,7 +48,7 @@
</block> </block>
</view> </view>
<view class="live-right"> <view class="live-right">
<view class="live-row"><image src="{{redUrl}}"></image> {{onlineCount}}在线</view> <view class="live-row"><image src="{{redUrl}}"></image> {{onlineCount}} 点人气</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -45,23 +45,23 @@ ...@@ -45,23 +45,23 @@
<view class="items"> <view class="items">
<navigator url="/pages/activity/activity-list/activity-list?city={{city}}"> <navigator url="/pages/activity/activity-list/activity-list?city={{city}}">
<image src="../../icon/member/schedule.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image> <image src="../../icon/member/schedule.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image>
<text style="font-size:28rpx;">排名: 1st</text> <text style="font-size:28rpx;">人气: 100</text>
</navigator> </navigator>
</view> </view>
</block> </block>
<view class="items">
<navigator url="/pages/my/my-collects/my-collects">
<image src="../../icon/my/fav.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image>
<text style="font-size:28rpx;">关注: 12.5k</text>
</navigator>
</view>
<!-- todo 0828 我的活动暂时也不实现 --> <!-- todo 0828 我的活动暂时也不实现 -->
<view class="items"> <view class="items">
<navigator url="/pages/my/my-orders/my-orders"> <navigator url="/pages/my/my-orders/my-orders">
<image src="../../icon/activity/order.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image> <image src="../../icon/activity/order.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image>
<text style="font-size:28rpx;">留言: 1302</text> <text style="font-size:28rpx;">热度: 1.2k</text>
</navigator>
</view>
<view class="items">
<navigator url="/pages/my/my-collects/my-collects">
<image src="../../icon/my/fav.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image>
<text style="font-size:28rpx;">关注: 12.5k</text>
</navigator> </navigator>
</view> </view>
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<!-- 商品价格 --> <!-- 商品价格 -->
<span> <span>
<view class="price-row"> <view class="price-row">
<view class="sub-price">{{item.num_watcher}}人在看</view> <view class="sub-price">{{item.num_watcher}} 点人气</view>
</view> </view>
</span> </span>
</navigator> </navigator>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- start key view --> <!-- start key view -->
<view class="page__hd" style="position:fixed; top:0;width: 100%;"> <view class="page__hd" style="position:fixed; top:0;width: 100%;">
<view class="tab-title"> <view class="tab-title">
<view class="{{selected=='@'?'border-tottom':'default'}}" id="@" bindtap="selected">热度商家榜</view> <view class="{{selected=='@'?'border-tottom':'default'}}" id="@" bindtap="selected">热度话题榜</view>
<view class="{{selected=='#'?'border-tottom':'default'}}" id="#" bindtap="selected">活跃聊天室</view> <view class="{{selected=='#'?'border-tottom':'default'}}" id="#" bindtap="selected">活跃聊天室</view>
</view> </view>
<!-- start_of_tab-content --> <!-- start_of_tab-content -->
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
"userConfirmedUseCompilerModuleSwitch": false "userConfirmedUseCompilerModuleSwitch": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.9.4", "libVersion": "2.14.1",
"appid": "wx72555e77d9e5cee2", "appid": "wx72555e77d9e5cee2",
"projectname": "nyx-master", "projectname": "nyx-master",
"isGameTourist": false, "isGameTourist": false,
......
//应写入腾讯地图的key,并改文件名为config.js
//Agora语音接口的key
const APPID = "28282830a1dd432caeeacdb633984a10";
if(APPID === ""){
wx.showToast({
title: `请在config.js中提供正确的appid`,
icon: 'none',
duration: 5000
});
}
//腾讯地图接口的key
module.exports = { module.exports = {
APPID: APPID,
key: "xxxxxxxxxxx", key: "xxxxxxxxxxx",
} }
\ No newline at end of file
class Layouter {
constructor(containerWidth, containerHeight) {
this.containerWidth = containerWidth;
this.containerHeight = containerHeight;
}
getSize(totalUser) {
let sizes = [];
let videoContainerHeight = this.containerHeight;
let videoContainerWidth = this.containerWidth;
switch (totalUser) {
case 0:
return [];
case 1:
return [{
x: 0,
y: 0,
width: videoContainerWidth,
height: videoContainerHeight
}];
case 2:
let y = (videoContainerHeight - videoContainerWidth / 2 * (4 / 3)) / 2;
let height = videoContainerWidth / 2 * (4 / 3);
return [{
x: 0,
y: y,
width: videoContainerWidth / 2,
height: height
},
{
x: videoContainerWidth / 2,
y: y,
width: videoContainerWidth / 2,
height: height
}
];
case 3:
return [{
x: 0,
y: 0,
width: videoContainerWidth,
height: videoContainerHeight - videoContainerWidth / 2
}, {
x: 0,
y: videoContainerHeight - videoContainerWidth / 2,
width: videoContainerWidth / 2,
height: videoContainerWidth / 2
}, {
x: videoContainerWidth / 2,
y: videoContainerHeight - videoContainerWidth / 2,
width: videoContainerWidth / 2,
height: videoContainerWidth / 2
}];
case 4:
return [{
x: 0,
y: 0,
width: videoContainerWidth / 2,
height: videoContainerHeight / 2
}, {
x: videoContainerWidth / 2,
y: 0,
width: videoContainerWidth / 2,
height: videoContainerHeight / 2
}, {
x: 0,
y: videoContainerHeight / 2,
width: videoContainerWidth / 2,
height: videoContainerHeight / 2
}, {
x: videoContainerWidth / 2,
y: videoContainerHeight / 2,
width: videoContainerWidth / 2,
height: videoContainerHeight / 2
}];
case 5:
return [{
x: 0,
y: 0,
width: videoContainerWidth / 2,
height: videoContainerHeight * 3 / 5
}, {
x: videoContainerWidth / 2,
y: 0,
width: videoContainerWidth / 2,
height: videoContainerHeight * 3 / 5
}, {
x: 0,
y: videoContainerHeight * 3 / 5,
width: videoContainerWidth / 3,
height: videoContainerHeight * 2 / 5
}, {
x: videoContainerWidth / 3,
y: videoContainerHeight * 3 / 5,
width: videoContainerWidth / 3,
height: videoContainerHeight * 2 / 5
}, {
x: videoContainerWidth * 2 / 3,
y: videoContainerHeight * 3 / 5,
width: videoContainerWidth / 3,
height: videoContainerHeight * 2 / 5
}];
case 6:
return [{
x: 0,
y: 0,
width: videoContainerWidth * 2 / 3,
height: videoContainerHeight * 3 / 5
},
{
x: videoContainerWidth * 2 / 3,
y: 0,
width: videoContainerWidth * 1 / 3,
height: videoContainerHeight * 3 / 5 / 2
},
{
x: videoContainerWidth * 2 / 3,
y: videoContainerHeight * 3 / 5 / 2,
width: videoContainerWidth * 1 / 3,
height: videoContainerHeight * 3 / 5 / 2
}, {
x: 0,
y: videoContainerHeight * 3 / 5,
width: videoContainerWidth / 3,
height: videoContainerHeight * 2 / 5
}, {
x: videoContainerWidth / 3,
y: videoContainerHeight * 3 / 5,
width: videoContainerWidth / 3,
height: videoContainerHeight * 2 / 5
}, {
x: videoContainerWidth * 2 / 3,
y: videoContainerHeight * 3 / 5,
width: videoContainerWidth / 3,
height: videoContainerHeight * 2 / 5
}
];
case 7:
return [
{
x: 0,
y: 0,
width: videoContainerWidth / 2,
height: videoContainerHeight / 3
},
{
x: videoContainerWidth / 2,
y: 0,
width: videoContainerWidth / 2,
height: videoContainerHeight / 3
},
{
x: 0,
y: videoContainerHeight / 3,
width: videoContainerWidth / 2,
height: videoContainerHeight / 3
},
{
x: videoContainerWidth / 2,
y: videoContainerHeight / 3,
width: videoContainerWidth / 2,
height: videoContainerHeight / 3
}, {
x: 0,
y: videoContainerHeight * 2 / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
}, {
x: videoContainerWidth / 3,
y: videoContainerHeight * 2 / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
}, {
x: videoContainerWidth * 2 / 3,
y: videoContainerHeight * 2 / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
}
];
case 8:
return [
{
x: 0,
y: 0,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: videoContainerWidth / 3,
y: 0,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: 2 * videoContainerWidth / 3,
y: 0,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: 0,
y: videoContainerHeight / 3,
width: videoContainerWidth / 2,
height: videoContainerHeight / 3
},
{
x: videoContainerWidth / 2,
y: videoContainerHeight / 3,
width: videoContainerWidth / 2,
height: videoContainerHeight / 3
}, {
x: 0,
y: videoContainerHeight * 2 / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
}, {
x: videoContainerWidth / 3,
y: videoContainerHeight * 2 / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
}, {
x: videoContainerWidth * 2 / 3,
y: videoContainerHeight * 2 / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
}
];
case 9:
return [
{
x: 0,
y: 0,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: videoContainerWidth / 3,
y: 0,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: 2 * videoContainerWidth / 3,
y: 0,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: 0,
y: videoContainerHeight / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: videoContainerWidth / 3,
y: videoContainerHeight / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: 2 * videoContainerWidth / 3,
y: videoContainerHeight / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: 0,
y: videoContainerHeight * 2 / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
}, {
x: videoContainerWidth / 3,
y: videoContainerHeight * 2 / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
}, {
x: videoContainerWidth * 2 / 3,
y: videoContainerHeight * 2 / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
}
];
case 10:
return [
{
x: 0,
y: 0,
width: videoContainerWidth / 3,
height: videoContainerHeight / 6
},
{
x: 0,
y: videoContainerHeight / 6,
width: videoContainerWidth / 3,
height: videoContainerHeight / 6
},
{
x: videoContainerWidth / 3,
y: 0,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: 2 * videoContainerWidth / 3,
y: 0,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: 0,
y: videoContainerHeight / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: videoContainerWidth / 3,
y: videoContainerHeight / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: 2 * videoContainerWidth / 3,
y: videoContainerHeight / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
},
{
x: 0,
y: videoContainerHeight * 2 / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
}, {
x: videoContainerWidth / 3,
y: videoContainerHeight * 2 / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
}, {
x: videoContainerWidth * 2 / 3,
y: videoContainerHeight * 2 / 3,
width: videoContainerWidth / 3,
height: videoContainerHeight / 3
}
];
}
}
}
module.exports = Layouter;
\ No newline at end of file
let logitems = [];
let dbgRtmp = false;
let systemInfoChecked = false;
let uid = `${parseInt(Math.random() * 1000000)}`;
let timer;
const debounce = function(fn, delay) {
return function () {
let context = this
let args = arguments
clearTimeout(timer)
timer = setTimeout(function () {
fn.apply(context, args)
}, delay)
}
}
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
const millisecond = date.getMilliseconds();
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second, millisecond].map(formatNumber).join(':')
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
const requestPermission = (scope, cb) => {
wx.getSetting({
success(res) {
if (res.authSetting[scope]) {
cb && cb();
} else {
wx.authorize({
scope: scope,
success() {
cb && cb();
}
})
}
}
})
}
const log = (msg, level) => {
let time = formatTime(new Date());
logitems.push(`${time}: ${msg}`);
if (level === "error") {
console.error(`${time}: ${msg}`);
} else {
console.log(`${time}: ${msg}`);
}
}
const getUid = () => {
return uid;
}
const mashupUrl = (url, channel) => {
return url;
}
const checkSystemInfo = (app) => {
if (!systemInfoChecked) {
systemInfoChecked = true;
wx.getSystemInfo({
success: function (res) {
log(`${JSON.stringify(res)}`);
let sdkVersion = res.SDKVersion;
let version_items = sdkVersion.split(".");
let major_version = parseInt(version_items[0]);
let minor_version = parseInt(version_items[1]);
app.globalData.systemInfo = res;
if (major_version <= 1 && minor_version < 7) {
wx.showModal({
title: '版本过低',
content: '微信版本过低,部分功能可能无法工作',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}
}
})
}
}
module.exports = {
getUid: getUid,
checkSystemInfo: checkSystemInfo,
formatTime: formatTime,
requestPermission: requestPermission,
log: log,
clearLogs: function () {logitems = []},
getLogs: function () { return logitems },
mashupUrl: mashupUrl,
debounce: debounce
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论