Commit 39d7abbe by 郑艺斌

新增跳转以及校验

parent 4310a86a
...@@ -68,6 +68,24 @@ Page({ ...@@ -68,6 +68,24 @@ Page({
}, },
addTag(){ addTag(){
const that = this const that = this
let pattern1 = /^\s+/g;
let pattern2 = /\s+$/g;
let tagText = this.data.tagText
if(pattern1.test(tagText)){
wx.showToast({
title: `文字前不能包含空格!`,
icon: 'none',
duration: 2000
})
return
}else if(pattern2.test(tagText)){
wx.showToast({
title: `文字后不能包含空格!`,
icon: 'none',
duration: 2000
})
return
}
wx.request({ wx.request({
url: baseUrl + '/api/emaint/problem-base/addLabel', url: baseUrl + '/api/emaint/problem-base/addLabel',
data: { data: {
...@@ -84,6 +102,12 @@ Page({ ...@@ -84,6 +102,12 @@ Page({
tagText:'' tagText:''
}) })
that.getTabs() that.getTabs()
}else{
wx.showToast({
title: res.data.responseResult,
icon: 'none',
duration: 2000
})
} }
}}) }})
}, },
......
...@@ -81,6 +81,8 @@ Page({ ...@@ -81,6 +81,8 @@ Page({
// 点击完成维修 // 点击完成维修
wanchengdan(e){ wanchengdan(e){
var that = this; var that = this;
wx.navigateTo({url:`../endRepair/repair?id=${e.currentTarget.dataset.id}`})
return
console.log(e.currentTarget.dataset.id) console.log(e.currentTarget.dataset.id)
this.setData({ this.setData({
// wantan: true, // wantan: true,
......
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 sign in to comment