Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-annual-summary
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-annual-summary
提交
1b5de8fe
提交
1b5de8fe
编写于
9月 07, 2020
作者:
guofeng.chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
测试支付
上级
d75e1475
变更
5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
39 行增加
和
11 行删除
+39
-11
main.js
src/main.js
+1
-1
user.js
src/store/modules/user.js
+0
-2
common.less
src/style/common.less
+5
-0
wxShare.js
src/utils/wxShare.js
+6
-0
goods-detail.vue
src/views/goods-detail.vue
+27
-8
未找到文件。
src/main.js
浏览文件 @
1b5de8fe
...
@@ -82,7 +82,7 @@ function fliterRoute(query, path) {
...
@@ -82,7 +82,7 @@ function fliterRoute(query, path) {
}
}
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
console
.
log
(
'_____href_____'
,
location
.
href
)
// 商品页授权登录路由处理
if
(
to
.
path
===
'/goods-detail'
)
{
if
(
to
.
path
===
'/goods-detail'
)
{
let
searchQuery
=
querystring
(
location
.
search
);
let
searchQuery
=
querystring
(
location
.
search
);
if
(
searchQuery
.
code
)
{
if
(
searchQuery
.
code
)
{
...
...
src/store/modules/user.js
浏览文件 @
1b5de8fe
...
@@ -77,14 +77,12 @@ const user = {
...
@@ -77,14 +77,12 @@ const user = {
},
},
getWxUserInfo
({
state
,
commit
},
code
)
{
getWxUserInfo
({
state
,
commit
},
code
)
{
console
.
log
(
'_______getWxUserInfo__________'
,
code
)
const
type
=
15
;
const
type
=
15
;
fetch
({
fetch
({
url
:
getBaseUrl
(
`wechats/users/info/
${
type
}
/
${
code
}
`
),
url
:
getBaseUrl
(
`wechats/users/info/
${
type
}
/
${
code
}
`
),
method
:
'get'
,
method
:
'get'
,
headers
:
{
token
:
state
.
token
}
headers
:
{
token
:
state
.
token
}
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
'____wx res_____'
,
res
.
data
)
sessionStorage
.
setItem
(
'wxInfo'
,
JSON
.
stringify
(
res
.
data
));
sessionStorage
.
setItem
(
'wxInfo'
,
JSON
.
stringify
(
res
.
data
));
commit
(
'SET_WX_INFO'
,
res
.
data
)
commit
(
'SET_WX_INFO'
,
res
.
data
)
});
});
...
...
src/style/common.less
浏览文件 @
1b5de8fe
...
@@ -96,6 +96,11 @@ html,body{
...
@@ -96,6 +96,11 @@ html,body{
zoom:1;
zoom:1;
}
}
.deep-img-w100 img{
display: block;
width: 100%;
}
.back_img{
.back_img{
background-repeat: no-repeat;
background-repeat: no-repeat;
background-size: 100% 100%;
background-size: 100% 100%;
...
...
src/utils/wxShare.js
浏览文件 @
1b5de8fe
...
@@ -122,6 +122,12 @@ export const wechatShare = (option = {}, successCB = () => {}, hideMenu) => {
...
@@ -122,6 +122,12 @@ export const wechatShare = (option = {}, successCB = () => {}, hideMenu) => {
}
}
};
};
export
function
chooseWXPay
(
params
)
{
wx
.
ready
(()
=>
{
wx
.
chooseWXPay
(
params
);
})
}
Vue
.
prototype
.
wechatShare
=
wechatShare
;
Vue
.
prototype
.
wechatShare
=
wechatShare
;
Vue
.
prototype
.
wxDisabledShare
=
wxDisabledShare
;
Vue
.
prototype
.
wxDisabledShare
=
wxDisabledShare
;
...
...
src/views/goods-detail.vue
浏览文件 @
1b5de8fe
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
<div
class=
"tab-line"
:style=
"
{left: `${tabLeft}px`}">
</div>
<div
class=
"tab-line"
:style=
"
{left: `${tabLeft}px`}">
</div>
</div>
</div>
<!-- 详情 -->
<!-- 详情 -->
<div
class=
"detail-box"
v-html=
"tabs[curtTabIdx] && tabs[curtTabIdx]['detail']"
></div>
<div
class=
"detail-box
deep-img-w100
"
v-html=
"tabs[curtTabIdx] && tabs[curtTabIdx]['detail']"
></div>
<!-- 底部购买 -->
<!-- 底部购买 -->
<div
class=
"btn-box"
>
<div
class=
"btn-box"
>
<div
class=
"money"
>
<div
class=
"money"
>
...
@@ -73,8 +73,10 @@
...
@@ -73,8 +73,10 @@
<
script
>
<
script
>
import
{
Swipe
,
SwipeItem
}
from
'vant'
;
import
{
Swipe
,
SwipeItem
}
from
'vant'
;
import
{
wxConfig
,
chooseWXPay
}
from
'@/utils/wxShare'
;
import
{
getAPPID
,
getWebPageUrl
,
isWeiXin
,
wxOauth
,
debounce
}
from
'@/utils'
;
import
{
getAPPID
,
getWebPageUrl
,
isWeiXin
,
wxOauth
,
debounce
}
from
'@/utils'
;
const
isWechat
=
isWeiXin
();
const
isWechat
=
isWeiXin
();
wxConfig
(
location
.
href
);
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -109,7 +111,7 @@ export default {
...
@@ -109,7 +111,7 @@ export default {
},
},
mounted
()
{
mounted
()
{
this
.
projectId
=
this
.
$route
.
query
.
projectId
;
this
.
projectId
=
this
.
$route
.
query
.
projectId
;
this
.
goodsId
=
this
.
$route
.
query
.
goodsId
||
10077
;
this
.
goodsId
=
this
.
$route
.
query
.
goodsId
||
74
;
this
.
returnUrl
=
this
.
$route
.
query
.
returnUrl
;
this
.
returnUrl
=
this
.
$route
.
query
.
returnUrl
;
this
.
getGoodsInfo
();
this
.
getGoodsInfo
();
this
.
getTabW
();
this
.
getTabW
();
...
@@ -294,14 +296,34 @@ export default {
...
@@ -294,14 +296,34 @@ export default {
// 微信内支付
// 微信内支付
goWxPayInner
(
orderId
)
{
goWxPayInner
(
orderId
)
{
const
data
=
{
const
data
=
{
openId
:
getAPPID
()
,
openId
:
this
.
wxInfo
.
openid
,
orderId
,
orderId
,
payChannel
:
1
,
payChannel
:
1
,
tradeType
:
1
,
tradeType
:
1
,
}
}
this
.
POST
(
'trade/center/jsapi_prepay'
,
data
).
then
(
res
=>
{
this
.
POST
(
'trade/center/jsapi_prepay'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
if
(
res
.
code
==
"000000"
)
{
console
.
log
(
'______prepay_____'
,
res
.
data
);
const
that
=
this
;
const
payData
=
{
...
res
.
data
,
success
:
function
()
{
let
query
=
{
orderId
};
if
(
that
.
projectId
)
{
query
.
projectId
=
that
.
projectId
}
if
(
that
.
returnUrl
)
{
query
.
returnUrl
=
that
.
returnUrl
}
that
.
$router
.
push
(
'prezult'
,
query
);
},
fail
:
function
()
{
that
.
$toast
(
'支付失败,请重试~'
);
},
cancel
:
function
()
{},
complete
:
function
()
{},
};
chooseWXPay
(
payData
);
}
else
{
}
else
{
this
.
$toast
(
res
.
message
);
this
.
$toast
(
res
.
message
);
}
}
...
@@ -526,10 +548,6 @@ export default {
...
@@ -526,10 +548,6 @@ export default {
font-size: 14px;
font-size: 14px;
text-align: justify;
text-align: justify;
padding: 15px 15px 75px;
padding: 15px 15px 75px;
img{
display: block;
width: 100%;
}
}
}
.btn-box{
.btn-box{
display: flex;
display: flex;
...
@@ -541,6 +559,7 @@ export default {
...
@@ -541,6 +559,7 @@ export default {
height: 60px;
height: 60px;
padding: 10px 15px;
padding: 10px 15px;
box-shadow: 0 -4px 4px rgba(240, 240, 240, 0.5);
box-shadow: 0 -4px 4px rgba(240, 240, 240, 0.5);
background-color: #fff;
.money{
.money{
flex: 1;
flex: 1;
width: 100px;
width: 100px;
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录