api接口baseUrl通过全局变量引入;代码格式化
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
// pages/apply/apply.js
|
||||
const app = getApp()
|
||||
const baseUrl = app.globalData.baseUrl
|
||||
// console.log("baseUrl", baseUrl)
|
||||
|
||||
var dateTimePicker = require('./dateTimePicker.js');
|
||||
Page({
|
||||
data: {
|
||||
@@ -95,7 +98,7 @@ Page({
|
||||
apply: function () {
|
||||
var data = this.data;
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/applySub',
|
||||
url: `${baseUrl}/apply/applySub`,
|
||||
data: {
|
||||
stu_id: data.id,
|
||||
issue: data.issue,
|
||||
|
@@ -1,11 +1,13 @@
|
||||
// pages/other/feedback.js
|
||||
Page({
|
||||
const app = getApp()
|
||||
const baseUrl = app.globalData.baseUrl
|
||||
// console.log("baseUrl", baseUrl)
|
||||
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
List:'',
|
||||
List: '',
|
||||
replay: [],
|
||||
},
|
||||
|
||||
@@ -27,13 +29,13 @@ Page({
|
||||
replay: e.detail.value
|
||||
})
|
||||
},
|
||||
agree:function (event) {
|
||||
agree: function (event) {
|
||||
var that = this
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/applyReplay',
|
||||
url: `${baseUrl}/apply/applyReplay`,
|
||||
data: {
|
||||
id:event.target.dataset.id,
|
||||
replay:event.target.dataset.replay,
|
||||
id: event.target.dataset.id,
|
||||
replay: event.target.dataset.replay,
|
||||
reasonId: 99
|
||||
},
|
||||
success: function (d) {
|
||||
@@ -41,25 +43,24 @@ Page({
|
||||
title: d.data.msg,
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
success: function () {
|
||||
}
|
||||
success: function () {}
|
||||
})
|
||||
that.onShow();
|
||||
}
|
||||
})
|
||||
},
|
||||
disagree:function (event) {
|
||||
disagree: function (event) {
|
||||
var that = this
|
||||
wx.showActionSheet({
|
||||
itemList: ['格式错误','出行地点不允许','时间填写错误'],
|
||||
success:function (res) {
|
||||
if(!res.cancel){
|
||||
itemList: ['格式错误', '出行地点不允许', '时间填写错误'],
|
||||
success: function (res) {
|
||||
if (!res.cancel) {
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/applyReplay',
|
||||
url: `${baseUrl}/apply/applyReplay`,
|
||||
data: {
|
||||
id:event.target.dataset.id,
|
||||
replay:event.target.dataset.replay,
|
||||
reasonId:res.tapIndex,
|
||||
id: event.target.dataset.id,
|
||||
replay: event.target.dataset.replay,
|
||||
reasonId: res.tapIndex,
|
||||
},
|
||||
success: function (d) {
|
||||
wx.showToast({
|
||||
@@ -82,7 +83,7 @@ Page({
|
||||
onShow: function () {
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/applyListNoReplay',
|
||||
url: `${baseUrl}/apply/applyListNoReplay`,
|
||||
success: function (d) {
|
||||
that.setData({
|
||||
List: d.data.data
|
||||
@@ -95,8 +96,7 @@ Page({
|
||||
// var that = this
|
||||
// console.log(event.target.dataset)
|
||||
// wx.request({
|
||||
// url: 'http://127.0.0.1:8080/apply/applyListNoReplay',
|
||||
|
||||
// url: `${baseUrl}/apply/applyListNoReplay`,
|
||||
// })
|
||||
// },
|
||||
/**
|
||||
@@ -133,4 +133,4 @@ Page({
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@@ -1,11 +1,14 @@
|
||||
// pages/other/feedback.js
|
||||
const app = getApp()
|
||||
const baseUrl = app.globalData.baseUrl
|
||||
// console.log("baseUrl", baseUrl)
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
List:'',
|
||||
List: '',
|
||||
replay: [],
|
||||
},
|
||||
|
||||
@@ -27,37 +30,37 @@ Page({
|
||||
replay: e.detail.value
|
||||
})
|
||||
},
|
||||
agree:function (event) {
|
||||
agree: function (event) {
|
||||
var that = this
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/applyReplay',
|
||||
url: `${baseUrl}/apply/applyReplay`,
|
||||
data: {
|
||||
id:event.target.dataset.id,
|
||||
replay:event.target.dataset.replay,
|
||||
id: event.target.dataset.id,
|
||||
replay: event.target.dataset.replay,
|
||||
reasonId: 99
|
||||
},
|
||||
success: function (d) {
|
||||
if(d.data.msg == "成功"){
|
||||
if (d.data.msg == "成功") {
|
||||
that.onshow();
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
disagree:function (event) {
|
||||
disagree: function (event) {
|
||||
var that = this
|
||||
wx.showActionSheet({
|
||||
itemList: ['格式错误','出行地点不允许','时间填写错误'],
|
||||
success:function (res) {
|
||||
if(!res.cancel){
|
||||
itemList: ['格式错误', '出行地点不允许', '时间填写错误'],
|
||||
success: function (res) {
|
||||
if (!res.cancel) {
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/applyReplay',
|
||||
url: `${baseUrl}/apply/applyReplay`,
|
||||
data: {
|
||||
id:event.target.dataset.id,
|
||||
replay:event.target.dataset.replay,
|
||||
reasonId:res.tapIndex,
|
||||
id: event.target.dataset.id,
|
||||
replay: event.target.dataset.replay,
|
||||
reasonId: res.tapIndex,
|
||||
},
|
||||
success: function (d) {
|
||||
if(d.data.msg == "成功"){
|
||||
if (d.data.msg == "成功") {
|
||||
that.onShow();
|
||||
}
|
||||
}
|
||||
@@ -72,8 +75,10 @@ Page({
|
||||
onShow: function () {
|
||||
var that = this;
|
||||
wx.request({
|
||||
url: 'http://127.0.0.1:8080/apply/myApply',
|
||||
data:{id:wx.getStorageSync('id')},
|
||||
url: `${baseUrl}/apply/myApply`,
|
||||
data: {
|
||||
id: wx.getStorageSync('id')
|
||||
},
|
||||
success: function (d) {
|
||||
that.setData({
|
||||
List: d.data.data
|
||||
@@ -116,4 +121,4 @@ Page({
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user