Commit 721e47e5 authored by 黄奎's avatar 黄奎

页面修改

parent 804aa513
This diff is collapsed.
export default { export default {
install(Vue, options) { install(Vue, options) {
Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285" Vue.prototype.host = "https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
// Vue.prototype.host2 = "http://192.168.0.110:8200"
// Vue.prototype.host2 = "https://mallApi.oytour.com" Vue.prototype.host2 = "http://localhost:5000"
Vue.prototype.host2 = "http://192.168.20.6:8088" //Vue.prototype.host2 = "https://mallApi.oytour.com"
// Vue.prototype.host2 = "http://192.168.20.24:8200"
// Vue.prototype.host2 = "http://192.168.20.17:8014" Vue.prototype.UploadConfig = function() { //本地上传配置
// Vue.prototype.host2 = "http://192.168.20.17:8014"
// Vue.prototype.host2 = "http://testmall.oytour.com/"
Vue.prototype.UploadConfig = function() {//本地上传配置
return { return {
UploadUrl:this.host2.indexOf('mallApi')!=-1 ? "https://upload.oytour.com/Upload/AppUpload":"http://192.168.20.214:8120/Upload/AppUpload", UploadUrl: this.host2.indexOf('mallApi') != -1 ? "https://upload.oytour.com/Upload/AppUpload" : "http://192.168.20.214:8120/Upload/AppUpload",
ImageUrl:this.host2.indexOf('mallApi')!=-1? "https://imgfile.oytour.com":"http://192.168.20.214:8130", ImageUrl: this.host2.indexOf('mallApi') != -1 ? "https://imgfile.oytour.com" : "http://192.168.20.214:8130",
} }
} }
//微宝阁请求
Vue.prototype.request = function(param, success, failed) { Vue.prototype.request = function(param, success, failed) {
//网络请求 //网络请求
uni.request({ uni.request({
...@@ -36,8 +34,8 @@ export default { ...@@ -36,8 +34,8 @@ export default {
} }
}); });
} }
//小程序常规请求
Vue.prototype.request2 = function(param, success, failed) { Vue.prototype.request2 = function(param, success, failed) {
//网络请求
uni.request({ uni.request({
url: this.host2 + param.url, url: this.host2 + param.url,
method: param.method || "Post", method: param.method || "Post",
...@@ -59,7 +57,6 @@ export default { ...@@ -59,7 +57,6 @@ export default {
let u = uni.getStorageSync("mall_UserInfo"); let u = uni.getStorageSync("mall_UserInfo");
if (u) { if (u) {
this.getLogin_t(u) this.getLogin_t(u)
// typeof failed == "function" && failed(res.data);
} }
} else if (res.data.resultCode != 1) { } else if (res.data.resultCode != 1) {
if (res.data.message != '') { if (res.data.message != '') {
...@@ -82,6 +79,50 @@ export default { ...@@ -82,6 +79,50 @@ export default {
} }
}); });
} }
//后台接口请求
Vue.prototype.requestAdmin = function(cmd, postMsg, success, failed) {
uni.request({
url: this.host2 + cmd,
method: "Post",
header: {
'content-type': "application/json"
},
data: {
MallBaseId: this.GetMiniAppId().MallBaseId,
TenantId: this.GetMiniAppId().TenantId,
msg: postMsg,
token: this.GetOpenId().AdminToken
},
success: res => {
if (res.data.resultCode == 10000) {
let u = uni.getStorageSync("mall_UserInfo");
if (u) {
this.getLogin_t(u)
}
} else if (res.data.resultCode != 1) {
if (res.data.message != '') {
uni.showToast({
title: res.data.message,
icon: "none",
});
}
typeof failed == "function" && failed(res.data);
} else {
typeof success == "function" && success(res.data);
}
},
fail: (e) => {
console.log("网络请求fail:" + JSON.stringify(e));
uni.showModal({
content: "" + res.errMsg
});
typeof failed == "function" && failed(res.data);
}
});
}
// token失效再次登录接口 // token失效再次登录接口
Vue.prototype.getLogin_t = function(obj) { Vue.prototype.getLogin_t = function(obj) {
let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0; let pid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
...@@ -120,7 +161,7 @@ export default { ...@@ -120,7 +161,7 @@ export default {
// 获取小程序APPID // 获取小程序APPID
Vue.prototype.GetMiniAppId = function() { Vue.prototype.GetMiniAppId = function() {
let appObj = {}; let appObj = {};
let appType = 1; let appType = 3;
switch (appType) { switch (appType) {
case 1: //赞羊 case 1: //赞羊
appObj = { appObj = {
...@@ -165,47 +206,47 @@ export default { ...@@ -165,47 +206,47 @@ export default {
}; };
break; break;
case 7: case 7:
appObj = {//韩国馆 appObj = { //韩国馆
AppId: 'wxbb033190e0ffa5db', AppId: 'wxbb033190e0ffa5db',
TenantId: 18, TenantId: 18,
MallBaseId: 8, MallBaseId: 8,
}; };
break; break;
case 8: case 8:
appObj = {//恋爱星球 appObj = { //恋爱星球
AppId: 'wx681f8ad58e6c48e4', AppId: 'wx681f8ad58e6c48e4',
TenantId: 21, TenantId: 21,
MallBaseId: 11, MallBaseId: 11,
}; };
break; break;
case 9: case 9:
appObj = {//罗演的杂货铺 appObj = { //罗演的杂货铺
AppId: 'wx67a8fb290ec58af4', AppId: 'wx67a8fb290ec58af4',
TenantId: 20, TenantId: 20,
MallBaseId: 10, MallBaseId: 10,
}; };
break; break;
case 10: case 10:
appObj = {//梅玲 appObj = { //梅玲
AppId: 'wx350f244458e5ba01', AppId: 'wx350f244458e5ba01',
TenantId: 22, TenantId: 22,
MallBaseId: 12, MallBaseId: 12,
}; };
break; break;
case 11: case 11:
appObj = {//星之旅 appObj = { //星之旅
AppId: 'wxa2c92313ece345f5', AppId: 'wxa2c92313ece345f5',
TenantId: 23, TenantId: 23,
MallBaseId: 13, MallBaseId: 13,
}; };
break; break;
case 12: case 12:
appObj = {//橙孀 appObj = { //橙孀
AppId: 'wx442f2a74b09d5f89', AppId: 'wx442f2a74b09d5f89',
TenantId: 24, TenantId: 24,
MallBaseId: 14, MallBaseId: 14,
}; };
break; break;
} }
return appObj; return appObj;
} }
...@@ -217,6 +258,7 @@ export default { ...@@ -217,6 +258,7 @@ export default {
UserId: 0, UserId: 0,
token: '', token: '',
SmallShopsId: 0, SmallShopsId: 0,
AdminToken: "", //后台Token
} }
if (mall_userinfo) { if (mall_userinfo) {
if (mall_userinfo.OpenId) { if (mall_userinfo.OpenId) {
...@@ -224,6 +266,7 @@ export default { ...@@ -224,6 +266,7 @@ export default {
obj.UserId = mall_userinfo.UserId; obj.UserId = mall_userinfo.UserId;
obj.token = mall_userinfo.Token; obj.token = mall_userinfo.Token;
obj.SmallShopsId = mall_userinfo.UserSmallShopId; obj.SmallShopsId = mall_userinfo.UserSmallShopId;
obj.AdminToken = mall_userinfo.AdminToken;
} }
} }
return obj return obj
...@@ -245,7 +288,6 @@ export default { ...@@ -245,7 +288,6 @@ export default {
val = Number(val).toFixed(2); val = Number(val).toFixed(2);
return val return val
} }
Vue.prototype.apiheader = function() { Vue.prototype.apiheader = function() {
return { return {
'X-Access-Token': '_4Y_WpUZ4a6SI5uJgsZ4Lb7t9mvqJTyr', 'X-Access-Token': '_4Y_WpUZ4a6SI5uJgsZ4Lb7t9mvqJTyr',
......
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 to comment