Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
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
viitto
mallapp
Commits
721e47e5
Commit
721e47e5
authored
Oct 22, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
804aa513
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
578 additions
and
610 deletions
+578
-610
index.vue
pages/MallMange/index.vue
+511
-585
api.js
plugin/api.js
+67
-25
No files found.
pages/MallMange/index.vue
View file @
721e47e5
This diff is collapsed.
Click to expand it.
plugin/api.js
View file @
721e47e5
export
default
{
install
(
Vue
,
options
)
{
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://192.168.20.6:8088"
// Vue.prototype.host2 = "http://192.168.20.24:8200"
// Vue.prototype.host2 = "http://192.168.20.17:8014"
// Vue.prototype.host2 = "http://192.168.20.17:8014"
// Vue.prototype.host2 = "http://testmall.oytour.com/"
Vue
.
prototype
.
UploadConfig
=
function
()
{
//本地上传配置
Vue
.
prototype
.
host2
=
"http://localhost:5000"
//Vue.prototype.host2 = "https://mallApi.oytour.com"
Vue
.
prototype
.
UploadConfig
=
function
()
{
//本地上传配置
return
{
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"
,
}
}
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"
,
}
}
//微宝阁请求
Vue
.
prototype
.
request
=
function
(
param
,
success
,
failed
)
{
//网络请求
uni
.
request
({
...
...
@@ -36,8 +34,8 @@ export default {
}
});
}
//小程序常规请求
Vue
.
prototype
.
request2
=
function
(
param
,
success
,
failed
)
{
//网络请求
uni
.
request
({
url
:
this
.
host2
+
param
.
url
,
method
:
param
.
method
||
"Post"
,
...
...
@@ -59,7 +57,6 @@ export default {
let
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
if
(
u
)
{
this
.
getLogin_t
(
u
)
// typeof failed == "function" && failed(res.data);
}
}
else
if
(
res
.
data
.
resultCode
!=
1
)
{
if
(
res
.
data
.
message
!=
''
)
{
...
...
@@ -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失效再次登录接口
Vue
.
prototype
.
getLogin_t
=
function
(
obj
)
{
let
pid
=
uni
.
getStorageSync
(
"pid"
)
?
uni
.
getStorageSync
(
"pid"
).
pid
:
0
;
...
...
@@ -120,7 +161,7 @@ export default {
// 获取小程序APPID
Vue
.
prototype
.
GetMiniAppId
=
function
()
{
let
appObj
=
{};
let
appType
=
1
;
let
appType
=
3
;
switch
(
appType
)
{
case
1
:
//赞羊
appObj
=
{
...
...
@@ -165,47 +206,47 @@ export default {
};
break
;
case
7
:
appObj
=
{
//韩国馆
appObj
=
{
//韩国馆
AppId
:
'wxbb033190e0ffa5db'
,
TenantId
:
18
,
MallBaseId
:
8
,
};
break
;
case
8
:
appObj
=
{
//恋爱星球
appObj
=
{
//恋爱星球
AppId
:
'wx681f8ad58e6c48e4'
,
TenantId
:
21
,
MallBaseId
:
11
,
};
break
;
case
9
:
appObj
=
{
//罗演的杂货铺
appObj
=
{
//罗演的杂货铺
AppId
:
'wx67a8fb290ec58af4'
,
TenantId
:
20
,
MallBaseId
:
10
,
};
break
;
case
10
:
appObj
=
{
//梅玲
appObj
=
{
//梅玲
AppId
:
'wx350f244458e5ba01'
,
TenantId
:
22
,
MallBaseId
:
12
,
};
break
;
break
;
case
11
:
appObj
=
{
//星之旅
appObj
=
{
//星之旅
AppId
:
'wxa2c92313ece345f5'
,
TenantId
:
23
,
MallBaseId
:
13
,
};
break
;
break
;
case
12
:
appObj
=
{
//橙孀
appObj
=
{
//橙孀
AppId
:
'wx442f2a74b09d5f89'
,
TenantId
:
24
,
MallBaseId
:
14
,
};
break
;
break
;
}
return
appObj
;
}
...
...
@@ -217,6 +258,7 @@ export default {
UserId
:
0
,
token
:
''
,
SmallShopsId
:
0
,
AdminToken
:
""
,
//后台Token
}
if
(
mall_userinfo
)
{
if
(
mall_userinfo
.
OpenId
)
{
...
...
@@ -224,6 +266,7 @@ export default {
obj
.
UserId
=
mall_userinfo
.
UserId
;
obj
.
token
=
mall_userinfo
.
Token
;
obj
.
SmallShopsId
=
mall_userinfo
.
UserSmallShopId
;
obj
.
AdminToken
=
mall_userinfo
.
AdminToken
;
}
}
return
obj
...
...
@@ -245,7 +288,6 @@ export default {
val
=
Number
(
val
).
toFixed
(
2
);
return
val
}
Vue
.
prototype
.
apiheader
=
function
()
{
return
{
'X-Access-Token'
:
'_4Y_WpUZ4a6SI5uJgsZ4Lb7t9mvqJTyr'
,
...
...
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