Commit 7188854c authored by 黄奎's avatar 黄奎

页面修改

parent 03477581
...@@ -5,7 +5,7 @@ export default { ...@@ -5,7 +5,7 @@ export default {
// Vue.prototype.host2 = "https://mallApi.oytour.com" // Vue.prototype.host2 = "https://mallApi.oytour.com"
// Vue.prototype.host2 = "http://192.168.1.5:8088" // Vue.prototype.host2 = "http://192.168.1.5:8088"
// Vue.prototype.host2 = "http://192.168.1.21" // Vue.prototype.host2 = "http://192.168.1.21"
Vue.prototype.host2 = "http://192.168.1.27:8200" Vue.prototype.host2 = "http://testmall.oytour.com/"
Vue.prototype.request = function(param, success, failed) { Vue.prototype.request = function(param, success, failed) {
//网络请求 //网络请求
...@@ -17,9 +17,7 @@ export default { ...@@ -17,9 +17,7 @@ export default {
}, },
data: param.data, data: param.data,
success: res => { success: res => {
if (res.data.code != 0 && res.data.msg != "商品未上架") { if (res.data.code != 0 && res.data.msg != "商品未上架") {}
}
typeof success == "function" && success(res.data); typeof success == "function" && success(res.data);
}, },
fail: (e) => { fail: (e) => {
...@@ -40,25 +38,22 @@ export default { ...@@ -40,25 +38,22 @@ export default {
'content-type': "application/json" 'content-type': "application/json"
}, },
data: { data: {
MallBaseId: 2, MallBaseId: this.GetMiniAppId().MallBaseId,
TenantId: 12, TenantId: this.GetMiniAppId().TenantId,
OpenId: this.GetOpenId().OpenId, OpenId: this.GetOpenId().OpenId,
UserId: this.GetOpenId().UserId, UserId: this.GetOpenId().UserId,
SmallShopsId: this.GetOpenId().SmallShopsId, SmallShopsId: this.GetOpenId().SmallShopsId,
MiniAppId: this.GetMiniAppId(), MiniAppId: this.GetMiniAppId().AppId,
msg: param.data, msg: param.data,
token: this.GetOpenId().token token: this.GetOpenId().token
}, },
success: res => { success: res => {
if (res.data.resultCode == 10000) { if (res.data.resultCode == 10000) {
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); 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 != '') {
uni.showToast({ uni.showToast({
...@@ -66,13 +61,8 @@ export default { ...@@ -66,13 +61,8 @@ export default {
icon: "none", icon: "none",
}); });
} }
typeof failed == "function" && failed(res.data); typeof failed == "function" && failed(res.data);
} else { } else {
typeof success == "function" && success(res.data); typeof success == "function" && success(res.data);
} }
}, },
...@@ -115,10 +105,32 @@ export default { ...@@ -115,10 +105,32 @@ export default {
} }
// 获取小程序APPID // 获取小程序APPID
Vue.prototype.GetMiniAppId = function() { Vue.prototype.GetMiniAppId = function() {
// return 'wxacd9f8cc3480d29e' let appObj = {};
return 'wxcf0727a7c78b501e' //旅小友 let appType = 1;
// return 'wx01350b305d45a63e' //饭粒汪 switch (appType) {
case 1: //赞羊
appObj = {
AppId: 'wxacd9f8cc3480d29e',
TenantId: 1,
MallBaseId: 1,
};
break;
case 2: //旅小友
appObj = {
AppId: 'wxcf0727a7c78b501e',
TenantId: 12,
MallBaseId: 2,
};
break;
case 3:
appObj = {
AppId: 'wx01350b305d45a63e',
TenantId: 14,
MallBaseId: 4,
};
break;
}
return appObj;
} }
//获取OpenId //获取OpenId
Vue.prototype.GetOpenId = function() { Vue.prototype.GetOpenId = function() {
......
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