@@ -89,16 +89,23 @@
const res = await this.$myRequest({
host: 'ip',
url: '?ie=utf-8',
+ // url: '/json',
method: 'POST'
})
- if (res) {
+ if (res.data) {
// console.log(res);
const reg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
let ip = reg.exec(res.data);
// 获取code
this.getCode(ip[0])
+ } else {
+ uni.showToast({
+ title: 未获得IP地址,
+ icon: 'none',
+ duration: 2000
+ })
}
},
/**
@@ -250,6 +257,7 @@
* 提示
*/
tip(param) {
+ let _this = this;
if (!this.isXiaoqu) {
if (param == false) {
uni.showModal({
@@ -265,7 +273,6 @@
});
} else {
- let _this = this;
title: '提示',
content: '目前只对【墨轩湖校区】的【热水钱包】进行充值!',
@@ -292,6 +299,7 @@
* 调用接口实现充值功能
chongzhi() {
+ var _this = this;
if (isNaN(this.amount)) {
uni.showToast({
title: '请输入正确金额',
@@ -309,7 +317,7 @@
success: (res) => {
if (res.confirm) {
// 获取IP
- this.getIP()
+ _this.getIP()
} else if (res.cancel) {
return
@@ -336,7 +344,7 @@
@@ -1446,10 +1446,19 @@
- uni.showToast({
- icon: 'none',
- title: '字节码或学号为空!'
- });
+ if (typeof this.byte35 == 'undefined' || this.byte35 == '') {
+ title: '字节码为空!'
+ });
+ }
+
+ if (typeof this.stu_number == 'undefined' || this.stu_number == '') {
+ title: '学号为空!'
// 初始化
this.setInit()
@@ -66,7 +66,7 @@
:style="{display: item3.isShow ? 'none' : ''}"></uni-icons>
<uni-icons type="minus-filled" size="22" color="#2979ff"
:style="{display: item3.isShow ? '' : 'none'}"></uni-icons>
- <view class="txt-jiaoshi">{{item3.label}}</view>
+ <view class="txt-jiaoshi">{{item3.label.split('-')[1]}}</view>
</view>
<uni-icons type="top" size="22" color="#2979ff"