Commit e2c31c11 by liuzhanxin

提交移动端代码修改

parent 4d5adf1c
......@@ -131,6 +131,6 @@ Vue.prototype.GLOBALUTIL = util;
background-color: #0faeff;
}
::-webkit-scrollbar {
background-color: #0faeff;
background-color: transparent;
}
</style>
var url = "http://47.94.204.226";
// var url = "http://47.94.204.226";
// var url = "http://10.2.24.104:9301"
// var url = "http://10.2.24.104"
// var url = "http://10.2.113.181:9301"
var url = "http://10.2.112.16:9301"
var token = "";
var addressSelectionTemp = [];
var user = {};
var sysInfo = {};
var intelligent_access_url = "http://10.2."
var commonHeader = {
'Accept': 'application/json',
'Content-Type': 'application/json',
"x-auth-token":"",
"user":"",
"tenant-id":undefined
};
import moment from "./moment.js"
export default{
url,
......@@ -10,5 +22,7 @@ export default{
user,
sysInfo,
moment,
token
token,
commonHeader,
intelligent_access_url
}
\ No newline at end of file
......@@ -90,17 +90,11 @@
},
getData:function(id){
var body = {};
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
uni.request({
url: this.GLOBALUTIL.url+'/base-data/v1/dict-items?sort_property=ID&sort_direction=ASC&dict_code=jsxx&&page_number=1&page_size=100&prev_id='+id,
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user' : JSON.stringify(user)
},
header:this.GLOBALUTIL.commonHeader,
body:null,
success: (res) => {
console.log(JSON.stringify(res))
......
<template>
<view class="sign-calendar">
<view class="top-bar">
<view @click="turning('prev')">上个月</view>
<view>{{ y }}{{ text.year }}{{ m + 1 }}{{ text.month }}</view>
<view @click="turning('next')">下个月</view>
</view>
<view class="week">
<view class="week-day" v-for="(item, index) in weekDay" :key="index">{{ item }}</view>
</view>
<view :class="{ hide: !monthOpen }" class="content" :style="{ height: height }">
<view :style="{ top: positionTop + 'upx' }" class="days">
<view class="item" v-for="(item, index) in dates" :key="index">
<view class="day" @click="selectOne(item, $event)" :class="{ choose: choose == handleDate(item.year,item.month+1,item.date), nolm: !item.lm }">{{ item.date }}</view>
<view class="sign" v-if="isSigned(item.year, item.month + 1, item.date)"></view>
<view class="today-text" v-if="isToday(item.year, item.month, item.date)"></view>
</view>
</view>
</view>
<image src="/static/dark-calendar/ico-arrow-up.png" mode="scaleToFill" @click="trgWeek()" class="weektoggel" :class="{ down: !monthOpen }"></image>
</view>
</template>
<script>
export default {
name: 'dark-calendar',
props: {
// 第一列星期几
weekstart: {
type: Number,
default: 7
},
// 已经签到的日期
signeddates: {
type: Array,
default: () => [
],
},
// 是否展开
open: {
type: Boolean,
default: true
}
},
data() {
return {
text: {
year: '年',
month: '月',
week: ['一', '二', '三', '四', '五', '六', '日'],
today: '今'
},
y: new Date().getFullYear(), // 年
m: new Date().getMonth(), // 月
dates: [], // 当前月日期集合
positionTop: 0,
monthOpen: true,
choose: ''
}
},
created() {
this.dates = this.monthDay(this.y, this.m)
!this.open && this.trgWeek()
},
mounted() {
let date = new Date()
let y = date.getFullYear()
let m = date.getMonth()
let d = date.getDate()
this.choose = this.handleDate(y,m+1,d)
},
computed: {
// 顶部星期栏目
weekDay() {
return this.text.week.slice(this.weekstart - 1).concat(this.text.week.slice(0, this.weekstart - 1))
},
height() {
return (this.dates.length / 7) * 80 + 'upx'
}
},
methods: {
// 获取当前月份天数
monthDay(y, m) {
let firstDayOfMonth = new Date(y, m, 1).getDay() // 当月第一天星期几
let lastDateOfMonth = new Date(y, m + 1, 0).getDate() // 当月最后一天
let lastDayOfLastMonth = new Date(y, m, 0).getDate() // 上一月的最后一天
let dates = [] // 所有渲染日历
let weekstart = this.weekstart == 7 ? 0 : this.weekstart // 方便进行日期计算,默认星期从0开始
let startDay = (() => {
// 周初有几天是上个月的
if (firstDayOfMonth == weekstart) {
return 0
} else if (firstDayOfMonth > weekstart) {
return firstDayOfMonth - weekstart
} else {
return 7 - weekstart + firstDayOfMonth
}
})()
let endDay = 7 - ((startDay + lastDateOfMonth) % 7) // 结束还有几天是下个月的
for (let i = 1; i <= startDay; i++) {
dates.push({
date: lastDayOfLastMonth - startDay + i,
day: weekstart + i - 1 || 7,
month: m - 1 >= 0 ? m - 1 : 12,
year: m - 1 >= 0 ? y : y - 1
})
}
for (let j = 1; j <= lastDateOfMonth; j++) {
dates.push({
date: j,
day: (j % 7) + firstDayOfMonth - 1 || 7,
month: m,
year: y,
lm: true
})
}
for (let k = 1; k <= endDay; k++) {
dates.push({
date: k,
day: (lastDateOfMonth + startDay + weekstart + k - 1) % 7 || 7,
month: m + 1 <= 11 ? m + 1 : 0,
year: m + 1 <= 11 ? y : y + 1
})
}
return dates
},
// 已经签到处理
isSigned(y, m, d) {
let flag = false
for (let i = 0; i < this.signeddates.length; i++) {
let dy = this.handleDate(y,m,d);
if (this.signeddates[i] == dy) {
flag = true
break
}
}
return flag
},
isToday(y, m, d) {
let date = new Date()
return y == date.getFullYear() && m == date.getMonth() && d == date.getDate()
},
// 切换成周模式
trgWeek() {
this.monthOpen = !this.monthOpen
if (this.monthOpen) {
this.positionTop = 0
} else {
let index = -1
this.dates.forEach((i, x) => {
this.isToday(i.year, i.month, i.date) && (index = x)
})
this.positionTop = -((Math.ceil((index + 1) / 7) || 1) - 1) * 80
}
},
// 点击回调
selectOne(i, event) {
let date = this.handleDate(i.year,i.month+1,i.date)
let selectD = new Date(date)
if (selectD.getMonth() != this.m) {
console.log('不在可选范围内')
return false
}
this.choose = date
this.$emit('on-click', date)
},
// 上个月,下个月
turning(_action) {
if (_action === 'next') {
if (this.m + 1 == 12) {
this.m = 0
this.y = this.y + 1
} else {
this.m = this.m + 1
}
} else {
if (this.m + 1 == 1) {
this.m = 11
this.y = this.y - 1
} else {
this.m = this.m - 1
}
}
this.dates = this.monthDay(this.y, this.m)
this.$emit('monthChange', this.dates[0])
},
handleDate(y,m,d){
var dateStr = "";
var month = "";
var day = "";
if(m > 10){
month = m+"";
}else{
month = "0"+m;
}
if(d > 10){
day = d+"";
}else{
day = "0"+d;
}
dateStr = y +"-"+ month+"-" + day;
return dateStr;
}
}
}
</script>
<style lang="scss" scoped>
.sign-calendar {
color: #fff;
font-size: 28upx;
text-align: center;
background-color: #3d9bf6;
padding-bottom: 10upx;
.top-bar {
font-size: 28upx;
height: 80upx;
line-height: 80upx;
border-bottom: 1upx solid rgba(255, 255, 255, 0.3);
display: flex;
> view {
flex: 1;
}
}
.week {
display: flex;
align-items: center;
height: 80upx;
line-height: 80upx;
border-bottom: 1upx solid rgba(255, 255, 255, 0.2);
view {
flex: 1;
}
}
.content {
position: relative;
overflow: hidden;
transition: height 0.4s ease;
background-color: #3d9bf6;
.days {
transition: top 0.3s;
display: flex;
align-items: center;
flex-wrap: wrap;
position: relative;
.item {
position: relative;
display: block;
height: 80upx;
line-height: 80upx;
width: calc(100% / 7);
.day {
font-style: normal;
display: inline-block;
vertical-align: middle;
width: 60upx;
height: 60upx;
line-height: 60upx;
overflow: hidden;
border-radius: 60upx;
&.choose {
background-color: #9fcdff;
color: #0157d8;
}
&.nolm {
color: #fff;
opacity: 0.3;
}
}
.sign {
font-style: normal;
width: 20upx;
height: 20upx;
background: #fff;
border-radius: 10upx;
position: absolute;
left: 50%;
margin-left: -10upx;
bottom: 0;
pointer-events: none;
}
.today-text {
position: absolute;
font-size: 20upx;
font-weight: normal;
width: 20upx;
height: 20upx;
line-height: 20upx;
right: 0;
top: 10upx;
color: #fff;
}
}
}
}
.hide {
height: 80upx !important;
}
.weektoggel {
width: 80upx;
height: 40upx;
margin: 10upx auto 0;
&.down {
transform: rotate(180deg);
}
}
}
</style>
......@@ -8,4 +8,8 @@ page {
overflow: hidden; /* 遮住顶部下拉刷新区域 */
box-sizing: border-box; /* 避免设置padding出现双滚动条的问题 */
width: 100%;
}
.mescroll-body-content{
width: 100%;
}
\ No newline at end of file
......@@ -26,7 +26,7 @@ const GlobalOption = {
empty: {
use: true, // 是否显示空布局
icon: "http://www.mescroll.com/img/mescroll-empty.png?v=1", // 图标路径 (建议放入static目录, 如 /static/img/mescroll-empty.png )
tip: '~ 暂无相关数据 ~' // 提示
tip: '~ 暂无更多数据 ~' // 提示
}
}
}
......
......@@ -112,7 +112,7 @@ MeScroll.prototype.extendUpScroll = function(optUp) {
empty: {
use: true, // 是否显示空布局
icon: null, // 图标路径
tip: '~ 暂无相关数据 ~', // 提示
tip: '~ 暂无更多数据 ~', // 提示
btnText: '', // 按钮
btnClick: null, // 点击按钮的回调
onShow: null, // 是否显示的回调
......
<template>
<view v-if="showPopup" class="uni-popup" @touchmove.stop.prevent="clear">
<uni-transition :mode-class="['fade']" :styles="maskClass" :duration="duration" :show="showTrans" @click="onTap" />
<uni-transition :mode-class="ani" :styles="transClass" :duration="duration" :show="showTrans" @click="onTap">
<view class="uni-popup__wrapper-box" @click.stop="clear">
<slot />
</view>
</uni-transition>
</view>
</template>
<script>
import uniTransition from '../uni-transition/uni-transition.vue'
/**
* PopUp 弹出层
* @description 弹出层组件,为了解决遮罩弹层的问题
* @tutorial https://ext.dcloud.net.cn/plugin?id=329
* @property {String} type = [top|center|bottom] 弹出方式
* @value top 顶部弹出
* @value center 中间弹出
* @value bottom 底部弹出
* @property {Boolean} animation = [ture|false] 是否开启动画
* @property {Boolean} maskClick = [ture|false] 蒙版点击是否关闭弹窗
* @event {Function} change 打开关闭弹窗触发,e={show: false}
*/
export default {
name: 'UniPopup',
components: {
uniTransition
},
props: {
// 开启动画
animation: {
type: Boolean,
default: true
},
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
type: {
type: String,
default: 'center'
},
// maskClick
maskClick: {
type: Boolean,
default: true
}
},
data() {
return {
duration: 300,
ani: [],
showPopup: false,
showTrans: false,
maskClass: {
'position': 'fixed',
'bottom': 0,
'top': 0,
'left': 0,
'right': 0,
'backgroundColor': 'rgba(0, 0, 0, 0.4)'
},
transClass: {
'position': 'fixed',
'left': 0,
'right': 0,
}
}
},
watch: {
type: {
handler: function(newVal) {
switch (this.type) {
case 'top':
this.ani = ['slide-top']
this.transClass = {
'position': 'fixed',
'left': 0,
'right': 0,
}
break
case 'bottom':
this.ani = ['slide-bottom']
this.transClass = {
'position': 'fixed',
'left': 0,
'right': 0,
'bottom': 0
}
break
case 'center':
this.ani = ['zoom-out', 'fade']
this.transClass = {
'position': 'fixed',
/* #ifndef APP-NVUE */
'display': 'flex',
'flexDirection': 'column',
/* #endif */
'bottom': 0,
'left': 0,
'right': 0,
'top': 0,
'justifyContent': 'center',
'alignItems': 'center'
}
break
}
},
immediate: true
}
},
created() {
if (this.animation) {
this.duration = 300
} else {
this.duration = 0
}
},
methods: {
clear(e) {
// TODO nvue 取消冒泡
e.stopPropagation()
},
open() {
this.showPopup = true
this.$nextTick(() => {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.showTrans = true
}, 50);
})
this.$emit('change', {
show: true
})
},
close(type) {
this.showTrans = false
this.$nextTick(() => {
clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.$emit('change', {
show: false
})
this.showPopup = false
}, 300)
})
},
onTap() {
if (!this.maskClick) return
this.close()
}
}
}
</script>
<style scoped>
.uni-popup {
position: fixed;
/* #ifdef H5 */
top: var(--window-top);
/* #endif */
/* #ifndef H5 */
top: 0;
/* #endif */
bottom: 0;
left: 0;
right: 0;
/* #ifndef APP-NVUE */
z-index: 99;
/* #endif */
}
.uni-popup__mask {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.4);
opacity: 0;
}
.mask-ani {
transition-property: opacity;
transition-duration: 0.2s;
}
.uni-top-mask {
opacity: 1;
}
.uni-bottom-mask {
opacity: 1;
}
.uni-center-mask {
opacity: 1;
}
.uni-popup__wrapper {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
position: absolute;
}
.top {
top: 0;
left: 0;
right: 0;
transform: translateY(-500px);
}
.bottom {
bottom: 0;
left: 0;
right: 0;
transform: translateY(500px);
}
.center {
/* #ifndef APP-NVUE */
display: flex;
flex-direction: column;
/* #endif */
bottom: 0;
left: 0;
right: 0;
top: 0;
justify-content: center;
align-items: center;
transform: scale(1.2);
opacity: 0;
}
.uni-popup__wrapper-box {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
position: relative;
}
.content-ani {
/* transition: transform 0.3s;
*/
transition-property: transform, opacity;
transition-duration: 0.2s;
}
.uni-top-content {
transform: translateY(0);
}
.uni-bottom-content {
transform: translateY(0);
}
.uni-center-content {
transform: scale(1);
opacity: 1;
}
</style>
\ No newline at end of file
<template>
<view v-if="isShow" ref="ani" class="uni-transition" :class="[ani.in]" :style="'transform:' +transform+';'+stylesObject" @click="change">
<slot></slot>
</view>
</template>
<script>
// #ifdef APP-NVUE
const animation = uni.requireNativePlugin('animation');
// #endif
/**
* Transition 过渡动画
* @description 简单过渡动画组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=985
* @property {Boolean} show = [false|true] 控制组件显示或隐藏
* @property {Array} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
* @value fade 渐隐渐出过渡
* @value slide-top 由上至下过渡
* @value slide-right 由右至左过渡
* @value slide-bottom 由下至上过渡
* @value slide-left 由左至右过渡
* @value zoom-in 由小到大过渡
* @value zoom-out 由大到小过渡
* @property {Number} duration 过渡动画持续时间
* @property {Object} styles 组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red`
*/
export default {
name: 'uniTransition',
props: {
show: {
type: Boolean,
default: false
},
modeClass: {
type: Array,
default () {
return []
}
},
duration: {
type: Number,
default: 300
},
styles: {
type: Object,
default () {
return {}
}
}
},
data() {
return {
isShow: false,
transform: '',
ani: {
in: '',
active: ''
}
};
},
watch: {
show: {
handler(newVal) {
if (newVal) {
this.open()
} else {
this.close()
}
},
immediate: true
}
},
computed: {
stylesObject() {
let styles = {
...this.styles,
'transition-duration': this.duration / 1000 + 's'
}
let transfrom = ''
for (let i in styles) {
let line = this.toLine(i)
transfrom += line + ':' + styles[i] + ';'
}
return transfrom
}
},
created() {
// this.timer = null
// this.nextTick = (time = 50) => new Promise(resolve => {
// clearTimeout(this.timer)
// this.timer = setTimeout(resolve, time)
// return this.timer
// });
},
methods: {
change() {
this.$emit('click', {
detail: this.isShow
})
},
open() {
clearTimeout(this.timer)
this.isShow = true
this.transform = ''
this.ani.in = ''
for (let i in this.getTranfrom(false)) {
if (i === 'opacity') {
this.ani.in = 'fade-in'
} else {
this.transform += `${this.getTranfrom(false)[i]} `
}
}
this.$nextTick(() => {
setTimeout(() => {
this._animation(true)
}, 50)
})
},
close(type) {
clearTimeout(this.timer)
this._animation(false)
},
_animation(type) {
let styles = this.getTranfrom(type)
// #ifdef APP-NVUE
if (!this.$refs['ani']) return
animation.transition(this.$refs['ani'].ref, {
styles,
duration: this.duration, //ms
timingFunction: 'ease',
needLayout: false,
delay: 0 //ms
}, () => {
if (!type) {
this.isShow = false
}
this.$emit('change', {
detail: this.isShow
})
})
// #endif
// #ifndef APP-NVUE
this.transform = ''
for (let i in styles) {
if (i === 'opacity') {
this.ani.in = `fade-${type?'out':'in'}`
} else {
this.transform += `${styles[i]} `
}
}
this.timer = setTimeout(() => {
if (!type) {
this.isShow = false
}
this.$emit('change', {
detail: this.isShow
})
}, this.duration)
// #endif
},
getTranfrom(type) {
let styles = {
transform: ''
}
this.modeClass.forEach((mode) => {
switch (mode) {
case 'fade':
styles.opacity = type ? 1 : 0
break;
case 'slide-top':
styles.transform += `translateY(${type?'0':'-100%'}) `
break;
case 'slide-right':
styles.transform += `translateX(${type?'0':'100%'}) `
break;
case 'slide-bottom':
styles.transform += `translateY(${type?'0':'100%'}) `
break;
case 'slide-left':
styles.transform += `translateX(${type?'0':'-100%'}) `
break;
case 'zoom-in':
styles.transform += `scale(${type?1:0.8}) `
break;
case 'zoom-out':
styles.transform += `scale(${type?1:1.2}) `
break;
}
})
return styles
},
_modeClassArr(type) {
let mode = this.modeClass
if (typeof(mode) !== "string") {
let modestr = ''
mode.forEach((item) => {
modestr += (item + '-' + type + ',')
})
return modestr.substr(0, modestr.length - 1)
} else {
return mode + '-' + type
}
},
// getEl(el) {
// console.log(el || el.ref || null);
// return el || el.ref || null
// },
toLine(name) {
return name.replace(/([A-Z])/g, "-$1").toLowerCase();
}
}
}
</script>
<style scoped>
.uni-transition {
transition-timing-function: ease;
transition-duration: 0.3s;
transition-property: transform, opacity;
}
.fade-in {
opacity: 0;
}
.fade-active {
opacity: 1;
}
.slide-top-in {
/* transition-property: transform, opacity; */
transform: translateY(-100%);
}
.slide-top-active {
transform: translateY(0);
/* opacity: 1; */
}
.slide-right-in {
transform: translateX(100%);
}
.slide-right-active {
transform: translateX(0);
}
.slide-bottom-in {
transform: translateY(100%);
}
.slide-bottom-active {
transform: translateY(0);
}
.slide-left-in {
transform: translateX(-100%);
}
.slide-left-active {
transform: translateX(0);
opacity: 1;
}
.zoom-in-in {
transform: scale(0.8);
}
.zoom-out-active {
transform: scale(1);
}
.zoom-out-in {
transform: scale(1.2);
}
</style>
\ No newline at end of file
......@@ -9,7 +9,6 @@
"app-plus" : {
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
......@@ -71,5 +70,14 @@
},
"mp-toutiao" : {
"usingComponents" : true
},
"h5" : {
"router" : {
"base" : "/cupl/app/h5/"
},
"devServer" : {
"https" : false
},
"title" : "智慧实验室"
}
}
......@@ -60,6 +60,31 @@
}
},
{
"path": "pages/Danger-Source/danger-list",
"style": {
"navigationBarTitleText": "危险源查询",
"app-plus" : {
"titleNView" : {
"buttons" : [
{
"text" : "筛选",
"fontSize" : "14"
}
]
}
}
}
},
{
"path": "pages/Danger-Source/danger-detail",
"style": {
"navigationBarTitleText": "危险源查询",
"app-plus" : {
}
}
},
{
"path": "pages/Rectification-Item/list",
"style": {
"navigationBarTitleText": "整改项查询",
......@@ -119,7 +144,122 @@
"style": {
"navigationStyle": "custom"
}
}
},
//实验室预约共享
{
"path": "pages/Appointment/calendar",
"style": {
"navigationBarTitleText": "预约",
"app-plus":{
"bounce":"none",
"titleNView" : {
"buttons" : [
{
"text" : "预约",
"fontSize" : "14"
}
]
}
}
}
},
{
"path": "pages/Appointment/detail",
"style": {
"navigationBarTitleText": "开放设置详情",
"app-plus":{
"bounce":"none",
"titleNView" : {
"buttons" : [
{
"text" : "预约",
"fontSize" : "14"
}
]
}
}
}
},
{
"path": "pages/Appointment/list",
"style": {
"navigationBarTitleText": "开放设置",
"app-plus":{
"bounce":"none",
"titleNView" : {
"buttons" : [
{
"text" : "筛选",
"fontSize" : "14"
}
]
}
}
}
},
{
"path": "pages/Appointment-Approve/list",
"style": {
"navigationBarTitleText": "预约审核",
"app-plus":{
"bounce":"none"
}
}
},
{
"path": "pages/My-Appointment/list",
"style": {
"navigationBarTitleText": "我的预约",
"app-plus":{
"bounce":"none"
}
}
},
{
"path": "pages/Intelligent-Access/scanCode",
"style": {
"navigationBarTitleText": "扫码开门",
"app-plus":{
"bounce":"none"
}
}
},
{
"path": "pages/Approval/list",
"style": {
"navigationBarTitleText": "待办列表",
"app-plus":{
"bounce":"none"
}
}
},
{
"path": "pages/Approval/Detail/danger-purchase-detail",
"style": {
"navigationBarTitleText": "审批详情",
"app-plus":{
"bounce":"none"
}
}
},
{
"path": "pages/Approval/Detail/danger-use-detail",
"style": {
"navigationBarTitleText": "审批详情",
"app-plus":{
"bounce":"none"
}
}
},
{
"path": "pages/Approval/item-info",
"style": {
"navigationBarTitleText": "详情",
"app-plus":{
"bounce":"none"
}
}
}
],
"tabBar": {
"color": "#7a7e83",
......
<template>
</template>
<script>
</script>
<style>
</style>
<template>
<MescrollBody class="containter" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback"
@up="upCallback">
<view class="news-li" v-for="news in dataList" :key="news.id" hover-class="hover" @click="goDetail(news)">
<view class="ori" style="height:100px;border-bottom: 1px solid #eeeeee;">
<image mode="scaleToFill" class="cover" src="../../static/lab-share/cover.jpg" />
<view style="flex-direction: column;">
<view>
<text class="labTitle">实验中心</text>
</view>
<view class="ori">
<view class="ori">
<view style="width: 20rpx;margin-right:20rpx;">
<image mode="scaleToFill" class="icon" src="/static/security-check/safeSys.png" />
</view>
<view style="display: flex;margin-right:30px">
<text class="detail">地址</text>
</view>
</view>
<view class="ori">
<view style="width: 20rpx;margin-right:20rpx;">
<image mode="scaleToFill" class="icon" src="/static/security-check/safeSys.png" />
</view>
<view style="display: flex;margin-right:30px">
<text class="detail">老师</text>
</view>
</view>
</view>
<view>
<image class="icon" src="../../static/security-check/safePerson.png">
<text class="detail">地址</text>
</view>
</view>
</view>
<view class="ori" style="padding-top: 20upx;padding-bottom: 20upx;">
<image class="icon" style="margin-left: 20px;" src="../../static/security-check/safePerson.png">
<text class="detail">开放时间:</text>
<text class="detail">2019020102</text>
</view>
</view>
</MescrollBody>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
export default {
mixins: [MescrollMixin],
data() {
return {
downOption: {
auto: false //是否在初始化后,自动执行downCallback; 默认true
},
dataList: [{"id":"123","name":'124',"status":"ad","check_point":"ad"}],
upOption: {
use: false, // 是否启用上拉加载; 默认true
},
}
},
methods: {
onLoad() {
var that = this;
uni.$on('refreshTaskList', function(data) {
})
this.loadData();
},
onUnload() {
uni.$off('refreshTaskList', function(data) {})
},
/*下拉刷新的回调 */
downCallback() {
this.mescroll.endSuccess();
},
/*上拉加载的回调 */
upCallback(page) {
},
/*获取列表*/
loadData() {
var body = {};
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
uni.request({
url: this.GLOBALUTIL.url + '/safety/v1/check-tasks?page_size=200&page_number=1',
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user': JSON.stringify(user)
},
body: null,
success: (res) => {
console.log(JSON.stringify(res))
var data = res.data.data;
data.map((opt) => {
opt.taskstatus = (this.handleStatus(opt)).text;
opt.color = (this.handleStatus(opt)).color;
var taskexecutor = JSON.parse(opt.excutor);
var taskexecutortext = "";
taskexecutor.map((opt) => {
taskexecutortext = opt.name + " ";
})
opt.taskexecutor = taskexecutortext;
opt.taskTypeTitle = opt.auto_task ? "上级下发" : "自建任务"
})
this.dataList = data;
}
})
},
goDetail(data) {
uni.navigateTo({
url: "./detail?settingId=" + data.id
})
}
},
components: {
MescrollBody
},
}
</script>
<style>
/*说明*/
.notice {
font-size: 30upx;
padding: 40upx 0;
border-bottom: 1upx solid #eee;
text-align: center;
}
/*展示上拉加载的数据列表*/
.news-li {
font-size: 32upx;
padding-right: 20upx;
padding-left: 20upx;
border-bottom: 1upx solid #eee;
width: calc(100%-40upx);
display: flex;
flex-direction: column;
background-color: #f5f5f5;
margin-top:30rpx;
}
.news-li .new-content {
font-size: 28upx;
margin-top: 10upx;
margin-left: 20upx;
color: #666;
}
.icon {
width: 20rpx;
height: 20rpx;
margin-right: 20rpx;
}
.cover {
width: 120upx;
height: 120upx;
border-radius: 60upx;
margin-left: 40upx;
margin-right: 20upx;
}
.top-container {
display: flex;
flex-direction: row;
align-items: center;
}
.status {
width: 170rpx;
height: 35rpx;
background-color: rgba(242, 115, 115, 0.10);
border-radius: 50rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 35rpx;
}
.status-finish {
width: 170rpx;
height: 35rpx;
background-color: rgba(47, 190, 178, 0.10);
border-radius: 50rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 35rpx;
}
.status-text {
color: #F27373;
font-size: 11px;
}
.status-finish-text {
color: #2FBEB2;
font-size: 11px;
}
.hover {
opacity: 0.7;
}
.title {
font-size: 17px;
font-weight: 300;
}
.des {
font-weight: 200;
font-size: 14px;
color: #676767
}
.detail {
font-size: 14px;
}
.type {
font-size: 14px;
}
.containter {
display: flex;
width: 100%;
background-color: #F5F5F5;
}
.labTitle{
}
.ori{
display: flex;
flex-direction: row;
align-items: center;
background-color: #FFFFFF;
width:100%
}
</style>
<template>
<view class="top-container">
<view class="detailtext" v-for="news in dataList" :key="news.title" >
<text class="titletext">{{news.title}}</text><text class="contenttext">{{news.value}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
code:"",
tradeName:"",
type:"",
managerName:"",
siteName:"",
alias:"",
unit:"",
description:"",
specification:"",
preservation:"",
count:"",
dataList:[],
openperiodarrayEnum: [
{ name: 2, title: '星期一'},
{ name: 3, title: '星期二' },
{ name: 4, title: '星期三' },
{ name: 5, title: '星期四' },
{ name: 6, title: '星期五' },
{ name: 7, title: '星期六' },
{ name: 1, title: '星期日' },
],
settingData:{}
}
},
methods: {
onLoad() {
var that = this
uni.$on('settingData', function(data) {
var detailData = data[0]
that.settingData = detailData;
console.log(detailData)
var data = [
{
title: "实验室",
value: ""
},
{
title: "开放项目",
value: ""
},
{
title: "开放周期",
value: ""
},
{
title: "开放时间",
value: ""
},
{
title: "指导老师",
value: ""
},
{
title: "最大座位数",
value: ""
}
]
data[0].value = detailData.labInfo.name
data[1].value = detailData.projects.length>0?detailData.projects[0].name:""
var periodTitle = "";
detailData.openPeriod.map((opt)=>{
that.openperiodarrayEnum.map((period)=>{
if(opt.code == period.name){
if(periodTitle == ""){
periodTitle = periodTitle+period.title
}else{
periodTitle = periodTitle+"、"+period.title
}
}
})
})
data[2].value = periodTitle;
data[3].value = detailData.startTime+"~"+detailData.endTime
data[4].value = detailData.teacher?detailData.teacher:"暂无"
data[5].value = detailData.maxUserCount
that.dataList = data;
that.$forceUpdate();
})
},
onNavigationBarButtonTap() {
uni.navigateTo({
url: "./calendar"
})
uni.$emit("calendarData", [this.settingData])
},
onUnload() {
uni.$off('settingData')
},
/*下拉刷新的回调 */
downCallback() {
this.mescroll.endSuccess();
},
/*上拉加载的回调 */
upCallback(page) {
},
}
}
</script>
<style>
.top-container {
display: flex;
flex-direction: column;
width: 100%;
margin-top: 10rpx;
margin-bottom: 20rpx;
}
.title {
font-size: 16px;
color: #333333;
}
.statuspic {
width: 80rpx;
height: 80rpx;
}
.titletext {
color: '#101317';
font-family: 'PingFangSC-Regular';
font-weight: '400';
margin-left: 10px;
font-size: 28rpx;
}
.titletextlong {
font-size: 28rpx;
color: #666666;
margin-right: 50rpx;
flex: 1
}
.contenttext {
font-size: 28rpx;
color: #333333;
font-family: 'PingFangSC-Regular';
font-weight: '400';
flex: 2;
display: flex;
align-items: flex-end;
justify-content: flex-end;
margin-right: 10px;
padding-left: 20px;
}
.description {
font-size: 28rpx;
color: #333333;
font-family: 'PingFangSC-Regular';
font-weight: '400';
flex: 2;
display: flex;
align-items: flex-end;
justify-content: flex-end;
margin-right: 10px;
}
.pic {
width: 80rpx;
height: 80rpx;
}
.remind {
font-size: 32rpx;
color: #CDCDCD;
}
.detailtext {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width:100%;
height:90upx;
border-bottom: 1px solid #D0D0D0;
}
.detaillongtext{
display: flex;
flex-direction: column;
width:100%;
border-bottom: 1px solid #D0D0D0;
}
.camera-button {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 200rpx;
height: 200rpx;
padding: 0;
}
</style>
<template>
<view style="width: 100%;height: 100%; display: flex;flex-direction: column;">
<view class="ori" style="width: 100%;height:200upx;border-radius: 5px;padding:0">
<view class="topContainer">
<view class="ori" style="margin-top: 5upx;">
<text class="approvalTitle">{{"危化品采购"}}</text>
</view>
<view class="ori" style="width: 100%;justify-content: space-between;">
<text class="type">{{"仓库名称"}}</text>
<text class="type">{{"160元"}}</text>
</view>
<view class="ori" style="width: 100%;justify-content: space-between;">
<view class="ori">
<view style="width: 20rpx;margin-right:20rpx;">
<image mode="scaleToFill" class="icon" src="/static/lab-share/teacher.png" />
</view>
<text class="type">{{"申请人"}}</text>
</view>
<text class="type" style="margin-left:20upx">{{"申请时间"}}</text>
</view>
</view>
</view>
<MescrollBody class="containter" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback"
@up="upCallback">
<view class="news-li" v-for="news in dataList" :key="news.id" hover-class="hover" @click="goDetail(news)">
<view class="ori" style="height:200upx;border-radius: 5px;">
<view class="line">
</view>
<view class="dotContainer">
<image mode="scaleToFill" class="dot" src="/static/lab-share/cover.jpg" />
</view>
<view style="height:160upx;justify-content: space-between;display: flex;flex-direction: column;">
<view>
<text class="labTitle">{{"这是一个危险源品名"}}</text>
</view>
<view>
<text class="type">{{"危险源类别"}}</text>
</view>
<view class="ori">
<view class="oriItem">
<text class="type">{{"单价:"}}</text>
<text class="type" style="margin-left:20upx">{{"20"}}</text>
</view>
<view class="oriItem">
<text class="type">{{"数量:"}}</text>
<text class="type" style="margin-left:20upx">{{"10"}}</text>
</view>
<view class="oriItem">
<text class="type">{{"总价:"}}</text>
<text class="type" style="margin-left:20upx">{{"200"}}</text>
</view>
</view>
</view>
</view>
</view>
</MescrollBody>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
export default {
mixins: [MescrollMixin],
data() {
return {
downOption: {
auto: false //是否在初始化后,自动执行downCallback; 默认true
},
dataList: [1,2,3],
upOption: {
use: false, // 是否启用上拉加载; 默认true
},
showProject:false,
showDrawer:false
}
},
methods: {
onLoad() {
var that = this;
uni.$on('refreshTaskList', function(data) {
})
this.loadData();
},
onUnload() {
uni.$off('refreshTaskList', function(data) {})
},
/*下拉刷新的回调 */
downCallback() {
this.mescroll.endSuccess();
},
/*上拉加载的回调 */
upCallback(page) {
},
/*获取列表*/
loadData() {
},
goDetail(data) {
uni.navigateTo({
url: "./detail?settingId=" + data.id
})
uni.$emit("approvalItemData", [data])
}
},
components: {
MescrollBody,
},
}
</script>
<style>
/*展示上拉加载的数据列表*/
.news-li {
font-size: 32upx;
padding-right: 20upx;
padding-left: 20upx;
width: calc(100%-40upx);
display: flex;
flex-direction: column;
background-color: #f5f5f5;
margin-top:30rpx;
}
.news-li .new-content {
font-size: 28upx;
margin-top: 10upx;
margin-left: 20upx;
color: #666;
}
.icon {
width: 25rpx;
height: 25rpx;
margin-right: 20rpx;
}
.top-container {
display: flex;
flex-direction: row;
align-items: center;
}
.status {
width: 170rpx;
height: 35rpx;
background-color: rgba(242, 115, 115, 0.10);
border-radius: 50rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 35rpx;
}
.status-finish {
width: 170rpx;
height: 35rpx;
background-color: rgba(47, 190, 178, 0.10);
border-radius: 50rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 35rpx;
}
.status-text {
color: #F27373;
font-size: 11px;
}
.status-finish-text {
color: #2FBEB2;
font-size: 11px;
}
.hover {
opacity: 0.7;
}
.title {
font-size: 17px;
font-weight: 300;
}
.des {
font-weight: 200;
font-size: 14px;
color: #676767
}
.detail {
font-size: 14px;
}
.type {
font-size: 14px;
}
.containter {
display: flex;
width: 100%;
background-color: #F5F5F5;
}
.labTitle{
}
.approvalTitle{
font-size: 32upx;
}
.ori{
display: flex;
flex-direction: row;
align-items: center;
background-color: #FFFFFF;
}
.oritest{
display: flex;
flex-direction: row;
align-items: center;
background-color: #FFFFFF;
}
.filterButton{
width:50%;
height:80upx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.selectLine {
width: 30upx;
height:1upx;
border-bottom: 1px solid #00CE47;
justify-self: flex-end;
}
.hover{
opacity: 0.7;
}
.titleContainer{
height: 90%;
display: flex;
justify-content: center;
align-items: center;
}
.d-container {
width: 600upx;
height:100%
}
.item {
width: auto;
margin-top: 20upx;
margin-left: 20upx;
margin-right: 40upx;
padding-bottom: 10upx;
}
.selcontent {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 20px;
}
.tip {
width: 30upx;
height: 30upx
}
.datacontent {
width: 100%;
font-size: 16px;
color: #4F4F4F;
}
.submit-button {
width:50%;
height:50px;
display: flex;
background-color: #409C9C;
justify-content: center;
align-items: center;
}
.clear-button {
display: flex;
width:50%;
height:50px;
background-color: #F8FAFA;
border-color: 1px solid #DDDEE1;
justify-content: center;
align-items: center;
}
.dot{
width:40upx;
height:40upx;
margin-top:15upx;
}
.dotContainer{
height:180upx;
width:80upx;
display: flex;
justify-content: center;
align-items: flex-start;
}
.line{
width:2px;
height:200upx;
background-color: #75A8FF;
}
.topContainer{
width: 100%;
padding-left:30upx;
padding-right:30upx;
flex:1;
height:160upx;
justify-content: space-between;
display: flex;
flex-direction: column;
}
.oriItem{
display: flex;
flex-direction: row;
align-items: center;
margin-right: 30upx;
}
</style>
<template>
<view class="top-container">
<view class="detailtext" v-for="news in dataList" :key="news.title" >
<text class="titletext">{{news.title}}</text><text class="contenttext">{{news.value}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
code:"",
tradeName:"",
type:"",
managerName:"",
siteName:"",
alias:"",
unit:"",
description:"",
specification:"",
preservation:"",
count:"",
dataList:[]
}
},
methods: {
onLoad() {
var that = this
uni.$on('approvalItemData', function(data) {
var detailData = data[0]
that.dataList = detailData;
that.$forceUpdate();
})
},
onUnload() {
uni.$off('approvalItemData')
},
/*下拉刷新的回调 */
downCallback() {
this.mescroll.endSuccess();
},
/*上拉加载的回调 */
upCallback(page) {
},
}
}
</script>
<style>
.top-container {
display: flex;
flex-direction: column;
width: 100%;
margin-top: 10rpx;
margin-bottom: 20rpx;
}
.title {
font-size: 16px;
color: #333333;
}
.statuspic {
width: 80rpx;
height: 80rpx;
}
.titletext {
color: '#101317';
font-family: 'PingFangSC-Regular';
font-weight: '400';
margin-left: 10px;
font-size: 28rpx;
}
.titletextlong {
font-size: 28rpx;
color: #666666;
margin-right: 50rpx;
flex: 1
}
.contenttext {
font-size: 28rpx;
color: #333333;
font-family: 'PingFangSC-Regular';
font-weight: '400';
flex: 2;
display: flex;
align-items: flex-end;
justify-content: flex-end;
margin-right: 10px;
padding-left: 20px;
}
.description {
font-size: 28rpx;
color: #333333;
font-family: 'PingFangSC-Regular';
font-weight: '400';
flex: 2;
display: flex;
align-items: flex-end;
justify-content: flex-end;
margin-right: 10px;
}
.pic {
width: 80rpx;
height: 80rpx;
}
.remind {
font-size: 32rpx;
color: #CDCDCD;
}
.detailtext {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width:100%;
height:90upx;
border-bottom: 1px solid #D0D0D0;
}
.detaillongtext{
display: flex;
flex-direction: column;
width:100%;
border-bottom: 1px solid #D0D0D0;
}
.camera-button {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 200rpx;
height: 200rpx;
padding: 0;
}
</style>
<template>
<view style="width: 100%;height: 100%; display: flex;flex-direction: column;">
<MescrollBody class="containter" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback"
@up="upCallback">
<view class="news-li" v-for="news in dataList" :key="news.id" hover-class="hover" @click="goDetail(news)">
<view class="ori" style="height:200upx;border-radius: 5px;">
<view class="line">
</view>
<view class="dotContainer">
<view class="dot"></view>
</view>
<view style="height:160upx;justify-content: space-between;display: flex;flex-direction: column;">
<view>
<text class="labTitle">{{news.bizObjectName}}</text>
</view>
<view>
<text class="type">{{news.bizTypeTitle_v}}</text>
</view>
<view class="ori">
<view class="ori">
<view style="width: 20rpx;margin-right:20rpx;">
<image mode="scaleToFill" class="icon" src="/static/lab-share/teacher.png" />
</view>
<text class="type">{{news["bizProcess.submitter.name"]}}</text>
</view>
<text class="type" style="margin-left:60upx">{{news.createTimeFormated}}</text>
</view>
</view>
</view>
</view>
</MescrollBody>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
import Drawer from '@/components/uni-drawer/uni-drawer.vue'
import Picker from "@/components/w-picker/w-picker.vue";
export default {
mixins: [MescrollMixin],
data() {
return {
downOption: {
auto: false //是否在初始化后,自动执行downCallback; 默认true
},
dataList: [],
upOption: {
use: false, // 是否启用上拉加载; 默认true
},
showProject:false,
showDrawer:false,
pageIndex:0,
}
},
methods: {
onLoad() {
var that = this;
uni.$on('refreshApprovalList', function(data) {
that.loadData();
})
this.loadData();
},
onUnload() {
uni.$off('refreshApprovalList')
},
/*下拉刷新的回调 */
downCallback() {
this.mescroll.endSuccess();
},
/*上拉加载的回调 */
upCallback(page) {
},
onNavigationBarButtonTap() {
},
/*获取列表*/
loadData() {
var body = {
"queryDefinitionMetaName": "com.beecode.sedu.workflow.query.ApprovalTask",
"queryFields": ["id", "bizTypeName", "finishTime", "taskName", "title", "taskState", "parameters", "result", "suggestion", "bizDataId", "processInstance.id", "bizObjectName", "bizTypeTitle_v", "bizProcess.submitter.name", "startTime", "processInstance.workflow.workflowDefinition.title"],
"orders": [{
"name": "startTime",
"asc": false
}],
"conditions": [{
"name":"taskState",
"relation":3,
"values":["2"]
}],
"pageIndex": this.pageIndex,
"pageSize": 20,
"useScene": true,
"sceneId":"",
"usePaging": true
}
uni.request({
url: this.GLOBALUTIL.url + '/query/functionQuery',
method: 'POST',
header: this.GLOBALUTIL.commonHeader,
data: JSON.stringify(body),
success: (res) => {
var data = JSON.parse(res.data.rowDatas);
data.map((opt)=>{
opt.createTimeFormated = this.GLOBALUTIL.moment(opt.createTime).format("YYYY-MM-DD HH:mm:ss")
return opt
})
this.dataList = data;
}
})
},
goDetail(data) {
// uni.navigateTo({
// url: "./Detail/danger-purchase-detail?settingId=" + data.id
// })
var parameters = JSON.parse(data.parameters);
uni.navigateTo({
url: "./Detail/danger-use-detail?approvalId=" + parameters.bizDataId
})
}
},
components: {
MescrollBody,
Picker,
Drawer
},
}
</script>
<style>
/*展示上拉加载的数据列表*/
.news-li {
font-size: 32upx;
padding-right: 20upx;
padding-left: 20upx;
width: calc(100%-40upx);
display: flex;
flex-direction: column;
background-color: #f5f5f5;
margin-top:30rpx;
height:200upx;
}
.news-li .new-content {
font-size: 28upx;
margin-top: 10upx;
margin-left: 20upx;
color: #666;
}
.icon {
width: 25rpx;
height: 25rpx;
margin-right: 20rpx;
}
.cover {
width: 120upx;
height: 120upx;
border-radius: 60upx;
margin-left: 40upx;
margin-right: 20upx;
}
.top-container {
display: flex;
flex-direction: row;
align-items: center;
}
.status {
width: 170rpx;
height: 35rpx;
background-color: rgba(242, 115, 115, 0.10);
border-radius: 50rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 35rpx;
}
.status-finish {
width: 170rpx;
height: 35rpx;
background-color: rgba(47, 190, 178, 0.10);
border-radius: 50rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 35rpx;
}
.status-text {
color: #F27373;
font-size: 11px;
}
.status-finish-text {
color: #2FBEB2;
font-size: 11px;
}
.hover {
opacity: 0.7;
}
.title {
font-size: 17px;
font-weight: 300;
}
.des {
font-weight: 200;
font-size: 14px;
color: #676767
}
.detail {
font-size: 14px;
}
.type {
font-size: 26upx;
}
.containter {
display: flex;
width: 100%;
background-color: #F5F5F5;
}
.labTitle{
color: #101317;
font-size: 30upx;
font-family: "PingFangSC-Regular";
}
.type{
color: #898989;
font-size: 24upx;
font-family: "PingFangSC-Regular";
}
.ori{
display: flex;
flex-direction: row;
align-items: center;
background-color: #FFFFFF;
}
.oritest{
display: flex;
flex-direction: row;
align-items: center;
background-color: #FFFFFF;
}
.filterButton{
width:50%;
height:80upx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.selectLine {
width: 30upx;
height:1upx;
border-bottom: 1px solid #00CE47;
justify-self: flex-end;
}
.hover{
opacity: 0.7;
}
.titleContainer{
height: 90%;
display: flex;
justify-content: center;
align-items: center;
}
.d-container {
width: 600upx;
height:100%
}
.item {
border-bottom: 1upx solid #D0D0D0;
width: auto;
margin-top: 20upx;
margin-left: 20upx;
margin-right: 40upx;
padding-bottom: 10upx;
}
.selcontent {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 20px;
}
.tip {
width: 30upx;
height: 30upx
}
.datacontent {
width: 100%;
font-size: 16px;
color: #4F4F4F;
}
.submit-button {
width:50%;
height:50px;
display: flex;
background-color: #409C9C;
justify-content: center;
align-items: center;
}
.clear-button {
display: flex;
width:50%;
height:50px;
background-color: #F8FAFA;
border-color: 1px solid #DDDEE1;
justify-content: center;
align-items: center;
}
.dot{
width:20upx;
height:20upx;
border-radius: 10upx;
background-color: #75A8FF;
margin-top:25upx;
}
.dotContainer{
height:180upx;
width:60upx;
display: flex;
justify-content: center;
align-items: flex-start;
}
.line{
width:2px;
height:200upx;
background-color: #75A8FF;
}
</style>
<template>
<view class="top-container">
<view class="detailtext" v-for="news in dataList" :key="news.title" >
<text class="titletext">{{news.title}}</text><text class="contenttext">{{news.value}}</text>
</view>
<view class="detaillongtext">
<text class="titletext" style="margin-top:10px">备注</text>
<text class="description" style="margin-left:10px;margin-top:10px">{{description}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
code:"",
tradeName:"",
type:"",
managerName:"",
siteName:"",
alias:"",
unit:"",
description:"",
specification:"",
preservation:"",
count:"",
dataList:[]
}
},
methods: {
onLoad() {
var that = this
uni.$on('dangerSourceDetailData', function(data) {
var detailData = data[0]
console.log(detailData)
if(detailData.filterType == "equipment"){
var data = [
{
title: "设备编号",
value: ""
},
{
title: "设备名称",
value: ""
},
{
title: "危险源类别",
value: ""
},
{
title: "存放地点",
value: ""
},
{
title: "设备类别",
value: ""
},
{
title: "规格",
value: ""
},
{
title: "数量",
value: ""
},
{
title: "价值",
value: ""
},
{
title: "仪器状态",
value: ""
},
{
title: "实验室",
value: ""
},
{
title: "实验分室",
value: ""
},
{
title: "管理员",
value: ""
}
]
data[0].value = detailData.code
data[1].value = detailData.name
that.type = "";
detailData.hazards.map((opt)=>{
that.type = that.type+opt.name + " "
})
data[2].value = that.type;
data[3].value = detailData.equipment_site
data[4].value = detailData.category
data[5].value = detailData.specification
data[6].value = detailData.quantity
data[7].value = detailData.price
data[8].value = ""//detailData.price
data[9].value = detailData.lab?JSON.parse(detailData.lab).name:""
data[10].value = detailData.locellus?JSON.parse(detailData.locellus).name:""
data[11].value = detailData.managerName
that.dataList = data;
that.$forceUpdate();
}else{
var data = [
{
"title":"编号",
"value":""
},
{
"title":"品名",
"value":""
},
{
"title":"负责人",
"value":""
},
{
"title":"危险源类别",
"value":""
},
{
"title":"实验场地",
"value":""
},
{
"title":"别名",
"value":""
},
{
"title":"规格",
"value":""
},
{
"title":"数量",
"value":""
},
{
"title":"计量单位",
"value":""
},
{
"title":"保存方式",
"value":""
}
]
data[0].value = detailData.consumable_info.code
data[1].value = detailData.consumable_info.trade_name
that.managerName = ""
detailData.consumables_stock.map((opt)=>{
that.managerName = that.managerName + JSON.parse(opt.manager).name
})
data[2].value = that.managerName;
that.type = "";
detailData.consumable_info.hazards.map((opt)=>{
that.type = that.type+opt.name + " "
})
data[3].value = that.type;
that.siteName = JSON.parse(detailData.lab_classroom.experiment_center).name
data[4].value = that.siteName;
that.alias = detailData.consumable_info.alias
data[5].value = that.alias;
that.unit = detailData.unit
data[8].value = that.unit;
that.specification = detailData.value
data[6].value = that.specification;
that.description = detailData.description == null ? "" : detailData.description
that.preservation = detailData.consumable_info.preservation
data[9].value = that.siteName;
that.count = detailData.consumables_stock[0].stock_number
data[7].value = that.count;
that.dataList = data;
that.$forceUpdate();
}
})
},
onUnload() {
uni.$off('dangerSourceDetailData', function(data) {
})
},
/*下拉刷新的回调 */
downCallback() {
this.mescroll.endSuccess();
},
/*上拉加载的回调 */
upCallback(page) {
},
}
}
</script>
<style>
.top-container {
display: flex;
flex-direction: column;
width: 100%;
margin-top: 10rpx;
margin-bottom: 20rpx;
}
.title {
font-size: 16px;
color: #333333;
}
.statuspic {
width: 80rpx;
height: 80rpx;
}
.titletext {
color: '#101317';
font-family: 'PingFangSC-Regular';
font-weight: '400';
margin-left: 10px;
font-size: 28rpx;
}
.titletextlong {
font-size: 28rpx;
color: #666666;
margin-right: 50rpx;
flex: 1
}
.contenttext {
font-size: 28rpx;
color: #333333;
font-family: 'PingFangSC-Regular';
font-weight: '400';
flex: 2;
display: flex;
align-items: flex-end;
justify-content: flex-end;
margin-right: 10px;
padding-left: 20px;
}
.description {
font-size: 28rpx;
color: #333333;
font-family: 'PingFangSC-Regular';
font-weight: '400';
flex: 2;
display: flex;
align-items: flex-end;
justify-content: flex-end;
margin-right: 10px;
}
.pic {
width: 80rpx;
height: 80rpx;
}
.remind {
font-size: 32rpx;
color: #CDCDCD;
}
.detailtext {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width:100%;
height:90upx;
border-bottom: 1px solid #D0D0D0;
}
.detaillongtext{
display: flex;
flex-direction: column;
width:100%;
border-bottom: 1px solid #D0D0D0;
}
.camera-button {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 200rpx;
height: 200rpx;
padding: 0;
}
</style>
<template>
<view style="width: 100%;height: 100%;background-color: #F5F5F5;display: flex;flex-direction: column;">
<view class="scanButton" hover-class="hover" @click="getEuqipmentStatus">
<text>查看班牌状态</text>
</view>
<view class="scanButton" hover-class="hover" @click="getEqStatus">
<text>获取锁</text>
</view>
<view v-if ="showCardStatus" v-for="news in deviceinfo" :key="news.deviceNo" class="scanButton" hover-class="hover" >
<text>班牌编码:{{news.deviceNo}}</text>
<text>班牌状态{{news.statusName}}</text>
</view>
<view class="scanButton" hover-class="hover" @click="getLockStatus">
<text>锁状态:{{lockStatus}}</text>
</view>
<view class="scanButton" hover-class="hover" @click="openLock">
<text>开锁</text>
</view>
<text>{{openLockStatus}}</text>
<text>摄像头列表:</text>
<text>{{cameraData.cameraName}}</text>
<view class="scanButton" hover-class="hover" @click="getPreviewUrl">
<text>查看监控</text>
</view>
<view v-if = "showVideo">
<video id="myVideo" :src="previewSrc"
@error="videoErrorCallback" controls></video>
</view>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
import FormAlert from "@/components/form-alert/h-form-alert.vue"
import PopUp from "@/components/popup/popup.vue"
import WebSkt from "./view-websocket.js"
export default {
mixins: [MescrollMixin],
data() {
return {
downOption: {
auto: false //是否在初始化后,自动执行downCallback; 默认true
},
dataList: [],
upOption: {
use: false, // 是否启用上拉加载; 默认true
},
submitShow:false,
lockStatus:"",
cameraData:{},
showCardStatus:false,
openLockStatus:"",
showVideo:false,
cameraName:"",
deviceinfo:[],
previewSrc:""
}
},
methods: {
onLoad() {
var that = this;
uni.$on('refreshTaskList', function(data) {
})
this.loadData();
this.getLockStatus();
this.getCameraList();
setTimeout(()=>{
var datas = [
{"deviceNo":"301F9A601DB7"}
];
WebSkt.getEquipmentStatus(datas);
},1000)
},
getEqStatus(){
var datas = [
{"deviceNo":"301F9A601DB7"}
];
WebSkt.getEquipmentStatus(datas);
},
onUnload() {
uni.$off('refreshTaskList', function(data) {})
},
/*下拉刷新的回调 */
downCallback() {
this.mescroll.endSuccess();
},
/*上拉加载的回调 */
upCallback(page) {
},
/*获取列表*/
loadData() {
},
signIn(data) {
this.submitShow = true;
},
cancel:function(){
this.submitShow = false;
},
onSubmitClick(){
this.submitShow = false;
uni.request({
url: '',
method: 'GET',
data: {},
success: res => {
},
fail: () => {},
complete: () => {}
});
this.$refs.popup.open({
type:'success',
content:'提交成功!',
timeout:1000,
isClick:false
});
},
openScan(){
// 只允许通过相机扫码
uni.scanCode({
onlyFromCamera: true,
success: function (res) {
console.log(res);
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
},
fail:function (res) {
console.log(res);
// console.log('条码类型:' + res.scanType);
// console.log('条码内容:' + res.result);
},
});
},
getEuqipmentStatus(){
var deviceInfo = WebSkt.getDeviceInfo();
console.log(deviceInfo)
this.deviceinfo = deviceInfo.map((opt)=>{
opt.statusName = opt.status=="1"?"在线":"离线"
return opt
});
this.showCardStatus = true;
},
videoErrorCallback: function(e) {
console.log(e)
},
getLockStatus(){
console.log("?")
uni.request({
url: 'http://wx.do-ok.com:8040/microservice-iot/api/third/v1/door_lock_status?schoolCode=3702034001',
method: 'GET',
body: null,
success: (res) => {
console.log(res);
var data = res.data.data[0];
if(data.lockStatus == 1){
this.lockStatus = "开"
}else{
this.lockStatus = "关"
}
},
});
},
openLock(){
var tmp = Date.parse( new Date() ).toString();
tmp = tmp.substr(0,10);
var body = {
"schoolCode":"3702034001",
"deviceNo":"301F9A601DB7",
"userId":"9c3a7f40198440f18589628204e9e09b",
"type":"4",
"tkey":tmp
}
uni.request({
url: 'http://wx.do-ok.com:8040/microservice-terminal/api/third/v1/scan_code',
method: 'POST',
header:{
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
},
data: body,
success: (res) => {
this.openLockStatus = res.data.msg
}
});
},
getCameraList(){
uni.request({
url: this.GLOBALUTIL.url+'/openlab/v1/test/camera',
method: 'GET',
header:this.GLOBALUTIL.commonHeader,
body: null,
success: (res) => {
console.log(res)
var data = res.data.data.list;
this.cameraData = data[0];
}
});
},
getPreviewUrl(){
uni.request({
url: this.GLOBALUTIL.url+'/openlab/v1/test/living?cameraIndexCode='+this.cameraData.cameraIndexCode,
method: 'GET',
header:this.GLOBALUTIL.commonHeader,
body: null,
success: (res) => {
console.log(res)
var url = res.data.data.url
this.previewSrc = url;
this.showVideo = true;
}
});
}
},
components: {
MescrollBody,
PopUp,
FormAlert
},
}
</script>
<style>
.scanButton{
width:400px;
height:50px;
display: flex;
justify-content: center;
align-items: flex-start;
flex-direction: column;
}
.hover {
opacity: 0.7;
}
</style>
var webScoketConut = 0;
/** ****************begin:消息处理************************** */
var remotewebsocket; // websocket实例
var lockReconnect = false; // 避免重复连接
var wsUrlweb = 'ws://mq.do-ok.com:6811';
var moniter = '';
var webscoketSend = 2;
var schoolCode = "3702034001"
var deviceInfo = "";
function UUID() {
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[14] = "4";
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
s[8] = s[13] = s[18] = s[23] = "-";
var uuid = s.join("");
return uuid;
}
var uuid = UUID();
function demo(jsons, el) {
for (var i = 0; i < jsons.length; i++) {
var index = 0;
for (var x in jsons[i]) {
var thisJson = jsons[i][x];
if (index == 0) {
var ths = '';
for (var vn in thisJson) {
ths += '<th style="padding:0 10px;border-right:1px solid #f2f2f2">' + vn + '</th>';
}
el.append('<thead><tr style="padding:0 10px;border-right:1px solid #f2f2f2">' + ths + '</tr></thead>');
}
var thsTbody = '';
for (var vn in thisJson) {
thsTbody += '<td style="padding:0 10px;border-right:1px solid #f2f2f2">' + thisJson[vn] + '</td>'
}
el.append('<tr>' + thsTbody + '</tr>')
index++;
}
}
}
var linkmsgWeb = {
"code": schoolCode,
"type": "system",
"subtype": "linkmsg",
"clienttype": "device_view",
"sender": uuid,
"receiver": "mina",
"body": "{}"
};
var heartmsgWeb = {
"code": schoolCode,
"type": "system",
"subtype": "heartmsg",
"clienttype": "device_view",
"sender": uuid,
"receiver": "mina",
"body": "{}"
};
var equipmentmsgWeb = {
"code": schoolCode,
"type": "command",
"subtype": "statusmsg",
"clienttype": "device_view",
"sender": uuid,
"receiver": "mina",
"body": {"datas":[{"deviceNo":"2852F90044A3"}]}
};
function createWebSocketWeb(url) {
try {
remotewebsocket = new WebSocket(url);
initEventHandleWeb();
} catch (e) {
reconnectWeb(url);
}
}
function initEventHandleWeb() {
remotewebsocket.onclose = function () {
reconnectWeb(wsUrlweb);
};
remotewebsocket.onerror = function () {
reconnectWeb(wsUrlweb);
};
remotewebsocket.onopen = function () {
// 心跳检测重置
heartCheckWeb.reset().start();
remotewebsocket.send("@" + JSON.stringify(linkmsgWeb) + "%");
};
remotewebsocket.onmessage = function (event) {
// 如果获取到消息,心跳检测重置,拿到任何消息都说明当前连接是正常的
heartCheckWeb.reset().start();
var message = event.data.replace("@", "").replace("%", "");
console.log(JSON.parse(message)); // 打印mina消息
try {
var message = JSON.parse(message);
var type = message.type;
var subtype = message.subtype;
var body = message.body;
switch (type) {
case 'sync_data': // 数据同步消息
if (subtype == 'download') { // 处理下载数据消息
}
break;
case 'im': // 处理即时消息
break;
case 'reply': // 处理mina响应
switch (subtype) {
case 'statusmsg': // 设备状态信息
var devices = body.datas
console.log(body)
deviceInfo = devices;
// devices数据结构如下:
//{
// deviceNo: "B51A60755B8824F73874AF89DF544D7A6" // 设备mac地址
// status: "1" // 设备连接状态("0"-离线,"1"-在线,"2"-异常)
//}
break;
}
break;
case 'command':
switch (subtype) {
case 'localdata':
break;
case 'screenshot':
break;
}
default:
console.log("没有匹配的消息类型");
}
} catch (e) {
console.log("收到的消息不是json字符串");
}
}
}
function reconnectWeb(url) {
webScoketConut++;
console.log('chonglian ')
if (lockReconnect) return;
lockReconnect = true;
// 没连接上会一直重连,设置延迟避免请求过多
setTimeout(function () {
createWebSocketWeb(url);
lockReconnect = false;
}, 2000);
}
// 心跳检测
var heartCheckWeb = {
timeout: 60000, // 60秒
timeoutObj: null,
serverTimeoutObj: null,
reset: function () {
clearTimeout(this.timeoutObj);
clearTimeout(this.serverTimeoutObj);
return this;
},
start: function () {
var self = this;
this.timeoutObj = setTimeout(function () {
// 这里发送一个心跳,后端收到后,返回一个心跳消息,
// onmessage拿到返回的心跳就说明连接正常
remotewebsocket.send("@" + JSON.stringify(heartmsgWeb) + "%");
self.serverTimeoutObj = setTimeout(function () { // 如果超过一定时间还没重置,说明后端主动断开了
remotewebsocket.close(); // 如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect // 会触发onclose导致重连两次
}, self.timeout)
}, this.timeout)
}
}
function getEquipmentStatus(datas){
// equipmentmsgWeb.body = {"datas":datas}
console.log(equipmentmsgWeb)
remotewebsocket.send("@" + JSON.stringify(equipmentmsgWeb) + "%");
}
function getDeviceInfo(){
return deviceInfo;
}
createWebSocketWeb(wsUrlweb);
var now = new Date();
window.setInterval(function () {
now = new Date();
}, 1000);
//定义时间格式,获取当前时间
function formatDates(date) {
var myyear = date.getFullYear();
var mymonth = date.getMonth() + 1;
var myweekday = date.getDate();
var hour = date.getHours();
var minute = date.getMinutes();
var second = date.getSeconds();
if (mymonth < 10) {
mymonth = "0" + mymonth;
}
if (myweekday < 10) {
myweekday = "0" + myweekday;
}
if (hour < 10) {
hour = "0" + hour;
}
if (minute < 10) {
minute = "0" + minute;
}
if (second < 10) {
second = "0" + second;
}
return (myyear + "-" + mymonth + "-" + myweekday + ' ' + hour + ':' + minute + ':' + second);
// return (myyear + "年" + mymonth + "月" + myweekday + "日");
}
export default {
schoolCode,
getEquipmentStatus,
deviceInfo,
getDeviceInfo
}
\ No newline at end of file
<template>
</template>
<script>
</script>
<style>
</style>
<template>
<view style="width: 100%;height: 100%;background-color: #F5F5F5;">
<MescrollBody class="containter" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback"
@up="upCallback">
<view class="news-li" v-for="news in dataList" :key="news.id" >
<view class="ori" style="height:300upx;border-bottom: 1px solid #EEEEEE;">
<image mode="scaleToFill" class="cover" src="../../static/lab-share/cover.jpg" />
<view style="flex-direction: column;">
<view>
<text class="labTitle">{{news.labName}}</text>
</view>
<view class="ori">
<view class="ori">
<view style="width: 20rpx;margin-right:20rpx;">
<image mode="scaleToFill" class="icon" src="/static/security-check/safeSys.png" />
</view>
<view style="display: flex;margin-right:30px">
<text class="detail">{{news.rooms[0].name}}</text>
</view>
</view>
</view>
<view>
<image class="icon" src="../../static/security-check/safePerson.png">
<text class="detail">预约时间:{{news.created}}</text>
</view>
<view>
<image class="icon" src="../../static/security-check/safePerson.png">
<text class="detail">开始时间:{{news.startDate}}</text>
</view>
<view>
<image class="icon" src="../../static/security-check/safePerson.png">
<text class="detail">结束时间:{{news.finishDate}}</text>
</view>
</view>
</view>
<view class="ori" style="justify-content: space-between;padding-top: 20upx;padding-bottom: 20upx;">
<view class="ori">
<image class="icon" style="margin-left: 20px;" src="../../static/security-check/safePerson.png">
<text class="detail">审核状态:</text>
<text class="detail">{{news.statusName}}</text>
</view>
<view class="signin" hover-class="hover" @click="signIn(news)">
<text class="detail" style="color:#ffffff">签到</text>
</view>
</view>
</view>
</MescrollBody>
<FormAlert v-if="submitShow" name="课程签到" placeholder="确定进行上课签到吗?" @confirm="onSubmitClick" @cancel="cancel"></FormAlert>
<PopUp ref="popup" :isdistance="true"></PopUp>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
import FormAlert from "@/components/form-alert/h-form-alert.vue"
import PopUp from "@/components/popup/popup.vue"
export default {
mixins: [MescrollMixin],
data() {
return {
downOption: {
auto: false //是否在初始化后,自动执行downCallback; 默认true
},
dataList: [],
upOption: {
use: false, // 是否启用上拉加载; 默认true
},
submitShow:false
}
},
methods: {
onLoad() {
var that = this;
uni.$on('refreshTaskList', function(data) {
})
this.loadData();
},
onUnload() {
uni.$off('refreshTaskList', function(data) {})
},
/*下拉刷新的回调 */
downCallback() {
this.mescroll.endSuccess();
},
/*上拉加载的回调 */
upCallback(page) {
},
/*获取列表*/
loadData() {
uni.request({
url: this.GLOBALUTIL.url + '/openlab/v2/batch?owner='+this.GLOBALUTIL.user.id,
method: 'GET',
header: this.GLOBALUTIL.commonHeader,
success: (res) => {
var finalData = res.data.data;
finalData.map((opt)=>{
opt.labName = opt.labInfo == null?"":opt.labInfo.name
var statusName = "";
if(opt.status == "passed"){
statusName = "已通过"
}else if(opt.status == "reject"){
statusName = "不通过"
}else{
statusName = "待审核"
}
opt.statusName = statusName;
return opt;
})
this.dataList = finalData;
console.log(JSON.stringify(res))
}
})
},
signIn(data) {
this.submitShow = true;
},
cancel:function(){
this.submitShow = false;
},
onSubmitClick(){
this.submitShow = false;
uni.request({
url: '',
method: 'GET',
data: {},
success: res => {
},
fail: () => {},
complete: () => {}
});
this.$refs.popup.open({
type:'success',
content:'提交成功!',
timeout:1000,
isClick:false
});
}
},
components: {
MescrollBody,
PopUp,
FormAlert
},
}
</script>
<style>
/*展示上拉加载的数据列表*/
.news-li {
font-size: 32upx;
padding-right: 20upx;
padding-left: 20upx;
border-bottom: 1upx solid #eee;
width: calc(100%-40upx);
display: flex;
flex-direction: column;
background-color: #f5f5f5;
margin-top:30rpx;
}
.news-li .new-content {
font-size: 28upx;
margin-top: 10upx;
margin-left: 20upx;
color: #666;
}
.icon {
width: 20rpx;
height: 20rpx;
margin-right: 20rpx;
}
.cover {
width: 120upx;
height: 120upx;
border-radius: 60upx;
margin-left: 40upx;
margin-right: 20upx;
}
.top-container {
display: flex;
flex-direction: row;
align-items: center;
}
.status {
width: 170rpx;
height: 35rpx;
background-color: rgba(242, 115, 115, 0.10);
border-radius: 50rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 35rpx;
}
.status-finish {
width: 170rpx;
height: 35rpx;
background-color: rgba(47, 190, 178, 0.10);
border-radius: 50rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 35rpx;
}
.status-text {
color: #F27373;
font-size: 11px;
}
.status-finish-text {
color: #2FBEB2;
font-size: 11px;
}
.hover {
opacity: 0.7;
}
.title {
font-size: 17px;
font-weight: 300;
}
.des {
font-weight: 200;
font-size: 14px;
color: #676767
}
.detail {
font-size: 14px;
}
.type {
font-size: 14px;
}
.containter {
display: flex;
width: 100%;
background-color: #F5F5F5;
}
.labTitle{
}
.ori{
display: flex;
flex-direction: row;
align-items: center;
background-color: #FFFFFF;
width:100%
}
.signin {
width:200upx;
height:60upx;
background-color: #00CE47;
display: flex;
justify-content: center;
align-items: center;
margin-right: 40upx;
}
</style>
......@@ -29,7 +29,6 @@
onLoad() {
var that = this
uni.$on('rectificationListData', function(data) {
console.log("@@@@@@@@@@@@@@@" + JSON.stringify(data))
var detailData = data[0]
that.roomName = JSON.parse(detailData.room).name
that.description = detailData.description;
......
<template>
<view style="width: 100%;height: 100%;">
<Mescroll style="background-color: #F5F5F5;" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption"
@down="downCallback" @up="upCallback">
<view class="news-li" v-for="news in dataList" :key="news.id" hover-class="hover" @click="goDetail(news)">
......@@ -7,7 +8,7 @@
<view class="top-container">
<text class="title">{{news.description}}</text>
<view class="detailtext"><text class="titletext">实验室</text><text class="contenttext">{{JSON.parse(news.check_scope).name}}</text></view>
<view class="detailtext"><text class="titletext">负责人</text><text class="contenttext">{{news.manager?JSON.parse(news.manager).name:""}}</text></view>
<view class="detailtext"><text class="titletext">负责人</text><text class="contenttext">{{news.managerName}}</text></view>
<view class="detailtext"><text class="titletext">创建人</text><text class="contenttext">{{news.creator?JSON.parse(news.creator).name:""}}</text></view>
<view class="detailtext"><text class="titletextlong">创建时间</text><text class="contenttext">{{news.createTime}}</text></view>
<view class="detailtext"><text class="titletextlong">检查任务</text><text class="contenttext">{{news.check_task_code_name?news.check_task_code_name:""}}</text></view>
......@@ -64,12 +65,13 @@
</view>
</view>
</Drawer>
<Picker :mode="pickerMod" @confirm="onConfirm" ref="picker" themeColor="#f00" :selectList="itemList"></Picker>
</Mescroll>
</Mescroll>
<Picker :mode="pickerMod" @confirm="onConfirm" ref="picker" themeColor="#f00" :selectList="itemList"></Picker>
</view>
</template>
<script>
import Mescroll from "../../components/mescroll-uni/mescroll-body.vue"
import Mescroll from "@/components/mescroll-uni/mescroll-body.vue"
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import Drawer from '@/components/uni-drawer/uni-drawer.vue'
import Picker from "@/components/w-picker/w-picker.vue";
......@@ -85,7 +87,8 @@
data() {
return {
downOption: {
auto: false //是否在初始化后,自动执行downCallback; 默认true
auto: false, //是否在初始化后,自动执行downCallback; 默认true
use:true
},
dataList: [],
upOption: {
......@@ -139,7 +142,9 @@
this.showDrawer = false;
},
onNavigationBarButtonTap() {
this.showDrawer = true;
this.showDrawer = true;
this.downOption.use = false
console.log("f")
},
onLoad() {
this.loadData();
......@@ -157,25 +162,27 @@
/*获取列表*/
loadData() {
var body = {};
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
uni.request({
url: this.GLOBALUTIL.url + '/safety/v1/dangers?page_number=1&page_size=200' + this.filterBody,
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user': JSON.stringify(user)
},
header: this.GLOBALUTIL.commonHeader,
body: null,
success: (res) => {
var data = res.data.data;
success: (res) => {
console.log(res)
var data = res.data.data;
data.map((opt) => {
opt.createTime = this.GLOBALUTIL.moment(opt.created).format("YYYY-MM-DD HH:mm:ss")
opt.imgsrc = this.handleStatus(opt)
})
data.sort(sortFunction);
data.sort(sortFunction);
data.map((opt)=>{
var managerName = ""
if(opt.manager){
managerName = opt.manager !="" ? JSON.parse(opt.manager).name:""
}
opt.managerName = managerName;
return opt
})
this.dataList = data;
// console.log(JSON.stringify(data))
}
......@@ -259,17 +266,11 @@
},
getTaskList() {
var body = {};
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
uni.request({
url: this.GLOBALUTIL.url + '/safety/v1/check-tasks?page_size=200&page_number=1',
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user': JSON.stringify(user)
},
header: this.GLOBALUTIL.commonHeader,
body: null,
success: (res) => {
var data = res.data.data;
......@@ -286,17 +287,10 @@
},
getLabList() {
var body = {};
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
uni.request({
url: this.GLOBALUTIL.url + '/education-manage/v1/experiment-centers?page_number=1&page_size=100&_=1539337073882',
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user': JSON.stringify(user)
},
header: this.GLOBALUTIL.commonHeader,
body: null,
success: (res) => {
var data = res.data.data;
......
......@@ -28,14 +28,16 @@
</button>
<ActionSheet :show="showActionSheet" :tips="tips" :item-list="itemList" :mask-closable="maskClosable"
:color="color" :size="size" :is-cancel="isCancel" @click="itemClick" @cancel="closeActionSheet"></ActionSheet>
<form-alert v-if="submitShow" name="检查对象" placeholder="确定提交所填的数据?" @confirm="onSubmitClick" @cancel="cancel"></form-alert>
<FormAlert v-if="submitShow" name="检查对象" placeholder="确定提交所填的数据?" @confirm="onSubmitClick" @cancel="cancel"></FormAlert>
<PopUp ref="popup" :isdistance="true"></PopUp>
</view>
</template>
<script>
import ActionSheet from "@/components/actionsheet/actionsheet.vue"
import AddressSelect from "@/components/multi-select/cityChiden.vue"
import AddressSelect from "@/components/multi-select/cityChiden.vue"
import PopUp from "@/components/popup/popup.vue"
import FormAlert from "@/components/form-alert/h-form-alert.vue"
import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
export default {
data() {
......@@ -155,16 +157,12 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
console.log(JSON.stringify(body))
console.log(JSON.stringify(body))
uni.request({
url: this.GLOBALUTIL.url+'/safety/v1/danger',
method: this.submitMethod,
data:JSON.stringify(body),
header: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'user' : JSON.stringify(user)
},
data: JSON.stringify(body),
header: this.GLOBALUTIL.commonHeader,
success: (res) => {
console.log(JSON.stringify(res))
if(res.statusCode == 200){
......@@ -252,7 +250,9 @@ import uniNavBar from "@/components/uni-header/uni-nav-bar/uni-nav-bar.vue"
components: {
ActionSheet,
AddressSelect,
uniNavBar
uniNavBar,
PopUp,
FormAlert
},
}
</script>
......
<template>
<mescroll-body class="containter" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback"
<MescrollBody class="containter" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback"
@up="upCallback">
<view v-if="isShow" class="news-li" v-for="(item,index) in dataList" :key="index">
<view>
......@@ -22,13 +22,16 @@
<button hover-class="submithover" @click="showModal" class="submit-button">
<text class="submittext">提交</text>
</button>
<form-alert v-if="submitShow" name="检查对象" placeholder="确定提交所填的数据?" @confirm="onSubmitClick" @cancel="cancel"></form-alert>
<FormAlert v-if="submitShow" name="检查对象" placeholder="确定提交所填的数据?" @confirm="onSubmitClick" @cancel="cancel"></FormAlert>
<PopUp ref="popup" :isdistance="true"></PopUp>
</mescroll-body>
</MescrollBody>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
import PopUp from "@/components/popup/popup.vue"
import FormAlert from "@/components/form-alert/h-form-alert.vue"
export default {
mixins: [MescrollMixin],
data() {
......@@ -54,10 +57,18 @@
},
showModal: function() {
this.submitShow = true;
},
onNavigationBarButtonTap() {
console.log(JSON.stringify(this.objectData))
uni.navigateTo({
url:"../Danger-Source/danger-list?labSite="+this.objectData.site_id
})
uni.$emit("queryDangerList",[this.objectData])
},
onLoad() {
var that = this;
uni.$on('sendCheckItem', function(data) {
uni.$on('sendCheckItem', function(data) {
console.log(JSON.stringify(data))
that.objectData = data[0]
that.taskId = data[2];
var content = data[1].children
......@@ -96,7 +107,7 @@
}
this.checkResult[index].result_type = JSON.stringify(res);
this.$forceUpdate();
console.log(JSON.stringify(this.checkResult))
// console.log(JSON.stringify(this.checkResult))
},
checkItem(item) {
uni.navigateTo({
......@@ -112,13 +123,10 @@
url: this.GLOBALUTIL.url +
'/base-data/v1/dict-items?sort_property=ID&sort_direction=ASC&dict_code=JCJG&page_number=1&page_size=10',
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user': JSON.stringify(user)
},
header: this.GLOBALUTIL.commonHeader,
body: null,
success: (res) => {
success: (res) => {
// console.log(JSON.stringify(res))
this.dataList.map((opt) => {
opt.checkitems = res.data.data;
})
......@@ -157,13 +165,9 @@
url: this.GLOBALUTIL.url + '/safety/v1/check-result',
method: 'POST',
data: JSON.stringify(body),
header: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'user': JSON.stringify(user)
},
header:this.GLOBALUTIL.commonHeader,
success: (res) => {
console.log(JSON.stringify(res))
console.log(JSON.stringify(res))
if (res.statusCode == 200) {
uni.$emit("refreshTaskList")
this.$refs.popup.open({
......@@ -181,7 +185,12 @@
}
})
}
}
},
components: {
PopUp,
FormAlert,
MescrollBody
},
}
</script>
......
<template>
<mescroll-body class="containter" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback"
<MescrollBody class="containter" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback"
@up="upCallback">
<view class="news-li" v-for="news in dataList" :key="news.id" hover-class="hover" @click="goDetail(news)">
<view class="top-container">
......@@ -27,11 +27,12 @@
</view>
<view><text class="type">{{news.taskTypeTitle}}</text></view>
</view>
</mescroll-body>
</MescrollBody>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
export default {
mixins: [MescrollMixin],
data() {
......@@ -67,17 +68,14 @@
/*获取列表*/
loadData() {
var body = {};
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
// var user = {};
// user.id = this.GLOBALUTIL.user.userid;
// user.name = encodeURI(this.GLOBALUTIL.user.username);
console.log(this.GLOBALUTIL.commonHeader)
uni.request({
url: this.GLOBALUTIL.url + '/safety/v1/check-tasks?page_size=200&page_number=1',
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user': JSON.stringify(user)
},
header: this.GLOBALUTIL.commonHeader,
body: null,
success: (res) => {
console.log(JSON.stringify(res))
......@@ -130,7 +128,10 @@
url: "./select-checkobject?taskId=" + data.id
})
}
}
},
components: {
MescrollBody
},
}
</script>
......
......@@ -47,18 +47,34 @@
closeActionSheet: function() {
this.showActionSheet = false
},
onConfirm(data) {
if (this.curType == "object") {
this.selObject = data.checkArr.value;
this.selObjectText = data.checkArr.label;
this.itemarr = [];
this.selectItem = "";
this.selectItemText = "";
this.loadItemData();
} else {
this.selectItem = data.checkArr.value;
this.selectItemText = data.checkArr.label;
onConfirm(data) {
if(data.checkArr){
if (this.curType == "object") {
this.selObject = data.checkArr.value;
this.selObjectText = data.checkArr.label;
this.itemarr = [];
this.selectItem = "";
this.selectItemText = "";
this.loadItemData();
} else {
this.selectItem = data.checkArr.value;
this.selectItemText = data.checkArr.label;
}
}else{
var realData = data.target["__args__"][0]
if (this.curType == "object") {
this.selObject = realData.checkArr.value;
this.selObjectText = realData.checkArr.label;
this.itemarr = [];
this.selectItem = "";
this.selectItemText = "";
this.loadItemData();
} else {
this.selectItem = realData.checkArr.value;
this.selectItemText = realData.checkArr.label;
}
}
},
onSubmitClick() {
var objectData = this.findObjectData();
......@@ -88,11 +104,7 @@
uni.request({
url: this.GLOBALUTIL.url + '/safety/v1/check-task-scope/' + this.taskId,
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user': JSON.stringify(user)
},
header:this.GLOBALUTIL.commonHeader,
body: null,
success: (res) => {
var data = res.data;
......@@ -117,11 +129,7 @@
uni.request({
url: this.GLOBALUTIL.url + '/safety/v1/check-task-lists/' + this.taskId + "?check_site_id=" + this.selObject,
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user': JSON.stringify(user)
},
header: this.GLOBALUTIL.commonHeader,
body: null,
success: (res) => {
var data = res.data;
......
......@@ -11,7 +11,7 @@
<text class="datacontent">{{curTask.name}}</text>
<image class="tip" src="../../static/common/arrow_right_gray.png">
</view>
</view>
</view>
<view class="item" hover-class="hover" @click="showObjectPicker">
<text class="title" style="margin-top: 30rpx;">检查对象</text>
<view class="selcontent">
......@@ -72,15 +72,8 @@
</scroll-view>
<ActionSheet :show="showActionSheet" :tips="tips" :item-list="actionList" :mask-closable="maskClosable"
:color="color" :size="size" :is-cancel="isCancel" @click="itemClick" @cancel="closeActionSheet"></ActionSheet>
<Picker
mode="linkage"
:level="1"
@confirm="onConfirm"
ref="picker"
:linkList="itemList"
themeColor="#f00"
></Picker>
<form-alert v-if="submitShow" name="整改项提交" placeholder="确定提交所填的数据?" @confirm="onSubmitClick" @cancel="cancel"></form-alert>
<Picker mode="selector" @confirm="onConfirm" ref="picker" themeColor="#f00" :selectList="itemList"></Picker>
<FormAlert v-if="submitShow" name="整改项提交" placeholder="确定提交所填的数据?" @confirm="onSubmitClick" @cancel="cancel"></FormAlert>
<PopUp ref="popup" :isdistance="true"></PopUp>
</view>
</template>
......@@ -88,7 +81,9 @@
<script>
import ActionSheet from "@/components/actionsheet/actionsheet.vue"
import AddressSelect from "@/components/multi-select/cityChiden.vue"
import Picker from "@/components/w-picker/w-picker.vue";
import Picker from "@/components/w-picker/w-picker.vue";
import PopUp from "@/components/popup/popup.vue"
import FormAlert from "@/components/form-alert/h-form-alert.vue"
export default {
data() {
return {
......@@ -182,12 +177,9 @@ import Picker from "@/components/w-picker/w-picker.vue";
url: this.GLOBALUTIL.url+'/safety/v1/danger',
method: 'POST',
data:bd,
header: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'user' : JSON.stringify(user)
},
success: (res) => {
header: this.GLOBALUTIL.commonHeader,
success: (res) => {
console.log(res);
if(res.statusCode == 200){
this.$refs.popup.open({
type:'success',
......@@ -289,30 +281,60 @@ import Picker from "@/components/w-picker/w-picker.vue";
}
})
this.$refs.picker.show()
},
clearCheckItem(){
this.curItemType = {};
this.curItem = {};
},
onConfirm(data){
console.log(JSON.stringify(data))
if(this.curPicker == "task"){
this.curTask = {"name":data.checkArr[0],value:data.checkValue[0]}
this.loadTaskObject();
}else if(this.curPicker == "object"){
this.curObject = {"name":data.checkArr[0],value:data.checkValue[0]}
this.objectData.map((opt)=>{
if(opt.id == this.curObject.value){
if(opt.type == "site"){
this.addressType = "site";
this.address = opt.name
}
this.curCheckScope = opt;
this.room = opt
}
})
this.loadItemTypeData();
}else if (this.curPicker == "type"){
this.curItemType = {"name":data.checkArr[0],value:data.checkValue[0]}
}else{
this.curItem = {"name":data.checkArr[0],value:data.checkValue[0]}
}
onConfirm(data){
if(data.checkArr){
if(this.curPicker == "task"){
this.curTask = {"name":data.checkArr.label,value:data.checkArr.value}
this.loadTaskObject();
this.clearCheckItem()
}else if(this.curPicker == "object"){
this.curObject = {"name":data.checkArr.label,value:data.checkArr.value}
this.objectData.map((opt)=>{
if(opt.id == this.curObject.value){
if(opt.type == "site"){
this.addressType = "site";
this.address = opt.name
}
this.curCheckScope = opt;
this.room = opt
}
})
this.loadItemTypeData();
}else if (this.curPicker == "type"){
this.curItemType = {"name":data.checkArr.label,value:data.checkArr.value}
}else{
this.curItem = {"name":data.checkArr.label,value:data.checkArr.value}
}
}else{
var realData = data.target["__args__"][0]
if(this.curPicker == "task"){
this.curTask = {"name":realData.checkArr.label,value:realData.checkArr.value}
this.loadTaskObject();
this.clearCheckItem()
}else if(this.curPicker == "object"){
this.curObject = {"name":realData.checkArr.label,value:realData.checkArr.value}
this.objectData.map((opt)=>{
if(opt.id == this.curObject.value){
if(opt.type == "site"){
this.addressType = "site";
this.address = opt.name
}
this.curCheckScope = opt;
this.room = opt
}
})
this.loadItemTypeData();
}else if (this.curPicker == "type"){
this.curItemType = {"name":realData.checkArr.label,value:realData.checkArr.value}
}else{
this.curItem = {"name":realData.checkArr.label,value:realData.checkArr.value}
}
}
},
showAddressSel(){
if(this.addressType == "site"){
......@@ -327,65 +349,53 @@ import Picker from "@/components/w-picker/w-picker.vue";
var body = {};
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
user.name = encodeURI(this.GLOBALUTIL.user.username);
console.log(JSON.stringify(this.GLOBALUTIL.commonHeader))
uni.request({
url: this.GLOBALUTIL.url+'/safety/v1/check-tasks?page_size=200&page_number=1',
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user' : JSON.stringify(user)
},
header: this.GLOBALUTIL.commonHeader,
body:null,
success: (res) => {
success: (res) => {
console.log(JSON.stringify(res))
var data = res.data.data;
var itemList = data.map((opt)=>{
return {label:opt.name,value:opt.id};
})
this.tasklist = itemList;
this.taskList = itemList;
this.itemList = itemList;
}
})
},
//任务对象
loadTaskObject(){
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
loadTaskObject(){
console.log(JSON.stringify(this.GLOBALUTIL.commonHeader))
uni.request({
url: this.GLOBALUTIL.url+'/safety/v1/check-task-scope/'+this.curTask.value,
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user' : JSON.stringify(user)
},
header: this.GLOBALUTIL.commonHeader,
body:null,
success: (res) => {
success: (res) => {
// console.log(res)
var data = res.data;
this.objectData = data;
var itemList = data.map((opt)=>{
return {label:opt.name,value:opt.id};
return {"label":opt.name,"value":opt.id};
})
this.objectList = itemList;
this.itemList = itemList;
}
})
},
loadItemTypeData(){
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
loadItemTypeData(){
console.log(this.GLOBALUTIL.url+'/safety/v1/check-task-lists/'+this.curTask.value+"?check_site_id="+this.curCheckScope.id)
uni.request({
url: this.GLOBALUTIL.url+'/safety/v1/check-task-lists/'+this.curTask.value+"?check_site_id="+this.selObject,
url: this.GLOBALUTIL.url+'/safety/v1/check-task-lists/'+this.curTask.value+"?check_site_id="+this.curCheckScope.id,
method: 'GET',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'user' : JSON.stringify(user)
},
header: this.GLOBALUTIL.commonHeader,
body:null,
success: (res) => {
success: (res) => {
console.log(res)
var data = res.data;
this.itemData = data;
var itemList = data.map((opt)=>{
......@@ -402,7 +412,9 @@ import Picker from "@/components/w-picker/w-picker.vue";
components: {
ActionSheet,
AddressSelect,
Picker,
Picker,
FormAlert,
PopUp
},
}
</script>
......
......@@ -11,7 +11,7 @@
</view>
</view>
<view class="btn-row">
<button type="primary" class="primary" @tap="bindLogin">登录</button>
<button type="primary" class="primary" @tap="logIntoZF">登录</button>
</view>
<view class="action-row">
<navigator url="../reg/reg">注册账号</navigator>
......@@ -46,9 +46,10 @@
return {
providerList: [],
hasProvider: false,
account: '20040998',
// account:"20190071",
password: 'password',
// account: '19970093',
// password: 'password',
account:"sysadmin",
password:"sysadmin",
positionTop: 0,
isDevtools: false,
}
......@@ -68,7 +69,37 @@
this.positionTop = uni.getSystemInfoSync().windowHeight - 100;
},
invokeServer(body) {
console.log(this.GLOBALUTIL.user)
var form = [];
for(let i in body){
if(body.hasOwnProperty(i)){
form.push(i+'='+encodeURI(body[i]));
}
}
var bodyStr = form.join("&");
uni.request({
url: this.GLOBALUTIL.url+'/api/login', //仅为示例,并非真实接口地址。
method: 'POST',
data: body,
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
},
success: (res) => {
console.log(JSON.stringify(res));
var user = {};
user.id = res.data.userId;
user.name = res.data.username;
this.GLOBALUTIL.user = user
this.GLOBALUTIL.commonHeader["x-auth-token"] = res.data.token;
this.GLOBALUTIL.commonHeader["user"] = JSON.stringify(user);
this.text = 'request success';
uni.reLaunch({
url: '../main/main',
});
}
})
},
invokeServerYNU(body) {
var form = [];
for(let i in body){
if(body.hasOwnProperty(i)){
......@@ -85,10 +116,17 @@
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
},
success: (res) => {
console.log(JSON.stringify(res))
console.log(JSON.stringify(res));
this.GLOBALUTIL.user = res.data.loginresponse
var user = {};
user.id = this.GLOBALUTIL.user.userid;
user.name = encodeURI(this.GLOBALUTIL.user.username);
this.GLOBALUTIL.user = user;
// this.GLOBALUTIL.commonHeader["x-auth-token"] = res.data.token;
this.GLOBALUTIL.commonHeader["user"] = JSON.stringify(user);
// this.GLOBALUTIL.commonHeader
this.text = 'request success';
console.log(res.data.loginresponse)
// console.log(res.data.loginresponse)
uni.reLaunch({
url: '../main/main',
});
......@@ -114,7 +152,8 @@
}
this.invokeServer({
username : this.account,
password : sha256(this.password),
password : sha256(this.password),
tenant:"",
type : type,
command : 'cppLogin',
response : 'json'
......@@ -173,6 +212,61 @@
uni.navigateBack();
}
},
logIntoYNU(){
var type = 0;
var emailReg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; //邮箱
var phoneReg = /^1[34578]\d{9}$/; //手机
var idcnReg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; //身份证
var sidnReg = /^[A-Za-z0-9]{4,20}$/; //学号/工号(由字母、数字组成,4-20位)
if (emailReg.test(this.account)) {
type = 0;
} else if (phoneReg.test(this.account)) {
type = 1;
} else if (idcnReg.test(this.account)) {
type = 2;
} else if (sidnReg.test(this.account)) {
type = 3;
} else {
type = 4;
}
this.invokeServerYNU({
username : this.account,
password : sha256(this.password),
tenant:"",
type : type,
command : 'cppLogin',
response : 'json'
});
return
},
logIntoZF(){
var type = 0;
var emailReg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; //邮箱
var phoneReg = /^1[34578]\d{9}$/; //手机
var idcnReg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; //身份证
var sidnReg = /^[A-Za-z0-9]{4,20}$/; //学号/工号(由字母、数字组成,4-20位)
if (emailReg.test(this.account)) {
type = 0;
} else if (phoneReg.test(this.account)) {
type = 1;
} else if (idcnReg.test(this.account)) {
type = 2;
} else if (sidnReg.test(this.account)) {
type = 3;
} else {
type = 4;
}
this.invokeServer({
username : this.account,
password : this.password,
tenant:"",
type : type,
command : 'cppLogin',
response : 'json'
});
return
}
},
onReady() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment