fix:身份验证修改,阈值查看添加权限控制

This commit is contained in:
shijing 2024-08-27 10:59:59 +08:00
parent f6d4a707a4
commit 3d07e2748f
27 changed files with 387 additions and 218 deletions

View File

@ -32,4 +32,16 @@ button[type='primary'] {
}
button[disabled][type='primary'] {
background-color: #fafafa!important;
}
/* .weui-cells_radio .weui-check[aria-checked=true]+.weui-icon-checked {
color: #438af4!important;
} */
.weui-cells_radio .weui-check[aria-checked=false]+.weui-icon-checked {
color: #ffffff!important;
}
/* .weui-cells_radio .weui-check[aria-checked=true]+.weui-icon-checked{color:#438af4!important;-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E)!important;mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E)!important} */
.weui-cells_checkbox .weui-check[aria-checked=true]+.weui-icon-checked{color:#438af4!important;mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000000%22%20strokeWidth%3D%2220%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%3E%3C%2Fcircle%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%3E%3C%2Fcircle%3E%3C%2Fsvg%3E)!important;-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000000%22%20strokeWidth%3D%2220%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%3E%3C%2Fcircle%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%3E%3C%2Fcircle%3E%3C%2Fsvg%3E)!important;
}
.weui-cells_radio .weui-check[aria-checked=true]+.weui-icon-checked{
color:#438af4!important;mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000000%22%20strokeWidth%3D%2220%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%3E%3C%2Fcircle%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%3E%3C%2Fcircle%3E%3C%2Fsvg%3E)!important;-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23000000%22%20strokeWidth%3D%2220%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%3E%3C%2Fcircle%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%3E%3C%2Fcircle%3E%3C%2Fsvg%3E)!important;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 56 KiB

BIN
images/shoucang.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

1
images/xuanzhong.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="24" cy="24" r="20" fill="#333" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><circle cx="24" cy="24" r="12" stroke="#FFF" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>

After

Width:  |  Height:  |  Size: 371 B

View File

@ -111,6 +111,9 @@ Page({
// 发送 res.code 到后台换取 openId, sessionKey, unionId
api.requesta('/rbac/user/mplogin/','POST', {code:res.code}).then(res=>{
getApp().globalData.admintoken = res.data.token;
wx.setStorageSync('token', res.data.token)
wx.setStorageSync('session_key', res.data.session_key)
wx.setStorageSync('userinfo', res.data.userinfo)
api.requesta('/rbac/user/info/', 'GET').then(res=>{
wx.hideLoading()
getApp().globalData.admininfo = res.data

View File

@ -3,10 +3,11 @@
<view class="page__bd">
<view class="weui-article">
<view class="weui-article__h1">{{title}}</view>
<view class="weui-article__h3">
<text style="color:red" wx:if="{{is_top}}">置顶 </text>
<span class="page__desc">{{ifrom}}</span>
</view>
<view class="page__desc">
<text style="color:red;margin-right: 10rpx;" wx:if="{{is_top}}">置顶</text>
<span>{{ifrom}}</span>
<span style="margin-left: auto;">{{update_time}}</span>
</view>
<view class="weui-article__p">
<mp-html content="{{content}}" domain="{{domain}}"/>
</view>

View File

@ -2,6 +2,22 @@
.page__title {
font-size: 18px;
}
.page {
background-color: var(--weui-BG-2);
.weui-article{
padding: 0!important;
}
.weui-article__h1{
padding: 24rpx 24rpx 0rpx 24rpx;
margin-bottom: 0;
background-color: #ffffff;
}
.page__desc{
margin-top: 0;
padding: 10rpx 24rpx 15rpx 24rpx;
background-color: #ffffff;
margin-bottom: 20rpx;
display: flex;
}
.weui-article__p{
padding: 24rpx;
background-color: #ffffff;
}

View File

@ -1,18 +1,17 @@
<view class="page">
<view class="head">{{count}}条资讯</view>
<view class="weui-cells weui-cells_after-title" style="margin-top:0px;padding: 20rpx;background:none;">
<view class="weui-cells weui-cells_after-title" style="margin-top:0px;background:none;">
<block wx:for="{{results}}" wx:key="unique">
<navigator url="detail?id={{item.id}}" style="margin-bottom: 20rpx;box-shadow: 0 0 13rpx 8rpx #f7f7f7;background: #ffffff;" hover-class="weui-cell_active">
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg" style="padding: 20rpx;border: 1rpx solid #f7f7f7;border-radius: 10rpx;">
<view class="weui-media-box__title">
<text wx:if="{{item.is_top}}" style="color:red;font-size: 24rpx;border: 1rpx solid red;border-radius: 6rpx;display: inline-block;padding: 2rpx 10rpx;">置顶 </text>
{{item.title}}
</view>
<view class="weui-media-box__desc" >
<!-- <text wx:if="{{item.is_top}}" style="color:red">置顶 </text> -->
<view style="text-indent: 1em;">发布人:{{item.ifrom}}</view>
<view style="text-indent: 1em;">发布时间:{{item.update_time}}</view>
<view class="weui-media-box__desc" style="display: flex;">
<text wx:if="{{item.is_top}}" style="color:red;margin-right: 10rpx;">置顶 </text>
<view>{{item.update_time}}</view>
<view style="margin-left: auto;">{{item.ifrom}}</view>
</view>
</view>
</navigator>

View File

@ -1,7 +1,9 @@
/* pages/candidate/index.wxss */
.searWrap{
display: flex;
margin-top: 30rpx;
/* margin-top: 30rpx; */
padding: 20rpx 0;
background: #ffffff;
}
.searchBtn{
/* flex: 2; */
@ -26,7 +28,9 @@
}
.listWrap{
padding: 20rpx;
margin-top: 20rpx;
box-sizing: border-box;
background: #ffffff;
}
.listTitle{
height: 70rpx;

View File

@ -9,7 +9,7 @@ Page({
answerP:false,
tmtotal:0,
moShi:'看题模式',
isTest:true,
isTest:false,
domain:getApp().globalData.mediahost,
},
radioChange: function (e) {
@ -111,13 +111,14 @@ Page({
that.setData({
isTest:false,
})
that.showOptions()
}else{
that.setData({
isTest:true,
answerP:false
})
}
debugger;
that.showOptions()
},
next: function () {
var that = this
@ -137,8 +138,6 @@ Page({
},
showOptions: function () {
let currentTm = this.data.currentTm;
// debugger;
console.log(currentTm)
let options = []
for (let key in currentTm.options) {
let option = {}
@ -148,15 +147,16 @@ Page({
}else{
option.right = false;
}
option.checked = false;
option.value = '<p>' + currentTm.options[key].toString() + '</p>'
if (currentTm.user_answer && this.data.moShi == '看题模式') {
if (!this.data.isTest) {
if (key == currentTm.user_answer || currentTm.user_answer.indexOf(key) != -1) {
option.checked = true
}
} else {
option.checked = false
}
console.log(option)
options.push(option)
}
this.setData({

View File

@ -7,6 +7,7 @@
(点击切换)</span>
</view>
</view> -->
<view class="page">
<view class="head">
<view class="typeBtns">
@ -41,7 +42,7 @@
<view style="float:left;width:90%"><mp-html content="{{item.value}}" domain="{{domain}}"/></view>
</view>
</view>
<view class="weui-cell__ft" wx:if="{{isTest}}">
<view class="weui-cell__ft">
<radio class="weui-check" value="{{item.key}}" checked="{{item.checked}}" />
<i class="weui-icon-checked"></i>
</view>
@ -61,7 +62,7 @@
<view style="float:left;width:90%"><mp-html content="{{item.value}}" domain="{{domain}}"/></view>
</view>
</view>
<view class="weui-cell__hd" wx:if="{{isTest}}">
<view class="weui-cell__hd">
<checkbox class="weui-check" value="{{item.key}}" checked="{{item.checked}}"/>
<i class="weui-icon-checked"></i>
</view>
@ -69,9 +70,9 @@
</checkbox-group>
</view>
<view class="weui-article" style="background: #ffffff;margin-top: 10rpx;" wx:if="{{answerP||!isTest}}">
<view class="weui-article__h2" wx:if="{{isright&&isTest}}" style="color:green;font-weight:bold">回答正确!</view>
<view class="weui-article__h2" wx:elif="{{isTest}}" style="color:red;font-weight:bold">回答有误!</view>
<view class="weui-article__h2">正确答案是{{currentTm.right}}<span wx:if="{{isTest}}" >,你的答案是{{currentTm.user_answer}}</span></view>
<view class="weui-article__h2" wx:if="{{isright}}" style="color:green;font-weight:bold">回答正确!</view>
<view class="weui-article__h2" wx:else style="color:red;font-weight:bold">回答有误!</view>
<view class="weui-article__h2">正确答案是{{currentTm.right}}<span>,你的答案是{{currentTm.user_answer}}</span></view>
<view class="weui-article__title" style="font-size: 30rpx;">
<span style="color:#438af4;font-weight: bold;font-size: 34rpx;">解析: </span>
<span wx:if="{{tm_current.question.resolution}}">{{tm_current.question.resolution}}</span>

View File

@ -68,3 +68,10 @@
.checkKey{
width: 70rpx; text-align: center; line-height: 70rpx;height: 70rpx;border-radius: 38rpx;border: 1rpx solid #aaaaaa;
}
/* .weui-cells_radio .weui-check[aria-checked=true]+.weui-icon-checked {
color: #438af4;
}
.weui-cells_radio .weui-check[aria-checked=false]+.weui-icon-checked {
color: #ffffff;
} */

View File

@ -1,8 +1,10 @@
<!--pages/lianxi/index.wxml-->
<view class="page">
<view style="height:10px"></view>
<view class="searchBtn" bindtap="searchItem">搜题</view>
<view style="position: relative;background: #ffffff;padding-bottom: 20rpx;">
<view class="searchBtn" bindtap="searchItem">搜题</view>
<view style="color:#438af4;font-weight:bold;text-align:center">{{workscopeName}}</view>
</view>
<view>
<block wx:for="{{questioncatData}}" wx:key="unique">
<view class="weui-panel weui-panel_access">
<view class="weui-panel__bd">
@ -10,7 +12,6 @@
<view class="weui-media-box__hd" style="width: 80rpx;height: 80rpx;">
<image class="weui-media-box__thumb" src="/images/tiku.png" alt></image>
</view>
<view class="weui-media-box__bd">
<h4 class="weui-media-box__title">{{item.name}}</h4>
<view class="weui-media-box__desc">
@ -28,3 +29,5 @@
</view>
</block>
</view>
</view>

View File

@ -1,13 +1,10 @@
/* pages/lianxi/index.wxss */
.weui-panel {
margin-left:8px;
margin-right:8px;
border-radius: 8px;
/* background: linear-gradient(to right, #fad8be 0%, #fe6673 100%); */
/* background:#00a7d0; */
background: rgba(255, 255, 255, 1);
box-shadow: 0px 4rpx 16rpx 0px rgba(140, 160, 181, 0.2);
/* background: linear-gradient(to right, #3399CC 0%, #0066CC 100%); */
/* box-shadow: 0px 4rpx 16rpx 0px rgba(140, 160, 181, 0.2); */
}
.weui-panel:first-of-type{
margin-top: 0!important;
}
.blueBold{
color:#438af4;

View File

@ -102,8 +102,8 @@
<button type="primary" size="mini" bindtap="showAnswer">答案</button>
</view>
<view style="width:25%">
<image style="width: 60rpx;margin-top: 10rpx;" mode="widthFix" src="/images/shoucang.png" bindtap="shoucang" wx:if="{{tm_current.is_collect}}"></image>
<image style="width:60rpx;margin-top: 10rpx;" mode="widthFix" src="/images/shoucang1.png" bindtap="shoucang" wx:else></image>
<image style="width: 60rpx;" mode="widthFix" src="/images/shoucang.png" bindtap="shoucang" wx:if="{{tm_current.is_collect}}"></image>
<image style="width:60rpx;" mode="widthFix" src="/images/shoucang1.png" bindtap="shoucang" wx:else></image>
</view>
</view>
</view>

View File

@ -1,8 +1,8 @@
<view class="page">
<view class="page__hd" style="padding-bottom: 0;">
<!-- <view class="page__hd" style="padding-bottom: 0;">
<view class="page__title">开启学习之旅</view>
<view class="page__desc">为了更好的为您服务,请注册!</view>
</view>
</view> -->
<!-- <view class="page__bd">
<view class="weui-cells__title">注册</view>
<view class="weui-cells weui-cells_after-title">
@ -28,7 +28,7 @@
</view>
</view>
</view> -->
<image class="logoImg" src="./../../images/loginBg.png" mode="widthFix"></image>
<image class="logoImg" src="./../../images/logoImg.png" mode="widthFix"></image>
<button wx:if="{{if_checked}}" class="weui-btn loginBtn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">手机号登录</button>
<view wx:else class="weui-btn loginBtn" bindtap="clickdenglu">手机号登录</view>
<a class="weui-btn loginBtn loginBtn_visit" bindtap="goMain">浏览进入</a>
@ -36,13 +36,13 @@
<view class="weui-footer weui-footer_fixed-bottom">
<view style="display: flex;justify-content: center;">
<view class="ceheckedIcon" bindtap="checkedChange">
<icon wx:if="{{if_checked}}" class="icon-small" type="success_no_circle" size="16"></icon>
<icon wx:if="{{if_checked}}" class="icon-small" type="success_no_circle" size="16" ></icon>
</view>
我已阅读并同意
<navigator url="/pages/protocol/index">
<navigator class="xieyi" url="/pages/protocol/index">
<view>《用户服务协议》</view>
</navigator>和
<navigator url="/pages/protocol/Privacy">
<navigator class="xieyi" url="/pages/protocol/Privacy">
<view>《隐私政策》</view>
</navigator>
</view>

View File

@ -1,4 +1,7 @@
/**index.wxss**/
page{
background: #1576bd;
}
.userinfo {
display: flex;
flex-direction: column;
@ -26,20 +29,20 @@
line-height: 100rpx;
padding: 0;
font-weight: 500;
background-color: #438af4;
background-color: #f15806;
margin-top: 50rpx;
}
.loginBtn_visit{
background-color: #ffffff;
color: #438af4;
border: 1rpx solid #438af4;
color: #666666;
/* border: 1rpx solid #438af4; */
}
.logoImg{
display: block;
width: 60%;
z-index: -1;
margin: auto;
margin-top: -100rpx;
margin-top: 10vh;
}
.ceheckedIcon{
width:40rpx;
@ -47,4 +50,10 @@
border-radius: 16rpx;
margin-right: 20rpx;
border: 1rpx solid #cccccc;
}
.weui-footer{
color: #ffffff;
}
.xieyi{
color: #f5b5b5!important;
}

View File

@ -57,11 +57,25 @@ Page({
}
},
numberChange(e){
let numb = e.detail.value.replace(/\D/g, '');
this.setData({
['userinfo.ID_number1']: numb,
})
return e.detail.value.replace(/\D/g, '')
let numb = e.detail.value;
this.setData({
['userinfo.ID_number1']: numb,
})
return e.detail.value
// let p = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
// let numb = e.detail.value;
// if(p.test(numb)){
// this.setData({
// ['userinfo.ID_number1']: numb,
// })
// return e.detail.value
// }else{
// wx.showToast({
// icon: 'none',
// title: '请输入正确的身份证号',
// })
// }
},
deptChange(e){
let that = this;
@ -111,22 +125,26 @@ Page({
},
tijiao(){
let userinfo = this.data.userinfo;
if(userinfo.name!==''&&userinfo.name!==null&&userinfo.name!=='未知'){
api.request('/crm/consumer/improve/', 'POST', userinfo).then(res => {
// debugger;
// console.log('信息补全成功'+res)
wx.setStorageSync('userinfo', userinfo);
app.globalData.userinfo = userinfo;
// let usIn = wx.getStorageSync('userinfo');
// console.log(usIn)
wx.switchTab({
url: '/pages/main/main',
let p = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if(p.test(userinfo.ID_number1)){
if(userinfo.name!==''&&userinfo.name!==null&&userinfo.name!=='未知'){
api.request('/crm/consumer/improve/', 'POST', userinfo).then(res => {
wx.setStorageSync('userinfo', userinfo);
app.globalData.userinfo = userinfo;
wx.switchTab({
url: '/pages/main/main',
})
})
})
}else{
wx.showToast({
icon: 'none',
title: '请完善信息后提交',
})
}
}else{
wx.showToast({
icon: 'none',
title: '请完善信息后提交',
title: '请输入正确的身份证号',
})
}
},

View File

@ -1,6 +1,9 @@
/* pages/login/logon.wxss *//**index.wxss**/
.page__bd {
margin: 20rpx;
border-radius: 10rpx;
padding-bottom: 40rpx;
background: #ffffff;
}
.loginTypeWrap{
width: 80%;

View File

@ -46,6 +46,11 @@ Page({
userinfo: userinfo,
search: that.search.bind(that)
})
if(userinfo.role_name == '游客'||(userinfo.name!==''&&userinfo.name!==null&&userinfo.name!=='未知'&&userinfo.name!==undefined)){}else{
wx.redirectTo({
url: '/pages/login/registe/registe',
})
}
}else{
// debugger;
app.callBackUserinfo=res=>{
@ -55,10 +60,14 @@ Page({
userinfo: userinfo,
search: that.search.bind(that)
})
if(userinfo.role_name == '游客'||(userinfo.name!==''&&userinfo.name!==null&&userinfo.name!=='未知'&&userinfo.name!==undefined)){}else{
wx.redirectTo({
url: '/pages/login/registe/registe',
})
}
}
}
}
api.request('/examtest/banner/', 'GET').then(res => {
if(res.data.length>0){
let images = []
@ -83,13 +92,6 @@ Page({
// userinfo: userinfo
// })
//获取用户信息判断返回信息是否有name如果有不做处理继续渲染页面如果没有则跳到信息完善页面
// if(userinfo.role_name == '游客'||(userinfo.name!==''&&userinfo.name!==null&&userinfo.name!=='未知'&&userinfo.name!==undefined)){
// }else{
// wx.redirectTo({
// url: '/pages/login/registe/registe',
// })
// }
// Api.getBanners().then(res=>{
// if(res.data.length>0){
// let images = []
@ -120,9 +122,18 @@ Page({
},
//阈值数据库
toThreshold: function () {
wx.navigateTo({
url: '/pages/main/threshold/threshold',
})
let perms = wx.getStorageSync('userinfo').perms;
if(perms.indexOf('threshold_view')>-1){
wx.navigateTo({
url: '/pages/main/threshold/threshold',
})
}else{
wx.showToast({
title: '您暂无查看权限,请联系管理人员',
icon: 'none'
})
}
},
goFile(){
wx.switchTab({
@ -143,9 +154,6 @@ Page({
}
}
})
// wx.navigateTo({
// url: '/pages/article/detail?id=1',
// })
},
//成绩查询
goScore(){
@ -209,7 +217,7 @@ Page({
success(res) {
if (res.confirm) {
wx.navigateTo({
url: '/pages/article/detail?id=6',
url: '/pages/article/detail?id=3',
})
}
}

View File

@ -51,52 +51,42 @@
<view class="topItemText topItemTextBlod">参加考试</view>
</a>
</view>
<!-- <a class="topItem" bindtap="toThreshold">
<image class="topItemImg" src="/images/yewu.png" mode="widthFix"></image>
<view class="topItemText">阈值数据库</view>
</a>
<a class="topItem" bindtap="goScore">
<image class="topItemImg" src="/images/yewu.png" mode="widthFix"></image>
<view class="topItemText">成绩查询</view>
</a> -->
<!-- -->
<view class="listItemsWrap" >
<!-- <view class="listItemsTitle"> 人员考试</view> -->
<view wx:if="{{userinfo && userinfo.name}}">
<a class="topItem" bindtap="goLianxi">
<i class="iconfont icon-tiku" style="font-size: 70rpx;color: #1e89ef;"></i>
<i class="iconfont iconColor icon-tiku" style="font-size: 70rpx;"></i>
<!-- <image class="topItemImg" src="/images/lianxii.png" mode="widthFix"></image> -->
<view class="topItemText">题库练习</view>
</a>
<a class="topItem" bindtap="goYati">
<i class="iconfont icon-kaoshi" style="font-size: 70rpx;color: #1e89ef;position: relative;top: -2rpx;"></i>
<i class="iconfont iconColor icon-kaoshi" style="font-size: 70rpx;position: relative;top: -2rpx;"></i>
<!-- <image class="topItemImg" src="/images/chengjichaxun.png" mode="widthFix"></image> -->
<view class="topItemText">押卷模考</view>
</a>
<a class="topItem" bindtap="goMoni">
<i class="iconfont icon-a-kaoshi2" style="font-size: 72rpx;color: #1e89ef;position: relative;top: 1rpx;"></i>
<i class="iconfont iconColor icon-a-kaoshi2" style="font-size: 72rpx;position: relative;top: 1rpx;"></i>
<!-- <image class="topItemImg" src="/images/yajuankaoshi.png" mode="widthFix"></image> -->
<view class="topItemText">自助模考</view>
</a>
<a class="topItem" bindtap="goCuoti" style="position: relative;">
<i class="iconfont icon-a-zuofei3" style="font-size: 70rpx;color: #1e89ef;"></i>
<i class="iconfont iconColor icon-a-zuofei3" style="font-size: 70rpx;"></i>
<!-- <image class="topItemImg" src="/images/cuotiji2.png" mode="widthFix"></image> -->
<view class="topItemText">错题集</view>
<view class="weui-badge" style="position: absolute;top: 1em;right: 1em;" wx:if="{{wrongnum!=0}}">{{wrongnum}}</view>
</a>
<a class="topItem" bindtap="goShoucang">
<i class="iconfont icon-guanzhu06" style="font-size: 70rpx;color: #1e89ef;"></i>
<i class="iconfont iconColor icon-guanzhu06" style="font-size: 70rpx;"></i>
<!-- <image class="topItemImg" src="/images/shoucang.png" mode="widthFix"></image> -->
<view class="topItemText">收藏集</view>
</a>
<a class="topItem" bindtap="testList">
<i class="iconfont icon-lishijilu-copy" style="font-size: 70rpx;color: #1e89ef;"></i>
<i class="iconfont iconColor icon-lishijilu-copy" style="font-size: 70rpx;"></i>
<!-- <image class="topItemImg" src="/images/kaoshijilu.png" mode="widthFix"></image> -->
<view class="topItemText">考试记录</view>
</a>
<a class="topItem" bindtap="goVideo">
<i class="iconfont icon-shipin" style="font-size: 70rpx;color: #1e89ef;"></i>
<i class="iconfont iconColor icon-shipin" style="font-size: 70rpx;"></i>
<!-- <image class="topItemImg" src="/images/video.png" mode="widthFix"></image> -->
<view class="topItemText fontAli">视频课程</view>
</a>
@ -108,64 +98,16 @@
</navigator>
</view>
</view>
<!-- <a class="topItem" bindtap="goScore">
<image class="topItemImg" src="/images/chengjichaxun.png" mode="widthFix"></image>
<view class="topItemText">成绩查询</view>
</a> -->
<!-- <view class="weui-cells weui-cells_after-title" style="margin-top:0px;padding: 20rpx;">
<view class="examDepTitle">人员考试</view>
<view class="weui-flex">
<a class="weui-flex__item" bindtap="goYati">
<view class="weui-grid__icon">
<image src="/images/yati.svg" alt></image>
</view>
<view class="weui-grid__label">正式考试</view>
</a>
<a class="weui-flex__item" bindtap="goMoni">
<view class="weui-grid__icon">
<image src="/images/moni.svg" alt></image>
</view>
<view class="weui-grid__label">模拟考试</view>
</a>
<a class="weui-flex__item" bindtap="goLianxi">
<view class="weui-grid__icon">
<image src="/images/suiji.svg" alt></image>
</view>
<view class="weui-grid__label">题库练习</view>
</a>
</view>
</view> -->
<!-- <view style="height: 120rpx;margin-top:4rpx;display: flex;">
<navigator url="/pages/exam/index" style="width: 50%;padding: 4rpx;">
<view class="bigCard">
<image src="/images/exam.svg" style="margin-right: 16rpx;width:40rpx; height: 40rpx;"></image>
<view>Ⅲ类自测入口</view></view>
</navigator>
<navigator url="/pages/candidate/my" style="width: 50%;padding: 4rpx;">
<view class="bigCard">
<image src="/images/candidate.svg" style="margin-right: 16rpx;width:40rpx; height: 40rpx;"></image>
<view>Ⅲ类报告单</view></view>
</navigator>
</view> -->
<!-- <view class="weui-cells weui-cells_after-title" style="margin-top:4rpx">
<view bindtap="showDg" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
<view class="weui-cell__hd">
<image src="/images/candidate.svg" style="margin-right: 16px;vertical-align: middle;width:20px; height: 20px;"></image>
</view>
<view class="weui-cell__bd">放射工作/管理人员</view>
<view class="weui-cell__ft weui-cell__ft_in-access" style="color:red">
</view>
</view>
<navigator url="/pages/candidate/index" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
<view class="weui-cell__hd">
<image src="/images/candidate.svg" style="margin-right: 16px;vertical-align: middle;width:20px; height: 20px;"></image>
</view>
<view class="weui-cell__bd">成绩报告单查询</view>
<view class="weui-cell__ft weui-cell__ft_in-access" style="color:red">
</view>
</navigator>
</view> -->
<view class="btnsWrap">
<!-- <navigator url="/pages/main/threshold/threshold">阈值数据库</navigator> -->
<a class="yuzhiBtn" bindtap="toThreshold">
<view class="">气味阈值数据库</view>
</a>
</view>
</view>
<!-- <mp-halfScreenDialog
show="{{dg1}}"
title="放射工作/管理人员"

View File

@ -110,4 +110,23 @@ page{
padding: 20rpx;
font-size: 30rpx;
font-weight: 600;
}
.iconColor{
color: #438af4!important;
}
.btnsWrap{
margin-top: 20rpx;
text-align: center;
height: 100rpx;
line-height: 100rpx;
border-radius: 10rpx;
color: #ffffff;
background-color: #438af4;
}
.yuzhiBtn{
width: 100%;
text-align: center;
height: 100rpx;
line-height: 100rpx;
background-color: greenyellow;
}

View File

@ -1,76 +1,84 @@
// pages/lianxi/index.js
const api = require("../../../utils/request.js");
Page({
/**
* 页面的初始数据
*/
data: {
results: [],
count:1,
query: {
page: 1,
limit: 10
}
limit: 10,
search:'',
compound_cate:''
},
arrayIndex:null,
array: ['醇类', '醛类', '酸类', '酯类', '酮类', '醚类', '酚类', '苯系物', '卤代物', '烷烃类', '烯烃类', '硫化物', '胺类', '其他'],
listData:[],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function () {
// that.getList(that.data.query)
this.getList();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
getList: function () {
var that = this
searchChange(e){
var that = this;
that.setData({
listData:[],
['query.page']:1,
['query.search']:e.detail.value
})
that.getList();
},
searchClear(){
this.setData({
['query.search']:'',
['query.page']:1,
['query.compound_cate']:'',
listData:[],
arrayIndex:null,
})
this.getList();
},
getList () {
var that = this;
console.log(that.data.query)
api.request('/cms/threshold/', 'GET',that.data.query).then(res => {
let list = res.data.results;
let dataList = that.data.listData;
for(let i = 0;i<list.length;i++){
dataList.push(list[i])
}
that.setData({
listData:dataList,
count:res.data.count
})
})
},
bindPickerChange(e) {
console.log('picker发送选择改变携带值为', e.detail.value)
let cate = this.data.array[e.detail.value];
this.setData({
arrayIndex: e.detail.value,
['query.compound_cate']:cate,
['query.page']:1,
listData:[]
})
this.getList();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onReachBottom() {
var that = this;
if (that.data.count > that.data.listData.length) {
that.setData({
['query.page']:that.data.query.page + 1,
})
that.getList()
} else {
wx.showToast({
title: '没有更多了',
icon: 'none'
})
}
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
})

View File

@ -1,6 +1,5 @@
{
"usingComponents": {},
"enablePullDownRefresh": true,
"onReachBottomDistance": 50,
"navigationBarTitleText": "阈值数据"
"navigationBarTitleText": "阈值数据"
}

View File

@ -1 +1,59 @@
<!-- 阈值数据库 -->
<view class="page">
<view class="weui-flex searchWrap">
<picker bindchange="bindPickerChange" value="{{arrayIndex}}" range="{{array}}" class="pickers">
<view class="picker">
<text wx:if="{{arrayIndex==null}}" style="color: #aaaaaa;">化合物分类</text>
{{array[arrayIndex]}}
</view>
</picker>
<input class="weui-input searchInput" type="text" value="{{query.search}}" maxlength="10" bindinput="searchChange" placeholder="输入名称或CAS号查询阈值"/>
<icon class="weui-icon-clear" style="width: 70rpx;height: 70rpx;z-index: 100;" bindtap="searchClear"></icon>
</view>
<view class="lists">
<view wx:if="{{listData.length>0}}">
<block wx:for="{{listData}}" wx:key="unique">
<view class="weui-media-box weui-media-box_appmsg" data-id="{{item.id}}" data-name="{{item.name}}">
<view class="weui-media-box__bd">
<h4 class="weui-media-box__title">
{{item.chinese_name}}
<span class="toptip">{{item.compound_cate}}</span>
</h4>
<view>
<text class="listItemLable">10-6(v/v)</text>
<text wx:if="{{item.ppm_sign!= '='}}">{{item.ppm_sign}}</text> {{item.ppm}}
</view>
<view>
<text class="listItemLable">μg/m3</text>
<text wx:if="{{item.mass_sign!= '='}}">{{item.mass_sign}}</text>{{item.mass}}
</view>
<view><text class="listItemLable">M(g/mol)</text> {{item.molecular}}</view>
<view><text class="listItemLable">CAS号</text>{{item.cas}}</view>
<view wx:if="{{item.odor_type!=null}}">
<text class="listItemLable">气味类型</text>
<span style="color:darkblue" wx:if="{{item.odor_type!=null}}">{{item.odor_type}}</span>
</view>
<view>
<text class="listItemLable">阈值类型</text>{{item.threshold_type}}
</view>
<view>
<text class="listItemLable">毒性信息</text>
<!-- 剧毒0.005681 -->
<text wx:if="{{item.toxicity_type!=null}}">({{item.toxicity_type}})</text>
<text wx:if="{{item.toxicity!=null}}">{{item.toxicity}}</text>
</view>
<view style="font-size: 24rpx;color: #aaaaaa;" wx:if="{{item.source_}}">
<text class="listItemLable">阈值说明</text>
<text>d感知阈值r识别阈值d&r感知阈值和识别阈值相同ng未明确</text>
</view>
<view style="font-size: 24rpx;color: #aaaaaa;" wx:if="{{item.source_}}">
<text class="listItemLable">阈值来源</text>{{item.source_.name}}
<span wx:if="{{item.source_.author!=null}}">——{{item.source_.author}}</span>
<span wx:if="{{item.source_.publish_year!=null}}">——{{item.source_.publish_year}}</span>
</view>
</view>
</view>
</block>
</view>
<view wx:else style="text-align: center;font-size: 30rpx;color: #333333;"> 输入名称或CAS号查询阈值进行搜索</view>
</view>
</view>

View File

@ -0,0 +1,64 @@
.page{
height:100%;
box-sizing: border-box;
}
.searchWrap {
padding: 20rpx;
display: flex;
position: fixed;
top: 0;
width: 100%;
z-index: 100;
box-sizing: border-box;
background: #efefef;
justify-content: space-between;
}
.pickers{
width: 200rpx;
border-radius: 40rpx;
background: #ffffff;
}
.picker{
height: 70rpx;
color: blue;
line-height: 70rpx;
text-align: center;
}
.searchInput{
width: 60%;
height: 70rpx;
line-height: 70rpx;
padding: 10rpx 20rpx;
box-sizing: border-box;
border-radius: 35rpx;
background-color: #ffffff;
}
.searchBtn{
flex-shrink:0;
width: 120rpx;
text-align: center;
height: 70rpx;
line-height: 70rpx;
}
.lists{
/* height: 100%; */
width: 100%;
overflow-y: scroll;
padding-top: 120rpx;
background: #ffffff;
box-sizing: border-box;
padding: 120rpx 20rpx 20rpx 20rpx;
}
.toptip{
color:blue;
border:1rpx solid blue;
font-size:10px;
display: inline-block;
padding: 2rpx 8rpx 1rpx 8rpx;
border-radius: 4rpx;
vertical-align:top;
}
.listItemLable{
width:160rpx;
display: inline-block;
}

View File

@ -36,12 +36,10 @@
<image wx:else class="itemImg" mode="widthFix" src="/images/file.svg"></image>
</view>
<view class="listItemText">
<view class="weui-media-box__title">{{item.name}}</view>
<view class="weui-media-box__title" style="font-size: 32rpx;">{{item.name}}</view>
<view class="weui-media-box__desc" style="display: flex;">
<text wx:if="{{item.description!==null}}">{{item.description}}</text>
<view>
下载量:<text style="color:darkblue;font-weight:bold">{{item.down_count}}</text>
</view>
<text style="color:darkblue;font-weight:bold;margin-left: auto;">{{item.down_count}}</text>
</view>
</view>
<!-- <a class="downloadBtn" bindtap="downFile" data-id="{{item.id}}" data-index="{{index}}">下载</a> -->
@ -54,9 +52,9 @@
<view class="infoView" style="text-align: center;">
<!-- <view style="text-align: center;">《{{infoItem.name}}》</view> -->
<view class="infoItem" wx:if="{{infoItem.name!==null}}">《{{infoItem.name}}》</view>
<view class="infoItem" wx:if="{{infoItem.description!==null}}"><view class="itemLeft">{{infoItem.type}}</view>{{infoItem.description}}</view>
<view class="infoItem" wx:if="{{infoItem.cate!==null}}"><view class="itemLeft">资料分类</view>{{infoItem.cate}}</view>
<view class="infoItem" wx:if="{{infoItem.downcount!==null}}"><view class="itemLeft">下载次数:</view>{{infoItem.downcount}}</view>
<view class="infoItem" wx:if="{{infoItem.description!==null}}">{{infoItem.description}}</view>
<a class="downloadBtn" bindtap="downFile" data-id="{{item.id}}" data-index="{{index}}">下载</a>
<view class="closeIcon" bindtap="closeInfo">
<view class="iconImg">
@ -64,5 +62,4 @@
</view>
</view>
</view>
</view>