Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengke
jz_Travel
Commits
8702d0b1
Commit
8702d0b1
authored
Sep 30, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
f5ae55cd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
89 deletions
+33
-89
api.js
plugin/api.js
+33
-89
No files found.
plugin/api.js
View file @
8702d0b1
...
...
@@ -2,12 +2,12 @@ export default {
install
(
Vue
,
options
)
{
Vue
.
prototype
.
host
=
"https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
//Vue.prototype.host2 = "http://192.168.20.24:840
0"
Vue
.
prototype
.
host2
=
"https://erpmallapi.oytour.com"
Vue
.
prototype
.
host2
=
"http://192.168.20.17:802
0"
//
Vue.prototype.host2 = "https://erpmallapi.oytour.com"
//Vue.prototype.host3 = "http://192.168.20.24"
Vue
.
prototype
.
host3
=
"https://reborn.oytour.com"
Vue
.
prototype
.
request
=
function
(
param
,
success
,
failed
)
{
Vue
.
prototype
.
request
=
function
(
param
,
success
,
failed
)
{
//网络请求
uni
.
request
({
url
:
this
.
host
+
"&r="
+
param
.
data
.
r
,
...
...
@@ -17,7 +17,7 @@ export default {
},
data
:
param
.
data
,
success
:
res
=>
{
if
(
res
.
data
.
code
!=
0
&&
res
.
data
.
msg
!=
"商品未上架"
)
{}
if
(
res
.
data
.
code
!=
0
&&
res
.
data
.
msg
!=
"商品未上架"
)
{
}
typeof
success
==
"function"
&&
success
(
res
.
data
);
},
fail
:
(
e
)
=>
{
...
...
@@ -29,7 +29,7 @@ export default {
}
});
}
Vue
.
prototype
.
request2
=
function
(
param
,
success
,
failed
)
{
Vue
.
prototype
.
request2
=
function
(
param
,
success
,
failed
)
{
//网络请求
uni
.
request
({
url
:
this
.
host2
+
param
.
url
,
...
...
@@ -76,10 +76,10 @@ export default {
});
}
//请求app接口
Vue
.
prototype
.
apipost
=
function
(
cmd
,
msg
,
success
,
failed
)
{
Vue
.
prototype
.
apipost
=
function
(
cmd
,
msg
,
success
,
failed
)
{
var
postData
=
this
.
GetPostData
(
cmd
,
msg
,
""
);
uni
.
request
({
url
:
this
.
host3
+
'/api/common/post'
,
url
:
this
.
host3
+
'/api/common/post'
,
method
:
"Post"
,
header
:
{
'Content-Type'
:
'application/json'
...
...
@@ -116,7 +116,7 @@ export default {
},
//获取请求参数
Vue
.
prototype
.
GetPostData
=
function
(
cmd
,
msg
)
{
Vue
.
prototype
.
GetPostData
=
function
(
cmd
,
msg
)
{
if
(
msg
==
null
||
msg
==
""
)
{
msg
=
{}
}
...
...
@@ -136,14 +136,14 @@ export default {
cmd
:
cmd
,
MallBaseId
:
MallBaseId
,
TenantId
:
TenantId
,
version
:
''
version
:
''
}
return
postData
},
// token失效再次登录接口
Vue
.
prototype
.
getLogin_t
=
function
(
obj
)
{
Vue
.
prototype
.
getLogin_t
=
function
(
obj
)
{
let
pid
=
uni
.
getStorageSync
(
"pid"
)
?
uni
.
getStorageSync
(
"pid"
).
pid
:
0
;
let
Up
=
uni
.
getStorageSync
(
"Up"
)
?
uni
.
getStorageSync
(
"Up"
).
Up
:
0
;
let
SmallShopId
=
uni
.
getStorageSync
(
"SmallShopId"
)
?
uni
.
getStorageSync
(
"SmallShopId"
).
SmallShopId
:
0
;
...
...
@@ -178,17 +178,10 @@ export default {
);
}
// 获取小程序APPID
Vue
.
prototype
.
GetMiniAppId
=
function
()
{
Vue
.
prototype
.
GetMiniAppId
=
function
()
{
let
appObj
=
{};
let
appType
=
2
;
switch
(
appType
)
{
case
1
:
//赞羊
appObj
=
{
AppId
:
'wxacd9f8cc3480d29e'
,
TenantId
:
1
,
MallBaseId
:
1
,
};
break
;
case
2
:
//旅小友
appObj
=
{
AppId
:
'wxcf0727a7c78b501e'
,
...
...
@@ -196,60 +189,11 @@ export default {
MallBaseId
:
2
,
};
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
;
}
//获取OpenId
Vue
.
prototype
.
GetOpenId
=
function
()
{
Vue
.
prototype
.
GetOpenId
=
function
()
{
let
mall_userinfo
=
wx
.
getStorageSync
(
'mall_UserInfo'
)
var
obj
=
{
OpenId
:
''
,
...
...
@@ -268,7 +212,7 @@ export default {
return
obj
}
//公用判断图片地址 判断是否包含http
Vue
.
prototype
.
getIconLink
=
function
(
url
)
{
Vue
.
prototype
.
getIconLink
=
function
(
url
)
{
let
str
=
''
if
(
url
&&
url
!=
''
)
{
if
(
url
.
indexOf
(
'http'
)
!=
-
1
)
{
...
...
@@ -280,12 +224,12 @@ export default {
}
}
//价格返回.00
Vue
.
prototype
.
getPrice
=
function
(
val
)
{
Vue
.
prototype
.
getPrice
=
function
(
val
)
{
val
=
Number
(
val
).
toFixed
(
2
);
return
val
}
Vue
.
prototype
.
apiheader
=
function
()
{
Vue
.
prototype
.
apiheader
=
function
()
{
return
{
'X-Access-Token'
:
'_4Y_WpUZ4a6SI5uJgsZ4Lb7t9mvqJTyr'
,
'X-App-Platform'
:
'wxapp'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment