Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-professional-exam
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-professional-exam
提交
a948e3f7
提交
a948e3f7
编写于
10月 21, 2020
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
站内调用原生方法
上级
291276fc
变更
3
展开全部
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
890 行增加
和
96 行删除
+890
-96
mixins.js
src/utils/mixins.js
+6
-2
goods-detail copy 1022.vue
src/views/goods-detail copy 1022.vue
+729
-0
goods-detail.vue
src/views/goods-detail.vue
+155
-94
未找到文件。
src/utils/mixins.js
浏览文件 @
a948e3f7
...
...
@@ -7,7 +7,7 @@ import { mapGetters } from 'vuex';
module
.
exports
=
{
data
:
function
()
{
return
{
token
:
'
weewfwefw'
token
:
'
'
,
}
},
created
:
function
()
{
...
...
@@ -235,7 +235,11 @@ module.exports = {
};
this
.
GET
(
"campaign/admin/task/checkToken"
,
param
).
then
(
res
=>
{
if
(
res
.
code
!==
"000000"
)
{
if
(
Window
.
__isWeb
)
{
this
.
goLogin
();
}
else
{
rocNative
.
gotoLogin
();
}
}
else
{
cb
&&
cb
()
}
...
...
src/views/goods-detail copy 1022.vue
0 → 100644
浏览文件 @
a948e3f7
此差异已折叠。
点击以展开。
src/views/goods-detail.vue
浏览文件 @
a948e3f7
...
...
@@ -78,12 +78,12 @@
</div>
<Loading
v-show=
"showLoading"
/>
<!--去激活-->
<C
hangeCard
<C
ouponSelectList
:changeErrorMsg=
"changeCardErrorMsg"
:isShow=
"showChangeCard"
@
cancle=
"cancleChangeCard"
@
confirm=
"changeCardAction"
>
</C
hangeCard
>
</C
ouponSelectList
>
<CourseDialog
content=
"微信授权"
subContent=
'
<p
style=
"font-size: 16px; font-weight: bold; text-align: center;"
>
云鹊医申请以下权限:
</p><p
style=
"font-size: 14px; color: #999; text-align: center; padding-bottom: 10px;"
>
获得你的公开信息(头像,昵称等)
</p>
'
...
...
@@ -101,10 +101,10 @@
import
{
Swipe
,
SwipeItem
}
from
'vant'
;
import
Loading
from
"@/components/common/common-loading"
;
import
CourseDialog
from
"@/components/course/course-dialog"
;
import
C
hangeCard
from
"@/components/coupon/coupon-select-list"
;
import
C
ouponSelectList
from
"@/components/coupon/coupon-select-list"
;
import
{
wxConfig
,
chooseWXPay
}
from
'@/utils/wxShare'
;
import
{
getAPPID
,
getTradeType
,
getWebPageUrl
,
isWeiXin
,
wxOauth
,
debounce
}
from
'@/utils'
;
import
{
getAPPID
,
getTradeType
,
getWebPageUrl
,
isWeiXin
,
wxOauth
,
debounce
,
getHactiveUrl
}
from
'@/utils'
;
import
{
mapGetters
}
from
"vuex"
;
const
isWechat
=
isWeiXin
();
// wxConfig(location.href);
...
...
@@ -115,10 +115,12 @@ export default {
SwipeItem
,
Loading
,
CourseDialog
,
C
hangeCard
C
ouponSelectList
},
data
()
{
return
{
token
:
""
,
isWeb
:
Window
.
__isWeb
,
goods
:
{
salePrice
:
{},
},
// 商品信息
...
...
@@ -133,13 +135,10 @@ export default {
isShowDialog
:
false
,
showChangeCard
:
false
,
//是否展示激活弹框,
changeCardErrorMsg
:
""
,
courseUrl
:
""
,
}
},
computed
:
{
...
mapGetters
([
"logged"
]),
// logged() {
// return this.$store.getters.logged;
// },
wxInfo
()
{
return
this
.
$store
.
state
.
user
.
wxInfo
;
},
...
...
@@ -152,11 +151,13 @@ export default {
},
},
created
()
{
let
_this
=
this
;
console
.
log
(
'in goods detail new'
,
111111111
);
let
href
=
location
.
href
;
this
.
shareUrl
=
href
;
this
.
projectId
=
this
.
$route
.
query
.
projectId
;
this
.
goodsId
=
this
.
$route
.
query
.
goodsId
||
74
;
this
.
courseUrl
=
this
.
$route
.
query
.
courseUrl
||
''
;
//
if
(
href
.
indexOf
(
"singlemessage"
)
>=
0
||
href
.
indexOf
(
"wx_code"
)
>=
0
)
{
if
(
this
.
projectId
)
{
this
.
shareUrl
=
getWebPageUrl
(
`profexam/#/goods-detail?goodsId=
${
this
.
goodsId
}
&projectId=
${
this
.
projectId
}
`
);
...
...
@@ -166,24 +167,34 @@ export default {
location
.
replace
(
this
.
shareUrl
);
}
localStorage
.
setItem
(
'returnUrl'
,
this
.
shareUrl
);
window
.
__getUserInfo4GD
=
function
(
param
)
{
// appVersion 安卓 3.2.2 iOS
console
.
log
(
"__getUserInfo4GD"
,
param
);
_this
.
token
=
param
.
userToken
;
_this
.
setUserInfo
(
param
);
};
window
.
__refresh
=
function
()
{
_this
.
getAppUserInfo
();
};
window
.
__WXpay
=
function
(
params
){
_this
.
paycallback
(
params
)
};
},
mounted
()
{
this
.
getGoodsInfo
();
this
.
getTabW
();
if
(
this
.
isWeb
)
{
const
{
token
,
info
}
=
this
.
$store
.
state
.
user
;
if
(
token
&&
!
info
.
id
)
{
this
.
$store
.
dispatch
(
'getUserInfo'
);
}
// // 微信内先去授权
// if (isWechat && !this.wxInfo.openid) {
// if (location.search.indexOf('code') >= 0 || this.wxCode) {
// // 避免code中转页再次授权
// return;
// }
// wxOauth();
// return;
// }
}
else
{
this
.
getAppUserInfo
();
}
// 数量加减
this
.
curtGoodsNum
=
this
.
goodsNum
;
...
...
@@ -192,6 +203,44 @@ export default {
sessionStorage
.
setItem
(
'goodsDetailParams'
,
JSON
.
stringify
(
this
.
$route
.
query
))
},
methods
:
{
//获取用户信息
getAppUserInfo
()
{
rocNative
.
getUserInfo
({
__funcName
:
"__getUserInfo4GD"
});
},
// 微信支付回调
paycallback
(
params
)
{
// 0成功 -1错误 -2 用户取消 -3 没有安装微信
let
url
=
getHactiveUrl
()
+
`/order?orderBack=1&id=
${
this
.
orderId
}
&courseUrl=
${
this
.
courseUrl
}
`
;
if
(
params
.
result
==
-
3
)
{
this
.
$toast
(
'您未安装微信,暂不能支付'
);
}
else
if
(
params
.
result
==
-
2
)
{
this
.
POST
(
`/trade/center/order/pay_cancelled`
,
{
orderId
:
this
.
orderId
}).
then
(
res
=>
{
this
.
jumpToOrder
(
url
);
}).
catch
((
err
)
=>
{})
}
else
{
this
.
jumpToOrder
(
url
);
}
},
// 跳转到指定页面
jumpToOrder
(
pageUrl
)
{
let
paramList
=
[
{
key
:
"pageUrl"
,
value
:
pageUrl
,
type
:
4
,
seqNo
:
1
}
]
rocNative
.
dispatchEventByModuleCode
({
modeCode
:
"M300"
,
jsonString
:
paramList
});
},
cancleChangeCard
()
{
this
.
showChangeCard
=
false
;
},
...
...
@@ -323,10 +372,7 @@ export default {
this
.
$sendBuriedData
({
component_tag
:
`888#88801`
});
if
(
!
this
.
logged
)
{
this
.
goLogin
();
return
;
}
this
.
commonCheckToken
(()
=>
{
let
num
=
this
.
curtGoodsNum
;
if
(
this
.
goods
.
limitPurchase
&&
this
.
goods
.
limitPurchaseNum
&&
num
>=
this
.
goods
.
limitPurchaseNum
)
{
this
.
$toast
(
'已达最大限购数量'
)
...
...
@@ -338,16 +384,16 @@ export default {
}
this
.
curtGoodsNum
=
num
+
1
;
this
.
countTotalPrice
();
});
},
// 数量减
onReduce
()
{
this
.
$sendBuriedData
({
component_tag
:
`888#88802`
});
if
(
!
this
.
logged
)
{
this
.
goLogin
();
return
;
}
this
.
commonCheckToken
(()
=>
{
let
num
=
this
.
curtGoodsNum
;
if
(
num
<=
1
)
{
this
.
$toast
(
'最少购买一张哦'
)
...
...
@@ -355,6 +401,7 @@ export default {
}
this
.
curtGoodsNum
=
num
-
1
;
this
.
countTotalPrice
();
});
},
goLogin
()
{
this
.
$store
.
dispatch
(
'goLogin'
);
...
...
@@ -370,11 +417,8 @@ export default {
this
.
$sendBuriedData
({
component_tag
:
`888#88803`
});
if
(
!
this
.
logged
)
{
this
.
goLogin
();
return
;
}
this
.
commonCheckToken
(()
=>
{
// 微信内先去授权
if
(
isWechat
&&
!
this
.
wxInfo
.
openid
)
{
this
.
isShowDialog
=
true
;
...
...
@@ -403,11 +447,27 @@ export default {
this
.
POST
(
'trade/center/order/createV2'
,
orderData
).
then
(
res
=>
{
if
(
res
.
code
==
"000000"
)
{
const
orderId
=
res
.
data
.
orderId
;
// if (isWechat) {
// this.goWxPayInner(orderId);
// } else {
// this.goWxPayOut(orderId);
// }
// 在站外,则调用站外支付
if
(
isWeb
)
{
if
(
isWechat
)
{
this
.
goWxPayInner
(
orderId
);
}
else
{
this
.
goWxPayOut
(
orderId
);
}
}
else
{
// TODO 使用
rocNative
.
WXpay
({
'__funcName'
:
'__WXpay'
,
'orderId'
:
String
(
orderId
)
});
}
if
(
this
.
projectId
)
{
this
.
createRelation
(
this
.
projectId
,
orderId
);
}
...
...
@@ -421,6 +481,7 @@ export default {
}).
catch
(()
=>
{
this
.
showLoading
=
false
;
});
});
},
// 微信内支付
goWxPayInner
(
orderId
)
{
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录