更新排名计算方式
This commit is contained in:
parent
80190b6693
commit
ad1e964359
2
app.js
2
app.js
|
@ -123,7 +123,7 @@ App({
|
|||
perms:[],
|
||||
openid:null
|
||||
},
|
||||
serverUrl: 'http://cbma.ctc-gz.com/',
|
||||
serverUrl: 'https://cbma.ctc-gz.com/',
|
||||
//serverUrl: 'http://127.0.0.1:8000/',
|
||||
//serverUrl: 'http://10.21.28.148:8000/',
|
||||
//serverUrl: 'http://192.168.0.103:8000/',
|
||||
|
|
3
app.json
3
app.json
|
@ -95,7 +95,8 @@
|
|||
"pages/user/chose",
|
||||
"pages/safelist/index",
|
||||
"pages/safefeedback/index",
|
||||
"pages/safefeedback/add"
|
||||
"pages/safefeedback/add",
|
||||
"pages/totalrate/index2"
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
|
|
|
@ -245,7 +245,7 @@ Page({
|
|||
showPw(){
|
||||
wx.showModal({
|
||||
title: '',
|
||||
content: '默认密码是0000,如果您修改过或者账号错误,请联系贵公司管理员(一般是安全管理部门),请及时登陆pc端修改密码!',
|
||||
content: '默认密码是0000,如果您修改过或者账号错误,请联系管理员协助处理',
|
||||
showCancel:false,
|
||||
confirmText:'知道了',
|
||||
success (res) {
|
||||
|
@ -253,7 +253,7 @@ Page({
|
|||
})
|
||||
},
|
||||
intro:function(){
|
||||
let fileurl = getApp().globalData.serverUrl + 'media/安全生产管理系统-国检集团.docx'
|
||||
let fileurl = getApp().globalData.serverUrl + 'media/default/通知.pdf'
|
||||
wx.showLoading({
|
||||
title: '下载中...',
|
||||
})
|
||||
|
@ -267,6 +267,9 @@ Page({
|
|||
if (fileurl.indexOf(".docx") != -1) {
|
||||
filetype = 'docx'
|
||||
}
|
||||
if (fileurl.indexOf(".pdf") != -1) {
|
||||
filetype = 'pdf'
|
||||
}
|
||||
wx.openDocument({
|
||||
filePath,
|
||||
fileType: filetype,
|
||||
|
|
|
@ -34,6 +34,6 @@
|
|||
<!-- <view class="weui-footer__links">
|
||||
<navigator url="" class="weui-footer__link">WeUI首页</navigator>
|
||||
</view> -->
|
||||
<view class="weui-footer__text" bindtap="intro">点击下载系统/小程序文档介绍</view>
|
||||
<view class="weui-footer__text" bindtap="intro">点击下载活动通知</view>
|
||||
<view class="weui-footer__text">Copyright © 2018-2021 中存大数据</view>
|
||||
</view>
|
|
@ -12,7 +12,7 @@
|
|||
<view class="weui-media-box__desc">最近编辑时间:{{modifytime}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-article">
|
||||
<view class="weui-article" wx:if="{{description}}">
|
||||
<view class="weui-article__section">
|
||||
<span> </span>
|
||||
{{desciption}}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<view class="head">共{{total}}条资料</view>
|
||||
<view class='search'>
|
||||
<input type='text' placeholder='输入你想要的内容' confirm-type='search' value="{{inputValue}}" bindinput='inputBind' bindconfirm='query' style="flex: 1;"></input>
|
||||
<input type='text' placeholder='输入关键字查询' confirm-type='search' value="{{inputValue}}" bindinput='inputBind' bindconfirm='query' style="flex: 1;"></input>
|
||||
<view style="padding:2rpx">
|
||||
<button type="primary" bindtap="query" >查询</button>
|
||||
</view>
|
||||
|
@ -34,12 +34,13 @@
|
|||
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
|
||||
<view class="weui-media-box__title">{{item.title}}</view>
|
||||
<view class="weui-media-box__desc">{{item.user__ubelongpart__partname}} {{item.user__name}}分享</view>
|
||||
<view class="weui-media-box__desc">类别:{{item.cate__name}}</view>
|
||||
<view class="weui-media-box__desc">{{item.title}}</view>
|
||||
<!-- <view class="weui-media-box__desc">类别:{{item.cate__name}}</view> -->
|
||||
</view>
|
||||
<view class="weui-panel__ft weui-cell__ft_in-access">
|
||||
<view class="weui-media-box__title">
|
||||
<span wx:if="{{item.type==1}}">播放量</span>
|
||||
<span wx:else>下载量</span>
|
||||
<span wx:if="{{item.type==1}}">播放</span>
|
||||
<span wx:else>下载</span>
|
||||
<span style="color:green;font-weight:bold"> {{item.downnum}}</span>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -105,6 +105,6 @@
|
|||
<!-- <view class="weui-footer__links">
|
||||
<navigator url="" class="weui-footer__link">WeUI首页</navigator>
|
||||
</view> -->
|
||||
<view class="weui-footer__text" bindtap="intro">点击下载系统/小程序文档介绍</view>
|
||||
<view class="weui-footer__text">Copyright © 2018-2020 国检集团</view>
|
||||
<!-- <view class="weui-footer__text" bindtap="intro">点击下载系统/小程序文档介绍</view>
|
||||
<view class="weui-footer__text">Copyright © 2018-2021 国检集团</view> -->
|
||||
</view>
|
|
@ -17,9 +17,9 @@
|
|||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
<view style="margin-top:4px;margin-bottom:4px;text-align:right;margin-right:4px">
|
||||
<!-- <view style="margin-top:4px;margin-bottom:4px;text-align:right;margin-right:4px">
|
||||
<switch bindchange="open">打开全部功能</switch>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="weui-cells__title" wx:if="{{!showAll}}">数据采集</view> -->
|
||||
<view class="weui-grids" wx:if="{{showAll}}">
|
||||
<navigator url="/pages/checkjob/index" class="weui-grid" hover-class="weui-grid_active">
|
||||
|
@ -118,9 +118,9 @@
|
|||
<view class="weui-grid__label">在线考试</view>
|
||||
<view class="weui-badge" style="position: absolute;top: 1em;right: 1em;" wx:if="{{dknum!=0}}">{{dknum}}</view>
|
||||
</view>
|
||||
<navigator class="weui-grid" hover-class="weui-grid_active" url="../totalrate/index">
|
||||
<navigator class="weui-grid" hover-class="weui-grid_active" url="../totalrate/index2">
|
||||
<image class="weui-grid__icon" src="../images/rate.png" />
|
||||
<view class="weui-grid__label">实时总排名</view>
|
||||
<view class="weui-grid__label">实时排名</view>
|
||||
</navigator>
|
||||
<navigator url="/pages/train/train" class="weui-grid" hover-class="weui-grid_active">
|
||||
<image class="weui-grid__icon" src="../images/train.png" />
|
||||
|
|
|
@ -0,0 +1,170 @@
|
|||
// pages/examtest/rate.js
|
||||
var util = require('../../utils/util.js')
|
||||
var sliderWidth = 96;
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
page: 1,
|
||||
serverUrl: getApp().globalData.serverUrl,
|
||||
ratelist: [],
|
||||
inputValue:'',
|
||||
tabs: ["个人排名", "机构排名"],
|
||||
activeIndex: 0,
|
||||
sliderOffset: 0,
|
||||
sliderLeft: 0
|
||||
},
|
||||
tabClick: function (e) {
|
||||
var that = this
|
||||
that.setData({
|
||||
sliderOffset: e.currentTarget.offsetLeft,
|
||||
activeIndex: e.currentTarget.id
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function () {
|
||||
var that =this
|
||||
wx.getSystemInfo({
|
||||
success: function (res) {
|
||||
that.setData({
|
||||
sliderLeft: (res.windowWidth / that.data.tabs.length - sliderWidth) / 2,
|
||||
sliderOffset: res.windowWidth / that.data.tabs.length * that.data.activeIndex
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
var that = this;
|
||||
that.getRatelist(that.data.page)
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
var that = this;
|
||||
if (that.data.activeIndex == 0) {
|
||||
that.getRatelist(1);
|
||||
wx.stopPullDownRefresh();
|
||||
this.data.page = 1;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
//上拉分页,将页码加1,然后调用分页函数
|
||||
var that = this
|
||||
if (that.data.activeIndex == 0) {
|
||||
this.data.page = this.data.page + 1;
|
||||
this.getRatelist();
|
||||
wx.stopPullDownRefresh();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
},
|
||||
getRatelist: function (page) {
|
||||
var that = this;
|
||||
if (page != 1) { page = that.data.page }
|
||||
wx.showLoading({
|
||||
title: '加载中',
|
||||
}),
|
||||
wx.request({
|
||||
url: this.data.serverUrl + 'api/examtestdetail?a=totalrate&rows=20&page=' + page + '&companyid=' + getApp().globalData.userInfo.companyid + '&search=' + that.data.inputValue,
|
||||
header: {
|
||||
'content-type': 'application/json', // 默认值
|
||||
'Cookie': getApp().globalData.sessionId,
|
||||
},
|
||||
success: res => {
|
||||
if (res.statusCode === 200) {
|
||||
console.log(res.data)
|
||||
if (res.data.rows.length == 0) {
|
||||
if (page == 1) {
|
||||
this.setData({
|
||||
total: res.data.total,
|
||||
ratelist: []
|
||||
})
|
||||
}
|
||||
else {
|
||||
wx.showModal({
|
||||
content: "已经到底啦!",
|
||||
showCancel: false,
|
||||
confirmText: "确定",
|
||||
})
|
||||
}
|
||||
} else {
|
||||
let list
|
||||
if (page == 1) {
|
||||
list = res.data.rows
|
||||
} else {
|
||||
list = this.data.ratelist.concat(res.data.rows)
|
||||
}
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
list[i].totaltookformat = util.formatSeconds(list[i].totaltook)
|
||||
}
|
||||
this.setData({
|
||||
total: res.data.total,
|
||||
ratelist: list,
|
||||
updatetime:res.data.updatetime
|
||||
})
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
orglist:res.data.rows2
|
||||
})
|
||||
wx.hideLoading();
|
||||
}
|
||||
});
|
||||
},
|
||||
//搜索框文本内容显示
|
||||
inputBind: function (event) {
|
||||
this.setData({
|
||||
inputValue: event.detail.value
|
||||
})
|
||||
},
|
||||
query: function () {
|
||||
this.page = 1
|
||||
this.getRatelist(this.page)
|
||||
},
|
||||
reset: function () {
|
||||
this.page = 1
|
||||
this.inputValue = ''
|
||||
this.getRatelist(this.page)
|
||||
}
|
||||
})
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "活动总排名",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
<view class="page">
|
||||
<view class="head">
|
||||
<view style="font-weight:bold;font-size:22px">活动总排名</view>
|
||||
<view>已有
|
||||
<span style="font-weight:bold;color:orange">{{total}}</span>
|
||||
人参与 更新时间:{{updatetime}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-tab">
|
||||
<view class="weui-navbar">
|
||||
<block wx:for="{{tabs}}" wx:key="*this">
|
||||
<view id="{{index}}" class="weui-navbar__item {{activeIndex == index ? 'weui-bar__item_on' : ''}}" bindtap="tabClick">
|
||||
<view class="weui-navbar__title">{{item}}</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="weui-navbar__slider" style="left: {{sliderLeft}}px; transform: translateX({{sliderOffset}}px); -webkit-transform: translateX({{sliderOffset}}px);"></view>
|
||||
</view>
|
||||
<view class="weui-tab__panel">
|
||||
<view class="weui-tab__content" hidden="{{activeIndex != 0}}">
|
||||
<view class='search'>
|
||||
<input type='text' placeholder='输入姓名/部门查询' confirm-type='search' value="{{inputValue}}" bindinput='inputBind' bindconfirm='query' style="flex: 1;"></input>
|
||||
<view style="padding:2rpx">
|
||||
<button type="primary" bindtap="query">查询</button>
|
||||
</view>
|
||||
<view style="padding:2rpx">
|
||||
<button type="primary" bindtap="reset">重置</button>
|
||||
</view>
|
||||
</view>
|
||||
<block wx:for="{{ratelist}}" wx:key="unique">
|
||||
<view class="weui-panel__bd">
|
||||
<view class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
|
||||
<view class="weui-media-box__hd weui-media-box__hd_in-appmsg" style="width:30px;" wx:if="{{item.rate==1||item.rate==2||item.rate==3}}">
|
||||
<image class="weui-media-box__thumb" src="../images/guanjun.svg" wx:if="{{item.rate==1}}"></image>
|
||||
<image class="weui-media-box__thumb" src="../images/yajun.svg" wx:if="{{item.rate==2}}"></image>
|
||||
<image class="weui-media-box__thumb" src="../images/jijun.svg" wx:if="{{item.rate==3}}"></image>
|
||||
|
||||
</view>
|
||||
<span class="index" style="width:auto" wx:else>{{item.rate}}</span>
|
||||
<view class="weui-media-box__hd weui-media-box__hd_in-appmsg">
|
||||
<!-- <image class="weui-media-box__thumb" src="{{userInfo.avatarUrl}}" /> -->
|
||||
<image class="weui-media-box__thumb" src="{{item.user__headimgurl}}"></image>
|
||||
</view>
|
||||
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
|
||||
<view class="weui-media-box__title">{{item.user__name}}
|
||||
</view>
|
||||
<view class="weui-media-box__desc">部门: {{item.user__ubelongpart__partname}}
|
||||
</view>
|
||||
<view class="weui-media-box__desc">已参加
|
||||
<span style="font-weight:bold;color:darkblue">{{item.testnum}}</span>
|
||||
场答题
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-panel__ft">
|
||||
|
||||
<view class="weui-media-box__title" style="background-color:orange;color:white;font-weight:bold">最高{{item.maxscore}}分</view>
|
||||
|
||||
<view class="weui-media-box__desc" style="background-color:green;color:white">总{{item.totalscore}}分</view>
|
||||
<view class="weui-media-box__desc" style="background-color:green;color:white">场均{{item.avgscore}}分</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="weui-tab__content" hidden="{{activeIndex != 1}}">
|
||||
<block wx:for="{{orglist}}" wx:key="unique">
|
||||
<view class="weui-panel__bd">
|
||||
<view class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
|
||||
<span class="index">{{index+1}}</span>
|
||||
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
|
||||
<view class="weui-media-box__title">{{item.user__ubelongpart__partname}}
|
||||
</view>
|
||||
<view class="weui-media-box__desc">共
|
||||
<span style="font-weight:bold;color:darkblue">{{item.totaluser}}</span>
|
||||
名成员
|
||||
参加了
|
||||
<span style="font-weight:bold;color:darkblue">{{item.totaltest}}</span>
|
||||
场答题
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-panel__ft">
|
||||
|
||||
<view class="weui-media-box__title" style="background-color:orange;color:white;font-weight:bold">场均:{{item.avgscore}}分</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
|
@ -0,0 +1,34 @@
|
|||
.head{
|
||||
color:#fff;
|
||||
background-color: cornflowerblue;
|
||||
text-align: center;
|
||||
height:60px;
|
||||
width:100%
|
||||
}
|
||||
.search
|
||||
{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
width:100%;
|
||||
height:auto;
|
||||
background-color:white;
|
||||
border:2rpx solid goldenrod;
|
||||
border-radius: 5rpx;
|
||||
|
||||
}
|
||||
|
||||
/* 搜索框提示文字样式 */
|
||||
.search input
|
||||
{
|
||||
padding-left:30rpx;
|
||||
}
|
||||
.index{
|
||||
color:#fff;
|
||||
background-color: darkslateblue;
|
||||
border-radius: 6px;
|
||||
width:30px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center
|
||||
}
|
Loading…
Reference in New Issue