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
447e663d
Commit
447e663d
authored
4 years ago
by
zhengxiuming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop'
parents
daac47f7
d1ecdebd
master
develop
wjw_ins_upadte
1.0.1.11
No related merge requests found
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 @
447e663d
...
...
@@ -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
})
...
...
This diff is collapsed.
Click to expand it.
pages/wxpay/wxpay.vue
View file @
447e663d
...
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
yarn.lock
0 → 100644
View file @
447e663d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
This diff is collapsed.
Click to expand it.
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