Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shop_mobile_uni
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
郑秀明
shop_mobile_uni
Commits
d1ecdebd
Commit
d1ecdebd
authored
Sep 07, 2020
by
zhengxiuming
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
522b4ae7
' into develop
parents
232c89d7
522b4ae7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2932 additions
and
74 deletions
+2932
-74
main.js
main.js
+58
-15
wxpay.vue
pages/wxpay/wxpay.vue
+66
-59
yarn.lock
yarn.lock
+2808
-0
No files found.
main.js
View file @
d1ecdebd
...
...
@@ -20,6 +20,49 @@ Vue.prototype.$wechat = wechat;
// #endif
Vue
.
config
.
productionTip
=
false
;
const
{
origin
}
=
window
.
location
;
let
url
=
''
;
// 测试环境
if
(
origin
.
indexOf
(
'local'
)
>
-
1
||
origin
.
indexOf
(
'test'
)
>
-
1
)
{
if
(
origin
.
indexOf
(
'test'
)
>
-
1
)
{
url
=
origin
+
'/mobile/index.php?'
;
}
else
{
url
=
'https://test.pet-dbc.cn/mobile/index.php?'
;
}
}
else
if
(
origin
.
indexOf
(
'jingxiang'
)
>
-
1
)
{
url
=
'https://jingxiang.pet-dbc.cn/mobile/index.php?'
;
}
else
{
url
=
'https://shop.pet-dbc.cn/mobile/index.php?'
;
}
var
search
=
window
.
location
.
href
.
split
(
'?'
);
if
(
search
[
1
])
{
var
arr
=
search
[
1
].
split
(
'&'
);
arr
.
every
((
item
,
index
)
=>
{
var
kv
=
item
.
split
(
'='
);
if
(
kv
[
0
]
===
'openId'
)
{
localStorage
.
openId
=
kv
[
1
];
var
exp
=
new
Date
();
exp
.
setTime
(
exp
.
getTime
()
+
3650
*
24
*
60
*
60
*
1000
);
document
.
cookie
=
'openId='
+
kv
[
1
]
+
';expires='
+
exp
.
toGMTString
();
$
.
ajax
({
url
:
url
+
'app=weixin&act=autoLogin'
,
type
:
'get'
,
data
:
{
openid
:
kv
[
1
]
},
dataType
:
'json'
,
success
:
function
(
res
)
{
alert
(
JSON
.
stringify
(
res
))
}
})
}
if
(
kv
[
0
]
===
'inionid'
)
{
localStorage
.
unionid
=
kv
[
1
];
}
});
}
// 加入购物车
function
addCart
(
spec_id
,
quantity
,
isLogin
)
{
...
...
@@ -86,10 +129,10 @@ function backup() {
// 跳转外部链接,使用webview
function
jump
(
url
,
type
)
{
// #ifdef H5
if
(
type
===
1
)
{
if
(
type
===
1
)
{
// 重定向到指定地址,防止回退
window
.
location
.
replace
(
url
);
}
else
if
(
type
===
2
){
}
else
if
(
type
===
2
)
{
uni
.
navigateTo
({
url
:
url
})
...
...
pages/wxpay/wxpay.vue
View file @
d1ecdebd
...
...
@@ -86,6 +86,11 @@
},
2000
);
return
;
}
jWeixin
.
miniProgram
.
getEnv
(
function
(
result
)
{
if
(
result
.
miniprogram
){
var
path
=
'/pages/pay/index?payParam='
+
encodeURIComponent
(
JSON
.
stringify
(
res
))
+
'&type=uni'
;
jWeixin
.
miniProgram
.
navigateTo
({
url
:
path
});
}
else
{
WeixinJSBridge
.
invoke
(
'getBrandWCPayRequest'
,
{
"appId"
:
res
.
app_id
,
//公众号名称,由商户传入
...
...
@@ -146,6 +151,8 @@
}
}
);
}
})
},
goBack
(){
this
.
$backup
();
...
...
yarn.lock
0 → 100644
View file @
d1ecdebd
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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