手机端评估培训

This commit is contained in:
caoqianming 2021-01-05 17:13:53 +08:00
parent 71db2fed0c
commit b767e94406
10 changed files with 258 additions and 68 deletions

View File

@ -83,7 +83,8 @@
"pages/operins/index",
"pages/inspect/index2",
"pages/inspect/detail2",
"pages/inspect/handle"
"pages/inspect/handle",
"pages/train/access"
],
"window": {
"backgroundTextStyle": "light",

135
pages/train/access.js Normal file
View File

@ -0,0 +1,135 @@
// pages/train/access.js
Page({
/**
* 页面的初始数据
*/
data: {
},
bindzwrsInput: function (e) {
this.data.knownum = e.detail.value
},
bindpxscInput: function (e) {
this.data.duration = e.detail.value
},
bindpxxgInput: function (e) {
this.data.pxxg = e.detail.value
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
trainname:options.trainname,
pxid:options.pxid
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
submit: function () {
var that = this;
if (!that.data.duration) {
that.Tap1('请输入培训时长!')
}
else if (!that.data.knownum) {
that.Tap1('请输入掌握人数!')
} else if (!that.data.pxxg) {
that.Tap1('请输入培训效果!')
} else {
that.accesspx()
}
},
Tap1: function (x) {
wx.showModal({
title: "系统提示",
content: x,
showCancel: false,
confirmText: "确定"
})
},
accesspx: function () {
// let pxlx = []
// let x = this.data.pxlxArray
// for (var i = 0, len = x.length; i < len; ++i) {
// if (x[i].checked = true) {
// pxlx.push(x[i].id)
// }
// }
var pxdata = {
trainid: this.data.pxid,
duration: this.data.duration,
knownum: this.data.knownum,
pxxg: this.data.pxxg
}
wx.showLoading({
title: '正在提交...',
})
wx.request({
url: getApp().globalData.serverUrl + 'accesstrain?trainid='+this.data.pxid,
header: {
'content-type': 'application/x-www-form-urlencoded', //
'Cookie': getApp().globalData.sessionId,
},
method: 'POST',
data: pxdata,
success: res => {
if (res.statusCode === 200) {
wx.hideLoading();
wx.navigateBack()
}
}
});
}
})

3
pages/train/access.json Normal file
View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

41
pages/train/access.wxml Normal file
View File

@ -0,0 +1,41 @@
<view class="page">
<view class="page__bd">
<view class="weui-cells weui-cells_after-title" style="margin-top:6px">
<navigator class="weui-cell weui-cell_access" url="detail?trainid={{pxid}}">
<view class="weui-cell__bd weui-cell_primary">
<view>培训名称</view>
</view>
<view class="weui-cell__ft weui-cell__ft_in-access">
{{trainname}}
</view>
</navigator>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__hd weui-cell_primary">
<view class="weui-label">培训时长</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" placeholder="请输入数字" bindinput="bindpxscInput" type="digit"/>
</view>
</view>
<view class="weui-cell weui-cell_access">
<view class="weui-cell__hd weui-cell_primary">
<view class="weui-label">掌握人数</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" placeholder="请输入数字" bindinput="bindzwrsInput" type="number"/>
</view>
</view>
<view class="weui-cell">
<view class="weui-cell__hd weui-cell_primary">
<view class="weui-label">培训效果</view>
</view>
<view class="weui-cell__bd">
<textarea class="weui-textarea" placeholder="请输入描述" style="height: 3.3em" bindinput="bindpxxgInput" />
</view>
</view>
</view>
<button class="weui-btn" type="primary" bindtap="submit">提交</button>
</view>
</view>

5
pages/train/access.wxss Normal file
View File

@ -0,0 +1,5 @@
/* pages/train/access.wxss */
.weui-btn{
width:auto;
margin: 5px;
}

View File

@ -136,7 +136,7 @@
<view class="weui-label">培训时长</view>
</view>
<view class="weui-cell__bd">
<input class="weui-input" placeholder="请输入数字(小时)" bindinput="bindpxscInput" />
<input class="weui-input" placeholder="请输入数字(小时)" bindinput="bindpxscInput" type="digit"/>
</view>
</view>
</view>

View File

@ -29,7 +29,6 @@ Page({
title: '成功,正在打开...',
})
const filePath = res.tempFilePath
console.log(filePath)
var filetype
let tpurls = []
if (fileurl.indexOf(".docx") != -1) {
@ -74,9 +73,7 @@ Page({
filePath,
fileType: filetype,
success(res) {
console.log('打开文档成功')
}, fail: function (e) {
console.log(e)
}
})
}
@ -95,7 +92,6 @@ Page({
});
}
});
console.log(options.trainid)
that.getPx(options.trainid)
},
onShow: function () {
@ -136,7 +132,6 @@ Page({
}
pxdata.material = material
pxdata.matershow = material[0].name
console.log(pxdata.material)
this.setData(pxdata)
//console.log(this.data.yhzt)

View File

@ -247,4 +247,14 @@ Page({
}
})
},
openQr: function(e){
wx.navigateTo({
url: 'qrcode?pxid='+e.currentTarget.dataset.id,
})
},
accessTrain: function(e){
wx.navigateTo({
url: 'access?pxid='+e.currentTarget.dataset.id+'&trainname='+e.currentTarget.dataset.trainname,
})
}
});

View File

@ -24,15 +24,15 @@
<view class="weui-media-box__desc">{{item.trainplace}}-{{item.starttime}}</view>
</navigator>
</view>
<view class="weui-panel__ft weui-cell__ft_in-access">
<view class="weui-panel__ft">
<view class="weui-media-box__title">
<view wx:if="{{item.state == 0}}">待评估</view>
<view wx:if="{{item.state == 1}}" style="color:white;background-color:green">已关闭</view>
<navigator url='qrcode?pxid={{item.trainid}}'>
<view wx:if="{{item.state == 0}}">
<button class="weui-btn mini-btn" type="primary" size="mini">签到二维码</button>
<button class="weui-btn mini-btn" size="mini" bindtap="openQr" data-id="{{item.trainid}}">签到二维码</button>
<button class="weui-btn mini-btn" type="primary" size="mini" bindtap="accessTrain" data-id="{{item.trainid}}" data-trainname="{{item.trainname}}">评估</button>
</view>
</navigator>
</view>
<!-- <view wx:if="{{item.todouser__name != null}}">
<view class="weui-media-box__desc">{{item.todouser__name}}</view>

View File

@ -18,6 +18,8 @@
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": false,
"useApiHook": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
@ -26,10 +28,11 @@
"useIsolateContext": true,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false,
"useMultiFrameRuntime": false,
"useApiHook": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": []
"packNpmRelationList": [],
"minifyWXSS": true,
"bundle": false
},
"compileType": "miniprogram",
"libVersion": "2.9.4",
@ -40,11 +43,9 @@
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
@ -52,7 +53,6 @@
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}