Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eduline
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
eduline
Commits
837d6bf1
Commit
837d6bf1
authored
Jun 03, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
68d5563a
005724fa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
785 additions
and
305 deletions
+785
-305
apps/course/Tpl/default/PayVideo/index_w3g.html
+202
-297
apps/course/Tpl/default/PayVideo/index_w3g_new.html
+516
-0
apps/exams/Tpl/default/Index/pay_w3g.html
+33
-3
apps/mall/Tpl/default/Goods/pay_w3g.html
+34
-5
No files found.
apps/course/Tpl/default/PayVideo/index_w3g.html
View file @
837d6bf1
<include
file=
"__THEME__/public_header_w3g"
/>
<include
file=
"__THEME__/public_header_w3g"
/>
<
!-- <link href="__APP__/css/pay_video_3g.css" rel="stylesheet"> --
>
<
link
href=
"__APP__/css/pay_video_3g.css"
rel=
"stylesheet"
>
<style>
<style>
body
{
padding
:
0
!important
;
}
</style>
<div
id=
"app"
>
<div
class=
"layout_v"
>
<div
class=
"pay_course_info layout_h"
>
<van-image
src=
"{:getCover($cover,220,130)}"
fit=
"cover"
width=
"120"
height=
"68"
></van-image>
<div
class=
"layout_v"
style=
"margin-left: 0.75rem;"
>
<span
class=
"text_14_600 color_333333"
>
{$video_title}
</span>
<span
class=
"text_14_600 color_FF3B3B"
style=
"margin-top: 0.5rem;"
>
¥{$moner_data['oriPrice']}
</span>
</div>
</div>
<div
class=
"normal_gap"
></div>
<div
class=
"layout_v pay_course_bottom"
>
<span
class=
"text_16_600 color_333333"
style=
"margin-bottom: 0.75rem;"
>
选择支付方式
</span>
<div
class=
"layout_h_b"
>
<div
class=
"layout_h_v_c"
>
<van-image
height=
"28"
width=
"28"
fit=
"cover"
src=
"__THEME__/img/weichat_logo.png"
></van-image>
<span
class=
"text_14_400 color_333333"
style=
"margin-left: 0.75rem;"
>
微信
</span>
</div>
<van-icon
class=
"self_center"
name=
"__THEME__/img/picker_y@3x.png"
size=
"20"
></van-icon>
</div>
</div>
<div
class=
"divider"
></div>
<div
style=
"margin: 1.5rem 0.75rem;"
class=
"layout_h_v_c"
>
<van-icon
@
click=
"agree = !agree"
size=
"22"
:name=
"agree ? '__THEME__/img/picker_y@3x.png' : '__THEME__/img/unpicker.png'"
style=
"margin-right: 0.5rem;"
></van-icon>
我已阅读并同意
<a
href=
"{:U('basic/Single/info',array('id'=>'buy'))}"
><span
class=
"color_primary"
>
《{$site['site_keyword']}购买协议》
</span></a>
</div>
</div>
<div
class=
"layout_h_v_c fixed_bottom_bar"
>
<span
class=
"text_14_600 color_333333"
style=
"margin-right: 0.5rem;"
>
合计
</span>
<span
class=
"text_14_600 color_FF3B3B"
>
¥{{totalPrice}}
</span>
<span
class=
"text_12_400 color_999999"
>
{{discount}}
</span>
<div
class=
"weight_full layout_h_r"
>
<div
@
click=
"onBuy({$id}, 'video')"
class=
"vip_buy_pay_button layout_center"
><span
class=
"text_14_400 color_white"
>
确认支付
</span></div>
</div>
</div>
</div>
<script>
</style>
new
Vue
({
el
:
"#app"
,
data
:
function
()
{
return
{
agree
:
false
,
info
:
{}
}
},
created
:
function
(){
},
computed
:
{
totalPrice
:
function
()
{
return
"{$moner_data['price']}"
},
discount
:
function
()
{
return
"(已优惠:¥0)"
}
},
methods
:
{
onBuy
:
function
(
id
,
type
)
{
let
that
=
this
if
(
that
.
agree
)
{
$
.
post
(
U
(
"course/PayVideo/checkPayOperat"
),
{
check_type
:
'{$pay_video_type}'
,
mid
:
MID
,
vid
:
id
,
pay
:
"wxpay"
,
money
:
"{$moner_data['oriPrice']}"
,
},
function
(
data
)
{
let
res
=
JSON
.
parse
(
data
)
if
(
res
.
status
==
1
)
{
that
.
startWxPay
(
id
)
}
else
{
ui
.
error
(
res
.
info
)
}
})
}
else
{
ui
.
error
(
'请阅读并同意购买协议'
)
}
},
startWxPay
:
function
(
id
)
{
$
.
ajax
({
url
:
"{:U('course/PayVideo/payLibrary')}"
,
data
:{
check_type
:
'{$pay_video_type}'
,
mid
:
MID
,
vid
:
id
,
pay
:
"wxpay"
,
money
:
"{$moner_data['oriPrice']}"
,
},
async
:
false
,
type
:
'post'
,
success
:
function
(
data
){
let
res
=
JSON
.
parse
(
data
)
if
(
res
.
status
==
1
)
{
}
else
{
ui
.
error
(
res
.
data
)
}
}})
},
checkPayStatus
:
function
(
num
)
{
let
that
=
this
$
.
ajax
({
url
:
"{:U('course/PayVideo/getPayStatus')}"
,
data
:{
pay_pass_num
:
num
},
type
:
'post'
,
success
:
function
(
res
){
try
{
res
=
JSON
.
parse
(
res
)
if
(
res
.
status
==
1
)
{
ui
.
success
(
'购买成功'
)
setTimeout
(
function
(){
window
.
location
.
href
=
res
.
data
},
1500
)
}
else
{
setTimeout
(
()
=>
{
that
.
checkPayStatus
(
num
)
},
1000
)
}
}
catch
(
e
){
return
}
}
})
}
}
})
</script>
<
!-- <
div class="body">
<div
class=
"body"
>
<div
class=
"wrap"
>
<div
class=
"wrap"
>
<div
class=
"min-height-wrap"
>
<div
class=
"min-height-wrap"
>
<div
class=
"class_order_tit"
>
核对订单信息
</div>
<!--商品信息-->
<dl
class=
"df_course-info"
>
<dl
class=
"df_course-info"
>
<dt><h3>
商品信息
</h3></dt>
<dd>
<dd>
<if
condition=
"$pay_video_type eq 'zy_video'"
>
<if
condition=
"$pay_video_type eq 'zy_video'"
>
<a
href=
"{:U('course/Video/view',['id'=>$id])}"
>
<a
href=
"{:U('course/Video/view',['id'=>$id])}"
>
<elseif condition="$pay_video_type eq 'zy_live'" />
<elseif
condition=
"$pay_video_type eq 'zy_live'"
/>
<a href="{:U('live/Index/view',['id'=>$id])}">
<a
href=
"{:U('live/Index/view',['id'=>$id])}"
>
<elseif condition="$pay_video_type eq 'zy_album'" />
<elseif
condition=
"$pay_video_type eq 'zy_album'"
/>
<a href="{:U('course/Album/view',['id'=>$id])}">
<a
href=
"{:U('course/Album/view',['id'=>$id])}"
>
<elseif condition="$pay_video_type eq 'zy_line_course'" />
<elseif
condition=
"$pay_video_type eq 'zy_line_course'"
/>
<a href="{:U('course/Album/view',['id'=>$id])}">
<a
href=
"{:U('course/Album/view',['id'=>$id])}"
>
<elseif condition="$pay_video_type eq 'zy_classes'" />
<elseif
condition=
"$pay_video_type eq 'zy_classes'"
/>
<a href="{:U('course/Classes/view',['id'=>$id])}">
<a
href=
"{:U('course/Classes/view',['id'=>$id])}"
>
</if>
</if>
<span>
<span>
<img
src=
"{:getCover($cover,220,130)}"
width=
"120"
height=
"70"
alt=
"{$video_title}"
>
<img
src=
"{:getCover($cover,220,130)}"
width=
"120"
height=
"70"
alt=
"{$video_title}"
>
</span>
</span>
<h3>
<h3>
{$video_title|mStr=20}<if condition="$course_hour_info"> - {$course_hour_info['title']|mStr=20}</if>
{$video_title|mStr=20}
<if
condition=
"$course_hour_info"
>
- {$course_hour_info['title']|mStr=20}
</if>
<p>¥<if condition="$course_hour_info">{$course_hour_info['course_hour_price']}<else/>
<p>
¥
<if
condition=
"$course_hour_info"
>
{$course_hour_info['course_hour_price']}
<else/>
<if condition="$is_event"> {$moner_data['selPrice']}<else/>{$moner_data['oriPrice']}</if>
<if
condition=
"$is_event"
>
{$moner_data['selPrice']}
<else/>
{$moner_data['oriPrice']}
</if>
</if></p>
</if></p>
</h3>
</h3>
</a>
</a>
</dd>
</dd>
</dl>
</dl>
<!--支付方式-->
<dl
class=
"df_pay-style"
>
<dl
class=
"df_pay-style"
>
<dt><h3>
支付方式
</h3></dt>
<dt><h3>
支付方式
</h3></dt>
<php>
if($is_wx){unset($payWay['支付宝支付']);}$firstPayWay = current($payWay);
</php>
<php>
if($is_wx){unset($payWay['支付宝支付']);}$firstPayWay = current($payWay);
</php>
...
@@ -179,23 +51,26 @@
...
@@ -179,23 +51,26 @@
</if>
</if>
<if
condition=
"in_array('unionpay',$payConfig['pay'])"
>
<if
condition=
"in_array('unionpay',$payConfig['pay'])"
>
<!--<span val="unionpay">银联支付</span>-->
</if>
</if>
<if
condition=
"in_array('lcnpay',$payConfig['pay'])"
>
<if
condition=
"in_array('lcnpay',$payConfig['pay'])"
>
<dd value="lcnpay" class="paytype"><a class="icon icon-qianbao"></a><span class="name">余额支付(¥{$account_balance})</span><i class="<if condition='($firstPayWay eq lcnpay)'>icon icon-xuanze</if>"></i></dd>
<dd
value=
"lcnpay"
class=
"paytype"
><a
class=
"icon icon-qianbao"
></a><span
class=
"name"
>
<!-- <img style="width: 24px;position: relative;top: -4px;left: -1%" src="__APP__/icon/yue.png" alt="图标"/> -->
余额支付(¥{$account_balance})
</span><i
class=
"<if condition='($firstPayWay eq lcnpay)'>icon icon-xuanze</if>"
></i></dd>
</if>
</if>
</dl>
</dl>
<if condition="$is_asb OR ($pay_order AND $used_coupon)">
<!--优惠券-->
<elseif condition="$show_coupon eq 1 and $course_hour_info eq null" />
<if
condition=
"$is_asb OR ($pay_order AND $used_coupon)"
>
<!-- 拼团无优惠券 --><!-- 砍价成功无优惠券 -->
<dl class="df_pay-coupon">
<elseif
condition=
"$show_coupon eq 1 and $course_hour_info eq null"
/>
<a href="{:U('course/PayVideo/coupon',['id'=>$id, 'vst'=>$coupon_vst, 'asb'=>$_GET['asb']])}">
<dl
class=
"df_pay-coupon"
>
<dt><h3>优惠券</h3></dt>
<a
href=
"{:U('course/PayVideo/coupon',['id'=>$id, 'vst'=>$coupon_vst, 'asb'=>$_GET['asb']])}"
>
<dd><p><if condition="$videoCoupon or $discount or $courseCard">有<else/>无</if>可用优惠券<i class="icon icon-youjiantou"></i></p></dd>
<dt><h3>
优惠券
</h3></dt>
</a>
<dd><p><if
condition=
"$videoCoupon or $discount or $courseCard"
>
有
<else/>
无
</if>
可用优惠券
<i
class=
"icon icon-youjiantou"
></i></p></dd>
</dl>
</a>
</dl>
</if>
</if>
<!--实付金额-->
<dl
class=
"df_pay-price"
>
<dl
class=
"df_pay-price"
>
<dd><h3>
实付金额
</h3><p
id=
"pay_money"
>
¥
<if
condition=
"$course_hour_info"
>
{$course_hour_info['course_hour_price']}
<else/>
{$moner_data['price']}
</if></p></dt>
<dd><h3>
实付金额
</h3><p
id=
"pay_money"
>
¥
<if
condition=
"$course_hour_info"
>
{$course_hour_info['course_hour_price']}
<else/>
{$moner_data['price']}
</if></p></dt>
<if
condition=
"in_array($pay_video_type, ['zy_video','zy_live','zy_classes']) and $chd eq 0"
>
<if
condition=
"in_array($pay_video_type, ['zy_video','zy_live','zy_classes']) and $chd eq 0"
>
...
@@ -203,10 +78,12 @@
...
@@ -203,10 +78,12 @@
</if>
</if>
</dl>
</dl>
<!--购买协议-->
<div
class=
"df_pay-protocol"
>
<div
class=
"df_pay-protocol"
>
<p><i
class=
"icon icon-xuanze"
attr=
"1"
></i>
我已阅读并同意
<a
href=
"{:U('basic/Single/info',array('id'=>'buy'))}"
>
《{$site['site_keyword']}购买协议》
</a></p>
<p><i
class=
"icon icon-xuanze"
attr=
"1"
></i>
我已阅读并同意
<a
href=
"{:U('basic/Single/info',array('id'=>'buy'))}"
>
《{$site['site_keyword']}购买协议》
</a></p>
</div>
</div>
<!--提交订单-->
<div
class=
"df_pay-buy"
>
<div
class=
"df_pay-buy"
>
<h3>
合计:
<strong
id=
"pay_money2"
>
¥
<if
condition=
"$course_hour_info"
>
{$course_hour_info['course_hour_price']}
<else/>
{$moner_data['price']}
</if></strong></h3>
<h3>
合计:
<strong
id=
"pay_money2"
>
¥
<if
condition=
"$course_hour_info"
>
{$course_hour_info['course_hour_price']}
<else/>
{$moner_data['price']}
</if></strong></h3>
<a
href=
"javascript:;"
onclick=
"buyOperat(this,{$id},'video');"
type=
"submit"
>
提交
</a>
<a
href=
"javascript:;"
onclick=
"buyOperat(this,{$id},'video');"
type=
"submit"
>
提交
</a>
...
@@ -230,7 +107,7 @@
...
@@ -230,7 +107,7 @@
<if
condition=
"$is_wx and in_array('wxpay',$payConfig['pay'])"
>
<if
condition=
"$is_wx and in_array('wxpay',$payConfig['pay'])"
>
<input
type=
"hidden"
value=
"wxpay"
name=
"pay"
/>
<input
type=
"hidden"
value=
"wxpay"
name=
"pay"
/>
<else/>
<else/>
<volist
name=
"payWay"
id=
"vo"
offset=
"0"
length=
"1"
>
<volist
name=
"payWay"
id=
"vo"
offset=
"0"
length=
"1"
>
<input
type=
"hidden"
value=
"{$vo}"
name=
"pay"
/>
<input
type=
"hidden"
value=
"{$vo}"
name=
"pay"
/>
</volist>
</volist>
...
@@ -239,9 +116,9 @@
...
@@ -239,9 +116,9 @@
</form>
</form>
</div>
</div>
</div>
</div>
</div>
-->
</div>
<
!-- <
if condition="$is_wx eq false">
<if
condition=
"$is_wx eq false"
>
<style>
<style>
#_ts_box_h5
{
width
:
290px
;
height
:
180px
;
text-align
:
center
;
color
:
#535353
;
border-radius
:
5px
;
position
:
fixed
;
background
:
#fff
;
-webkit-box-shadow
:
0
2px
5px
#dddddd
;
-moz-box-shadow
:
0
2px
5px
#dddddd
;
-khtml-box-shadow
:
0
2px
5px
#dddddd
;
-ms-box-shadow
:
0
0
15px
#888888
;
box-shadow
:
0
0
15px
#888888
;
z-index
:
997
;
left
:
5%
;
top
:
35%
;
margin
:
0
auto
;
background
:
#fff
;}
#_ts_box_h5
{
width
:
290px
;
height
:
180px
;
text-align
:
center
;
color
:
#535353
;
border-radius
:
5px
;
position
:
fixed
;
background
:
#fff
;
-webkit-box-shadow
:
0
2px
5px
#dddddd
;
-moz-box-shadow
:
0
2px
5px
#dddddd
;
-khtml-box-shadow
:
0
2px
5px
#dddddd
;
-ms-box-shadow
:
0
0
15px
#888888
;
box-shadow
:
0
0
15px
#888888
;
z-index
:
997
;
left
:
5%
;
top
:
35%
;
margin
:
0
auto
;
background
:
#fff
;}
._hide_box_h5
{
z-index
:
996
;
filter
:
alpha
(
opacity
=
50
);
background
:
#666
;
opacity
:
0.5
;
-moz-opacity
:
0.5
;
left
:
0
;
top
:
0
;
height
:
99%
;
width
:
100%
;
position
:
fixed
;}
._hide_box_h5
{
z-index
:
996
;
filter
:
alpha
(
opacity
=
50
);
background
:
#666
;
opacity
:
0.5
;
-moz-opacity
:
0.5
;
left
:
0
;
top
:
0
;
height
:
99%
;
width
:
100%
;
position
:
fixed
;}
...
@@ -255,122 +132,150 @@
...
@@ -255,122 +132,150 @@
<div
id=
"_layer-content"
>
已完成支付
</div>
<div
id=
"_layer-content"
>
已完成支付
</div>
<div
class=
"_layer-wt"
><a
href=
"{:U('course/PayVideo/index',['vst'=>$_GET['vst']])}"
>
支付遇到问题,联系客服
</a></div>
<div
class=
"_layer-wt"
><a
href=
"{:U('course/PayVideo/index',['vst'=>$_GET['vst']])}"
>
支付遇到问题,联系客服
</a></div>
</div>
</div>
</if>
-->
</if>
<script>
<script>
// $(function(){
$
(
function
(){
// $(".df_pay-style dd:last-child").children("i").css("border","1px solid #ededed");
$
(
".df_pay-style dd:last-child"
).
children
(
"i"
).
css
(
"border"
,
"1px solid #ededed"
);
// $(".df_pay-style dd").on("click",function(){
$
(
".df_pay-style dd"
).
on
(
"click"
,
function
(){
// $(this).children("i").attr("class","icon icon-xuanze").css("border","1px solid transparent").parent().siblings().children("i").removeAttr("class","icon icon-xuanze").css("border","1px solid #ededed");
$
(
this
).
children
(
"i"
).
attr
(
"class"
,
"icon icon-xuanze"
).
css
(
"border"
,
"1px solid transparent"
).
parent
().
siblings
().
children
(
"i"
).
removeAttr
(
"class"
,
"icon icon-xuanze"
).
css
(
"border"
,
"1px solid #ededed"
);
// });
});
// $(".df_pay-protocol i").on("click",function(){
$
(
".df_pay-protocol i"
).
on
(
"click"
,
function
(){
// var proVal = $(this).attr("attr");
var
proVal
=
$
(
this
).
attr
(
"attr"
);
// if(proVal==1){
if
(
proVal
==
1
){
// $(this).attr("attr","0").css("color","#656565");
$
(
this
).
attr
(
"attr"
,
"0"
).
css
(
"color"
,
"#656565"
);
// }else{
}
else
{
// $(this).attr("attr","1").css("color","#57BC4C")
$
(
this
).
attr
(
"attr"
,
"1"
).
css
(
"color"
,
"#57BC4C"
)
// }
}
// });
});
// })
})
// '
<
if
condition
=
"$is_wx eq false"
>
'
'<if condition="$is_wx eq false">'
// $(function(){
$
(
function
(){
// var wpay = "{$_GET['
wpay
']}";
var
wpay
=
"{$_GET['wpay']}"
;
// var ppn = "{$_GET['
ppn
']}";
var
ppn
=
"{$_GET['ppn']}"
;
// if(wpay != ''){
if
(
wpay
!=
''
){
// $('
.
_hide_box_h5
,
#
_ts_box_h5
').show();
$
(
'._hide_box_h5,#_ts_box_h5'
).
show
();
// $('
#
_layer
-
content
').click(function(){
$
(
'#_layer-content'
).
click
(
function
(){
// $('
.
_hide_box_h5
,
#
_ts_box_h5
').hide();
$
(
'._hide_box_h5,#_ts_box_h5'
).
hide
();
// s = setInterval(function(){
s
=
setInterval
(
function
(){
// $.ajax({
$
.
ajax
({
// url: "{:U('
course
/
PayVideo
/
getPayStatus
')}",
url
:
"{:U('course/PayVideo/getPayStatus')}"
,
// data:{pay_pass_num:ppn},
data
:{
pay_pass_num
:
ppn
},
// type:'
post
',
type
:
'post'
,
// success: function(res){
success
:
function
(
res
){
// try{
try
{
// res = JSON.parse(res);
res
=
JSON
.
parse
(
res
);
// if(res.status == 1){
if
(
res
.
status
==
1
){
// clearInterval(s);
clearInterval
(
s
);
// ui.success('
购买成功
');
ui
.
success
(
'购买成功'
);
// setTimeout(function(){
setTimeout
(
function
(){
// window.location.href = res.data;
window
.
location
.
href
=
res
.
data
;
// },2000);
},
2000
);
// }
}
// }catch(e){
}
catch
(
e
){
// return;
return
;
// }
}
// }
}
// });
});
// },1800);
},
1800
);
// });
});
// }
}
// });
});
// '
<
/if>
'
'</if>'
// $(function(){
$
(
function
(){
// $('.paytype').click(function(){
// var id = '{$coupon.id}';
// var pay = $(this).attr('value');
// var price = '{$moner_data.price}';
// $('input:hidden[name="pay"]').val(pay);
// // console.log(price);
// });
// $.ajax({
// });
// type:"POST",
// url:"{:U('course/PayVideo/getCouponInfo')}",
// function buyvCoupon(cid,coupon_id,discount_type) {
// data:{id:id},
// if(MID
<=
0
){
// dataType:"json",
// ui.confirm('请先登录', {
// success:function(data){
// yes: function () {
// if(data){
// window.location.href = "{:U('basic/Passport/login')}";
// buyvCoupon(data.coupon_id,data.cuid,data.type,price);
// }
// }else{
// });
// return false;
// return false;
// }
// }
// }
// if(!cid || !coupon_id || !discount_type){
// });
// ui.error('参数错误');
// return false;
//支付方式选择
// }
$
(
'.paytype'
).
click
(
function
(){
// var price = $('#pay_money_val').val();
var
pay
=
$
(
this
).
attr
(
'value'
);
// if(price
<=
0
){
$
(
'input:hidden[name="pay"]'
).
val
(
pay
);
// ui.error('该课程不需要您购买');
});
// return false;
// }
// $(".hide_box").fadeToggle();
// $('#coupon_id').val(coupon_id);
// $(".shang_box").fadeToggle();
// $.post(U("course/PayVideo/checkCoupon"),{cid:cid,coupon_id:coupon_id,discount_type:discount_type,price:price},function(e){
// if(e.status == 1){
});
// $('.removeUse').show();
// }else{
function
buyvCoupon
(
cid
,
coupon_id
,
discount_type
)
{
// ui.error(e.info);
if
(
MID
<=
0
){
// }
ui
.
confirm
(
'请先登录'
,
{
// },'json');
yes
:
function
()
{
// }
window
.
location
.
href
=
"{:U('basic/Passport/login')}"
;
}
});
return
false
;
}
if
(
!
cid
||
!
coupon_id
||
!
discount_type
){
ui
.
error
(
'参数错误'
);
return
false
;
}
var
price
=
$
(
'#pay_money_val'
).
val
();
if
(
price
<=
0
){
ui
.
error
(
'该课程不需要您购买'
);
return
false
;
}
$
(
'#coupon_id'
).
val
(
coupon_id
);
$
.
post
(
U
(
"course/PayVideo/checkCoupon"
),{
cid
:
cid
,
coupon_id
:
coupon_id
,
discount_type
:
discount_type
,
price
:
price
},
function
(
e
){
if
(
e
.
status
==
1
){
// $('#cod_money1').text("-¥"+e.data.minus_price);
// $('#cod_money2').text("¥"+e.data.minus_price);
// $('#pay_money').text("¥"+e.data.after_price);
// $('#pay_money2').text("¥"+e.data.after_price);
// $('#pay_money_val').val(e.data.after_price);
// ui.success(e.info);
$
(
'.removeUse'
).
show
();
}
else
{
ui
.
error
(
e
.
info
);
}
},
'json'
);
}
//取消使用
//取消使用
//
function removeUse(sid){
function
removeUse
(
sid
){
//
var code = $("input[name='card']").val();
var
code
=
$
(
"input[name='card']"
).
val
();
//
$.ajax({
$
.
ajax
({
//
type:"POST",
type
:
"POST"
,
//
url:"{:U('course/PayVideo/cancelExchangeCard')}",
url
:
"{:U('course/PayVideo/cancelExchangeCard')}"
,
//
data:{code:code,mhm_id:sid},
data
:{
code
:
code
,
mhm_id
:
sid
},
//
dataType:"json",
dataType
:
"json"
,
//
success:function(data){
success
:
function
(
data
){
//
if(data.status == 1){
if
(
data
.
status
==
1
){
//
ui.success(data.info);
ui
.
success
(
data
.
info
);
//
setTimeout('window.location.reload()', 500);
setTimeout
(
'window.location.reload()'
,
500
);
//
}else{
}
else
{
//
ui.error(data.info);
ui
.
error
(
data
.
info
);
//
return false;
return
false
;
//
}
}
//
}
}
//
});
});
//
}
}
/**
/**
* 删除字符串str的首尾空格
* 删除字符串str的首尾空格
* @name trim
* @name trim
* @grammar UM.utils.trim(str) => String
* @grammar UM.utils.trim(str) => String
*/
*/
//
var trim =function (str) {
var
trim
=
function
(
str
)
{
//
return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, '');
return
str
.
replace
(
/
(
^
[
\t\n\r]
+
)
|
([
\t\n\r]
+$
)
/g
,
''
);
//
}
}
//购买操作
//购买操作
...
@@ -424,39 +329,39 @@
...
@@ -424,39 +329,39 @@
if
(
data
.
status
==
1
){
if
(
data
.
status
==
1
){
var
pay_pass_num
=
data
.
data
.
pay_pass_num
;
var
pay_pass_num
=
data
.
data
.
pay_pass_num
;
'<if condition="$is_wx">'
'<if condition="$is_wx">'
WeixinJSBridge
.
invoke
(
WeixinJSBridge
.
invoke
(
'getBrandWCPayRequest'
,
JSON
.
parse
(
data
.
data
.
html
),
'getBrandWCPayRequest'
,
JSON
.
parse
(
data
.
data
.
html
),
function
(
res
){
function
(
res
){
if
(
res
.
err_msg
==
"get_brand_wcpay_request:ok"
){
if
(
res
.
err_msg
==
"get_brand_wcpay_request:ok"
){
s
=
setInterval
(
function
(){
s
=
setInterval
(
function
(){
$
.
ajax
({
$
.
ajax
({
url
:
"{:U('course/PayVideo/getPayStatus')}"
,
url
:
"{:U('course/PayVideo/getPayStatus')}"
,
data
:{
pay_pass_num
:
pay_pass_num
},
data
:{
pay_pass_num
:
pay_pass_num
},
type
:
'post'
,
type
:
'post'
,
success
:
function
(
res
){
success
:
function
(
res
){
try
{
try
{
res
=
JSON
.
parse
(
res
);
res
=
JSON
.
parse
(
res
);
if
(
res
.
status
==
1
){
if
(
res
.
status
==
1
){
clearInterval
(
s
);
clearInterval
(
s
);
ui
.
success
(
'购买成功'
);
ui
.
success
(
'购买成功'
);
setTimeout
(
function
(){
setTimeout
(
function
(){
window
.
location
.
href
=
res
.
data
;
window
.
location
.
href
=
res
.
data
;
},
1500
);
},
1500
);
}
}
catch
(
e
){
return
;
}
}
}
catch
(
e
){
return
;
}
}
}
);
}
}
,
1800
);
});
}
}
,
1800
);
}
}
);
}
);
'<else/>'
'<else/>'
var
a
=
document
.
createElement
(
'a'
);
var
a
=
document
.
createElement
(
'a'
);
a
.
href
=
data
.
data
.
html
;
a
.
href
=
data
.
data
.
html
;
a
.
click
();
a
.
click
();
return
false
;
return
false
;
'</if>'
'</if>'
}
else
{
}
else
{
ui
.
error
(
data
.
data
);
ui
.
error
(
data
.
data
);
...
...
apps/course/Tpl/default/PayVideo/index_w3g_new.html
0 → 100644
View file @
837d6bf1
<include
file=
"__THEME__/public_header_w3g"
/>
<!-- <link href="__APP__/css/pay_video_3g.css" rel="stylesheet"> -->
<style>
body
{
padding
:
0
!important
;
}
</style>
<div
id=
"app"
>
<div
class=
"layout_v"
>
<div
class=
"pay_course_info layout_h"
>
<van-image
src=
"{:getCover($cover,220,130)}"
fit=
"cover"
width=
"120"
height=
"68"
></van-image>
<div
class=
"layout_v"
style=
"margin-left: 0.75rem;"
>
<span
class=
"text_14_600 color_333333"
>
{$video_title}
</span>
<span
class=
"text_14_600 color_FF3B3B"
style=
"margin-top: 0.5rem;"
>
¥{$moner_data['oriPrice']}
</span>
</div>
</div>
<div
class=
"normal_gap"
></div>
<div
class=
"layout_v pay_course_bottom"
>
<span
class=
"text_16_600 color_333333"
style=
"margin-bottom: 0.75rem;"
>
选择支付方式
</span>
<div
class=
"layout_h_b"
>
<div
class=
"layout_h_v_c"
>
<van-image
height=
"28"
width=
"28"
fit=
"cover"
src=
"__THEME__/img/weichat_logo.png"
></van-image>
<span
class=
"text_14_400 color_333333"
style=
"margin-left: 0.75rem;"
>
微信
</span>
</div>
<van-icon
class=
"self_center"
name=
"__THEME__/img/picker_y@3x.png"
size=
"20"
></van-icon>
</div>
</div>
<div
class=
"divider"
></div>
<div
style=
"margin: 1.5rem 0.75rem;"
class=
"layout_h_v_c"
>
<van-icon
@
click=
"agree = !agree"
size=
"22"
:name=
"agree ? '__THEME__/img/picker_y@3x.png' : '__THEME__/img/unpicker.png'"
style=
"margin-right: 0.5rem;"
></van-icon>
我已阅读并同意
<a
href=
"{:U('basic/Single/info',array('id'=>'buy'))}"
><span
class=
"color_primary"
>
《{$site['site_keyword']}购买协议》
</span></a>
</div>
</div>
<div
class=
"layout_h_v_c fixed_bottom_bar"
>
<span
class=
"text_14_600 color_333333"
style=
"margin-right: 0.5rem;"
>
合计
</span>
<span
class=
"text_14_600 color_FF3B3B"
>
¥{{totalPrice}}
</span>
<span
class=
"text_12_400 color_999999"
>
{{discount}}
</span>
<div
class=
"weight_full layout_h_r"
>
<div
@
click=
"onBuy({$id}, 'video')"
class=
"vip_buy_pay_button layout_center"
><span
class=
"text_14_400 color_white"
>
确认支付
</span></div>
</div>
</div>
</div>
<script>
new
Vue
({
el
:
"#app"
,
data
:
function
()
{
return
{
agree
:
false
,
info
:
{}
}
},
created
:
function
(){
},
computed
:
{
totalPrice
:
function
()
{
return
"{$moner_data['price']}"
},
discount
:
function
()
{
return
"(已优惠:¥0)"
}
},
methods
:
{
onBuy
:
function
(
id
,
type
)
{
let
that
=
this
if
(
that
.
agree
)
{
$
.
post
(
U
(
"course/PayVideo/checkPayOperat"
),
{
check_type
:
'{$pay_video_type}'
,
mid
:
MID
,
vid
:
id
,
pay
:
"wxpay"
,
money
:
"{$moner_data['oriPrice']}"
,
},
function
(
data
)
{
let
res
=
JSON
.
parse
(
data
)
if
(
res
.
status
==
1
)
{
that
.
startWxPay
(
id
)
}
else
{
ui
.
error
(
res
.
info
)
}
})
}
else
{
ui
.
error
(
'请阅读并同意购买协议'
)
}
},
startWxPay
:
function
(
id
)
{
$
.
ajax
({
url
:
"{:U('course/PayVideo/payLibrary')}"
,
data
:{
check_type
:
'{$pay_video_type}'
,
mid
:
MID
,
vid
:
id
,
pay
:
"wxpay"
,
money
:
"{$moner_data['oriPrice']}"
,
},
async
:
false
,
type
:
'post'
,
success
:
function
(
data
){
let
res
=
JSON
.
parse
(
data
)
if
(
res
.
status
==
1
)
{
}
else
{
ui
.
error
(
res
.
data
)
}
}})
},
checkPayStatus
:
function
(
num
)
{
let
that
=
this
$
.
ajax
({
url
:
"{:U('course/PayVideo/getPayStatus')}"
,
data
:{
pay_pass_num
:
num
},
type
:
'post'
,
success
:
function
(
res
){
try
{
res
=
JSON
.
parse
(
res
)
if
(
res
.
status
==
1
)
{
ui
.
success
(
'购买成功'
)
setTimeout
(
function
(){
window
.
location
.
href
=
res
.
data
},
1500
)
}
else
{
setTimeout
(
()
=>
{
that
.
checkPayStatus
(
num
)
},
1000
)
}
}
catch
(
e
){
return
}
}
})
}
}
})
</script>
<!-- <div class="body">
<div class="wrap">
<div class="min-height-wrap">
<dl class="df_course-info">
<dd>
<if condition="$pay_video_type eq 'zy_video'">
<a href="{:U('course/Video/view',['id'=>$id])}">
<elseif condition="$pay_video_type eq 'zy_live'" />
<a href="{:U('live/Index/view',['id'=>$id])}">
<elseif condition="$pay_video_type eq 'zy_album'" />
<a href="{:U('course/Album/view',['id'=>$id])}">
<elseif condition="$pay_video_type eq 'zy_line_course'" />
<a href="{:U('course/Album/view',['id'=>$id])}">
<elseif condition="$pay_video_type eq 'zy_classes'" />
<a href="{:U('course/Classes/view',['id'=>$id])}">
</if>
<span>
<img src="{:getCover($cover,220,130)}" width="120" height="70" alt="{$video_title}">
</span>
<h3>
{$video_title|mStr=20}<if condition="$course_hour_info"> - {$course_hour_info['title']|mStr=20}</if>
<p>¥<if condition="$course_hour_info">{$course_hour_info['course_hour_price']}<else/>
<if condition="$is_event"> {$moner_data['selPrice']}<else/>{$moner_data['oriPrice']}</if>
</if></p>
</h3>
</a>
</dd>
</dl>
<dl class="df_pay-style">
<dt><h3>支付方式</h3></dt>
<php>if($is_wx){unset($payWay['支付宝支付']);}$firstPayWay = current($payWay);</php>
<if condition="in_array('alipay',$payConfig['pay']) and ($is_wx eq false)">
<dd value="alipay" class="paytype"><a class="icon icon-zhifubao1"></a><span class="name">支付宝</span><if condition="$firstPayWay eq alipay"><i class="icon icon-xuanze"></i></if></dd>
</if>
<if condition="in_array('wxpay',$payConfig['pay'])">
<dd value="wxpay" class="paytype"><a class="icon icon-weixinzhifu1"></a><span class="name">微信支付</span><i class="<if condition='$is_wx or $firstPayWay eq wxpay '>icon icon-xuanze</if>" style="border: 1px solid rgb(237, 237, 237);"></i></dd>
</if>
<if condition="in_array('unionpay',$payConfig['pay'])">
</if>
<if condition="in_array('lcnpay',$payConfig['pay'])">
<dd value="lcnpay" class="paytype"><a class="icon icon-qianbao"></a><span class="name">余额支付(¥{$account_balance})</span><i class="<if condition='($firstPayWay eq lcnpay)'>icon icon-xuanze</if>"></i></dd>
</if>
</dl>
<if condition="$is_asb OR ($pay_order AND $used_coupon)">
<elseif condition="$show_coupon eq 1 and $course_hour_info eq null" />
<dl class="df_pay-coupon">
<a href="{:U('course/PayVideo/coupon',['id'=>$id, 'vst'=>$coupon_vst, 'asb'=>$_GET['asb']])}">
<dt><h3>优惠券</h3></dt>
<dd><p><if condition="$videoCoupon or $discount or $courseCard">有<else/>无</if>可用优惠券<i class="icon icon-youjiantou"></i></p></dd>
</a>
</dl>
</if>
<dl class="df_pay-price">
<dd><h3>实付金额</h3><p id="pay_money">¥<if condition="$course_hour_info">{$course_hour_info['course_hour_price']}<else/>{$moner_data['price']}</if></p></dt>
<if condition="in_array($pay_video_type, ['zy_video','zy_live','zy_classes']) and $chd eq 0">
<dd><h3>优惠折扣</h3><p id="cod_money1">-¥<if condition="$is_event"> {$moner_data['selPrice'] - $moner_data['price']}<else/>{$moner_data['oriPrice']- $moner_data['price']}</if></p></dd>
</if>
</dl>
<div class="df_pay-protocol">
<p><i class="icon icon-xuanze" attr="1"></i>我已阅读并同意<a href="{:U('basic/Single/info',array('id'=>'buy'))}">《{$site['site_keyword']}购买协议》</a></p>
</div>
<div class="df_pay-buy">
<h3>合计:<strong id="pay_money2">¥<if condition="$course_hour_info">{$course_hour_info['course_hour_price']}<else/>{$moner_data['price']}</if></strong></h3>
<a href="javascript:;" onclick="buyOperat(this,{$id},'video');" type="submit">提交</a>
</div>
<form action="{:U('course/PayVideo/payLibrary')}" method="POST" id="pay_video_form">
<input type="hidden" value="{$id}" name="vid" />
<input type="hidden" value="1" name="discount_type" />
<input type="hidden" value="{$coupon_use_id}" name="coupon_id" id="coupon_id" />
<input type="hidden" value="{$_SESSION['mid']}" name="mid" />
<input type="hidden" name="mount_mhm_id" value="{$mount_mhm_id}" />
<input type="hidden" value="{$agent_mhm_id}" name="agent_mhm_id" />
<input type="hidden" name="asb" value="{$asb}">
<input type="hidden" name="event" value="{$event_id}">
<input type="hidden" value="{$pay_video_type}" name="check_type" />
<input type="hidden" value="{$video_title}" name="title" />
<if condition="in_array($pay_video_type,['zy_video','zy_live','zy_classes'])">
<input type="hidden" value="{$course_hour_info['id']}" name="course_hour_id" />
</if>
<php>if($_GET['order']){</php><input type="hidden" value="1" name="order" /><php>}</php>
<input type="hidden" id="pay_money_val" value="{$moner_data['price']}" name="money" />
<if condition="$is_wx and in_array('wxpay',$payConfig['pay'])">
<input type="hidden" value="wxpay" name="pay" />
<else/>
<volist name="payWay" id="vo" offset="0" length="1">
<input type="hidden" value="{$vo}" name="pay" />
</volist>
</if>
<input type="hidden" value="{$_GET['vst']}" name="vst" />
</form>
</div>
</div>
</div> -->
<!-- <if condition="$is_wx eq false">
<style>
#_ts_box_h5{width:290px;height:180px;text-align: center;color: #535353;border-radius: 5px;position: fixed;background: #fff;-webkit-box-shadow: 0 2px 5px #dddddd;-moz-box-shadow: 0 2px 5px #dddddd;-khtml-box-shadow: 0 2px 5px #dddddd;-ms-box-shadow: 0 0 15px #888888;box-shadow: 0 0 15px #888888;z-index: 997;left: 5%;top: 35%;margin: 0 auto;background: #fff;}
._hide_box_h5{z-index:996;filter:alpha(opacity=50);background:#666;opacity: 0.5;-moz-opacity: 0.5;left:0;top:0;height:99%;width:100%;position:fixed;}
#_ts_box_h5 ._box_hd{padding: 20px 0px;color: black;font-size: 16px;border-bottom: 1px solid rgba(0, 0, 0, 0.16);}
#_layer-content{padding: 15px 0px;color: rgba(255, 35, 0, 0.69);font-size: 16px;border-bottom: 1px solid rgba(0, 0, 0, 0.1);}
._layer-wt{padding: 15px 0px;color: #908d8d;font-size: 16px;}
</style>
<div class="_hide_box_h5" style="display: none;"></div>
<div id="_ts_box_h5" style="display: none;">
<div class="_box_hd" >请确认微信支付是否完成</div>
<div id="_layer-content">已完成支付</div>
<div class="_layer-wt"><a href="{:U('course/PayVideo/index',['vst'=>$_GET['vst']])}">支付遇到问题,联系客服</a></div>
</div>
</if> -->
<script>
// $(function(){
// $(".df_pay-style dd:last-child").children("i").css("border","1px solid #ededed");
// $(".df_pay-style dd").on("click",function(){
// $(this).children("i").attr("class","icon icon-xuanze").css("border","1px solid transparent").parent().siblings().children("i").removeAttr("class","icon icon-xuanze").css("border","1px solid #ededed");
// });
// $(".df_pay-protocol i").on("click",function(){
// var proVal = $(this).attr("attr");
// if(proVal==1){
// $(this).attr("attr","0").css("color","#656565");
// }else{
// $(this).attr("attr","1").css("color","#57BC4C")
// }
// });
// })
// '
<
if
condition
=
"$is_wx eq false"
>
'
// $(function(){
// var wpay = "{$_GET['
wpay
']}";
// var ppn = "{$_GET['
ppn
']}";
// if(wpay != ''){
// $('
.
_hide_box_h5
,
#
_ts_box_h5
').show();
// $('
#
_layer
-
content
').click(function(){
// $('
.
_hide_box_h5
,
#
_ts_box_h5
').hide();
// s = setInterval(function(){
// $.ajax({
// url: "{:U('
course
/
PayVideo
/
getPayStatus
')}",
// data:{pay_pass_num:ppn},
// type:'
post
',
// success: function(res){
// try{
// res = JSON.parse(res);
// if(res.status == 1){
// clearInterval(s);
// ui.success('
购买成功
');
// setTimeout(function(){
// window.location.href = res.data;
// },2000);
// }
// }catch(e){
// return;
// }
// }
// });
// },1800);
// });
// }
// });
// '
<
/if>
'
// $(function(){
// $('.paytype').click(function(){
// var pay = $(this).attr('value');
// $('input:hidden[name="pay"]').val(pay);
// });
// });
// function buyvCoupon(cid,coupon_id,discount_type) {
// if(MID
<=
0
){
// ui.confirm('请先登录', {
// yes: function () {
// window.location.href = "{:U('basic/Passport/login')}";
// }
// });
// return false;
// }
// if(!cid || !coupon_id || !discount_type){
// ui.error('参数错误');
// return false;
// }
// var price = $('#pay_money_val').val();
// if(price
<=
0
){
// ui.error('该课程不需要您购买');
// return false;
// }
// $('#coupon_id').val(coupon_id);
// $.post(U("course/PayVideo/checkCoupon"),{cid:cid,coupon_id:coupon_id,discount_type:discount_type,price:price},function(e){
// if(e.status == 1){
// $('.removeUse').show();
// }else{
// ui.error(e.info);
// }
// },'json');
// }
//取消使用
// function removeUse(sid){
// var code = $("input[name='card']").val();
// $.ajax({
// type:"POST",
// url:"{:U('course/PayVideo/cancelExchangeCard')}",
// data:{code:code,mhm_id:sid},
// dataType:"json",
// success:function(data){
// if(data.status == 1){
// ui.success(data.info);
// setTimeout('window.location.reload()', 500);
// }else{
// ui.error(data.info);
// return false;
// }
// }
// });
// }
/**
* 删除字符串str的首尾空格
* @name trim
* @grammar UM.utils.trim(str) => String
*/
// var trim =function (str) {
// return str.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, '');
// }
//购买操作
var
buyOperat
=
function
(
sbt
,
vid
,
type
){
if
(
MID
<=
0
){
ui
.
confirm
(
'请先登录'
,
{
yes
:
function
()
{
window
.
location
.
href
=
"{:U('basic/Passport/login')}"
;
}
});
return
false
;
}
if
(
!
vid
||
!
type
){
ui
.
error
(
'参数错误'
);
return
false
;
}
if
(
$
(
'.df_pay-protocol i.icon-xuanze'
).
attr
(
'attr'
)
!=
'1'
){
ui
.
error
(
"购买必须同意《{$site['site_keyword']}购买协议》"
);
return
false
;
}
var
form
=
$
(
'#pay_video_form'
);
var
pay
=
$
(
'input:hidden[name="pay"]'
).
val
();
var
money
=
$
(
'input:hidden[name="money"]'
).
val
();
if
(
pay
!=
'alipay'
&&
pay
!=
'unionpay'
&&
pay
!=
'wxpay'
&&
pay
!=
'lcnpay'
){
ui
.
error
(
'支付方式错误'
);
return
false
;
}
if
(
money
<=
0
){
ui
.
error
(
'该课程不需要您购买'
);
return
false
;
}
$
(
sbt
).
attr
(
'style'
,
'background:rgba(102, 102, 102, 0.65)'
).
removeAttr
(
'onclick'
);
setTimeout
(
function
(){
$
.
post
(
U
(
"course/PayVideo/checkPayOperat"
),
form
.
serialize
(),
function
(
data
){
if
(
data
.
status
==
1
){
$
(
sbt
).
attr
(
"onclick"
,
"buyOperat(this,'{$id}','video')"
).
removeAttr
(
'style'
);
if
(
pay
==
'wxpay'
){
$
.
ajax
({
url
:
"{:U('course/PayVideo/payLibrary')}"
,
data
:
form
.
serialize
(),
async
:
false
,
type
:
'post'
,
success
:
function
(
data
){
if
(
typeof
data
!=
'object'
){
var
data
=
eval
(
'('
+
data
+
')'
);
}
if
(
data
.
status
==
1
){
var
pay_pass_num
=
data
.
data
.
pay_pass_num
;
'<if condition="$is_wx">'
WeixinJSBridge
.
invoke
(
'getBrandWCPayRequest'
,
JSON
.
parse
(
data
.
data
.
html
),
function
(
res
){
if
(
res
.
err_msg
==
"get_brand_wcpay_request:ok"
){
s
=
setInterval
(
function
(){
$
.
ajax
({
url
:
"{:U('course/PayVideo/getPayStatus')}"
,
data
:{
pay_pass_num
:
pay_pass_num
},
type
:
'post'
,
success
:
function
(
res
){
try
{
res
=
JSON
.
parse
(
res
);
if
(
res
.
status
==
1
){
clearInterval
(
s
);
ui
.
success
(
'购买成功'
);
setTimeout
(
function
(){
window
.
location
.
href
=
res
.
data
;
},
1500
);
}
}
catch
(
e
){
return
;
}
}
});
},
1800
);
}
}
);
'<else/>'
var
a
=
document
.
createElement
(
'a'
);
a
.
href
=
data
.
data
.
html
;
a
.
click
();
return
false
;
'</if>'
}
else
{
ui
.
error
(
data
.
data
);
setTimeout
(
function
(){
window
.
location
.
href
=
window
.
location
.
href
;
},
1500
);
}
},
error
:
function
(){
return
false
}
});
}
else
if
(
pay
==
'lcnpay'
){
$
.
post
(
U
(
"course/PayVideo/payLibrary"
),
$
(
'#pay_video_form'
).
serialize
(),
function
(
res
){
res
=
JSON
.
parse
(
res
);
if
(
res
.
status
==
1
){
ui
.
success
(
res
.
info
);
setTimeout
(
function
(){
window
.
location
.
href
=
res
.
data
;
},
2000
);
}
else
{
ui
.
error
(
res
.
info
);
return
false
}
});
}
else
{
$
(
".buyOperating"
).
hide
();
$
(
".mask"
).
hide
();
$
(
"#charge"
).
attr
(
'id'
,
''
);
setTimeout
(
""
,
3000
);
form
.
submit
();
}
}
else
if
(
data
.
status
==
9
){
ui
.
error
(
data
.
info
);
window
.
location
.
reload
();
}
else
{
var
time
=
15
;
var
_codesetInterval
=
setInterval
(
function
(){
if
(
time
<=
0
){
$
(
sbt
).
attr
(
"onclick"
,
"buyOperat(this,'{$id}','video')"
).
removeAttr
(
'style'
);
clearInterval
(
_codesetInterval
);
}
else
{
$
(
sbt
).
attr
(
'style'
,
'background:rgba(102, 102, 102, 0.65)'
).
removeAttr
(
'onclick'
);
time
--
;
}
},
1000
);
ui
.
error
(
data
.
info
);
return
false
;
}
},
'json'
);
},
1000
);
}
</script>
<include
file=
"__THEME__/public_footer_w3g"
/>
apps/exams/Tpl/default/Index/pay_w3g.html
View file @
837d6bf1
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
});
});
}
}
if
(
that
.
agree
)
{
if
(
that
.
agree
)
{
var
s
=
0
;
$
.
ajax
({
$
.
ajax
({
url
:
"{:U('course/PayVideo/payLibraryExams')}"
,
url
:
"{:U('course/PayVideo/payLibraryExams')}"
,
data
:
{
data
:
{
...
@@ -85,9 +86,38 @@
...
@@ -85,9 +86,38 @@
async
:
false
,
async
:
false
,
type
:
'post'
,
type
:
'post'
,
success
:
function
(
data
){
success
:
function
(
data
){
let
res
=
JSON
.
parse
(
data
)
let
res2
=
JSON
.
parse
(
data
);
if
(
res
.
status
==
1
)
{
clearInterval
(
s
);
if
(
res2
.
status
==
1
)
{
var
pay_pass_num
=
res2
.
data
.
pay_pass_num
;
WeixinJSBridge
.
invoke
(
'getBrandWCPayRequest'
,
JSON
.
parse
(
res2
.
data
.
html
),
function
(
res
){
if
(
res
.
err_msg
==
"get_brand_wcpay_request:ok"
){
s
=
setInterval
(
function
(){
$
.
ajax
({
url
:
"{:U('course/PayVideo/getPayStatus')}"
,
data
:{
pay_pass_num
:
pay_pass_num
},
type
:
'post'
,
success
:
function
(
res
){
try
{
res
=
JSON
.
parse
(
res
);
if
(
res
.
status
==
1
){
clearInterval
(
s
);
ui
.
success
(
'购买成功'
);
setTimeout
(
function
(){
window
.
location
.
href
=
res
.
data
;
},
1500
);
}
}
catch
(
e
){
return
;
}
}
});
},
1800
);
}
}
);
}
else
{
}
else
{
ui
.
error
(
res
.
data
)
ui
.
error
(
res
.
data
)
}
}
...
...
apps/mall/Tpl/default/Goods/pay_w3g.html
View file @
837d6bf1
...
@@ -127,6 +127,7 @@
...
@@ -127,6 +127,7 @@
ui
.
error
(
"购买必须同意《{$site['site_keyword']}购买协议》"
)
ui
.
error
(
"购买必须同意《{$site['site_keyword']}购买协议》"
)
return
return
}
}
var
s
=
0
;
$
.
ajax
({
$
.
ajax
({
url
:
"{:U('classroom/Pay/buyGoods')}"
,
url
:
"{:U('classroom/Pay/buyGoods')}"
,
data
:
{
data
:
{
...
@@ -138,12 +139,40 @@
...
@@ -138,12 +139,40 @@
},
},
async
:
false
,
async
:
false
,
type
:
'post'
,
type
:
'post'
,
success
:
function
(
res
)
{
success
:
function
(
data
)
{
console
.
log
(
res
)
data
=
JSON
.
parse
(
data
);
if
(
res
.
status
==
1
)
{
if
(
data
.
status
==
1
)
{
var
pay_pass_num
=
data
.
data
.
pay_pass_num
;
WeixinJSBridge
.
invoke
(
'getBrandWCPayRequest'
,
JSON
.
parse
(
data
.
data
.
html
),
function
(
res
){
if
(
res
.
err_msg
==
"get_brand_wcpay_request:ok"
){
s
=
setInterval
(
function
(){
$
.
ajax
({
url
:
"{:U('classroom/Pay/getPayStatus')}"
,
data
:{
pay_pass_num
:
pay_pass_num
},
type
:
'post'
,
success
:
function
(
res
){
try
{
res
=
JSON
.
parse
(
res
);
if
(
res
.
status
==
1
){
clearInterval
(
s
);
ui
.
success
(
'购买成功'
);
setTimeout
(
function
(){
window
.
location
.
href
=
res
.
data
;
},
1500
);
}
}
catch
(
e
){
return
;
}
}
});
},
1800
);
}
}
);
}
else
{
}
else
{
ui
.
error
(
res
.
info
?
res
.
info
:
res
.
data
)
ui
.
error
(
data
.
info
?
data
.
info
:
data
.
data
)
}
}
}
}
})
})
...
...
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