edit-item-pay

This commit is contained in:
lccsw
2022-10-12 11:11:23 +08:00
parent dd7da03a82
commit a1a4bd4c03
7 changed files with 135 additions and 65 deletions
+65 -17
View File
@@ -6,6 +6,7 @@ class Act extends Wx {
private $group_id;
private $secretkey = '7a23vx9257';
private $item_banner = ['https://qs.haodian.cn/web/images/project/H5-ShiYu/goods.jpg'];
public function __construct(){
parent::__construct();
@@ -105,6 +106,9 @@ class Act extends Wx {
}else{
$info['live_url'] = "https://live.liche.cn/watch/{$row['channelId']}?userid={$userid}&ts={$ts}&sign={$sign}";
}
//判断是否支付商品
$is_pay = $this->market_sylive_order_model->count(['item_id'=>$a_id,'status'=>1,'uid'=>$this->uid]);
$info['is_pay'] = $is_pay ? 1 : 0;
$this->data['info'] = $info;
$this->data['sign_package'] = $sign_package;
$this->data['share'] = $share;
@@ -241,12 +245,17 @@ class Act extends Wx {
$jsondata = json_decode($row['jsondata'],true);
$item = $jsondata['item'] ? $jsondata['item'] : [];
$is_pay = $this->market_sylive_order_model->count(['item_id'=>$a_id,'status'=>1,'uid'=>$this->uid]);
if($is_pay){
$url = http_host_com('home').'/h5/market/sylive/act/ucenter?skey='.$skey;
redirect($url);exit;
}
$e_time = time() < strtotime($row['timeEnd']) ? strtotime($row['timeEnd']) - time() : 0;
$banner = [];
if($item['itemImg']){
foreach ($item['itemImg'] as $value) {
$banner[] = build_qiniu_image_url($value);
}
$banner = $this->item_banner;
$validity = '';
if($item['useTimeStart'] || $item['useTimeEnd']){
$useTimeStart = date('Y-m-d',strtotime($item['useTimeStart']));
$useTimeEnd = date('Y-m-d',strtotime($item['useTimeEnd']));
$validity = "有效期 {$useTimeStart} - {$useTimeEnd}";
}
$info = [
'title' => $item['title'] ? $item['title'] : '',
@@ -255,7 +264,7 @@ class Act extends Wx {
'content' => $item['introduction'] ? $item['introduction'] : '',
'banner' => $banner,
'skey' => $skey,
'is_pay' => $is_pay
'validity' => $validity
];
$this->data['info'] = $info;
$this->data['_title'] = $row['title'];
@@ -322,21 +331,60 @@ class Act extends Wx {
if(!$row){
throw new Hd_exception('参数错误',400);
}
$order = $this->market_sylive_order_model->get(['uid'=>$this->uid,'status'=>1,'item_id'=>$a_id]);
if(!$order){
$url = http_host_com('home').'/h5/market/sylive/act/item?skey='.$skey;
redirect($url);exit;
}
$jsondata = json_decode($row['jsondata'],true);
$item = $jsondata['item'] ? $jsondata['item'] : [];
$banner = [];
if($item['itemImg']){
foreach ($item['itemImg'] as $value) {
$banner[] = build_qiniu_image_url($value);
}
$validity = '';
if($item['useTimeStart'] || $item['useTimeEnd']){
$useTimeStart = date('Y-m-d',strtotime($item['useTimeStart']));
$useTimeEnd = date('Y-m-d',strtotime($item['useTimeEnd']));
$validity = "有效期 {$useTimeStart} - {$useTimeEnd}";
}
$order = [
'uname' => $order['uname'] ? $order['uname'] : '',
'utel' => $order['mobile'] ? $order['mobile'] : '',
'slogan' => '尊享您的直播好礼',
'valid_time' => $validity,
'oid' => $order['sid'],
'c_time' => date('Y-m-d H:i:s'),
];
$if_pid = 0;
$ac_user = $this->act_user_model->get(['userId'=>$this->uid,'activityId'=>$a_id],'channelId');
$ac_user['channelId'] && $pid_user = $this->user_model->get(['userId'=>$ac_user['channelId']],'uname,organizationId,mobile');
$gw_tel = $gw_slogan = $gw_title = '';
if($ac_user['channelId'] && $pid_user['organizationId']>0){
$group_id = $this->sylive_entity->get_level($pid_user['organizationId']);
if($group_id==3){ //顾问
$if_pid = 1;
$where = [
"organizationId in (select parentId from lc_market_sylive_organization where organizationId={$pid_user['organizationId']})" => null
];
$org = $this->market_sylive_organization_model->get($where);
}elseif($group_id==2){ //店长
$if_pid = 1;
$where = [
"organizationId" => $pid_user['organizationId']
];
$org = $this->market_sylive_organization_model->get($where);
}
$gw_title = $org['organizationName'];
$gw_slogan = $pid_user['uname'].'·您的专属的福利官';
$gw_tel = $pid_user['mobile'];
}
$order = $this->market_sylive_order_model->get(['uid'=>$this->uid,'status'=>1,'item_id'=>$a_id]);
$info = [
'title' => $item['title'],
'content' => $item['introduction'],
'banner' => $banner,
'state' => $order ? 0 : 1,
'text' => $order ? '已抢购' : '未抢购',
'bg' => "https://qs.haodian.cn/web/images/project/H5-ShiYu/mine-bg.jpg",
'logo' => "https://qs.haodian.cn/web/images/project/H5-ShiYu/goodslogo.jpg",
'if_pid' => $if_pid,
'title' => $gw_title,
'slogan' => $gw_slogan,
'cust_tel' => $gw_tel,
'introTitle' => '权益说明',
'content' => $item['introduction'] ? $item['introduction'] : '',
'order' => $order,
'skey' => $skey
];
$this->data['info'] = $info;
+1 -1
View File
@@ -31,7 +31,7 @@
</template>
</div>
<a class="bottom-opt pt15 bg-1a1a1a ulib-r750 text-center color-fff" href="/h5/market/sylive/act/ucenter?skey=<?=$info['skey']?>">
<a class="bottom-opt pt15 bg-1a1a1a ulib-r750 text-center color-fff" href="/h5/market/sylive/act/ucenter?skey=<?=$info['skey']?>" v-if="info.is_pay">
<i class="iconfont icon-wode text-middle font-36"></i>
<div class="font-22">我的</div>
</a>
+29 -20
View File
@@ -2,7 +2,7 @@
<div id="app">
<div class="container relative pb130">
<!--轮播-->
<div class="goods-banner relative imgsize-750X680 z-index-0">
<div class="goods-banner relative imgsize-750X680 z-index-0" v-if='info.banner.length>1'>
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="item in info.banner">
@@ -12,25 +12,31 @@
</div>
<div class="swiper-pagination ulib-rl750 font-22 color-fff"></div>
</div>
<div v-else><img class="imgsize-750X680" :src="info.banner[0]" alt="#" /></div>
<!--end 轮播-->
<div class="relative pl30 pr30 pb30 z-index-1 goods-con">
<div class="relative bg-fff mb30 ml30 mr30 inner40 pr220 ulib-r20 box-shadow-darkGray">
<div class="font-36">{{info.title}}</div>
<div class="mt10 font-22 color-999" v-if="info.e_time>0" v-html="showTime"></div>
<div class="absolute right-0 box-middle mr30 color-fe9538">
<div class="mt10 font-22 color-999">{{info.validity}}</div>
<div class="absolute right-0 box-middle mr30 color-c4302c">
<span class="font-28">¥</span>
<span class="font-64">{{info.price}}</span>
</div>
</div>
<div class="relative bg-fff mb30 ml30 mr30 inner40 ulib-r20 box-shadow-darkGray">
<div class="pb20 text-center"><div class="inline-block relative pl10 pr10 introTitle font-36"><span class="relative z-index-1">{{info.introTitle}}</span></div></div>
<div class="line-height-17 font-28 color-666 text-break space-pre-line" v-html="info.content"></div>
</div>
</div>
<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="showReg" class="block bg-1a1a1a pt20 pb20 text-center font-36 color-fff ulib-r10" href="javascript:void(0)" v-else>立即支付</a>
<a class="block bg-1a1a1a pt20 pb20 text-center color-fff ulib-r10" v-if="info.e_time>0" @click="showReg" href="javascript:void(0)">
<div class="font-32">立即支付<span>{{info.price}}</span></div>
<div class="mt10 font-20 color-888" v-html="showTime"></div>
</a>
<div class="bg-999 pt30 pb30 text-center color-fff ulib-r10" v-else>活动已结束</div>
</div>
</div>
<div class="msg fn-hide" :style="isShowReg?'display:block':'display:none'" v-if="isShowReg">
@@ -54,7 +60,6 @@
</div>
</div>
</div>
</div>
<script>
@@ -64,8 +69,10 @@
data: {
// info:{
// title:"纳米Box 轻Young空间",
// e_time: 5000,
// e_time: 5,
// price:9.9,
// validity:'有效期 2022-08-01 -2022 -08-31',
// introTitle:'权益说明',
// content:'纳米BOX充分考虑到了用户的用车续航焦虑问题,新车采用了高密度电池组,CLTC续航331km。此外,纳米BOX全系支持快充、慢充功能,快充30分钟可以完成30~80%的补电,慢充4小时即可满电,轻松覆盖日常用车需求。纳米BOX充分考虑到了用户的用车续航焦虑问题,新车采用了高密度电池组,CLTC续航331km。此外,纳米BOX全系支持快充、慢充功能,快充30分钟可以完成30~80%的补电,慢充4小时即可满电,轻松覆盖日常用车需求。',
// "banner": [
// "https://img.zcool.cn/community/0144975f5d8a2711013e3187fe2bb7.jpg@1280w_1l_2o_100sh.jpg",
@@ -87,7 +94,7 @@
showTime() {
//剩余秒数<=0
if (this.info.e_time <= 0) {
return "已过期";
return "活动已结束";
}
// 剩余秒数>0
else {
@@ -140,22 +147,15 @@
clearInterval(this.bundleIntervalEvent);
},
methods: {
showReg: function() {
this.isShowReg = true
},
closeReg: function() {
this.isShowReg = false
},
//直播倒计时
intervalEvent() {
if (this.info.e_time > 0) {
this.info.e_time--;
} else {
clearInterval(this.bundleIntervalEvent);
}
},
//支付
toPay(){
toPay() {
var that = this
if (!this.name) {
mDialog.msg({
@@ -186,7 +186,7 @@
pause: 2000,
content: "恭喜您购买成功",
onClose:function(){
location.reload();
window.location = "/h5/market/sylive/act/ucenter?skey=<?=$info['skey']?>";
}
});
}else{
@@ -199,8 +199,17 @@
}
},'json')
}
},
//直播倒计时
intervalEvent() {
if (this.info.e_time > 0) {
this.info.e_time--;
} else {
clearInterval(this.bundleIntervalEvent);
}
},
}
},
})
</script>
+37 -24
View File
@@ -1,26 +1,30 @@
<body class="bg-f6">
<div id="app">
<div class="container relative pb130">
<!--轮播-->
<div class="goods-banner relative imgsize-750X680 z-index-0">
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="item in info.banner">
<img class="imgsize-750X680" :src="item" alt="#" />
</div>
</div>
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pb40" :style="'background-image:url('+info.bg+')'">
<div class="relative height-710">
<div class="pt90 pl100 pr100 fn-clear">
<div class="fn-fl font-18">订单号 {{info.order.oid}}</div>
<div class="fn-fr font-18"><i class="iconfont icon-time"></i>{{info.order.c_time}}</div>
</div>
<div class="swiper-pagination ulib-rl750 font-22 color-fff"></div>
</div>
<!--end 轮播-->
<div class="relative pl30 pr30 pb30 z-index-1 goods-con" v-if="info.title">
<div class="relative bg-fff mb30 ml30 mr30 inner40 ulib-r20 box-shadow-darkGray overflowhidden">
<div :class="info.state==0?'orderTip text-center font-24 color-fff bg-888':'orderTip text-center font-24 color-fff bg-ff5a5a'">{{info.text}}</div>
<div class="text-center">{{info.title}}</div>
<div class="mt20 line-height-17 font-28 color-666 text-break space-pre-line" v-html="info.content"></div>
<div class="uinfo absolute box-center pt15 pb15 pl30 pr30 font-32 ulib-r750">{{info.order.uname}} · {{info.order.utel}}</div>
<div class="odslogan absolute box-center text-center color-e4bc93 space-nowrap">
<div class="pb10 bbs-1-e4bc93 font-48">{{info.order.slogan}}</div>
<div class="mt10 font-24">{{info.order.valid_time}}</div>
</div>
</div>
<div class="relative bg-fff mb30 ml30 mr30 inner40 pl150 pr220 ulib-r20 box-shadow-darkGray" v-if="info.if_pid">
<img class="absolute left-0 box-middle ml35 imgsize-90X90 ulib-r750" :src="info.logo" :alt="info.title" />
<div class="font-36">{{info.title}}</div>
<div class="mt10 font-22 color-999">{{info.slogan}}</div>
<div class="mt10 font-22 color-999">{{info.validity}}</div>
<a class="absolute right-0 box-middle mr30" :href="'tel:'+info.cust_tel">
<img class="imgsize-60X60" src="https://qs.haodian.cn/web/images/project/H5-ShiYu/tel.png" alt="拨打电话" />
</a>
</div>
<div class="relative bg-fff mb30 ml30 mr30 inner40 ulib-r20 box-shadow-darkGray">
<div class="pb20 text-center"><div class="inline-block relative pl10 pr10 introTitle font-36"><span class="relative z-index-1">{{info.introTitle}}</span></div></div>
<div class="line-height-17 font-28 color-666 text-break space-pre-line" v-html="info.content"></div>
</div>
</div>
<a class="bottom-opt pt15 bg-1a1a1a ulib-r750 text-center color-fff" href="/h5/market/sylive/act?skey=<?=$info['skey']?>">
<i class="iconfont icon-shouye text-middle font-36"></i>
@@ -34,14 +38,23 @@
el: '#app',
data: {
// info:{
// title:"2022-08-19 直播间活动权益",
// bg:"https://qs.haodian.cn/web/images/project/H5-ShiYu/mine-bg.jpg",
// logo:"https://qs.haodian.cn/web/images/project/H5-ShiYu/goodslogo.jpg",
// title:"东风·纳米",
// slogan:"东风EV·您的专属的福利官",
// cust_tel:'15355555555',
// introTitle:'权益说明',
// content:'纳米BOX充分考虑到了用户的用车续航焦虑问题,新车采用了高密度电池组,CLTC续航331km。此外,纳米BOX全系支持快充、慢充功能,快充30分钟可以完成30~80%的补电,慢充4小时即可满电,轻松覆盖日常用车需求。纳米BOX充分考虑到了用户的用车续航焦虑问题,新车采用了高密度电池组,CLTC续航331km。此外,纳米BOX全系支持快充、慢充功能,快充30分钟可以完成30~80%的补电,慢充4小时即可满电,轻松覆盖日常用车需求。',
// "banner": [
// "https://img.zcool.cn/community/0144975f5d8a2711013e3187fe2bb7.jpg@1280w_1l_2o_100sh.jpg",
// "https://qs.haodian.cn/web/images/project/H5-ShiYu/upload/v-5.jpg",
// ],
// order:{
// uname:'张大三',
// utel:'13459***382',
// slogan:'尊享您的直播好礼',
// valid_time:'2022-08-01-2022-08-31',
// oid:'XM202210111563586',
// c_time:'2022-10-11 15:35:52',
// }
// },
info:<?=json_encode($info,JSON_UNESCAPED_UNICODE)?>,
info : <?=json_encode($info,JSON_UNESCAPED_UNICODE)?>,
},
created(){
+1 -1
View File
@@ -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?20221010">
<link rel="stylesheet" href="/css/h5/market/sylive/h5.css?20221011">
<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>
+1 -1
View File
@@ -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?20221009">
<link rel="stylesheet" href="/css/h5/market/sylive/h5.css?20221011">
<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>
File diff suppressed because one or more lines are too long