Commit 8702d0b1 authored by 罗超's avatar 罗超

1

parent f5ae55cd
...@@ -2,12 +2,12 @@ export default { ...@@ -2,12 +2,12 @@ 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.20.24:8400" Vue.prototype.host2 = "http://192.168.20.17:8020"
Vue.prototype.host2 = "https://erpmallapi.oytour.com" // Vue.prototype.host2 = "https://erpmallapi.oytour.com"
//Vue.prototype.host3 = "http://192.168.20.24" //Vue.prototype.host3 = "http://192.168.20.24"
Vue.prototype.host3 = "https://reborn.oytour.com" Vue.prototype.host3 = "https://reborn.oytour.com"
Vue.prototype.request = function(param, success, failed) { Vue.prototype.request = function (param, success, failed) {
//网络请求 //网络请求
uni.request({ uni.request({
url: this.host + "&r=" + param.data.r, url: this.host + "&r=" + param.data.r,
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +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) => {
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ 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,
...@@ -76,10 +76,10 @@ export default { ...@@ -76,10 +76,10 @@ export default {
}); });
} }
//请求app接口 //请求app接口
Vue.prototype.apipost = function(cmd, msg, success, failed) { Vue.prototype.apipost = function (cmd, msg, success, failed) {
var postData = this.GetPostData(cmd, msg, ""); var postData = this.GetPostData(cmd, msg, "");
uni.request({ uni.request({
url: this.host3+'/api/common/post', url: this.host3 + '/api/common/post',
method: "Post", method: "Post",
header: { header: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
...@@ -116,7 +116,7 @@ export default { ...@@ -116,7 +116,7 @@ export default {
}, },
//获取请求参数 //获取请求参数
Vue.prototype.GetPostData = function(cmd, msg) { Vue.prototype.GetPostData = function (cmd, msg) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
msg = {} msg = {}
} }
...@@ -136,14 +136,14 @@ export default { ...@@ -136,14 +136,14 @@ export default {
cmd: cmd, cmd: cmd,
MallBaseId: MallBaseId, MallBaseId: MallBaseId,
TenantId: TenantId, TenantId: TenantId,
version:'' version: ''
} }
return postData return postData
}, },
// 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;
let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0; let Up = uni.getStorageSync("Up") ? uni.getStorageSync("Up").Up : 0;
let SmallShopId = uni.getStorageSync("SmallShopId") ? uni.getStorageSync("SmallShopId").SmallShopId : 0; let SmallShopId = uni.getStorageSync("SmallShopId") ? uni.getStorageSync("SmallShopId").SmallShopId : 0;
...@@ -178,17 +178,10 @@ export default { ...@@ -178,17 +178,10 @@ export default {
); );
} }
// 获取小程序APPID // 获取小程序APPID
Vue.prototype.GetMiniAppId = function() { Vue.prototype.GetMiniAppId = function () {
let appObj = {}; let appObj = {};
let appType = 2; let appType = 2;
switch (appType) { switch (appType) {
case 1: //赞羊
appObj = {
AppId: 'wxacd9f8cc3480d29e',
TenantId: 1,
MallBaseId: 1,
};
break;
case 2: //旅小友 case 2: //旅小友
appObj = { appObj = {
AppId: 'wxcf0727a7c78b501e', AppId: 'wxcf0727a7c78b501e',
...@@ -196,60 +189,11 @@ export default { ...@@ -196,60 +189,11 @@ export default {
MallBaseId: 2, MallBaseId: 2,
}; };
break; break;
case 3:
appObj = {
AppId: 'wx01350b305d45a63e',
TenantId: 14,
MallBaseId: 4,
};
break;
case 4:
appObj = { //郍田
AppId: 'wx1bf3a7c76b10bb6d',
TenantId: 16,
MallBaseId: 6,
};
break;
case 5:
appObj = { //惠爱
AppId: 'wxcab2515c608644b9',
TenantId: 17,
MallBaseId: 7,
};
break;
case 6:
appObj = { //甲鹤
AppId: 'wx38e054ee42b054f4',
TenantId: 15,
MallBaseId: 5,
};
break;
case 7:
appObj = { //韩国馆
AppId: 'wxbb033190e0ffa5db',
TenantId: 18,
MallBaseId: 8,
};
break;
case 8:
appObj = { //恋爱星球
AppId: 'wx681f8ad58e6c48e4',
TenantId: 21,
MallBaseId: 11,
};
break;
case 9:
appObj = { //罗演的杂货铺
AppId: 'wx67a8fb290ec58af4',
TenantId: 20,
MallBaseId: 10,
};
break;
} }
return appObj; return appObj;
} }
//获取OpenId //获取OpenId
Vue.prototype.GetOpenId = function() { Vue.prototype.GetOpenId = function () {
let mall_userinfo = wx.getStorageSync('mall_UserInfo') let mall_userinfo = wx.getStorageSync('mall_UserInfo')
var obj = { var obj = {
OpenId: '', OpenId: '',
...@@ -268,7 +212,7 @@ export default { ...@@ -268,7 +212,7 @@ export default {
return obj return obj
} }
//公用判断图片地址 判断是否包含http //公用判断图片地址 判断是否包含http
Vue.prototype.getIconLink = function(url) { Vue.prototype.getIconLink = function (url) {
let str = '' let str = ''
if (url && url != '') { if (url && url != '') {
if (url.indexOf('http') != -1) { if (url.indexOf('http') != -1) {
...@@ -280,12 +224,12 @@ export default { ...@@ -280,12 +224,12 @@ export default {
} }
} }
//价格返回.00 //价格返回.00
Vue.prototype.getPrice = function(val) { Vue.prototype.getPrice = function (val) {
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',
'X-App-Platform': 'wxapp', 'X-App-Platform': 'wxapp',
......
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