Browse Source

修改自动获取appid 订单分类请求参数修改

test
Enzo 4 years ago
parent
commit
c4ef6c81c3
  1. 3
      common/api.js
  2. 7
      common/http.js
  3. 9
      common/uploadFile.js
  4. 7
      manifest.json
  5. 4
      pages/order/order.vue

3
common/api.js

@ -1,11 +1,10 @@
// appId: 正式 null | 测试 wxb35ef055a4dd8ad4
// appId: 正式 null | 测试 wxeb58570b5e04d147
export const DEV = "dev"; // dev 测试 | prod 正式
export const VERSION = '1.0.0'; // 版本号
export const DEVURL = 'https://hainan.lanzulive.com'; // 测试服请求地址
// export const DEVURL = 'http://hainan.com'; // 测试服请求地址
export const PRODURL = ''; // 正式服请求地址
export const API_WXLOGIN = '/api/login'; //登录

7
common/http.js

@ -90,7 +90,12 @@ function $http(url, data = {}, options = {}){
}
//商户id
options.appid = 'wxb35ef055a4dd8ad4'
var accountInfo = wx.getAccountInfoSync();
var autoappid = accountInfo.miniProgram.appId;
options.appid = autoappid || 'wxeb58570b5e04d147'
console.log('请求',options.appid)
let user_info = uni.getStorageSync('userinfo')
let user_token = user_info.token

9
common/uploadFile.js

@ -30,12 +30,19 @@ const uploadFile = function (filePath, successc, failc) {
let fileTypeIndex = filePath.lastIndexOf('.');
let fileType = filePath.substring(fileTypeIndex);
var accountInfo = wx.getAccountInfoSync();
var autoappid = accountInfo.miniProgram.appId;
var uploadappid = autoappid || 'wxeb58570b5e04d147';
console.log('上次',uploadappid)
uni.uploadFile({
url: url + url_a,//开发者服务器 url
filePath: filePath,//要上传文件资源的路径
name: 'image',
header: {
appid: 'wxb35ef055a4dd8ad4',
appid: uploadappid,
Authentication: uni.getStorageSync('userinfo').token
},

7
manifest.json

@ -56,7 +56,12 @@
"es6" : false,
"postcss" : true
},
"usingComponents" : true
"usingComponents" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "你的位置信息将用于获取对应任务信息"
}
}
},
"mp-alipay" : {
"usingComponents" : true

4
pages/order/order.vue

@ -71,7 +71,7 @@
isPage: true
}, {
name: '待付款',
type: 0,
type: '0,1,4',
list: [],
loadingClass: true,
loadingText: '正在加载中',
@ -79,7 +79,7 @@
isPage: true
}, {
name: '已付款',
type: '1,2,3,5',
type: '2,3,5',
list: [],
loadingClass: true,
loadingText: '正在加载中',

Loading…
Cancel
Save