-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
62 lines (53 loc) · 1.11 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import Vue from 'vue'
import App from './App'
Vue.config.productionTip = false
App.mpType = 'app'
/* Vue.prototype.href = "https://wx.tbshou.com";
Vue.prototype.serverURL = "https://wx.tbshou.com/index.php/"; */
Vue.prototype.APPID = "wx26504ae2a2c63a53";
/* Vue.prototype.secret = "dd6d168f9d043e7d87076f3addb0a6f0"; */
Vue.prototype.goLogin = function() { // 未登录
uni.navigateTo({
url:'../login/login'
})
}
Vue.prototype.noRegister = function() { // 未登录
uni.showModal({
title:'',
content:'您还没有登录,请先登录~',
success(res) {
if(res.confirm){
uni.navigateTo({
url:'../login/login'
})
}
}
})
}
Vue.prototype.myRequest = function(url,datas,callback) {
uni.showLoading({
title:'加载中...',
mask:true
})
uni.request({
url:this.serverURL + url,
method:"POST",
data:datas,
success(res) {
callback(res);
}
})
}
Vue.prototype.myModel = function(title) {
uni.showModal({
title:'',
content:title
})
}
Vue.prototype.checkMobile = function(mobile) {
return RegExp(/^1[3456789]\d{9}$/).test(mobile);
}
const app = new Vue({
...App
})
app.$mount()