edit-market-sylive2
This commit is contained in:
@@ -256,12 +256,17 @@ class Act extends Wx {
|
||||
//支付
|
||||
public function post_pay(){
|
||||
$skey = $this->input->post('skey');
|
||||
$name = $this->input->post('name');
|
||||
$mobile = $this->input->post('telPhone');
|
||||
$param = $this->myencryption->base64url_decode($skey);
|
||||
$a_id = intval($param['a_id']);//活动id
|
||||
$row = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
|
||||
if(!$row){
|
||||
$this->show_json('',400,'参数错误');
|
||||
}
|
||||
if(!mobile_valid($mobile)){
|
||||
$this->show_json('',400,'请输入正确手机号');
|
||||
}
|
||||
$jsondata = json_decode($row['jsondata'],true);
|
||||
$item = $jsondata['item'] ? $jsondata['item'] : [];
|
||||
//判断是否已支付
|
||||
@@ -285,13 +290,15 @@ class Act extends Wx {
|
||||
'expire_time' => time()+24*60*60,//订单过期时间
|
||||
'createTime' => date('Y-m-d H:i:s')
|
||||
];
|
||||
$name && $unpay['uname'] = $name;
|
||||
$mobile && $unpay['mobile'] = $mobile;
|
||||
$oid = $this->market_sylive_order_model->add($unpay);
|
||||
if(!is_numeric($oid)){
|
||||
$this->show_json('',400,'创建订单失败');
|
||||
}
|
||||
}
|
||||
$user = $this->user_model->get(['userId'=>$this->uid]);
|
||||
$notify_url = http_host_com('home').'//h5/market/sylive/notify';
|
||||
$notify_url = http_host_com('home').'/h5/market/sylive/notify';
|
||||
$result = $this->pay($unpay['sid'],$unpay['total_price'],$user['openid'],$unpay['item_title'],$notify_url,$unpay['expire_time']);
|
||||
if(!$result['code']){
|
||||
$this->show_json('',400,$result['msg']);
|
||||
|
||||
@@ -29,10 +29,32 @@
|
||||
|
||||
<div class="fixed left-0 bottom-0 right-0 inner30 bg-fff z-index-2" >
|
||||
<a class="block bg-999 pt20 pb20 text-center font-36 color-fff ulib-r10" href="javascript:void(0)" v-if="info.is_pay">已支付</a>
|
||||
<a @click="toPay" class="block bg-1a1a1a pt20 pb20 text-center font-36 color-fff ulib-r10" href="javascript:void(0)" v-else>立即支付</a>
|
||||
<a @click="showReg" class="block bg-1a1a1a pt20 pb20 text-center font-36 color-fff ulib-r10" href="javascript:void(0)" v-else>立即支付</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="msg fn-hide" :style="isShowReg?'display:block':'display:none'" v-if="isShowReg">
|
||||
<div class="msgBg" @click="closeReg"></div>
|
||||
<div class="msgMain">
|
||||
<div class="content">
|
||||
<div class="word">
|
||||
|
||||
<div class="mt30 relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="text" v-model="name" placeholder="请输入您的姓名" />
|
||||
</div>
|
||||
|
||||
<div class="mt30 relative bg-f6 ulib-r10">
|
||||
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="tel" v-model="telPhone" placeholder="请输入手机号" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt20 opt pl40 pr40">
|
||||
<a class="block pt25 pb25 bg-1a1a1a text-center font-32 color-fff ulib-r750" @click="toPay()">确定支付</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -52,6 +74,10 @@
|
||||
// },
|
||||
info : <?=json_encode($info)?>,
|
||||
bundleIntervalEvent: '',//倒计时
|
||||
isShowReg: false,
|
||||
name: '',
|
||||
telPhone: '',
|
||||
isSubmiting: false,
|
||||
},
|
||||
created(){
|
||||
|
||||
@@ -114,7 +140,12 @@
|
||||
clearInterval(this.bundleIntervalEvent);
|
||||
},
|
||||
methods: {
|
||||
|
||||
showReg: function() {
|
||||
this.isShowReg = true
|
||||
},
|
||||
closeReg: function() {
|
||||
this.isShowReg = false
|
||||
},
|
||||
//直播倒计时
|
||||
intervalEvent() {
|
||||
if (this.info.e_time > 0) {
|
||||
@@ -125,31 +156,50 @@
|
||||
},
|
||||
//支付
|
||||
toPay(){
|
||||
$.post('/h5/market/sylive/act/post_pay',{'skey':'<?=$info['skey']?>'},function (res){
|
||||
if(res.code==200){
|
||||
var jsondata = res.data;
|
||||
WeixinJSBridge.invoke(
|
||||
'getBrandWCPayRequest',
|
||||
jsondata,
|
||||
function(res){
|
||||
if(res.err_msg == "get_brand_wcpay_request:ok" ){//前端返回成功支付
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "恭喜您购买成功",
|
||||
onClose:function(){
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
mDialog.msg({content: "支付失败"});
|
||||
var that = this
|
||||
if (!this.name) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入您的姓名"
|
||||
});
|
||||
}else if (!/^1[3456789]\d{9}$/.test(this.telPhone)) {
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "请输入正确手机号"
|
||||
});
|
||||
}else{
|
||||
that.isSubmiting = true
|
||||
$.post('/h5/market/sylive/act/post_pay',{'skey':'<?=$info['skey']?>','name':that.name,'telPhone':that.telPhone},function (res){
|
||||
that.isSubmiting = false
|
||||
this.isShowReg = false
|
||||
if(res.code==200){
|
||||
var jsondata = res.data;
|
||||
WeixinJSBridge.invoke(
|
||||
'getBrandWCPayRequest',
|
||||
jsondata,
|
||||
function(res){
|
||||
if(res.err_msg == "get_brand_wcpay_request:ok" ){//前端返回成功支付
|
||||
mDialog.msg({
|
||||
duration: 250,
|
||||
pause: 2000,
|
||||
content: "恭喜您购买成功",
|
||||
onClose:function(){
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
mDialog.msg({content: "支付失败"});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}else{
|
||||
mDialog.msg({content: res.msg});
|
||||
}
|
||||
},'json')
|
||||
);
|
||||
}else{
|
||||
mDialog.msg({content: res.msg});
|
||||
}
|
||||
},'json')
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title><?=$_title?></title>
|
||||
<link rel="stylesheet" href="/css/h5/market/sylive/h5.css?2022">
|
||||
<link rel="stylesheet" href="/css/h5/market/sylive/h5.css?20221008">
|
||||
<link rel="stylesheet" href="https://qs.haodian.cn/web/javascript/swiper/css/swiper.min.css">
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/jquery.3.4.1.min.js"></script>
|
||||
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/vue.2.6.10.min.js"></script>
|
||||
|
||||
@@ -18,6 +18,17 @@
|
||||
</div>
|
||||
<!--预热阶段-->
|
||||
<div v-if="tabid==1">
|
||||
|
||||
<div class="relative mt30 bg-fff5ec overflowhidden ulib-r20" v-if="begin.cell3 && begin.cell3.length>0">
|
||||
<div class="orderTip text-center font-24 color-fff bg-ff5a5a">我的</div>
|
||||
<div class="fn-flex pl20 pr20 text-center">
|
||||
<a class="fn-flex-item pt40 pb40" v-for="item in begin.cell3" :href="item.url">
|
||||
<div class="font-32 color-fe9538">{{item.num}}</div>
|
||||
<div class="mt10 font-22 color-666">{{item.title}}<i v-if="item.url" class="iconfont icon-gengduo"></i></div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt30 overflowhidden ulib-r20">
|
||||
<div class="bg-fff5ec fn-flex text-center">
|
||||
<a class="fn-flex-item pt40 pb40" v-for="item in begin.cell1" :href="item.url">
|
||||
@@ -33,14 +44,6 @@
|
||||
<div class="mt10 font-22 color-666">{{item.title}}</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="bg-f6 fn-flex text-center" v-if="begin.cell3 && begin.cell3.length>0">
|
||||
<a class="bg-fff5ec fn-flex-item pt40 pb40" v-for="item in begin.cell3" :href="item.url">
|
||||
<div class="font-32 color-fe9538">{{item.num}}</div>
|
||||
<div class="mt10 font-22 color-666">
|
||||
{{item.title}}<i v-if="item.url" class="iconfont icon-gengduo"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20">
|
||||
@@ -90,6 +93,17 @@
|
||||
<!--直播阶段-->
|
||||
<div v-if="tabid==2">
|
||||
<div class="mt30 bg-f9 inner20 overflowhidden text-center font-24 color-666 ulib-r20">直播结束后2小时同步数据</div>
|
||||
|
||||
<div class="relative mt30 bg-fff5ec overflowhidden ulib-r20" v-if="live.cell4 && live.cell4.length>0">
|
||||
<div class="orderTip text-center font-24 color-fff bg-ff5a5a">我的</div>
|
||||
<div class="fn-flex pl20 pr20 text-center">
|
||||
<a class="fn-flex-item pt40 pb40" v-for="item in live.cell4" :href="item.url">
|
||||
<div class="font-32 color-fe9538">{{item.num}}</div>
|
||||
<div class="mt10 font-22 color-666">{{item.title}}<i v-if="item.url" class="iconfont icon-gengduo"></i></div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt30 overflowhidden ulib-r20">
|
||||
<div class="bg-fff5ec fn-flex text-center">
|
||||
<a class="fn-flex-item pt40 pb40" v-for="item in live.cell1" :href="item.url">
|
||||
@@ -111,14 +125,6 @@
|
||||
<div class="mt10 font-22 color-666">{{item.title}}</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="bg-f6 fn-flex text-center" v-if="live.cell4 && live.cell4.length>0">
|
||||
<a class="fn-flex-item pt40 pb40" v-for="item in live.cell4" :href="item.url">
|
||||
<div class="font-32 color-fe9538">{{item.num}}</div>
|
||||
<div class="mt10 font-22 color-666">
|
||||
{{item.title}}<i v-if="item.url" class="iconfont icon-gengduo"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt30 bg-f9 inner40 overflowhidden ulib-r20">
|
||||
|
||||
Reference in New Issue
Block a user