edit-sylive-item

This commit is contained in:
lccsw
2022-11-09 17:45:35 +08:00
parent 77927e93e1
commit ea72ce7256
12 changed files with 164 additions and 347 deletions
@@ -7,7 +7,6 @@ class Act extends Wx {
private $group_id = 4;
private $teamLevel = 3;
private $secretkey = '7a23vx9257';
private $item_banner = ['https://qs.haodian.cn/web/images/project/H5-ShiYu/goods.jpg'];
private $template_id = 'DO0B9IYYub1d0oNvy9czzGbe6_1EU8PQmnLEoDOcmXA';
@@ -16,6 +16,7 @@ abstract class Common extends CI_Controller{
protected $session;
protected $log_dir = 'market/sylive';
protected $secret = "market_sylive_h5_test";
protected $secretkey = '7a23vx9257';
public function __construct(){
parent::__construct();
+7 -2
View File
@@ -21,6 +21,7 @@ class Item extends Wx{
$param = $this->myencryption->base64url_decode($skey);
$a_id = intval($param['a_id']);//活动id
$row = $this->market_sylive_items_model->get(['itemId'=>$itemId,'activityId'=>$a_id]);
$act = $this->market_sylive_activity_model->get(['activityId'=>$a_id]);
if(!$row){
throw new Hd_exception('参数错误',400);
}
@@ -58,11 +59,15 @@ class Item extends Wx{
$channel_user = $this->act_user_model->get(['userId'=>$ac_user['channelId'],'activityId'=>$a_id]);
$channel_user['bizId'] && $need_shop = 0;
}
$need_shop = 1;
$biz_arr = $city_arr = $province_arr = [];
if($need_shop){
$province_arr = $this->msa_bizinfo_model->select(['status'=>0,'activityId'=>4],'',0,0,'distinct provinceName as name');
}
$user = $this->user_model->get(['userId'=>$this->uid],'unionid,nickname,headimg');
$userid = $user['unionid'] ? $user['unionid'] : $this->uid;
$ts = time()*1000;
$sign = md5($this->secretkey.$userid.$this->secretkey.$ts);
$live_url = "https://live.haodian.cn/watch/{$act['channelId']}?userid={$userid}&ts={$ts}&sign={$sign}";
$info = [
'itemId' => $row['itemId'],
'title' => $title,
@@ -76,6 +81,7 @@ class Item extends Wx{
'validity' => $validity,
'introTitle' => '权益说明',
'need_shop' => $need_shop,
'live_url' => $live_url
];
$this->data['province_arr'] = $province_arr;
$this->data['city_arr'] = $city_arr;
@@ -223,7 +229,6 @@ class Item extends Wx{
$code = random_string('numeric', 4);
$redis->save($key, $code, 60*5);
$content = "【好店云】您的验证码为: {$code},请勿泄露于他人!";
echo $content;exit;
b2m_send_sms($mobile,$content);
}
$this->show_json('',200, '验证码已发送');
+38 -83
View File
@@ -25,100 +25,55 @@ class Ucenter extends Wx{
throw new Hd_exception('参数错误',400);
}
$lists = [];
if($this->a_id<4){
//判断是否支付商品
$is_pay = $this->market_sylive_order_model->count(['itemId'=>$this->a_id,'status'=>1,'userId'=>$this->uid,'type'=>0,'activityId<'=>4]);
$is_pay && $lists[] = ['title'=>'我的权益','url'=>"/h5/market/sylive/ucenter/mygift?skey={$params['skey']}"];
}
$lists[] = ['title'=>'我的订单','url'=>"/h5/market/sylive/ucenter/orders?skey={$params['skey']}"];
$lists[] = ['title'=>'我的权益','url'=>"/h5/market/sylive/ucenter/orders?skey={$params['skey']}"];
$lists[] = ['title'=>'我的抽奖','url'=>"/h5/market/sylive/ucenter/win?skey={$params['skey']}"];
$lists[] = ['title'=>'联系客服','url'=>"https://work.weixin.qq.com/kfid/kfc77374393839a9d9b?enc_scene=ENCAEt1rsV7GcticSp5Xyc245thCkz9T6YRm7gShvqffNqW3A89DzkZvzjusx44EinUTe"];
$user = $this->user_model->get(['userId'=>$this->uid],'unionid,nickname,headimg');
$info = [
'title' => $user['nickname'],
'logo' => Sylive_entity::DF_IMG,
'logo' => $user['headimg'],
'list' => $lists
];
$this->data['info'] = $info;
$this->data['params'] = $params;
$this->show_view('h5/market/sylive/ucenter/index');
}
//我的权益
public function mygift(){
$row = $this->market_sylive_activity_model->get(['activityId'=>$this->a_id]);
if(!$row){
throw new Hd_exception('参数错误',400);
}
$order = $this->market_sylive_order_model->get(['userId'=>$this->uid,'status'=>1,'itemId'=>$this->a_id,'type'=>0]);
if(!$order){
$url = http_host_com('home').'/h5/market/sylive/act/item?skey='.$this->data['skey'];
redirect($url);exit;
}
$jsondata = json_decode($row['jsondata'],true);
$item = $jsondata['item'] ? $jsondata['item'] : [];
$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_jsondata = json_decode($order['jsondata'],true);
$order = [
'id' => $order['id'],
'uname' => $order['uname'] ? $order['uname'] : '',
'utel' => $order['mobile'] ? $order['mobile'] : '',
'slogan' => '尊享您的直播好礼',
'valid_time' => $validity,
'sid' => $order['sid'],
'c_time' => date('Y-m-d H:i:s'),
'region' => $order_jsondata['address']['region'] ? $order_jsondata['address']['region'] : '',
'detail' => $order_jsondata['address']['detail'] ? $order_jsondata['address']['detail'] : ''
];
$if_pid = 0;
$ac_user = $this->act_user_model->get(['userId'=>$this->uid,'activityId'=>$this->a_id],'channelId');
$ac_user['channelId'] && $pid_user = $this->user_model->get(['userId'=>$ac_user['channelId']],'uname,organizationId,mobile,headimg');
$logo = $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 = $pid_user['uname'];
$gw_slogan = $org['organizationName'];
$gw_tel = $pid_user['mobile'];
$logo = $pid_user['headimg'];
}
$info = [
'bg' => "https://qs.haodian.cn/web/images/project/H5-ShiYu/mine-bg.jpg",
'logo' => $logo,
'if_pid' => $if_pid,
'title' => $gw_title,
'slogan' => $gw_slogan,
'cust_tel' => $gw_tel,
'introTitle' => '权益说明',
'content' => $item['introduction'] ? $item['introduction'] : '',
'order' => $order,
'skey' => $this->data['skey']
];
$this->data['info'] = $info;
$this->data['_title'] = $row['title'];
//微信分享
$wx_info = $this->share_info($row);
$this->data['sign_package'] = $wx_info['sign_package'];
$this->data['share'] = $wx_info['share'];
$this->show_view('h5/market/sylive/ucenter/mygift');
//我的抽奖
public function win(){
$this->show_view('h5/market/sylive/ucenter/win');
}
public function ajax_win(){
$params = $this->input->get();
$page = $params['page'] ? $params['page'] : 1;
$size = $params['size'] ? $params['size'] : 20;
$where = [
'activityId' => $this->a_id,
'userId' => $this->uid,
'win' => 1
];
$total = $this->market_sylive_order_model->count($where);;
$lists = [];
if($total){
$rows = $this->market_sylive_order_model->select($where,'id desc',$page,$size,'id,sid,winType');
foreach ($rows as $key => $val) {
$winType = $this->market_sylive_order_model->winTypeAry($this->a_id,$val['winType']);
$lists[] = [
'id' => $val['id'],
'img' => $winType['img'],
'title' => $winType['tag'],
'goods' => $winType['title']
];
}
}
$data = [
'total' => $total,
'lists' => $lists
];
$this->show_json($data,200);
}
//我的订单
public function orders(){
$this->show_view('h5/market/sylive/ucenter/orders');
@@ -133,9 +88,9 @@ class Ucenter extends Wx{
}
$item = $this->market_sylive_items_model->get(['itemId'=>$order['itemId']]);
$validity = '';
if($item['useStart'] || $item['timeEnd']){
if($item['useStart'] || $item['useEnd']){
$useTimeStart = date('Y-m-d',strtotime($item['useStart']));
$useTimeEnd = date('Y-m-d',strtotime($item['timeEnd']));
$useTimeEnd = date('Y-m-d',strtotime($item['useEnd']));
$validity = "有效期 {$useTimeStart} - {$useTimeEnd}";
}
$order_jsondata = json_decode($order['jsondata'],true);
+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?20221105">
<link rel="stylesheet" href="/css/h5/market/sylive/h5.css?20221106">
<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>
+6 -2
View File
@@ -104,7 +104,7 @@
<div class="content">
<div class="word text-center">
<div class="font-36">支付成功</div>
<div class="mt15 font-22 color-999">请输入您的地址,我们会第一时间为您发出!</div>
<div class="mt15 font-22 color-999">请输入您的收货地址</div>
<div class="mt30 relative bg-f6 ulib-r10">
<input id="region" class="wp100 inner30 font-28 bg-f6 border-none ulib-r10" type="text" readonly="" v-model="region" placeholder="选择省/市/区" />
<input id="regionvalue" type="hidden" v-model="regionvalue"/>
@@ -117,7 +117,7 @@
<a class="block pt25 pb25 bg-1a1a1a text-center font-32 color-fff ulib-r10" @click="postAddress()">确认</a>
</div>
<div class="mt30 text-center">
<a class="font-24 text-underline" @click="closeSuccess()">不了,看完直播再说></a>
<a class="font-24 text-underline" @click="goLive()">不了,看完直播再说></a>
</div>
</div>
</div>
@@ -476,6 +476,10 @@
},'json');
}
},
//跳转直播间
goLive(){
window.location = this.info.live_url;
}
},
watch: {
'province': function (nv, ov) {
+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?2022102420">
<link rel="stylesheet" href="/css/h5/market/sylive/h5.css?20221106">
<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>
@@ -13,7 +13,7 @@
<div class="uinfo absolute wp100 pr100 pl100">
<div class="space-nowrap"><span>{{info.order.uname}}</span><span class="font-28">·{{info.order.utel}}</span></div>
<div class="mt10 uinfoadd font-22 ulib-rl750" v-if="show_address" @click="showAdd()"><i class="iconfont mr5 icon-dizhi"></i>{{show_address}}</div>
<div class="mt10 uinfoadd font-22 ulib-rl750" v-else @click="showAdd()"><i class="iconfont mr5 icon-zengjia"></i>收货地址</div>
<div class="mt10 uinfoadd font-22 ulib-rl750" v-else @click="showAdd()"><i class="iconfont mr5 icon-zengjia"></i>(完善收货地址)</div>
</div>
<!-- <div class="uinfo absolute box-center pt15 pb15 pl30 pr30 font-32 ulib-r750 space-nowrap">{{info.order.uname}} · {{info.order.utel}}</div>-->
<div class="odslogan absolute box-center text-center color-e4bc93 space-nowrap">
@@ -44,7 +44,7 @@
<div class="msgMain">
<div class="content">
<div class="word text-center">
<div class="mt15 font-22 color-999">请输入您的地址,我们会第一时间为您发出!</div>
<div class="mt15 font-22 color-999">请输入您的收货地址</div>
<div class="mt30 relative bg-f6 ulib-r10">
<input id="region" class="wp100 inner30 font-28 bg-f6 border-none ulib-r10" type="text" readonly="" v-model="region" placeholder="选择省/市/区" />
<input id="regionvalue" type="hidden" v-model="regionvalue"/>
@@ -56,9 +56,11 @@
<div class="mt30">
<a class="block pt25 pb25 bg-1a1a1a text-center font-32 color-fff ulib-r10" @click="postAddress()">确认</a>
</div>
<!--
<div class="mt30 text-center">
<a class="font-24 text-underline" @click="isShowAdd=!isShowAdd">不了,看完直播再说></a>
</div>
-->
</div>
</div>
</div>
@@ -90,7 +92,7 @@
region:'<?=$info['order']['region']?>',
regionvalue:'',
address:'<?=$info['order']['detail']?>',
show_address:'<?=$info['order']['region'].' '.$info['order']['detail']?>',
show_address:'<?=$info['order']['region'] ? $info['order']['region']." ".$info['order']['detail'] : ''?>',
isShowAdd: false,
isSubmiting: false,
},
@@ -1,230 +0,0 @@
<link rel="stylesheet" href="https://qs.haodian.cn/web/javascript/LArea/css/LArea.css">
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/LArea/js/LAreaData1.js"></script>
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/LArea/js/LAreaData2.js"></script>
<script type="text/javascript" src="https://qs.haodian.cn/web/javascript/LArea/js/LArea.js"></script>
<body class="bg-f6">
<div id="app" ref="app">
<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.sid}}</div>
<div class="fn-fr font-18"><i class="iconfont icon-time"></i> {{info.order.c_time}}</div>
</div>
<div class="uinfo absolute wp100 pr100 pl100">
<div class="space-nowrap"><span>{{info.order.uname}}</span><span class="font-28">·{{info.order.utel}}</span></div>
<div class="mt10 uinfoadd font-22 ulib-rl750" v-if="show_address" @click="showAdd()"><i class="iconfont mr5 icon-dizhi"></i>{{show_address}}</div>
<div class="mt10 uinfoadd font-22 ulib-rl750" v-else @click="showAdd()"><i class="iconfont mr5 icon-zengjia"></i>收货地址</div>
</div>
<!-- <div class="uinfo absolute box-center pt15 pb15 pl30 pr30 font-32 ulib-r750 space-nowrap">{{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 bds-1-eee" :src="info.logo" :alt="info.title" />
<div>
<span class="font-36 text-middle">{{info.title}}</span>
<span class="inline-block pl10 pr10 line-height-15 text-middle ulib-r750 font-22 color-fff bg-1a1a1a">专属顾问</span>
</div>
<div class="mt10 font-22 color-999">{{info.slogan}}</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 rich-text-img" v-html="info.content"></div>
</div>
</div>
<? $this->load->view('h5/market/sylive/nav_my') ?>
<div class="msg fn-hide" :style="isShowAdd?'display:block':'display:none'" v-if="isShowAdd">
<div class="msgBg" @click="isShowAdd=!isShowAdd"></div>
<div class="msgMain">
<div class="content">
<div class="word text-center">
<div class="mt15 font-22 color-999">请输入您的地址,我们会第一时间为您发出!</div>
<div class="mt30 relative bg-f6 ulib-r10">
<input id="region" class="wp100 inner30 font-28 bg-f6 border-none ulib-r10" type="text" readonly="" v-model="region" placeholder="选择省/市/区" />
<input id="regionvalue" type="hidden" v-model="regionvalue"/>
</div>
<div class="mt30 relative bg-f6 ulib-r10">
<input class="wp100 inner30 font-28 bg-f6 border-none ulib-r10" type="text" v-model="address" placeholder="请输入详细地址" />
</div>
</div>
<div class="mt30">
<a class="block pt25 pb25 bg-1a1a1a text-center font-32 color-fff ulib-r10" @click="postAddress()">确认</a>
</div>
<div class="mt30 text-center">
<a class="font-24 text-underline" @click="isShowAdd=!isShowAdd">不了,看完直播再说></a>
</div>
</div>
</div>
</div>
</div>
<script>
let hostUrl = ''
var app = new Vue({
el: '#app',
data: {
// info:{
// 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小时即可满电,轻松覆盖日常用车需求。',
// 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)?>,
region:'<?=$info['order']['region']?>',
regionvalue:'',
address:'<?=$info['order']['detail']?>',
show_address:'<?=$info['order']['region'].' '.$info['order']['detail']?>',
isShowAdd: false,
isSubmiting: false,
},
created(){
},
computed: {
},
mounted() {
let that = this
let swiper = new Swiper('.goods-banner .swiper-container', {
//loop: true,
//autoHeight: true,
pagination: {
el: '.swiper-pagination',
type: 'fraction',
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
on: {
slideChangeTransitionEnd: function(){
that.activeIndex = this.activeIndex
},
},
});
},
beforeDestroy() {
},
methods: {
showAdd: function() {
this.isShowAdd = true
let that = this;
//选择省市初始化
setTimeout(function () {
let area = new LArea();
area.init({
'trigger': '#region', //触发选择控件的文本框,同时选择完毕后name属性输出到该位置
'valueTo': '#regionvalue', //选择完毕后id属性输出到该位置
'keys': {
id: 'value',
name: 'text'
}, //绑定数据源相关字段 id对应valueTo的value属性输出 name对应trigger的value属性输出
'type': 2,
'data': [provs_data, citys_data, dists_data]
});
if(that.region !=''){
for(var i in provs_data){
if(provs_data[i].text==that.region.split(",")[0]){
var x=i;
var city=citys_data[provs_data[i].value];
for(var j in city){
if(city[j].text==that.region.split(",")[1]){
var y=j;
var district=dists_data[city[j].value];
for(var k in district){
if(district[k].text==that.region.split(",")[2]){
var z=k;
}
}
}
}
}
}
area.value=[x,y,z];//控制初始位置,注意:该方法并不会影响到input的value
}else{
//area.value=[12,1,1];//控制初始位置,注意:该方法并不会影响到input的value
}
area.success = function(){
that.regionvalue = $("#regionvalue").val();
}
}, 200)
},
//提交地址
postAddress() {
if (this.isSubmiting) return;
if (!this.region) {
mDialog.msg({
duration: 250,
pause: 2000,
content: "请选择所在地区"
});
}else if (!this.address) {
mDialog.msg({
duration: 250,
pause: 2000,
content: "请输入详细地址"
});
}else{
this.isSubmiting = true
var params = {
'skey':'<?=$skey?>',
'region':this.region,
'address':this.address,
'id':this.info.order.id
}
var that = this;
$.post('/h5/market/sylive/ucenter/edit_address',params,function (res){
that.isSubmiting = false
if(res.code==200){
mDialog.msg({
duration: 250,
pause: 2000,
content: res.msg,
onClose:function(){
window.location.reload();
}
});
}else{
mDialog.msg({
duration: 250,
pause: 2000,
content: res.msg
});
}
},'json');
//提交数据
// mDialog.msg({
// duration: 250,
// pause: 2000,
// content: "提交成功"
// });
// this.isShowAdd = false
// this.isSubmiting = false
}
},
},
})
</script>
<?=$this->load->view('h5/market/sylive/share_script')?>
</body>
@@ -69,29 +69,6 @@
that.isDataEnd = true;
}
},'json');
//请求接口成功后
// that.loading = false;
// that.page = that.page + 1;
// let res = {}
// res.data = {
// list:[
// {
// sid:'350200021120220830526302',
// img:'https://qs.haodian.cn/web/images/project/H5-ShiYu/upload/linebg.jpg',
// title:'闽浙纳米BOX私享会闽浙纳米BO享会闽浙纳米BOX私X私享会',
// time:'2022.10.20 10:00:25',
// price:'6.9',
// url:'mygift.html',
// }
// ],
// total:20,
// },
// that.list = that.list.concat(res.data.list);
// if (res.data.total == 0) {
// that.isNoData = true;
// } else if (that.list.length == res.data.total) {
// that.isDataEnd = true;
// }
}
},
+104
View File
@@ -0,0 +1,104 @@
<body class="bg-f6">
<div class="height-500 fixed left-0 right-0 top-0 z-index-0 bg-1a1a1a"></div>
<div class="bg-f6" id="app" ref="app">
<div class="container">
<div class="inner30 pt0">
<a class="block mt30 inner30 bg-fff ulib-r20" :href="item.url" v-for="(item,index) in list">
<div class="relative overflowhidden ulib-r10">
<div class="orderTip2 text-center font-24 color-fff bg-ff5a5a" v-if="item.title">{{item.title}}</div>
<img class="imgsize-630X180 ulib-r10" :src="item.img" alt="#">
</div>
<div class="mt15 text-center font-30 color-333">{{item.goods}}</div>
<div class="mt15 text-center font-20 color-bbb">*抽奖礼品需提车后才能享受</div>
</a>
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"><span class="text-middle font-22">暂无数据</span></div>
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span></div>
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd&&list.length>20">我们是有底线的</div>
</mugen-scroll>
</div>
</div>
<? $this->load->view('h5/market/sylive/nav_my') ?>
<script>
let hostUrl = ''
var app = new Vue({
el: '#app',
data: {
loading: false,
isDataEnd: false,
isNoData: false,
page: 1,
size: 20,
list:[],
},
mounted() {
},
methods: {
//拉取数据
fetchData: function() {
this.getOrderList()
},
//获取大区列表
getOrderList(){
let that=this;
if (!that.isNoData && !that.isDataEnd && !that.loading) {
that.loading = true;
//请求接口
var params = {
'skey':'<?=$skey?>',
'page':that.page
}
//请求接口
$.get('/h5/market/sylive/ucenter/ajax_win',params,function (res){
that.loading = false;
that.page = that.page + 1;
that.list = that.list.concat(res.data.lists);
if (res.data.total == 0) {
that.isNoData = true;
} else if (that.list.length == res.data.total) {
that.isDataEnd = true;
}
},'json');
//请求接口成功后
// that.loading = false;
// that.page = that.page + 1;
//
// let res = {}
// res.data = {
// list:[
// {
// id:'111',
// img:'http://simg.mo.xmfish.com/quan/2022_08/179c0eb5f189c356571868bf48e38828.jpg',
// title:'一等奖',
// goods:'小米电动车',
// },
// {
// id:'111',
// img:'https://img.zcool.cn/community/01f3bc63523e7c000e061000ee6483.jpg?x-oss-process=image/auto-orient,1',
// title:'五等奖',
// goods:'电饭煲一个',
// },
//
// ],
// total:20,
// },
//
// that.list = that.list.concat(res.data.list);
// if (res.data.total == 0) {
// that.isNoData = true;
// } else if (that.list.length == res.data.total) {
// that.isDataEnd = true;
// }
}
},
},
})
</script>
</body>
File diff suppressed because one or more lines are too long