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
...@@ -9,3 +9,132 @@ String.prototype.isCode = function() { ...@@ -9,3 +9,132 @@ 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 @click="onTab(idx)" v-for="(opt, idx) in options" :key="idx" :class="idx == tab ? 'tab_item_selected' : 'tab_item_normal'">
<span>{{opt.title}}</span>
</div> </div>
<div class="name">{:getUserName($user['uid'])}</div>
<div class="desc">
<if condition="$user['vip_type'] gt 0">
剩余有效期{$user.exp_date}天
<else />
(非会员)
</if>
{$user.vip_title}
</div> </div>
<div class="btn"> </van-sticky>
<if condition="$user['is_high'] neq 1 || $user['vip_type'] eq 0"> <div class="vip_content layout_v">
<a href="{:U('home/User/recharge')}"> <van-image class="vip_bg" fit="cover" class="vip_bg" :src="currentBg" width="100%" height="100%" ></van-image>
<if condition="$user['vip_type'] gt 0"> <div class="layout_h_b vip_info_top">
续费升级 <div class="layout_h">
<else /> <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>
</if>
</a>
</if>
</div> </div>
<div class="hint_top layout_h">
<van-icon class="self_center" size="12" :name="currentHint" ></van-icon>
<div :class="currentColor" class="text_12_400 self_center" style="margin-left: 0.125rem;">{{currentState}}</div>
</div> </div>
<else />
<!-- 未登录状态 -->
<div class="login-status">
<div class="pic">
<img class="lazyload" data-original="__THEME__/images/noavatar/big.jpg" alt="">
</div> </div>
<div class="desc">开通会员专享免费课程</div> <div class="layout_h_b vip_info_bottom">
<div class="btn"> <div class="text_16_400 self_center" :class="currentColor">{{currentCount}} 人已开通</div>
<a href="{:U('basic/Passport/login')}">立即登录</a> <div @click="onToBuy" class="vip_price_hint layout_center">
<span class="text_16_400" :class="currentColor">{{currentPrice}}</span>
</div> </div>
</div> </div>
</if>
</div> </div>
<div class="vip_right_content layout_v">
<!-- 会员类型 --> <span class="text_16_600 color_333333" style="margin-bottom: 1rem;">会试会员专享特权</span>
<div class="member-type border-line"> <div v-for="(item, index) in currentRight" :key="index" class="text_12_400 color_333333 layout_h">
<volist name="vipInfo" id="vip" offset="0"> <div class="vip_dot self_center"></div>
<div class="types-item"> <span>{{item.video_title}}</span>
<div class="pic">
<img class="lazyload" data-original="{:getAttachUrlByAttachId($vip['cover'])}" alt="">
</div>
<div class="level">{$vip.title}</div>
<div class="price">¥{$vip.vip_month}/月</div>
<div class="price">¥{$vip.vip_year}/年</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 class="priv-con">
<volist name="vipInfo" id="vip">
<if condition="$vip['vip_course'] eq null">
<div class="priv-list">
<div class="no-data">
暂时没有课程数据
</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>
</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>
<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);
......
...@@ -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