Browse Source

准备下qs

master
unknown 11 months ago
parent
commit
dc6ab6a289
  1. 2
      components/appointItem-student/appointItem-student.vue
  2. 31
      config/request.js
  3. 2
      manifest.json
  4. 3
      pages.json
  5. 2
      pages/login/login.vue
  6. 9
      pages/tabbar/student/index.vue
  7. BIN
      static/images/index/newSatus.png

2
components/appointItem-student/appointItem-student.vue

@ -33,7 +33,7 @@
</view>
<view class="row">
<view class="iconImg">
<image src="@/static/images/index/radio_nor.png" mode=""></image>
<image src="@/static/images/index/newSatus.png" mode=""></image>
</view>
<view class="name">最新状态<text>就先放着不做</text> </view>
</view>

31
config/request.js

@ -28,7 +28,7 @@ module.exports = (vm) => {
// alert(contentTypeIndex)
config.header['content-type'] = ContentType[contentTypeIndex]
}
// config.header['content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
config.header['content-type'] = 'application/json;charset=utf-8'
// 初始化请求拦截器时,会执行此方法,此时data为undefined,赋予默认{}
config.data = config.data || {}
// 根据custom参数中配置的是否需要token,添加对应的请求头
@ -40,6 +40,35 @@ module.exports = (vm) => {
if(noToken&&config.header.Authorization) {
delete config.header.Authorization
}
// get请求映射params参数
console.log(config.method)
// if (config.method === 'GET' && config.params) {
// let url = config.url + '?';
// for (const propName of Object.keys(config.params)) {
// const value = config.params[propName];
// const part = encodeURIComponent(propName) + '='
// if (value !== null && typeof(value) !== "undefined") {
// if (typeof value === 'object') {
// for (const key of Object.keys(value)) {
// let params = propName + '[' + key + ']';
// const subPart = params + '='
// // console.log(subPart + (value[key]) + '&')
// url += subPart + decodeURIComponent(value[key]) + "&";
// }
// } else {
// url += part + encodeURI(value) + "&";
// }
// }
// }
// url = url.slice(0, -1);
// console.log(url)
// config.params = {};
// config.url = url;
// }
return config
}, config => { // 可使用async await 做异步操作
return Promise.reject(config)

2
manifest.json

@ -82,7 +82,7 @@
"disableHostCheck" : true,
"proxy" : {
"/api" : {
"target" : "http://192.168.1.39:48080/",
"target" : "http://192.168.1.36:48080/",
"changeOrigin" : true,
"secure" : true,
"pathRewrite" : {

3
pages.json

@ -297,9 +297,6 @@
]
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

2
pages/login/login.vue

@ -33,7 +33,7 @@
</view>
</view> -->
</view>
<u-picker :show="show" :columns="columnsArea" keyName="name" @confirm="confirmArea" @close="show=false"></u-picker>
<u-picker :show="show" :columns="columnsArea" keyName="name" @confirm="confirmArea" @cancel="show=false"></u-picker>
<u-action-sheet :actions="list" :title="title" :show="showRole" @select="selectClick" ></u-action-sheet>
</view>
</template>

9
pages/tabbar/student/index.vue

@ -143,7 +143,14 @@
methods: {
confirmDatePicker(val) {
this.showDatePicker = false
this.params.applyDate = this.screen.timer = uni.$u.date(val.value, 'yyyy-mm-dd')
// this.params.applyDate = this.screen.timer = uni.$u.date(val.value, 'yyyy-mm-dd')
this.screen.timer = uni.$u.date(val.value, 'yyyy-mm-dd')
let startTimer = this.screen.timer + ' 00:00:00'
let endTimer = this.screen.timer+ ' 23:59:59'
this.params.applyDate = [startTimer, endTimer]
// this.params['applyDate[0]'] = encodeURI(startTimer)
// this.params['applyDate[1]'] = encodeURI(endTimer)
this.listInit()
},
confirmCar(val) {

BIN
static/images/index/newSatus.png

After

Width: 34  |  Height: 30  |  Size: 1.1 KiB

Loading…
Cancel
Save