作者 anyv
1 个管道 的构建 通过 耗费 1 秒

2

... ... @@ -388,16 +388,27 @@ class PersonalcenterController extends WeChatBaseController{
$_POST['uid'] = cmf_get_current_user_id();
$_POST['create_time'] = time();
$_POST['state'] = 0;
$data = Db::name('money_expend') -> insert($_POST);
$money_expend = Db::name('money_expend') -> where('uid='.$_POST['uid']." and state=0") -> select();
$money = 0;
foreach ($money_expend as $key => $val){
$money += $val['money'];
$user_balance = Db::name('my_user') -> where('uid',$_POST['uid']) -> find();
$user_money_expend = Db::name('money_expend') -> where("uid=".$_POST['uid']." and state =0") -> select();
$money_expend = $_POST['money'];
foreach ($user_money_expend as $key => $val){
$money_expend += $val['money'];
}
if($data){
return $money;
}else{
$user_balance['balance'] = $user_balance['balance']-$user_balance['balance']*0.006;
if($money_expend > $user_balance['balance'] ){
return false;
}else{
$data = Db::name('money_expend') -> insert($_POST);
$money_expend = Db::name('money_expend') -> where('uid='.$_POST['uid']." and state=0") -> select();
$money = 0;
foreach ($money_expend as $key => $val){
$money += $val['money'];
}
if($data){
return $money;
}else{
return false;
}
}
}
... ...
... ... @@ -17,6 +17,12 @@ class SchoolController extends WeChatBaseController{
*/
public function school(){
$uid = cmf_get_current_user_id();
$school = Db::name('school') -> where("uid",$uid) -> select() -> toArray();
foreach ($school as $key => $val){
$school[$key]['class'] = Db::name('grade_class') -> where('school_id',$val['id']) -> select() -> toArray();
}
$this -> assign('school',$school);
return $this -> fetch();
}
... ... @@ -30,8 +36,23 @@ class SchoolController extends WeChatBaseController{
}
/**
* 编辑学校
*/
public function school_edit(){
return $this -> fetch();
}
/**
* 删除学校
*/
public function school_del(){
return $this -> fetch();
}
... ...
... ... @@ -33,7 +33,7 @@
<div class="log_top_co">
<!-- 顶部 -->
<div class=" order_top log_top_co">
<a href="javascript:history.back(-1)">
<a href="">
<img src="__TMPL__/public/assets/images/left.png" alt="" />
</a>
<p>添加学校</p>
... ... @@ -108,14 +108,15 @@
<div class="log_four_contants_left">
<img class="log_Img9" src="__TMPL__/public/assets/images/73.png" alt="" />
</div>
<input type="hidden" value="0" class="grade" id="grade1">
<div class="log_four_contants_right">一年级</div>
</div>
<div class="log_four_contants_input_block" style="display: block">
<div class="log_four_contants_input ">
<div class="log_four_contants_input">
<div class="log_four_ooo">
<div class="log_four_xian_ban">
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" value="" /></div>
<div class="log_four_xian_nei">
<input type="text" data-index='0' placeholder="选择班级" name="" id="" value="" />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
</div>
... ... @@ -125,7 +126,7 @@
<div class="log_four_ooo">
<div class="log_four_xian_ban2">
<div class="log_four_xian_nei">
<input type="text" placeholder=" 选择班级" />
<input type="text" data-index='0' placeholder=" 选择班级" />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
... ... @@ -140,7 +141,6 @@
<div class="log_four_contants_left">
<img class="log_Img9" src="__TMPL__/public/assets/images/39_0.png" alt="" />
</div>
<input type="hidden" value="0" class="grade" id="grade2">
<div class="log_four_contants_right">
二年级
</div>
... ... @@ -149,7 +149,7 @@
<div class="log_four_contants_input ">
<div class="log_four_ooo">
<div class="log_four_xian_ban">
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" value="" /></div>
<div class="log_four_xian_nei"><input data-index='1' type="text" placeholder="选择班级" name="" id="" value="" /></div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
</div>
... ... @@ -159,7 +159,7 @@
<div class="log_four_ooo">
<div class="log_four_xian_ban2">
<div class="log_four_xian_nei">
<input type="text" placeholder=" 选择班级" />
<input type="text" data-index='1' placeholder=" 选择班级" />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
... ... @@ -174,7 +174,6 @@
<div class="log_four_contants_left">
<img class="log_Img9" src="__TMPL__/public/assets/images/39_0.png" alt="" />
</div>
<input type="hidden" value="0" class="grade" id="grade3">
<div class="log_four_contants_right">
三年级
</div>
... ... @@ -183,7 +182,7 @@
<div class="log_four_contants_input ">
<div class="log_four_ooo">
<div class="log_four_xian_ban">
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" value="" /></div>
<div class="log_four_xian_nei"><input data-index='2' type="text" placeholder="选择班级" name="" id="" value="" /></div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
</div>
... ... @@ -193,7 +192,7 @@
<div class="log_four_ooo">
<div class="log_four_xian_ban2">
<div class="log_four_xian_nei">
<input type="text" placeholder=" 选择班级" />
<input type="text" data-index='2' placeholder=" 选择班级" />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
... ... @@ -216,7 +215,7 @@
<div class="log_four_contants_input ">
<div class="log_four_ooo">
<div class="log_four_xian_ban">
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" value="" /></div>
<div class="log_four_xian_nei"><input data-index='3' type="text" placeholder="选择班级" name="" id="" value="" /></div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
</div>
... ... @@ -226,7 +225,7 @@
<div class="log_four_ooo">
<div class="log_four_xian_ban2">
<div class="log_four_xian_nei">
<input type="text" placeholder=" 选择班级" />
<input type="text" data-index='3' placeholder=" 选择班级" />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
... ... @@ -249,7 +248,7 @@
<div class="log_four_contants_input ">
<div class="log_four_ooo">
<div class="log_four_xian_ban">
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" value="" /></div>
<div class="log_four_xian_nei"><input type="text" data-index='4' placeholder="选择班级" name="" id="" value="" /></div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
</div>
... ... @@ -259,7 +258,7 @@
<div class="log_four_ooo">
<div class="log_four_xian_ban2">
<div class="log_four_xian_nei">
<input type="text" placeholder=" 选择班级" />
<input type="text" data-index='4' placeholder=" 选择班级" />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
... ... @@ -282,7 +281,7 @@
<div class="log_four_contants_input ">
<div class="log_four_ooo">
<div class="log_four_xian_ban">
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" value="" /></div>
<div class="log_four_xian_nei"><input type="text" data-index='5' placeholder="选择班级" name="" id="" value="" /></div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
</div>
... ... @@ -292,7 +291,7 @@
<div class="log_four_ooo">
<div class="log_four_xian_ban2">
<div class="log_four_xian_nei">
<input type="text" placeholder=" 选择班级" />
<input type="text" data-index='5' placeholder=" 选择班级" />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
... ... @@ -317,7 +316,7 @@
<div class="log_four_contants_input ">
<div class="log_four_ooo">
<div class="log_four_xian_ban">
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" value="" /></div>
<div class="log_four_xian_nei"><input type="text" data-index='6' placeholder="选择班级" name="" id="" value="" /></div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
</div>
... ... @@ -327,7 +326,7 @@
<div class="log_four_ooo">
<div class="log_four_xian_ban2">
<div class="log_four_xian_nei">
<input type="text" placeholder=" 选择班级" />
<input type="text" data-index='6' placeholder=" 选择班级" />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
... ... @@ -337,7 +336,7 @@
</div>
</div>
</div>
<div class=" log_four_contant_ones" data-id="初二">
<div class=" log_four_contant_ones">
<div class="log_botms">
<div class="log_four_contants_left">
<img class="log_Img9" src="__TMPL__/public/assets/images/39_0.png" alt="" />
... ... @@ -350,7 +349,7 @@
<div class="log_four_contants_input ">
<div class="log_four_ooo">
<div class="log_four_xian_ban">
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" value="" /></div>
<div class="log_four_xian_nei"><input type="text" data-index='7' placeholder="选择班级" name="" id="" value="" /></div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
</div>
... ... @@ -360,7 +359,7 @@
<div class="log_four_ooo">
<div class="log_four_xian_ban2">
<div class="log_four_xian_nei">
<input type="text" placeholder=" 选择班级" />
<input type="text" data-index='7' placeholder=" 选择班级" />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
... ... @@ -383,7 +382,7 @@
<div class="log_four_contants_input ">
<div class="log_four_ooo">
<div class="log_four_xian_ban">
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" value="" /></div>
<div class="log_four_xian_nei"><input type="text" data-index='8' placeholder="选择班级" name="" id="" value="" /></div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
</div>
... ... @@ -393,7 +392,7 @@
<div class="log_four_ooo">
<div class="log_four_xian_ban2">
<div class="log_four_xian_nei">
<input type="text" placeholder=" 选择班级" />
<input type="text" placeholder=" 选择班级" data-index='8' />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
... ... @@ -419,7 +418,7 @@
<div class="log_four_contants_input ">
<div class="log_four_ooo">
<div class="log_four_xian_ban">
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" value="" /></div>
<div class="log_four_xian_nei"><input type="text" data-index='9' placeholder="选择班级" name="" id="" value="" /></div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
</div>
... ... @@ -429,7 +428,7 @@
<div class="log_four_ooo">
<div class="log_four_xian_ban2">
<div class="log_four_xian_nei">
<input type="text" placeholder=" 选择班级" />
<input type="text" placeholder=" 选择班级" data-index='9' />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
... ... @@ -452,7 +451,7 @@
<div class="log_four_contants_input ">
<div class="log_four_ooo">
<div class="log_four_xian_ban">
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" value="" /></div>
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" id="" value="" data-index='10' /></div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
</div>
... ... @@ -462,7 +461,7 @@
<div class="log_four_ooo">
<div class="log_four_xian_ban2">
<div class="log_four_xian_nei">
<input type="text" placeholder=" 选择班级" />
<input type="text" placeholder=" 选择班级" data-index='10' />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
... ... @@ -485,7 +484,7 @@
<div class="log_four_contants_input ">
<div class="log_four_ooo">
<div class="log_four_xian_ban">
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" value="" /></div>
<div class="log_four_xian_nei"><input type="text" placeholder="选择班级" name="" id="" value="" data-index='11' /></div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
</div>
... ... @@ -495,7 +494,7 @@
<div class="log_four_ooo">
<div class="log_four_xian_ban2">
<div class="log_four_xian_nei">
<input type="text" placeholder=" 选择班级" />
<input type="text" placeholder=" 选择班级" data-index='11' />
</div>
<div class="log_four_xian_icon">
<img src="__TMPL__/public/assets/images/down.png" alt="" />
... ... @@ -544,63 +543,49 @@
});
}
});
$(".log_four_contant_one").each(function() {
$(this).click(function() {
console.log(333334354);
var index = $(this).index();
console.log(index);
// $(".log_four_radios").eq(idnex).addClass("log_ten_block").siblings().removeClass("log_ten_block")
var text1 = $(this).find(".log_four_contant_right").text();
console.log(text1)
$("#four_inp").attr("placeholder", text1);
xcg = $(this).find('.log_four_contant_right').text();
console.log(xcg)
$(".log_four_contant_one img").eq(index).attr("src", "__TMPL__/public/assets/images/73.png").parents(".log_four_contant_one").siblings().find("img").attr("src", "__TMPL__/public/assets/images/39_0.png");
if($(".log_four_contant_one img").eq(index).attr("src") == "__TMPL__/public/assets/images/73.png") {
$(".log_four_radios").eq(index).css({
display: "block"
});
$(".log_four_radios").find('input').val('');
$(".log_four_radio").css({
display: "none"
});
}
});
});
$('.log_four_radios').each(function(){
let arr = []
let nianj = '';
let enternum = '';
let fir = '';
let sec = ''
$('.log_four_radios').each(function() {
var index = $(this).index();
console.log(index);
$(this).find('.log_botms').click(function(){
if($(this).find('.log_Img9').attr("src") == '__TMPL__/public/assets/images/39_0.png'){
$(this).find('.log_botms').click(function() {
if($(this).find('.log_Img9').attr("src") == '__TMPL__/public/assets/images/39_0.png') {
$(this).find('.log_Img9').attr("src", "__TMPL__/public/assets/images/73.png");
$(this).next('.log_four_contants_input_block').slideDown();
console.log($(this).find(".log_four_contants_right").text())
}else{
} else {
$(this).find('.log_Img9').attr("src", '__TMPL__/public/assets/images/39_0.png');
$(this).next('.log_four_contants_input_block').slideUp();
}
});
})
$(".log_four_contant_ones").each(function(){
var $startinput;
var $endinput;
var cc;
$(this).find(".log_four_xian_ban input").blur(function(){
$startinput = $(this).val();
})
$(this).find(".log_four_xian_ban2 input").blur(function(){
$endinput = $(this).val();
cc = $startinput + $endinput;
console.log(cc);
// $(this).closest("school_ooo").find("#four_inp").attr("placeholder","$startinput+"-"+$endinput")
// var content = $startinput +
})
})
//添加地址
var city_picker = new mui.PopPicker({
layer: 3
... ... @@ -615,6 +600,19 @@
});
}, 200);
});
//輸入年级
$('.log_four_contants_input_block').on('change', 'input', function(e) {
var index = $(this).data('index');
var inputs = $(this).parents('.log_four_contants_input_block').find('input');
var tempData = '';
var classes = index == 0 ? '一年级' : index == 1 ? '二年级' : index == 2 ? '三年级' : index == 3 ? '四年级' : index == 4 ? '五年级' : index == 5 ? '六年级' : index == 6 ? '初一' : index == 7 ? '初二' : index == 8 ? '初三' : index == 9 ? '高一' : index == 10 ? '高二' : index == 11 ? '高三' : '';
if(inputs[0].value && inputs[1].value) {
tempData = classes + '-' + inputs[0].value + '-' + inputs[1].value
}
arr[index] = tempData;
console.log(arr)
})
</script>
</body>
... ...
... ... @@ -24,75 +24,28 @@
</div>
<!-- 学校列表 -->
<div class="log_seven">
<div class="log_seven_list log_seven_list_one">
<div class="log_seven_left">
<div class="log_seven_left_one">实验小学</div>
<div class="log_seven_left_two">
<span>一年级1~6班</span><span>二年级1~6班</span><span>二年级1~6班</span>
<volist name="school" id="val">
<div class="log_seven_list log_seven_list_one">
<div class="log_seven_left">
<div class="log_seven_left_one">{$val.school}</div>
<div class="log_seven_left_two">
<volist name="val.class" id="vo">
<span>{$vo.grade}{$vo.class}班</span>
</volist>
</div>
<div class="log_secen_left_three">{$val.region}</div>
</div>
<div class="log_secen_left_three">天津市西青区花园产业园</div>
</div>
<div class="log_seven_right">
<div class="log_seven_right_one">
<img src="__TMPL__/public/assets/images/87.png" alt="" />
</div>
<div class="log_seven_right_one log_seven_right_two">
<img src="__TMPL__/public/assets/images/86.png" alt="" />
<div class="log_seven_right">
<div class="log_seven_right_one">
<img src="__TMPL__/public/assets/images/87.png" alt="" onclick="school_edit({$vo.id})" />
</div>
<div class="log_seven_right_one log_seven_right_two" onclick="school_del({$vo.id})">
<img src="__TMPL__/public/assets/images/86.png" alt="" />
</div>
</div>
</div>
</div>
<div class="log_seven_list log_seven_list_two">
<div class="log_seven_left">
<div class="log_seven_left_one">实验小学</div>
<div class="log_seven_left_two">
<span>一年级1~6班</span><span>二年级1~6班</span><span>二年级1~6班</span>
</div>
<div class="log_secen_left_three">天津市西青区花园产业园</div>
</div>
<div class="log_seven_right">
<div class="log_seven_right_one">
<img src="__TMPL__/public/assets/images/87.png" alt="" />
</div>
<div class="log_seven_right_one log_seven_right_two">
<img src="__TMPL__/public/assets/images/86.png" alt="" />
</div>
</div>
</div>
<div class="log_seven_list log_seven_list_three">
<div class="log_seven_left">
<div class="log_seven_left_one">实验小学</div>
<div class="log_seven_left_two">
<span>一年级1~6班</span><span>二年级1~6班</span><span>二年级1~6班</span>
</div>
<div class="log_secen_left_three">天津市西青区花园产业园</div>
</div>
<div class="log_seven_right">
<div class="log_seven_right_one">
<img src="__TMPL__/public/assets/images/87.png" alt="" />
</div>
<div class="log_seven_right_one log_seven_right_two">
<img src="__TMPL__/public/assets/images/86.png" alt="" />
</div>
</div>
</div>
<div class="log_seven_list log_seven_list_four">
<div class="log_seven_left">
<div class="log_seven_left_one">实验小学
</div>
<div class="log_seven_left_two">
<span>一年级1~6班</span><span>二年级1~6班</span><span>二年级1~6班</span>
</div>
<div class="log_secen_left_three">天津市西青区花园产业园</div>
</div>
<div class="log_seven_right">
<div class="log_seven_right_one">
<img src="__TMPL__/public/assets/images/87.png" alt="" />
</div>
<div class="log_seven_right_one log_seven_right_two">
<img src="__TMPL__/public/assets/images/86.png" alt="" />
</div>
</div>
</div>
</volist>
</div>
<!-- 按钮 -->
<div class="log_seven_btn">
... ... @@ -108,6 +61,14 @@
<script src="__TMPL__/public/assets/js/mui.picker.min.js"></script>
<script src="__TMPL__/public/assets/js/city.data-3.js"></script>
<script>
/**
*点击删除学校
*/
function school_del(){
alert('11111');
}
</script>
<script>
//删除管理地址
$('.log_seven_right_two').each(function(){
$(this).click(function(){
... ...
... ... @@ -108,7 +108,7 @@
.log_top {
width: 100%;
/* height: 1.76rem; */
background-image: url(../img/41.png);
background-image: url(../images/41.png);
background-size: cover;
background-repeat: no-repeat;
}
... ... @@ -944,7 +944,7 @@
}
.log_four_top_right_bg {
background-image: url(../img/71.png);
background-image: url(../images/71.png);
background-size: 100% 100%;
background-repeat: no-repeat;
color: #F20000
... ... @@ -1579,19 +1579,19 @@
}
.log_seven_list_one {
background-image: url(../img/81.png);
background-image: url(../images/81.png);
}
.log_seven_list_two {
background-image: url(../img/80.png);
background-image: url(../images/80.png);
}
.log_seven_list_three {
background-image: url(../img/79.png);
background-image: url(../images/79.png);
}
.log_seven_list_four {
background-image: url(../img/78.png);
background-image: url(../images/78.png);
}
.log_seven_right {
... ...