0
0
Files
Babyclass/resources/views/layouts/app.blade.php
2020-08-04 10:17:22 +08:00

179 lines
6.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">
<title>@yield('title', config('app.name')) @if(session('area','')) {{ session('area','')->province??'' }}{{ session('area','')->city??'' }}{{ session('area','')->area??'' }} @endif</title>
<link rel="stylesheet" href="/assets/home/css/mzui.min.css">
<link rel="stylesheet" href="/assets/home/css/style.css?{{time()}}">
@yield('css')
@yield('js')
</head>
<body>
@yield('content')
<section class="layer hidden affix no-margin no-padding" id="pass">
<div class="empty" style="padding-top:20%">
<img src="/assets/home/img/gz010.png" style="width: 76%;">
<p style="margin-top: 1.5rem;font-size: .8rem;">
关注公众平台
<br>
及时获取最新消息
</p>
<div style="width:30%;margin:10px auto;">
<button class="btn ajax-get refresh" data-href="{{ route('pass.time') }}" style="background-color: #f49d0c;color: #fff;border-radius: .2rem;margin-top: .5rem">今日不再提示</button>
</div>
</div>
<div class="white_fixed"></div>
</section>
@section('footer')
@include('layouts.footer')
@show
</body>
<script type="text/javascript" src="/assets/home/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="/assets/home/js/mzui.min.js" ></script>
@section('layer')
<script type="text/javascript" src="/assets/home/js/layer/layer.min.js" ></script>
@show
<script type="text/javascript" src="/assets/home/js/cjango.js?v={{uniqid()}}"></script>
<script type="text/javascript" src="/assets/home/js/vue.js"></script>
<script type="text/javascript" src="/assets/home/js/main.js"></script>
@section('share')
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
@php
$app = app('wechat.official_account');
$share_url = route("index.index");
$share_title = '宝宝课欢迎您加入';
if(Auth::user() && Auth::user()->identity->identity_id>0){
$share_desc = Auth::user()->info->nickname .'邀请您加入';
$share_imgUrl = 'http://bbclass.shanyoubao.com/storage/headimgurl/'.Auth::id().'.jpg';
}else{
$share_desc = '为宝宝提供优质的教育和娱乐';
$share_imgUrl = '';
}
if(Auth::user() && Auth::user()->identity->identity_id>0){
$share_url = route("index.index").'?share_uid='.Auth::id();
$canShare = true;
}else{
$canShare = false;
}
// $shareinfo = App\Models\WechatRule::where('name','share_config')->first();
// if($shareinfo){
// $share_title = $shareinfo->title ?? '宝宝课欢迎您加入';
// $share_desc = $shareinfo->description ?? '为宝宝提供优质的教育和娱乐';
// $share_imgUrl = 'http://www.bohaimingpin.com'.$shareinfo->storage->path ?? 'http://www.bohaimingpin.com/storage/2018/11/12/ed7a8c50f93d582ea8768e944ab9093f.jpg';
// }
@endphp
wx.config(<?php echo $app->jssdk->buildConfig(['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'hideMenuItems', 'getLocation', 'openLocation', 'checkJsApi', 'scanQRCode']) ?>);
wx.ready(function() {
@section('hideMenuItems')
wx.hideMenuItems({
menuList: ['menuItem:copyUrl','menuItem:share:facebook','menuItem:share:QZone','menuItem:readMode','menuItem:openWithQQBrowser','menuItem:openWithSafari','menuItem:originPage','menuItem:share:weiboApp','menuItem:share:qq','menuItem:share:email','menuItem:share:brand'@if(!$canShare) ,'menuItem:share:appMessage','menuItem:share:timeline' @endif]
});
@show
wx.onMenuShareTimeline({
title: '{{ $share_title }}',
desc: '{{ $share_desc }}',
link: '{{ $share_url }}',
imgUrl: '{{ $share_imgUrl }}',
success: function () {
}
});
wx.onMenuShareAppMessage({
title: '{{ $share_title }}',
desc: '{{ $share_desc }}',
link: '{{ $share_url }}',
imgUrl: '{{ $share_imgUrl }}',
success: function () {
}
});
wx.getLocation({
type : 'gcj02', // 默认为wgs84的gps坐标如果要返回直接给openLocation用的火星坐标可传入'gcj02'
success : function(res) {
console.log(res);
var token = "{{ csrf_token() }}";
$.post("{{ route('index.location') }}",{lat:res.latitude,lng:res.longitude,_token:token},function(result){
if (result.statusCode==200) {
location.reload();
$('.home_location').html(result.message+'&nbsp;<i class="icon-angle-down"></i>');
}
});
},
cancel : function(res) {
}
});
});
wx.error(function(res) {
// updateAlert(res.errMsg);
});
$(".mapOpen").on('click',function(){
var $this=$(this);
var lat=$this.data('lat');
var lng=$this.data('lng');
var title=$this.data('title');
var address=$this.data('address');
lat = parseFloat(lat);
lng = parseFloat(lng);
if (lat=='0.0000000' || lng=='0.0000000') {
updateAlert($this.data('message'));
return false;
}
wx.openLocation({
latitude: lat,
longitude: lng,
name: title,
address: address,
scale: 13,
infoUrl: ''
});
});
@if(Auth::user())
@if(empty(Auth::user()->info->subscribe_at) && Auth::user()->info->pass_at<now())
var myDisplay = new $.Display({
display: 'popover',
backdrop:'fade',
target: '#pass',
placement:'center',
autoHide:false,
displayAuto:true
});
@endif
@endif
</script>
@show
@yield('script')
<script type="text/javascript">
/*分享*/
$(".j_footer_share").on('click',function (e) {
$("#shareimg").attr('src',"{{ route('share.getnewCode') }}?_t={{ time() }}");
$(".j_share").show();
console.log('33');
});
$(".j_share_close").click(function (e) {
$(".j_share").hide();
});
</script>
</html>