@@ -1,46 +1,42 @@ | |||
<template> | |||
<view class="page"> | |||
<view class="btn scanCodeBtn" @click="tapScan">扫码</view> | |||
<scanCode ref="refScanCode"></scanCode> | |||
</view> | |||
<view class=""><view class="btn" @click="tabCode">扫码</view></view> | |||
</template> | |||
<script> | |||
import scanCode from "@/components/scanCode.vue" | |||
import scanCodeFun from '@/common/js/scanCodeFun.js'; | |||
export default { | |||
components:{scanCode}, | |||
data() { | |||
return {}; | |||
}, | |||
methods: { | |||
tapScan() { | |||
this.$refs['refScanCode'].scanCode().then(res=>{ | |||
if (!res) return; | |||
var userInfo = this.GET_GLOBAL("loginUser"); | |||
var result = this.HTTP_GET( | |||
"learun/adms/EducationalAdministration/StuInfoBasic/stuinfo", | |||
{ | |||
userid: userInfo.userId, | |||
meetid: res.result, | |||
}, | |||
"扫码出错" | |||
).then(res1=>{ | |||
this.TOAST(res1.result) | |||
data() { | |||
return {}; | |||
}, | |||
methods: { | |||
init() { | |||
let _this = this; | |||
// 允许从相机和相册扫码 | |||
scanCodeFun.scanCodeFun().then(res => { | |||
//console.log(res); | |||
if(!res) return | |||
_this.LOADING('正在提交数据…'); | |||
_this.HTTP_GET('learun/adms/EducationalAdministration/StuInfoBasic/stuinfo', res.result, '加载数据时出错').then(res => { | |||
_this.HIDE_LOADING(); | |||
//console.log(res); | |||
if(res){ | |||
let url = res.HealthStatus == '0'? '../StudentQRCode/Normal/list' : res.HealthStatus == '1'? '../StudentQRCode/AbNormalWeak/list' : res.HealthStatus == '2'? '../StudentQRCode/AbNormalSerious/list' : '../StudentQRCode/Normal/list'; | |||
_this.NAV_TO(url, {stuNo:res.StuNo}, true); | |||
} | |||
}) | |||
}) | |||
}) | |||
}, | |||
}, | |||
}, | |||
tabCode() { | |||
this.init(); | |||
} | |||
}, | |||
mounted() { | |||
let _this = this; | |||
setTimeout(function() { | |||
_this.init(); | |||
}, 100); | |||
} | |||
}; | |||
</script> | |||
<style lang="less" scoped> | |||
@import "~@/common/css/sidepage.less"; | |||
@import "~@/common/css/customlist.less"; | |||
.scanCodeBtn{ | |||
width: 120px; | |||
height: 120px; | |||
border-radius: 50%; | |||
line-height: 120px; | |||
margin-top: 180px; | |||
} | |||
</style> | |||
<style></style> |
@@ -264,8 +264,16 @@ export default{ | |||
getpayfeetotal(){ | |||
let value = 0 | |||
this.FinaChargesStandardList.map(item=>{ | |||
let strValue = item.SJAmount.toString() | |||
// if(strValue.split(".")[1]&&strValue.split(".")[1].length>2){ | |||
// item.SJAmount = strValue.match(/^\d+(?:\.\d{0,2})?/) | |||
// } | |||
if(/^-?\d+(,\d{3})*(\.\d{1,2})?$/.test(item.SJAmount)){ | |||
value += Number(item.SJAmount) | |||
if(strValue.indexOf(".") == -1&&Number(item.SJAmount)%1 === 0){ | |||
item.SJAmount = Number(item.SJAmount) | |||
} | |||
value = this.numSub(value,Number(item.SJAmount)) | |||
// value += Number(item.SJAmount) | |||
} | |||
}) | |||
this.payfeetotal = value | |||
@@ -280,6 +288,23 @@ export default{ | |||
}) | |||
this.item = item | |||
}, | |||
numSub(num1, num2) { | |||
var baseNum, baseNum1, baseNum2; | |||
var precision;// 精度 | |||
try { | |||
baseNum1 = num1.toString().split(".")[1].length; | |||
} catch (e) { | |||
baseNum1 = 0; | |||
} | |||
try { | |||
baseNum2 = num2.toString().split(".")[1].length; | |||
} catch (e) { | |||
baseNum2 = 0; | |||
} | |||
baseNum = Math.pow(10, Math.max(baseNum1, baseNum2)); | |||
precision = (baseNum1 >= baseNum2) ? baseNum1 : baseNum2; | |||
return ((num1 * baseNum + num2 * baseNum) / baseNum).toFixed(precision); | |||
} | |||
}, | |||
created() { | |||
this.init() | |||
@@ -1,39 +1,73 @@ | |||
<template> | |||
<view class="page"> | |||
<view class="btn" @click="tapScan"> | |||
扫码 | |||
</view> | |||
<view class="container"> | |||
<image class="logo" src="@/static/xc-logo.png" mode="widthFix"></image> | |||
<image class="titlelogo" src="@/static/img-stuEnter/titlelogo.png" mode="widthFix"></image> | |||
<image class="btn" src="@/static/img-stuEnter/scanbtn.png" mode="widthFix" @click="tapScan"></image> | |||
<!-- <view class="page"> | |||
<view class="btn scanCodeBtn" @click="tapScan">扫码</view> | |||
</view> --> | |||
<scanCode ref="refScanCode"></scanCode> | |||
</view> | |||
</template> | |||
<script> | |||
import scanCodeFun from '@/common/js/scanCodeFun.js'; | |||
import scanCode from "@/components/scanCode.vue" | |||
export default { | |||
data() { | |||
return {} | |||
}, | |||
methods:{ | |||
init() { | |||
let _this = this; | |||
scanCodeFun.scanCodeFun().then(res => { | |||
if(!res) return; | |||
this.NAV_TO('./from', { StuNo: res.result }, true); | |||
}) | |||
}, | |||
tapScan() { | |||
this.init(); | |||
} | |||
}, | |||
mounted() { | |||
let _this = this; | |||
setTimeout(function() { | |||
_this.init(); | |||
}, 100); | |||
} | |||
components:{scanCode}, | |||
data() { | |||
return {}; | |||
}, | |||
methods: { | |||
tapScan() { | |||
this.$refs['refScanCode'].scanCode().then(res=>{ | |||
if (!res) return; | |||
// var userInfo = this.GET_GLOBAL("loginUser"); | |||
this.NAV_TO('./from', { StuNo: res.result }, true); | |||
// var result = this.HTTP_GET( | |||
// "learun/adms/EducationalAdministration/StuInfoBasic/stuinfo", | |||
// { | |||
// userid: userInfo.userId, | |||
// meetid: res.result, | |||
// }, | |||
// "扫码出错" | |||
// ).then(res1=>{ | |||
// this.TOAST(res1.result) | |||
// }) | |||
}) | |||
}, | |||
}, | |||
}; | |||
</script> | |||
<style lang="less" scoped> | |||
@import '~@/common/css/sidepage.less'; | |||
@import '~@/common/css/customlist.less'; | |||
// @import "~@/common/css/sidepage.less"; | |||
// @import "~@/common/css/customlist.less"; | |||
// .scanCodeBtn{ | |||
// width: 120px; | |||
// height: 120px; | |||
// border-radius: 50%; | |||
// line-height: 120px; | |||
// } | |||
.logo{ | |||
width: 258px; | |||
} | |||
.titlelogo{ | |||
width: 268px; | |||
margin-top: 52px; | |||
margin-bottom: 20px; | |||
} | |||
.btn{ | |||
width: 184px; | |||
} | |||
.container{ | |||
height: 100vh; | |||
text-align: center; | |||
box-sizing: border-box; | |||
background-image: url("@/static/stu-bg.png"); | |||
background-repeat: no-repeat; | |||
background-size: 100%; | |||
background-color: #0c86d8; | |||
} | |||
</style> |