Commit be7343e9 by 冷斌

Merge remote-tracking branch 'origin/master'

parents e08ea1ce a18bc379
...@@ -415,6 +415,23 @@ div::-webkit-scrollbar { ...@@ -415,6 +415,23 @@ div::-webkit-scrollbar {
color:rgba(101,192,0,1); color:rgba(101,192,0,1);
} }
.selected_condition_container {
padding-top: 0.5rem;
padding-left: 0.75rem;
padding-right: 0.25rem;
}
.selected_condition {
box-sizing: border-box;
min-width: 5rem;
padding: 0.4375rem 1.1875rem;
height: 2rem;
background:rgba(251,255,247,1);
border-radius: 1rem;
margin-right: 0.5rem;
margin-bottom: 0.5rem;
}
.popup_top_button { .popup_top_button {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
...@@ -701,3 +718,76 @@ div::-webkit-scrollbar { ...@@ -701,3 +718,76 @@ div::-webkit-scrollbar {
padding: 0 !important; padding: 0 !important;
margin: 0.75rem; margin: 0.75rem;
} }
/* VIP */
.color_xiangshi {
color: #65C000;
}
.color_huishi {
color: #3364BB;
}
.color_dianshi {
color: #E58F00;
}
.vip_content {
box-sizing: border-box;
height: 6.25rem;
margin: 1rem;
position: relative;
justify-content: space-between;
}
.vip_bg {
position: absolute !important;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
.vip_info_top {
margin-top: 0.75rem;
margin-left: 1rem;
margin-right: 1rem;
align-items: flex-start;
}
.vip_info_bottom {
margin-left: 1rem;
margin-bottom: 0.75rem;
margin-right: 1rem;
}
.hint_top {
}
.vip_price_hint {
width: 6.25rem;
height: 2rem;
background:rgba(255,255,255,1);
border-radius: 1rem;
}
.vip_right_content {
margin-top: 1.5rem;
padding-left: 0.625rem;
padding-right: 0.625rem;
}
.vip_dot {
width:0.25rem;
height:0.25rem;
border-radius: 0.125rem;
overflow: hidden;
background:rgba(163,228,96,1);
margin-right: 0.5rem;
}
.vip_buy_top_state {
padding: 0.375rem 0.75rem;
}
\ No newline at end of file
...@@ -8,4 +8,133 @@ String.prototype.isCode = function() { ...@@ -8,4 +8,133 @@ String.prototype.isCode = function() {
String.prototype.isPwd = function() { String.prototype.isPwd = function() {
return this.length >= 6 && this.length <= 18 return this.length >= 6 && this.length <= 18
}
Array.prototype.hx_concat = function(mark) {
return this.reduce((v, e) => {
if (e == undefined || e.toString().length == 0) {
return v
}
return v.length == 0 ? e.toString() : (v + mark + e.toString())
},
'')
}
Array.prototype.hx_forEach = function(call) {
for (var i = 0; i < this.length; i++) {
call(this[i])
}
}
Array.prototype.hx_forEachIndex = function(call) {
for (var i = 0; i < this.length; i++) {
call(this[i], i)
}
}
Array.prototype.hx_map = function(map) {
var newArray = []
this.hx_forEach(function(e) {
newArray.push(map(e))
})
return newArray
}
Array.prototype.hx_mapIndex = function(map) {
var newArray = []
for (var i = 0; i < this.length; i++) {
newArray.push(map(this[i], i))
}
return newArray
}
Array.prototype.hx_filterMap = function(map, filter) {
var newArray = []
this.hx_forEach(function(e) {
if (filter(e)) {
newArray.push(map(e))
}
})
return newArray
}
Array.prototype.hx_pushIf = function(value, checker) {
if (checker !== undefined && checker(value)) {
this.push(value)
}
return this
}
Array.prototype.hx_convertPushIf = function(converter, checker, value) {
if(converter && checker && checker(value)) {
this.push(converter(value))
}
return this
}
Array.prototype.hx_firstOf = function(checker) {
if (checker !== undefined) {
for (var i = 0; i < this.length; i++) {
var e = this[i]
if (checker(e)) {
return e
}
}
}
return undefined
}
Array.prototype.hx_firstOfKey = function(v, k) {
return this.hx_firstOf(r => {
return r[k] == v
})
}
Array.prototype.hx_indexOf = function(checker) {
if (checker !== undefined) {
for (var i = 0; i < this.length; i++) {
var e = this[i]
if (checker(e)) {
return i
}
}
}
return -1
}
Array.prototype.hx_indexOfKey = function(v, k) {
return this.hx_indexOf(r => {
return r[k] == v
})
}
Array.prototype.hx_filter = function(filter) {
if (filter !== undefined) {
var newArray = []
this.hx_forEach(function(e) {
if (filter(e)) {
newArray.push(e)
}
})
return newArray
}
return this
}
Array.prototype.hx_swap = function(r, l, handler) {
var length = this.length
if (r >= 0 && l >= 0 && r < length && l < length) {
var p = this[r]
var q = this[l]
if (handler !== undefined) {
handler(p, q)
}
this[r] = this.splice(l, 1, this[r])[0]
console.log(this[r])
console.log(this)
}
}
Array.prototype.hx_lastIndex = function() {
return this.length > 0 ? this.length - 1 : 0
} }
\ No newline at end of file
<include file="__THEME__/public_header_w3g" /> <include file="__THEME__/public_header_w3g" />
<script src="__THEMEW3G__/js/flexible.js"></script> <style>
<link rel="stylesheet" type="text/css" href="__APP__/css/vip_3g.css"> body {
<div class="page"> padding-bottom: 0 !important;
<div class="status border-line"> }
<if condition="$_SESSION['mid']"> </style>
<!-- 登录状态 --> <div id="app">
<div class="login-status"> <div class="layout_v">
<div class="pic"> <van-sticky>
<img class="lazyload" data-original="{:getUserFace($user['uid'],b)}" alt=""> <div class="tabs_container">
</div> <div @click="onTab(idx)" v-for="(opt, idx) in options" :key="idx" :class="idx == tab ? 'tab_item_selected' : 'tab_item_normal'">
<div class="name">{:getUserName($user['uid'])}</div> <span>{{opt.title}}</span>
<div class="desc">
<if condition="$user['vip_type'] gt 0">
剩余有效期{$user.exp_date}天
<else />
(非会员)
</if>
{$user.vip_title}
</div>
<div class="btn">
<if condition="$user['is_high'] neq 1 || $user['vip_type'] eq 0">
<a href="{:U('home/User/recharge')}">
<if condition="$user['vip_type'] gt 0">
续费升级
<else />
开通会员
</if>
</a>
</if>
</div> </div>
</div> </div>
<else /> </van-sticky>
<!-- 未登录状态 --> <div class="vip_content layout_v">
<div class="login-status"> <van-image class="vip_bg" fit="cover" class="vip_bg" :src="currentBg" width="100%" height="100%" ></van-image>
<div class="pic"> <div class="layout_h_b vip_info_top">
<img class="lazyload" data-original="__THEME__/images/noavatar/big.jpg" alt=""> <div class="layout_h">
<van-image src="{:getUserFace($user['uid'],b)}" round width="32" height="32" ></van-image>
<div class="text_16_600 color_333333 self_center" style="margin-left: 0.5rem;">{:getUserName($user['uid'])}</div>
</div> </div>
<div class="desc">开通会员专享免费课程</div> <div class="hint_top layout_h">
<div class="btn"> <van-icon class="self_center" size="12" :name="currentHint" ></van-icon>
<a href="{:U('basic/Passport/login')}">立即登录</a> <div :class="currentColor" class="text_12_400 self_center" style="margin-left: 0.125rem;">{{currentState}}</div>
</div> </div>
</div> </div>
</if> <div class="layout_h_b vip_info_bottom">
</div> <div class="text_16_400 self_center" :class="currentColor">{{currentCount}} 人已开通</div>
<div @click="onToBuy" class="vip_price_hint layout_center">
<!-- 会员类型 --> <span class="text_16_400" :class="currentColor">{{currentPrice}}</span>
<div class="member-type border-line">
<volist name="vipInfo" id="vip" offset="0">
<div class="types-item">
<div class="pic">
<img class="lazyload" data-original="{:getAttachUrlByAttachId($vip['cover'])}" alt="">
</div> </div>
<div class="level">{$vip.title}</div>
<div class="price">¥{$vip.vip_month}/月</div>
<div class="price">¥{$vip.vip_year}/年</div>
</div> </div>
</volist>
</div>
<!-- 会员特权 -->
<div class="member-priv border-line">
<div class="member-title">会员特权</div>
<div class="priv-tabs">
<volist name="vipInfo" id="vip">
<div class="item <eq name='key' value='0'> active </eq>">{$vip.title}</div>
</volist>
</div> </div>
<div class="priv-con"> <div class="vip_right_content layout_v">
<volist name="vipInfo" id="vip"> <span class="text_16_600 color_333333" style="margin-bottom: 1rem;">会试会员专享特权</span>
<if condition="$vip['vip_course'] eq null"> <div v-for="(item, index) in currentRight" :key="index" class="text_12_400 color_333333 layout_h">
<div class="priv-list"> <div class="vip_dot self_center"></div>
<div class="no-data"> <span>{{item.video_title}}</span>
暂时没有课程数据 </div>
</div>
</div>
<else />
<div class="priv-list <eq name='key' value='0'> active </eq>">
<volist name="vip.vip_course" id="vce" offset="0" length="8">
<div class="item">
<a <if condition="$vce['type'] eq 1">href="{:U('course/Video/view',array('id'=>$vce['id']))}"<else/>href="{:U('live/Index/view',array('id'=>$vce['id']))}"</if> class="pic">
<img class="lazyload" src="{:getCover($vce['cover'],275,160)}" alt="">
</a>
<a <if condition="$vce['type'] eq 1">href="{:U('course/Video/view',array('id'=>$vce['id']))}"<else/>href="{:U('live/Index/view',array('id'=>$vce['id']))}"</if> class="name">{:t($vce['video_title'])}</a>
<div class="grid">
<span class="line"><php>if($marketConf['order_switch'] == 1) {</php>{$vce['video_order_count_mark']}<php>}else{</php>{$vce['video_order_count']}<php>}</php>人在学习</span>
<if condition="$vce['price'] eq 0">
<span class="free">免费</span>
<else/>
<span class="price">¥{$vce['price']}</span>
</if>
</div>
</div>
</volist>
<if condition="count($vip['vip_course']) eq 8">
<a href="javascript:;" class="priv-more" data-id="{$vip.id}">查看更多</a>
</if>
</div>
</if>
</volist>
</div>
</div>
<!-- 最新会员 -->
<div class="member-latest">
<div class="member-title">最新会员</div>
<div class="latest-grid">
<volist name="new_vip" id="nv">
<a href="{:U('home/UserShow/index',array('uid'=>$nv['uid']))}" class="latest-item">
<div class="pic">
<img class="lazyload" data-original="{:getUserFace($nv['uid'],b)}" alt="">
</div>
<div class="name">{:getUsername($nv['uid'])}</div>
</a>
</volist>
</div> </div>
</div> </div>
</div> </div>
<script> <script>
// 会员特权切换 new Vue({
$(".member-priv .priv-tabs .item").click(function() { el: '#app',
var index = $(this).index(); data: function() {
$(this).addClass("active").siblings().removeClass("active"); return {
$(".member-priv .priv-con .priv-list").eq(index).addClass("active").siblings().removeClass("active"); tab: 0,
}); userInfo: {},
//查看更多 vipInfo: {},
$(".priv-more").click(function(){ options: [{
var id = $(this).data('id'); title: '乡试',
window.location.href = "{:U('course/Video/index')}"+'?vtype=1'+'&vip_id='+id; color: "color_xiangshi",
}); price: "",
count: "",
state: "",
rights: [],
bg: "g-bg@3x.png",
hint: "g@3x.png"
},{
title: '会试',
color: "color_huishi",
price: "",
count: "",
state: "",
rights: [],
bg: "b-bg@3x.png",
hint: "b@3x.png"
},{
title: '殿试',
color: "color_dianshi",
price: "",
count: "",
state: "",
rights: [],
bg: "y-bg@3x.png",
hint: "y@3x.png"
}]
}
},
created:function(){
document.title = "会员信息"
this.vipInfo = {:json_encode($vipInfo)};
this.userInfo = {:json_encode($user)};
this.vipInfo.forEach( r => {
let opt = undefined
if(r.title == "乡试") {
opt = this.options[0]
} else if(r.title == "会试") {
opt = this.options[1]
} else if(r.title == "殿试") {
opt = this.options[2]
}
if(opt) {
opt.price = r.vip_month + "元/月"
opt.rights = r.vip_course
opt.id = r.id
}
})
},
computed: {
currentBg: function() {
let opt = this.options[this.tab]
return "__THEME__/img/" + opt.bg
},
currentHint: function() {
let opt = this.options[this.tab]
return "__THEME__/img/" + opt.hint
},
currentColor: function() {
let opt = this.options[this.tab]
return opt.color
},
currentState: function() {
let opt = this.options[this.tab]
return opt.title == this.userInfo.vip_title ? "已开通" : "暂未开通"
},
currentPrice: function() {
return this.options[this.tab].price
},
currentCount: function() {
return this.options[this.tab].count
},
currentRight: function() {
return this.options[this.tab].rights
}
},
methods: {
onTab: function(idx) {
this.tab = idx
},
onToBuy: function() {
window.location.href = "{:U('home/User/recharge')}"
}
}
})
</script> </script>
<include file="__THEME__/public_footer_w3g" /> <include file="__THEME__/public_footer_w3g" />
...@@ -276,6 +276,10 @@ class VideoAction extends CommonAction ...@@ -276,6 +276,10 @@ class VideoAction extends CommonAction
//如果是ajax并且为h5访问 直接输出后边的数据 //如果是ajax并且为h5访问 直接输出后边的数据
if ($this->isAjax() && $this->is_wap) { if ($this->isAjax() && $this->is_wap) {
if ($_GET['api']) {
echo json_encode($data);
exit();
}
$html = $this->fetch('index_w3g_ajax'); $html = $this->fetch('index_w3g_ajax');
$data['data'] = $html; $data['data'] = $html;
echo json_encode($data); echo json_encode($data);
......
<include file="__THEME__/public_header_w3g" /> <include file="__THEME__/public_header_w3g" />
<!-- <link rel="stylesheet" href="__APP__/css/course_3g.css">
<style>
.icon-01{background-image:url(__THEME__/icon/icon.png);width:8px;height:12px;background-position:-220px -219px}
.icon-02{margin-left:5px;background-image:url(__THEME__/icon/icon.png);width:12px;height:7px;background-position:-469px -172px}
.classlist .huodong{width:70px;height:20px;background:#FF541F;display:inline-block;position:absolute;right:4px;bottom:0;text-align:center;color:#fff;line-height:20px;border-radius: 4px;z-index:2;}
.classlist .huodong i{font-size:14px;margin-right:2px;}
.jiujiunone-class-id.active {
color: #00BED4 !important;
}
</style> -->
<style> <style>
body { body {
...@@ -40,9 +29,9 @@ ...@@ -40,9 +29,9 @@
<div class="layout_v" style="width: 100vw"> <div class="layout_v" style="width: 100vw">
<span class="all_category_title text_16_600 color_333333">分类</span> <span class="all_category_title text_16_600 color_333333">分类</span>
<div class="drop_down_grid"> <div class="drop_down_grid">
<div @click="onCategory('')" class="van-ellipsis" :class="selectedCategory('') ? 'drop_down_option_selected' : 'drop_down_option'">全部</div> <div @click="onCategory('', '')" class="van-ellipsis" :class="selectedCategory('') ? 'drop_down_option_selected' : 'drop_down_option'">全部</div>
<volist name="selCate" id="top"> <volist name="selCate" id="top">
<div @click="onCategory('{$top['id']}')" class="van-ellipsis" :class="selectedCategory('{$top['id']}') ? 'drop_down_option_selected' : 'drop_down_option'">{$top.title}</div> <div @click="onCategory('{$top['id']}', '{$top.title}')" class="van-ellipsis" :class="selectedCategory('{$top['id']}') ? 'drop_down_option_selected' : 'drop_down_option'">{$top.title}</div>
</volist> </volist>
</div> </div>
<span class="all_category_title text_16_600 color_333333">讲师</span> <span class="all_category_title text_16_600 color_333333">讲师</span>
...@@ -51,9 +40,9 @@ ...@@ -51,9 +40,9 @@
</div> </div>
<span class="all_category_title text_16_600 color_333333">状态</span> <span class="all_category_title text_16_600 color_333333">状态</span>
<div class="drop_down_grid"> <div class="drop_down_grid">
<div @click="onBuy('')" class="van-ellipsis" :class="selectedBuy('') ? 'drop_down_option_selected' : 'drop_down_option'">全部</div> <div @click="onBuy('', '')" class="van-ellipsis" :class="selectedBuy('') ? 'drop_down_option_selected' : 'drop_down_option'">全部</div>
<div @click="onBuy('1')" class="van-ellipsis" :class="selectedBuy('1') ? 'drop_down_option_selected' : 'drop_down_option'">已购买</div> <div @click="onBuy('1', '已购买')" class="van-ellipsis" :class="selectedBuy('1') ? 'drop_down_option_selected' : 'drop_down_option'">已购买</div>
<div @click="onBuy('2')" class="van-ellipsis" :class="selectedBuy('2') ? 'drop_down_option_selected' : 'drop_down_option'">未购买</div> <div @click="onBuy('2', '未购买')" class="van-ellipsis" :class="selectedBuy('2') ? 'drop_down_option_selected' : 'drop_down_option'">未购买</div>
</div> </div>
<span class="all_category_title text_16_600 color_333333">价格区间</span> <span class="all_category_title text_16_600 color_333333">价格区间</span>
<div all-range-input class="layout_h"> <div all-range-input class="layout_h">
...@@ -62,199 +51,44 @@ ...@@ -62,199 +51,44 @@
<van-field class="all_range_input" v-model="maxPrice" type="number" input-align="center" placeholder="最高价" ></van-field> <van-field class="all_range_input" v-model="maxPrice" type="number" input-align="center" placeholder="最高价" ></van-field>
</div> </div>
<div class="two_button_container layout_h" style="margin-top: 2.5rem;"> <div class="two_button_container layout_h" style="margin-top: 2.5rem;">
<div class="two_button_left">重置</div> <div @click="onReset" class="two_button_left">重置</div>
<div class="two_button_right">确认</div> <div @click="onSure" class="two_button_right">确认</div>
</div> </div>
</div> </div>
</van-dropdown-item> </van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</van-sticky> <div class="selected_condition_container layout_h_wrap">
</div> <div v-for="(con, idx) in selected" :key="idx" class="selected_condition text_14_400 color_primary">
</div> <span class="self_center">{{con.title}}</span>
<!--选择价格区间弹框-->
<!-- <div class="jiujiunone-class-bg"></div>
<div class="jiujiunone-class">
<div class="jiujiunone-class-title">分类筛选</div>
<div class="jiujiunone-class-box">
<volist name="selCate" id="top">
<div class="jiujiunone-class-list">
<div class="jiujiunone-class-base jiujiunone-class-id <php>if($_GET['cateId'] == $top['id']){</php>active<php>}</php>" data-url="{:U('course/Video/index',array_merge($default_params,['cateId'=>$top['id']]))}">{$top.title}</div>
<div class="jiujiunone-class-next">
<volist name="top.child" id="child">
<a href="javascript:;" class="jiujiunone-class-item jiujiunone-class-id <php>if($_GET['cateId'] == $child['id']){</php>active<php>}</php>" data-url="{:U('course/Video/index',array_merge($default_params,['cateId'=>$child['id']]))}">{$child.title}</a>
</volist>
</div> </div>
</div> </div>
</volist> </van-sticky>
</div> <van-list
<div class="jiujiunone-class-bottom"> v-model="loading"
<div class="jiujiunone-class-dete">确定</div> :finished="finished"
</div> finished-text="没有更多了"
</div> --> @load="onLoad">
<!-- <div class="selebox"></div> <div v-for="(item, index) in items" :key="index" class="home_class_item layout_v">
<div class="cover"></div> --> <div class="layout_h">
<!-- <div class="min-height-wrap"> <van-image style="margin-right: 0.75rem;" height="72" width="128" fit="cover" src="{:getCover($vo['cover'] ,580 , 320 )}">
<div class="maskbox"></div> </van-image>
<div class="body"> <div class="weight_full layout_v">
<div class="selectdiv"> --> <span class="text_14_600 color_333333 van-multi-ellipsis--l2">{{item.title}}</span>
<span class="text_14_600 color_FF3B3B" style="margin-top: 0.5rem;">
<!-- <div> {{item.price}}
<dl>
<dt>分类:<span class="<php>if(!$_GET['cateId']){</php>on<php>}</php>"><a href="{:U('course/Video/index',array_merge($default_params,['cateId'=>'']))}">不限</a></span></dt>
<volist name="selCate[0]" id="vo">
<dt class="<eq name='vo.zy_currency_category_id' value='$selectedCates[0]'>on</eq>">
<a href="{:U('course/Video/index',array_merge($default_params,['cateId'=>$vo['zy_currency_category_id']]))}">{$vo['title']}</a>
</dt>
</volist>
</dl>
<php>
unset($selCate[0]);
$level = 0;
$cate_params = '';
</php>
<volist name="selCate" id="subCate">
<php>
if(!$subCate){
continue;
}
$cate_params .= ','.$selectedCates[$level];
$level++;
</php>
<dl>
<dt class="<php>if(!$selectedCates[$level]){</php>on<php>}</php>">
<a href="{:U('course/Video/index',array_merge($default_params,['cateId'=>$cate_params]))}">不限</a>
</dt>
<volist name="subCate" id="vo">
<dt class="<eq name='vo.zy_currency_category_id' value='$selectedCates[$level]'>on</eq>">
<a href="{:U('course/Video/index',array_merge($default_params,['cateId'=>$cate_params.','.$vo['zy_currency_category_id']]))}">{$vo['title']}</a>
</dt>
</volist>
</dl>
</volist>
</div> -->
<!-- <php>if($vip_levels){</php>
<div>
<dl>
<dt>会员:<span class="<php>if(!$_GET['vip_id']){</php>on<php>}</php>"><a href="{:U('course/Video/index',array_merge($default_params,['vip_id'=>'']))}">不限</a></span>
</dt>
<volist name="vip_levels" id="vo">
<dt <if condition="$_GET['vip_id'] eq $key">class="on"</if>>
<a href="{:U('course/Video/index',array_merge($default_params,['vip_id'=>$key]))}">{$vo}<span class="icon-ck"></span></a>
</dt>
</volist>
</dl>
</div>
<php>}</php> -->
<!-- <div>
<dl class="margin-left">
<dt>类型:</dt>
<dt <eq name="vtype" value="2">class="on"</eq>><a href="{:U('course/Video/index',array_merge($default_params,['vtype'=>2]))}">直播</a></dt>
<dt <eq name="vtype" value="1">class="on"</eq>><a href="{:U('course/Video/index',array_merge($default_params,['vtype'=>1]))}">点播</a></dt>
<dt <eq name="vtype" value="6">class="on"</eq>><a href="{:U('course/Video/index',array_merge($default_params,['vtype'=>6]))}">班级</a></dt>
</dl>
</div>
<div>
<dl class="margin-left">
<dt>排序:</dt>
<dt <eq name="orderBy" value="new">class="on"</eq>><a href="{:U('course/Video/index',array_merge($default_params,['orderBy'=>'new']))}">最新</a></dt>
<dt <eq name="orderBy" value="scoredesc">class="on"</eq>><a href="{:U('course/Video/index',array_merge($default_params,['orderBy'=>'scoredesc']))}">评分</a>
</dt>
<php>if($orderBy == 't_price'){</php>
<dt <eq name="orderBy" value="t_price">class="on"</eq>><a href="{:U('course/Video/index',array_merge($default_params,['orderBy'=>'t_price_down']))}">价格
<i class="icon-01"></i></a></dt>
<php>}else{</php>
<dt <eq name="orderBy" value="t_price_down">class="on"</eq>><a href="{:U('course/Video/index',array_merge($default_params,['orderBy'=>'t_price']))}">价格
<i class="icon-01"></i></a></dt>
<php>}</php>
<dt class="max_wid_padding">价格区间 <i class="icon-02"></i></dt>
</dl>
</div>
<div class="max_wid_pad_box" style="border: 0;" name="group-list">
<a href="{:U('course/Video/index',array_merge($default_params,['lower'=>'']))}" <eq name="lower" value="1">class="on"</eq>>不限</a>
<a href="{:U('course/Video/index',array_merge($default_params,['lower'=>'0,99']))}" <eq name="Think.get.lower"
value="0,99">class="on"</eq>>¥99以下<span class="icon-ck"></span></a>
<a href="{:U('course/Video/index',array_merge($default_params,['lower'=>'100,499']))}" <eq name="Think.get.lower"
value="100,499">class="on"</eq>>¥100-499<span class="icon-ck"></span></a>
<a href="{:U('course/Video/index',array_merge($default_params,['lower'=>'500,1000']))}" <eq name="Think.get.lower"
value="500,1000">class="on"</eq>>¥500,1000<span class="icon-ck"></span></a>
<a href="{:U('course/Video/index',array_merge($default_params,['lower'=>'1000,']))}" <eq name="Think.get.lower"
value="1000,">class="on"</eq>">¥1000以上<span class="icon-ck"></span></a>
</div>
<div class="setmonry max_wid_pad_box" style="display: none;">
<label for="">自定义价格:</label> <input name="lower" placeholder="最低价" type="text"> - <input name="toper" placeholder="最高价"
type="text">
</div>
<div class="jiujiunone">
<php>if($default_params){</php>
<div style="line-height: 32px"><a class="fl screen prevValue" href="{:U('course/Video/index')}">清空条件</a></div>
<php>}</php>
<span class="jiujiunone_span posabs_span">课程分类</span>
<div class="clickoffon" onclick="clickoffon(this)">筛选</div>
</div>
</div> -->
<!-- <php>if($cateId){</php>
<div class="searchdiv">在“<span>{:mStr(t($title),10)}</span>”分类下,找到{$list_data.count}门课程</div>
<php>}</php>
<ul class="classlist clearfix" style="float:left;width:100%">
<php>if($list_data['data']){</php>
<volist name="list_data['data']" id="vo">
<li>
<a href="{$vo['view_url']}">
<strong>
<if condition="$vo['event_type_info']">
<span class="huodong">{$vo['event_type_info']['text']}</span>
</if>
<img class="lazyload" data-original="{:getCover($vo['cover'],580 , 320)}" alt="">
<php>if($vo['type'] == 1 && $vo['is_buy_video']){</php>
<span class="hasbuy">已购买</span>
<php>}</php>
<php>if($vo['type'] == 2 && $vo['is_buy_live']){</php>
<span class="hasbuy">已购买</span>
<php>}</php>
</strong>
<span>
<h4>
{$vo['video_title']}
</h4>
<div class="clearfix">
<em>
<php>if($vo['mz_price']['price'] == 0) {</php>
<i style="color: #39b75d;">免费</i>
<php>} else {</php>
<i style="color: #ff4000;">¥{$vo['mz_price']['price']}</i>
<php>}</php>
</em>
<em>
<php>if($marketConf['order_switch'] == 1) {</php>{$vo['video_order_count_mark']}<php>}else{</php>{$vo['video_order_count']}<php>}</php>人在学
</em>
</div>
</span> </span>
</a> <span class="text_12_400 color_999999">
</li> {{item.count}}人正在学习
</volist> </span>
<php>}else{</php> </div>
<include file="__THEME__/no_data_w3g" /> </div>
<php>}</php> <div class="home_divider divider"></div>
</ul> </div>
</div>
</van-list>
<php>if($list_data['data']){</php>
<div class="loadding">
<if condition="$list_data['nowPage'] eq $list_data['totalPages']">
<div>再拉也没有了</div>
<else />正在加载更多。。
</if>
</div> </div>
<a class="backtop"></a> </div>
<php>}</php>
</div>-->
<script> <script>
...@@ -262,230 +96,128 @@ ...@@ -262,230 +96,128 @@
el: '#app', el: '#app',
data: function() { data: function() {
return { return {
cate: "", cate: "{$_GET['cateId']}",
buy: "", buy: "",
minPrice: "", minPrice: "",
maxPrice: "" maxPrice: "",
loading: false,
finished: false,
conditions: [],
selected: [],
page: 0,
items: []
} }
}, },
computed: { computed: {
selectedCategory: function() { selectedCategory: function() {
let cate = this.cate let cate = this.cate
return function(c) { return function(c) {
return c == cate return c == cate
} }
}, },
selectedBuy: function() { selectedBuy: function() {
let buy = this.buy let buy = this.buy
return function(c) { return function(c) {
return c == buy return c == buy
} }
} },
}, },
created: function(){ created: function(){
document.title = "全部真题" document.title = "全部课程"
this.onInit()
}, },
methods: { methods: {
onCategory: function(id) { onInit: function() {
let p = {:json_encode($selCate)};
if(p[this.cate]) {
this.onCondition(this.cate, p[this.cate].title, 'category')
this.selected = this.conditions
}
},
//Helper
onCondition: function(id, title, key) {
let idx = this.conditions.hx_indexOf( r => { return r.type == key })
if(idx != -1) {
this.conditions.splice(idx, 1)
}
if(id.length != 0) {
let condition = {
type: key,
id: id,
title: title
}
let idx = this.conditions.hx_indexOf( r => { return r.id == id })
if(idx == -1) {
this.conditions.push(condition)
}
}
},
onCategory: function(id, title) {
this.onCondition(id, title, 'category')
this.cate = id this.cate = id
}, },
onBuy: function(type) { onBuy: function(type, title) {
this.onCondition(type, title, 'buy')
this.buy = type this.buy = type
}, },
} onSure: function() {
}) this.$refs.filter.toggle()
this.selected = this.conditions
function clickoffon(a) { this.loading = true
var _this = $(a) this.page = 0
if (_this.html() == "收起") { this.onLoad()
_this.html("筛选"); },
$(".prevValue").css("display", "none")
$(".clickoffon").css("background", "none"); onReset: function() {
$(".clickoffon").css("color", "#979797"); this.$refs.filter.toggle();
$(".clickoffon").css("marginRight", "0"); this.onCategory('', '')
$(".clickoffon").css("padding", "0 0"); this.onBuy('', '')
$(".jiujiunone_span").css("display", "inline"); this.loading = true
$(".selectdiv>div").css("display", "none"); this.page = 0
$(".jiujiunone").css("display", "block"); this.onLoad()
$(".selebox").hide() },
$("body").css("overflow-y", "auto") onLoad: function() {
let that = this
} else { let on = "{$marketConf['order_switch']}" == 1
_this.html("收起"); $.ajax({
$(".prevValue").css("display", "block"); type: "GET",
$(".clickoffon").css("backgroundColor", "#00BED4"); url: "{:U('course/Video/index')}",
$(".clickoffon").css("color", "white"); data: "api=1&p=" + (this.page + 1) +
$(".clickoffon").css("marginRight", "0"); "&orderBy=&cateId=" + this.cate + "&vtype=1&charge=&videofile=&eaxm_id=&lower=" + this.minPrice + "&mhm_id=&best={$_GET['best']}&vip_id=",
$(".clickoffon").css("padding", "0 10px"); dataType: "json",
$(".jiujiunone_span").css("display", "none"); success: function(data) {
$(".selectdiv>div").css("display", "block"); that.loading =false
$(".max_wid_pad_box").hide() let res = data
$(".selebox").show() let old = []
$("body").css("overflow-y", "hidden") if(that.page != 0) {
$(".jiujiunone").css("display", "block"); old = that.items
}
} let array = res.data.length > 0 ? res.data : []
} that.items = old.concat(array.map( r => {
$(function() { let pi = r.mz_price
setsearchUrl = window.location.search; return {
id: r.id,
function removeByValue(arr, val) { title: r.video_title,
for (var i = 0; i < arr.length; i++) { price: pi.price == 0 ? '免费' : ('¥' + pi.price),
if (arr[i] == val) { count: on ? r.video_order_count_mark : r.video_order_count
arr.splice(i, 1); }
break; }))
} that.page = res.nowPage
} that.finished = res.nowPage >= res.totalPages
}
$(".hd").click(function() {
if ($(".maskbox").css("display") == "none") {
$(".maskbox").css({
"display": "block"
});
} else {
$(".maskbox").css({
"display": "none"
});
}
});
var p = 1;
$(window).scroll(function() {
var scrollTop = $(this).scrollTop();
var scrollHeight = $(document).height();
var windowHeight = $(this).height();
if (scrollHeight - (scrollTop + windowHeight) < 60) {
if (!p || p >= parseInt("{$list_data['totalPages']}")) {
$('.loadding').html('<div>再拉也没有了</div>');
return false;
} else {
p = p + 1;
ajaxBang();
}
}
});
//请求事件
/*if ($("body").height() < $(window).height()) {
ajaxBang()
}*/
function ajaxBang() {
$.ajax({
type: "GET",
url: "{:U('course/Video/index')}",
data: "p=" + p +
"&orderBy={$_GET['orderBy']}&cateId={$_GET['cateId']}&vtype={$_GET['vtype']}&charge={$_GET['charge']}&videofile={$_GET['videofile']}&eaxm_id={$_GET['eaxm_id']}&lower={$_GET['lower']}&mhm_id={$_GET['mhm_id']}&best={$_GET['best']}&vip_id={$_GET['vip_id']}",
dataType: "json",
success: function(data) {
$(".classlist").append(data.data)
if (!p || p >= data.totalPages) {
$('.loadding').html('<div>再拉也没有了</div>')
return false;
} else {
p = data.nowPage + 1; //下一页
} }
} })
}); }
}
});
function replaceParamVal(paramName, replaceWith) {
var oUrl = this.location.href.toString();
var re = eval('/(' + paramName + '=)([^&]*)/gi');
var nUrl = oUrl.replace(re, paramName + '=' + replaceWith);
this.location = nUrl;
window.location.href = nUrl
}
$("input[name='toper'],input[name='lower'").blur(function() {
if ($("input[name='toper']").val() == "" || $("input[name='lower']").val() == "") {
return;
}
var up = $("input[name='lower']").val();
var down = $("input[name='toper']").val();
if (up.match(/^\d+$/) && down.match(/^\d+$/)) {
value = up + ',' + down;
} else {
ui.error("请输入数字");
return false;
}
if (window.location.href.indexOf("lower") == -1) {
window.location.href = window.location.href + "?lower=" + up + "," + down;
} else {
replaceParamVal("lower", up + "," + down)
}
});
if ($(".clickoffon").html() == "收起") {
} else {
$(".prevValue").css("display", "none")
}
</script>
<script type="text/javascript">
$(document).ready(function() {
$(".nav_list ul li:eq(1)").addClass("on");
});
$(".max_wid_padding").on("click", function() {
if ($(".max_wid_pad_box").css("display") == "none") {
$(".max_wid_pad_box").css("display", "flex")
} else {
$(".max_wid_pad_box").css("display", "none")
} }
}) })
$(".intent .intent-info span").click(function() {
$(".intent .intent-info span").removeClass("active");
$(this).addClass("active");
$(".intent .intent-btn").addClass("active");
});
// 课程分类
$(".jiujiunone .jiujiunone_span").click(function() {
$(this).addClass("active");
$(".jiujiunone-class").show()
$(".jiujiunone-class-bg").show()
});
// 确定
$(".jiujiunone-class .jiujiunone-class-dete").click(function() {
$(".jiujiunone .jiujiunone_span").removeClass("active");
$(".jiujiunone-class").hide()
$(".jiujiunone-class-bg").hide()
let url = $(".jiujiunone-class-id.active").data("url");
if(url){
window.location.href = url;
}else{
window.location.reload();
}
});
// 清空条件
$(".jiujiunone-class .jiujiunone-class-del").click(function() {
$(".jiujiunone .jiujiunone_span").removeClass("active");
$(".jiujiunone-class").hide()
$(".jiujiunone-class-bg").hide()
$(".jiujiunone-class-id").removeClass("active");
});
// 点击背景关闭
$(".jiujiunone-class-bg").click(function(){
$(".jiujiunone .jiujiunone_span").removeClass("active");
$(".jiujiunone-class").hide()
$(".jiujiunone-class-bg").hide()
})
// $(".jiujiunone-class-base").click(function(){
// });
// 选中
$(".jiujiunone-class-id").click(function(e){
e.preventDefault();
$(".jiujiunone-class-id").removeClass("active");
$(this).addClass("active");
})
</script> </script>
<include file="__THEME__/public_footer_w3g" /> <include file="__THEME__/public_footer_w3g" />
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<van-icon name="__THEME__/img/collect.png" size="24"></van-icon> <van-icon name="__THEME__/img/collect.png" size="24"></van-icon>
</template> </template>
</van-cell> </van-cell>
<van-cell @click="onCellTap('{:U('home/User/vipCard')}')" class="center_bottom_cell" title-class="text_14_400 color_333333 center_bottom_cell_text" title="会员信息" is-link > <van-cell @click="onCellTap('{:U('classroom/Vip/index')}')" class="center_bottom_cell" title-class="text_14_400 color_333333 center_bottom_cell_text" title="会员信息" is-link >
<template #icon> <template #icon>
<van-icon name="__THEME__/img/membership.png" size="24"></van-icon> <van-icon name="__THEME__/img/membership.png" size="24"></van-icon>
</template> </template>
...@@ -440,6 +440,10 @@ ...@@ -440,6 +440,10 @@
active: 3 active: 3
} }
}, },
created:function(){
let vipInfo = {:json_encode($vipInfo)};
console.log(vipInfo)
},
mounted:function(){ mounted:function(){
$("#preloader").hide(); $("#preloader").hide();
}, },
......
<include file="__THEME__/public_header_w3g"/> <include file="__THEME__/public_header_w3g"/>
<div id="app">
<div class="layout_v">
<div class="vip_buy_top_state">
<span class="text_12_400 color_999999">当前身份:<?php if($learnc['vip_type']==0):?>非会员<?php else: echo $learnc['vip_type_txt'];endif;?></span>
</div>
<div class="home_list_part" style="margin-top: 0.75rem;">
<div class="home_list_header layout_h">
<div class="home_list_header_v_line"></div>
<span class="text_16_600 color_333333 self_center" style="margin-left: 0.5rem;">选择会员</span>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="__APP__/css/recharge_3g.css"> <link rel="stylesheet" href="__APP__/css/recharge_3g.css">
<div class="body"> <div class="body">
<!-- <div class="header2">
<a href="{:U('home/User/index')}" class="icon-back"></a>
<div>会员充值</div>
</div> -->
<div class="integral"> <div class="integral">
<span>当前身份:</span> <span>当前身份:</span>
<span><?php if($learnc['vip_type']==0):?>非VIP会员<?php else: echo $learnc['vip_type_txt'];endif;?></span> <span><?php if($learnc['vip_type']==0):?>非VIP会员<?php else: echo $learnc['vip_type_txt'];endif;?></span>
......
...@@ -215,9 +215,8 @@ ...@@ -215,9 +215,8 @@
price: r.price price: r.price
}})) }}))
opt.page = res.nowPage opt.page = res.nowPage
opt.finished = res.nowPage == res.totalPages opt.finished = res.nowPage >= res.totalPages
that.finished = res.nowPage == res.totalPages that.finished = res.nowPage >= res.totalPages
console.log(that.finished)
} }
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment