手机端评估培训
This commit is contained in:
parent
71db2fed0c
commit
b767e94406
3
app.json
3
app.json
|
@ -83,7 +83,8 @@
|
||||||
"pages/operins/index",
|
"pages/operins/index",
|
||||||
"pages/inspect/index2",
|
"pages/inspect/index2",
|
||||||
"pages/inspect/detail2",
|
"pages/inspect/detail2",
|
||||||
"pages/inspect/handle"
|
"pages/inspect/handle",
|
||||||
|
"pages/train/access"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"backgroundTextStyle": "light",
|
"backgroundTextStyle": "light",
|
||||||
|
|
|
@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
|
@ -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>
|
|
@ -0,0 +1,5 @@
|
||||||
|
/* pages/train/access.wxss */
|
||||||
|
.weui-btn{
|
||||||
|
width:auto;
|
||||||
|
margin: 5px;
|
||||||
|
}
|
|
@ -136,7 +136,7 @@
|
||||||
<view class="weui-label">培训时长</view>
|
<view class="weui-label">培训时长</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="weui-cell__bd">
|
<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>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -29,7 +29,6 @@ Page({
|
||||||
title: '成功,正在打开...',
|
title: '成功,正在打开...',
|
||||||
})
|
})
|
||||||
const filePath = res.tempFilePath
|
const filePath = res.tempFilePath
|
||||||
console.log(filePath)
|
|
||||||
var filetype
|
var filetype
|
||||||
let tpurls = []
|
let tpurls = []
|
||||||
if (fileurl.indexOf(".docx") != -1) {
|
if (fileurl.indexOf(".docx") != -1) {
|
||||||
|
@ -74,9 +73,7 @@ Page({
|
||||||
filePath,
|
filePath,
|
||||||
fileType: filetype,
|
fileType: filetype,
|
||||||
success(res) {
|
success(res) {
|
||||||
console.log('打开文档成功')
|
|
||||||
}, fail: function (e) {
|
}, fail: function (e) {
|
||||||
console.log(e)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -95,7 +92,6 @@ Page({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(options.trainid)
|
|
||||||
that.getPx(options.trainid)
|
that.getPx(options.trainid)
|
||||||
},
|
},
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
|
@ -136,7 +132,6 @@ Page({
|
||||||
}
|
}
|
||||||
pxdata.material = material
|
pxdata.material = material
|
||||||
pxdata.matershow = material[0].name
|
pxdata.matershow = material[0].name
|
||||||
console.log(pxdata.material)
|
|
||||||
this.setData(pxdata)
|
this.setData(pxdata)
|
||||||
|
|
||||||
//console.log(this.data.yhzt)
|
//console.log(this.data.yhzt)
|
||||||
|
|
|
@ -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,
|
||||||
|
})
|
||||||
|
}
|
||||||
});
|
});
|
|
@ -24,15 +24,15 @@
|
||||||
<view class="weui-media-box__desc">{{item.trainplace}}-{{item.starttime}}</view>
|
<view class="weui-media-box__desc">{{item.trainplace}}-{{item.starttime}}</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
<view class="weui-panel__ft weui-cell__ft_in-access">
|
<view class="weui-panel__ft">
|
||||||
<view class="weui-media-box__title">
|
<view class="weui-media-box__title">
|
||||||
<view wx:if="{{item.state == 0}}">待评估</view>
|
<view wx:if="{{item.state == 0}}">待评估</view>
|
||||||
<view wx:if="{{item.state == 1}}" style="color:white;background-color:green">已关闭</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}}">
|
<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>
|
</view>
|
||||||
</navigator>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- <view wx:if="{{item.todouser__name != null}}">
|
<!-- <view wx:if="{{item.todouser__name != null}}">
|
||||||
<view class="weui-media-box__desc">{{item.todouser__name}}</view>
|
<view class="weui-media-box__desc">{{item.todouser__name}}</view>
|
||||||
|
|
|
@ -1,59 +1,59 @@
|
||||||
{
|
{
|
||||||
"description": "项目配置文件。",
|
"description": "项目配置文件。",
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": false,
|
"urlCheck": false,
|
||||||
"es6": true,
|
"es6": true,
|
||||||
"enhance": false,
|
"enhance": false,
|
||||||
"postcss": true,
|
"postcss": true,
|
||||||
"preloadBackgroundData": false,
|
"preloadBackgroundData": false,
|
||||||
"minified": true,
|
"minified": true,
|
||||||
"newFeature": true,
|
"newFeature": true,
|
||||||
"coverView": true,
|
"coverView": true,
|
||||||
"nodeModules": true,
|
"nodeModules": true,
|
||||||
"autoAudits": false,
|
"autoAudits": false,
|
||||||
"showShadowRootInWxmlPanel": true,
|
"showShadowRootInWxmlPanel": true,
|
||||||
"scopeDataCheck": false,
|
"scopeDataCheck": false,
|
||||||
"uglifyFileName": false,
|
"uglifyFileName": false,
|
||||||
"checkInvalidKey": true,
|
"checkInvalidKey": true,
|
||||||
"checkSiteMap": true,
|
"checkSiteMap": true,
|
||||||
"uploadWithSourceMap": true,
|
"uploadWithSourceMap": true,
|
||||||
"compileHotReLoad": false,
|
"compileHotReLoad": false,
|
||||||
"babelSetting": {
|
"useMultiFrameRuntime": false,
|
||||||
"ignore": [],
|
"useApiHook": true,
|
||||||
"disablePlugins": [],
|
"babelSetting": {
|
||||||
"outputPath": ""
|
"ignore": [],
|
||||||
},
|
"disablePlugins": [],
|
||||||
"useIsolateContext": true,
|
"outputPath": ""
|
||||||
"useCompilerModule": false,
|
},
|
||||||
"userConfirmedUseCompilerModuleSwitch": false,
|
"useIsolateContext": true,
|
||||||
"useMultiFrameRuntime": false,
|
"useCompilerModule": false,
|
||||||
"useApiHook": true,
|
"userConfirmedUseCompilerModuleSwitch": false,
|
||||||
"packNpmManually": false,
|
"userConfirmedBundleSwitch": false,
|
||||||
"packNpmRelationList": []
|
"packNpmManually": false,
|
||||||
},
|
"packNpmRelationList": [],
|
||||||
"compileType": "miniprogram",
|
"minifyWXSS": true,
|
||||||
"libVersion": "2.9.4",
|
"bundle": false
|
||||||
"appid": "wx5c39b569f01c27db",
|
},
|
||||||
"projectname": "aqyj",
|
"compileType": "miniprogram",
|
||||||
"isGameTourist": false,
|
"libVersion": "2.9.4",
|
||||||
"simulatorType": "wechat",
|
"appid": "wx5c39b569f01c27db",
|
||||||
"simulatorPluginLibVersion": {},
|
"projectname": "aqyj",
|
||||||
"condition": {
|
"isGameTourist": false,
|
||||||
"search": {
|
"simulatorType": "wechat",
|
||||||
"current": -1,
|
"simulatorPluginLibVersion": {},
|
||||||
"list": []
|
"condition": {
|
||||||
},
|
"search": {
|
||||||
"conversation": {
|
"list": []
|
||||||
"current": -1,
|
},
|
||||||
"list": []
|
"conversation": {
|
||||||
},
|
"list": []
|
||||||
"game": {
|
},
|
||||||
"currentL": -1,
|
"game": {
|
||||||
"list": []
|
"currentL": -1,
|
||||||
},
|
"list": []
|
||||||
"miniprogram": {
|
},
|
||||||
"current": -1,
|
"miniprogram": {
|
||||||
"list": []
|
"list": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue