From 0a7e75fb2db3a7069b0fb321fc259f86712b6a61 Mon Sep 17 00:00:00 2001 From: 潘浩文 <phw@bronet.cn> Date: Mon, 22 Oct 2018 17:10:38 +0800 Subject: [PATCH] 1 --- app/portal/controller/PrizeController.php | 24 +++++++++++++++++------- public/themes/simpleboot3/portal/prize/getScore.html | 17 ++++++++++++++++- public/themes/simpleboot3/portal/prize/successupload.html | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+), 8 deletions(-) create mode 100644 public/themes/simpleboot3/portal/prize/successupload.html diff --git a/app/portal/controller/PrizeController.php b/app/portal/controller/PrizeController.php index 1e868fa..fae3e87 100644 --- a/app/portal/controller/PrizeController.php +++ b/app/portal/controller/PrizeController.php @@ -137,6 +137,7 @@ class PrizeController extends WeChatBaseController } public function getScore(){ + $this->checkUser(); $app = new Application($this->options); $js = $app->js; $jss = $js->config(['chooseImage', 'uploadImage', 'previewImage'], $debug = true, $beta = false, $json = true); @@ -146,16 +147,14 @@ class PrizeController extends WeChatBaseController //上传小票提交 public function uploadPost(){ + $re=$this->checkUser(); $param = $this->request->param(); - $options = [ - 'app_id' => config('wechat_config.app_id'), - 'secret' => config('wechat_config.secret'), - 'payment' => config('wechat_config.payment'), - ]; - $app = new Application($options); + $app = new Application($this->options); // 获取 access token 实例 $access_token = $app->access_token; - return $this->getmedia($access_token, $param['media'], date('Ymd')); + $save_name=$this->getmedia($access_token, $param['media'], date('Ymd')); + Db::name('users_score_log')->insert(['users_id'=>$re['id'],'create_time'=>time(),'thumbnail'=>$save_name]); + return 1; } private function getmedia($access_token, $media_id, $foldername) { @@ -176,6 +175,17 @@ class PrizeController extends WeChatBaseController return $saveName; } + public function uploadSuccess(){ + return $this->fetch('successupload'); + } + + + + + + + + //兑奖记录 public function prizeRecord(){ $status=$this->request->param('status'); diff --git a/public/themes/simpleboot3/portal/prize/getScore.html b/public/themes/simpleboot3/portal/prize/getScore.html index 9b6a6a9..88e1718 100644 --- a/public/themes/simpleboot3/portal/prize/getScore.html +++ b/public/themes/simpleboot3/portal/prize/getScore.html @@ -160,7 +160,22 @@ wx.ready(function () { }); //确定上传小票 $(".footer").click(function(){ - window.location.href='successupload.html' + $.ajax({ + url: "{:url('portal/prize/uploadPost')}", + type: "post", + data: { + 'media': serverIds, + }, + success: function (data) { + if (data == 1) { + mui.toast('保存成功') + window.location.href = "{:url('portal/prize/uploadSuccess')}" + } else { + mui.alert('保存失败'); + return false + } + } + }) }) </script> </body> diff --git a/public/themes/simpleboot3/portal/prize/successupload.html b/public/themes/simpleboot3/portal/prize/successupload.html new file mode 100644 index 0000000..0bea709 --- /dev/null +++ b/public/themes/simpleboot3/portal/prize/successupload.html @@ -0,0 +1,86 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"> + <script type="text/javascript" src="__TMPL__/public/assets/js/base.js"></script> + <title>上传成功</title> + <style> + .container{ + padding-top: 3.8rem; + } + .success{ + width:1.04rem; + height:1.04rem; + margin:0 auto; + font-size: 0; + } + .success img{ + width:100%; + height:100%; + } + .successword{ + text-align: center; + color:#CA277B; + font-size: 0.36rem; + margin-top: 0.2rem; + } + .upsuccess{ + width:3.65rem; + margin: 0 auto; + color:#252729; + font-size: 0.26rem; + } + .increase{ + width:3.62rem; + margin: 0 auto; + text-align: center; + color:#252729; + font-size: 0.26rem; + margin-top: 0.2rem; + } + .word{ + margin-top: 0.68rem; + } + .footer{ + width:6.86rem; + text-align: center; + height:0.88rem; + line-height: 0.88rem; + position:fixed; + bottom:0.55rem; + left:0; + right:0; + margin: 0 auto; + background:#CA277B ; + border-radius: 0.44rem; + color:#fff; + font-size:0.32rem ; + } + + </style> +</head> +<body> + <div class="container"> + <div class="success"> + <img src="__TMPL__/public/assets/images/img/successupload.png" alt=""> + </div> + <p class="successword">上传成功</p> + </div> +<div class="word"> + <p class="upsuccess">上传成功,等待后台审核通过后</p> + <P class="increase">增加相应积分</P> +</div> +<div class="footer"> + 返回 +</div> + +<script type="text/javascript" src="__TMPL__/public/assets/js/jquery.min.js"></script> +<script> + $(".footer").click(function(){ + window.location.href='uploadticket.html' + }) +</script> +</body> +</html> -- libgit2 0.24.0