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
4b1d0d35
Commit
4b1d0d35
authored
Jun 02, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
12d5c8d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1066 additions
and
495 deletions
+1066
-495
apps/course/Tpl/default/PayVideo/index_w3g.html
+550
-495
apps/course/Tpl/default/PayVideo/index_w3g_new.html
+516
-0
No files found.
apps/course/Tpl/default/PayVideo/index_w3g.html
View file @
4b1d0d35
<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>
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
className=
"body"
>
<div
className=
"wrap"
>
<div
className=
"min-height-wrap"
>
<div
className=
"class_order_tit"
>
核对订单信息
</div>
<!--商品信息-->
<dl
className=
"df_course-info"
>
<dt><h3>
商品信息
</h3></dt>
<dd>
<if
condition=
"$pay_video_type eq 'zy_video'"
>
<a
href=
"{:U('course/Video/view',['id'=>$id])}"
>
<
elseif
condition=
"$pay_video_type eq 'zy_ive'"
/>
<a
href=
"{:U('live/Index/view',['id'=>$id])}"
>
<elseif
condition=
"$pay_video_type eq 'zy_abum'"
/>
<a
href=
"{:U('course/Album/view',['id'=>$id])}"
>
<elseif
condition=
"$pay_video_type eq 'zy_line_corse'"
/>
<a
href=
"{:U('course/Album/view',['id'=>$id])}"
>
<elseif
condition=
"$pay_video_type eq 'zy_clases'"
/>
<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|mS
tr=20}
<if
condition=
"$course_hour_info"
>
- {$course_hour_info['title']|mStr=20}
</if>
<p>
¥
<if
condition=
"$course_hour_info"
>
{$course_hour_info['course_hour_pr
ice']}
<else/>
<if
condition=
"$is_event"
>
{$moner_data['selPr
ice']}
<
else/>
{$moner_data['oriPr
ice']}
</if>
</if></p>
</h3>
</a
>
</dd>
</dl>
<!--支付方式-->
<dl
className=
"df
style"
>
<dt><h3>
支付方式
</
h3></dt>
<php>
if($is_wx){unset($payWay['支付宝支付']);}$firstPayWay = curren
yWay);
</php>
<if
condition=
"in_array('alipay',$payConfig['pay']) and ($
eq false)"
>
<dd
value=
"alipay"
className=
"paytype"
><a
className=
"icon icon-zhi
ubao1"
></a><span
className=
"name"
>
支付宝
</span><if
condition=
"$firstPayWay eq alipay"
><i
className=
"icon icon-
xuanze"
></
i></if
></dd>
</if>
<if
condition=
"in_array(
',$payConfig['pay'])"
>
<dd
value=
"wxpay"
className=
"paytype"
><a
className=
"icon
con-weixinzhifu1"
></a><span
cl
ssName=
"name"
>
微信支付
</span><i
className=
"<if condition='$is_wx or $firstPayWay eq wx
ay '>icon icon-xuanze</if>"
style=
"border: 1px solid rgb(237
, 237, 237);"
></i></dd>
</if>
<if
condition=
"in_arra
onpay',$payConfig['pay'])"
>
<!--<s
al="u
y">银联支付</span>-->
</if>
<if
condition=
"in_ar
cnpay',$payConfig['pay'])"
>
<dd
value=
"lcnpay"
className=
"paytype"
><a
className=
"icon icon-qianbao"
></a><span
className=
"name"
>
<!-- <img style="width: 24px;position: relative;top: -4px;left: -1%" src="__APP__/icon/yue.png" alt="图标"/> -->
余
支付(¥{$account_balance})
</span><i
className=
"<if condition='($firstPayWay eq lcnpay)'
icon
nze</if>"
>
</i></dd>
</if>
</dl>
<!--优惠券-->
<if
condition=
"$is_asb OR ($pay_order AND $used_coupon)"
>
<!-- 拼团无优惠券 --><!-- 砍价成功无优惠券 -->
<elseif
condition=
"$showco
eq 1 and $course_hour_info eq null"
/>
<dl
className=
"df_pay-coupon"
>
<a
href=
"{:U('course/PayVideo/coupon',['id'=>$
t'=>$coupon_vst, 'asb
T['a
sb'
]])}"
>
<dt><h3>
优惠券
</h3></dt>
<dd><p><if
condit
ion=
"$v
i
deoCo
upon or $discount or $courseCard"
>
有
<else/>
无
</if>
可
用优惠券
<i
cla
e=
"ic
con-y
ntou"
></i></p>
</dd>
</a>
</dl>
</
if>
<!--实付金额-->
<dl
clas
sName=
"df_pay-price"
>
<dd><h3>
实付金额
</h3><p
id=
"pay_money"
>
¥
<if
conditio
n=
"$cou
rse_hour_info"
>
{$cours
e_hou
r_in
fo['c
_hour_price']}
<else/>
{$moner_data['price']}
</if></p></dt>
<if
condition=
"in_array($pay_vi
pe, ['zy_video','
zy_live','zy_classes'
]) and $chd eq 0"
>
<dd><h3>
优惠折扣
</h3><p
id=
"cod_money1"
>
-¥
<if
condition
=
"$is_e
vent"
>
{$moner_data['selPrice'] - $moner_data['
price
']}
<
else/>
{$mo
data[
rice']- $mo
data['price']}
</if></p></dd>
</if>
</dl>
<!--购买协议-->
<div
className=
"df_pay-proto
ol"
>
<p><i
className=
"icon icon-xuanze"
attr=
"1"
></i>
我已阅读并同意
<a
href=
"{:U('basic/Singl
fo',ar
id'=>'buy'))}"
>
《{$site['site_keyword']}购买协议》
</a></p>
</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
className=
"df_pay-buy"
>
<h3>
合计:
<strong
id=
"pay_money2"
>
¥
<if
c
ondition=
"$course_hour
_info
"
>
{$course_hou
o['course_hour_price']}
<else/>
{$moner_data['price']}
</if></strong></h3>
<a
href=
"
javas
t:;"
onClick=
"buyOperat(this,{$id},'video');"
type=
"submit"
>
提交
</a>
</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>
<form
action=
"{:U('course/PayVideo/payLibrary')}"
method=
"
POST"
id=
"pay_video_form"
>
<input
type=
"hiden"
value=
"{$id}"
name=
"vid"
/>
<input
type=
"hidden"
value=
"1"
name=
"discout_type"
/>
<input
type=
"hidden"
value=
"{$coupon_use_id}"
name=
"
coupon_id"
id=
"coupon_id"
/>
<input
type=
"hidden"
value=
"{$_ES
'mid']}"
name=
"mid"
/>
<input
type=
"hidden"
name=
"mount_mhm_d"
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_vieo
,['zy
o','zy_live','zy_classes'])"
>
<input
type=
"hidden"
value=
"{$course_hur
_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['pice']}"
name=
"
money"
/>
<if
condition=
"$is_wx and in_arra
y',$payConfig['pay'])"
>
<input
type=
"hiden"
value=
"wxpay"
name=
"pay
"
/>
<else/>
<volist
name=
"payWay"
id=
"vo"
offset=
"0
"
l
gth=
"1"
>
<input
type=
"hidden"
value=
"{$vo}"
name=
"pay
"
/>
</vol
ist
>
</if>
<input
type=
"hidden"
val
ue=
"{$_GET['vst
']}"
name=
"vst"
/>
</form>
</d
iv
>
</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>
<if
condition=
"$is_wx eq false"
>
<style>
#_ts_box_h5
{
width
:
290px
;
height
:
180px
;
text-align
:
center
;
colo
r
:
#535353
;
border-radius
:
5px
;
pos
ition
:
fixed
;
background
:
#fff
;
-webkit-box-
shadow
:
0
2px
5px
#dddddd
;
-moz-box
-shadow
:
0
2px
5
p
x
#dddddd
;
-khtm
l
-box-sha
dow
:
0
2px
5px
#dddddd
;
-ms-box
-shadow
:
0
0
15px
#888888
;
box-
shadow
:
0
0
15px
#
88888
8
;
z-in
de
x
:
997
;
left
:
5%
;
t
op
:
3
5%
;
margin
:
0
au
to
;
background
:
#fff
;}
._hide_box_h5
{
z-
index
:
996
;
fil
ter
:
alpha
(
opacit
y
=
50
);
background
:
#666
;
opacity
:
0.5
;
-moz-opaci
ty
:
0.5
;
left
:
0
;
to
p
:
0
;
height
:
99%
;
widt
h
:
100%
;
position
:
fixed
;}
#_ts
_box_h5
._box_hd
{
padding
:
20px
0px
;
color
:
black
;
font-size
:
1
6px
;
border-
b
ottom
:
1px
solid
r
gba
(
0
,
0
,
0
,
0
.
16
);}
#_layer-
c
tent
{
pad
ng
:
15px
0px
;
color
:
rgba
(
255
,
35
,
0
,
0.69
);
font-size
:
16px
;
border-bottom
:
1px
solid
rgba
(
0
,
0
,
0
,
0.1
);}
._layer-wt
{
pdding
:
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>
</
div
>
</
if
>
<script>
new
Vue
({
el
:
"#app"
,
data
:
function
()
{
return
{
agree
:
false
,
info
:
{}
}
},
created
:
function
(){
},
computed
:
{
totalPrice
:
function
()
{
return
"{$moner_data['price']}"
},
discount
:
function
()
{
return
"(已优惠:¥0)"
$
(
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"
)
}
},
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
)
});
})
'<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
;
}
}
})
}
else
{
ui
.
error
(
'请阅读并同意购买协议'
)
});
},
1800
);
});
}
});
'</if>'
$
(
function
(){
// var id = '{$coupon.id}';
// var price = '{$moner_data.price}';
// // console.log(price);
// $.ajax({
// type:"POST",
// url:"{:U('course/PayVideo/getCouponInfo')}",
// data:{id:id},
// dataType:"json",
// success:function(data){
// if(data){
// buyvCoupon(data.coupon_id,data.cuid,data.type,price);
// }else{
// return false;
// }
// }
// });
//支付方式选择
$
(
'.paytype'
).
click
(
function
(){
var
pay
=
$
(
this
).
attr
(
'value'
);
$
(
'input:hidden[name="pay"]'
).
val
(
pay
);
});
// $(".hide_box").fadeToggle();
// $(".shang_box").fadeToggle();
});
function
buyvCoupon
(
cid
,
coupon_id
,
discount_type
)
{
if
(
MID
<=
0
){
ui
.
confirm
(
'请先登录'
,
{
yes
:
function
()
{
window
.
location
.
href
=
"{:U('basic/Passport/login')}"
;
}
},
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
}
}
})
});
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
){
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
;
}
})
</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> -->
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
;
}
<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
);
}
$
(
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/course/Tpl/default/PayVideo/index_w3g_new.html
0 → 100644
View file @
4b1d0d35
<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"
/>
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