Home > php教程 > php手册 > WeMall WeChat mall source code event registration plug-in code details

WeMall WeChat mall source code event registration plug-in code details

WBOY
Release: 2016-10-09 08:32:16
Original
1253 people have browsed it

WeMall微信商城源码插件活动报名代码是用于商业推广的比较有效的方式,分享了部分比较重要的代码,供技术员学习参考,商家可自由设置报名项目,活动时间,报名内容

WeMall微信商城源码插件活动报名代码是用于商业推广的比较有效的方式,分享了部分比较重要的代码,供技术员学习参考,商家可自由设置报名项目,活动时间,报名内容

代码详情地址:http://addon.wemallshop.com/Product/addonList/menu_id/1 或 www.wemallshop.com


AdminController.class<?php<br /> <br /> namespace Addons\Apply\Controller;<br /> <br /> class AdminController extends InitController<br /> {<br /> <br /> public function __construct()<br /> {<br /> parent::__construct();<br /> }<br /> <br /> public function index()<br /> {<br /> $config = M("AddonApplyConfig")->find();<br>         $this->assign("config", $config);<br> <br>         $record = D('Addons://Apply/AddonApplyRecord'); // 实例化User对象<br>         $count = $record->count();// 查询满足要求的总记录数<br>         $Page = new \Think\Page($count, 12);// 实例化分页类 传入总记录数和每页显示的记录数(25)<br>         $Page->setConfig('theme', "<div class=&#039;widget-content padded text-center&#039;><ul class=&#039;pagination&#039;></li><li>%FIRST%</li><li>%UP_PAGE%</li><li>%LINK_PAGE%</li><li>%DOWN_PAGE%</li><li>%END%</li><li><a> %HEADER%  %NOW_PAGE%/%TOTAL_PAGE% 页</a></ul></div>");<br>           $show = $Page->show();// Display output in pages<br> // Perform paging data query. Note that the parameters of the limit method must use the attributes of the Page class<br> $record = $record->limit($Page->firstRow . ',' . $Page->listRows)->order("id desc")->relation(true)->select( );<br> <br>           $this->assign("record", $record);//Assignment data set<br>           $this->assign('page', $show);// Assignment paging output<br> <br>           $this->display();<br> }<br> <br> Public function addConfig()<br> {<br>         $event = $_POST["event"];<br>              // $event = str_replace('"', "", $event);<br>             // $event = str_replace('[', "", $event);<br> ​​​​//$event = str_replace(']', "", $event);<br>              // $event = json_encode(explode(",", $event), JSON_UNESCAPED_UNICODE);<br> <br>          $_POST["event"] = $event;<br> M("AddonApplyConfig")->where(array("id" => "1"))->save($_POST);<br>           $this->success('Modification successful', 'Admin/Admin/index/addon/Apply');<br> <br> }<br> }
IndexController.class<?php<br /> <br /> <br /> namespace AddonsApplyController;<br /> <br /> class IndexController extends InitController<br /> {<br /> Public $appUrl = "";<br /> Public function __construct()<br /> {<br />           parent::__construct();<br />          $this->appUrl = "http://" . I("server.HTTP_HOST");<br> }<br> <br> <br> Public function index()<br> {<br> ​​​​$user = R("App/Public/oauthLogin");<br>                 // $this->assign("user",$user);<br> ​​​​<br> <br>          $config = M("AddonApplyConfig")->where(array("status" => 1))->find();<br>              // print_r(explode(',',$config["event"]));<br>          $this->assign("event", explode(',',$config["event"]));<br>          $this->assign("config", $config);<br> <br>          $contact = M("Contact")->where(array("user_id" => $user["id"]))->find();<br>            if ($contact) {<br>                $this->assign("contact", $contact);<br>          }<br> <br> M("AddonApplyConfig")->where(array("id" => 1))->setInc("visiter");<br> <br>           $this->assign('user', $user);// Assignment paging output<br>           $this->display();<br> }<br> <br> Public function addConfig()<br> {<br>        M("AddonApplyConfig")->where(array("id" => "1"))->save($_POST);<br>     }<br> <br>     public function addOrder()<br>     {<br>    <br> <br>         $userHas = M("AddonApplyContact")->where(array("user_id" => session("userId")))->find();<br> <br>         if ($userHas) {<br>             $contact ["id"] = $userHas ["id"];<br>             $contact ["user_id"] = session("userId");<br>             $contact ["name"] = $_POST ["name"];<br>             $contact ["address"] = $_POST ["address"];<br>             M("AddonApplyContact")->save($contact);<br>         } else {<br>             $contact ["user_id"] = session("userId");<br>             $contact ["name"] = $_POST ["name"];<br>             $contact ["city"] = "";<br>             $contact ["area"] = "";<br>             $contact ["address"] = $_POST ["address"];<br>             M("AddonApplyContact")->add($contact);<br>         }<br>         $userHas = M("AddonApplyContact")->where(array("user_id" => session("userId")))->find();<br>         $contact_id = $userHas["id"];<br> <br>         $config = M("AddonApplyConfig")->find();<br> <br>         $data ["user_id"] = session("userId");<br>         $data ["contact_id"] = $contact_id;<br>         $data ["name"] = $_POST ["name"];<br>         $data ["phone"] = $_POST ["phone"];<br>         $data ["note"] = $_POST ["note"];<br>         $data ["event"] = $_POST["event"];<br>         $data ["time"] = date("Y-m-d H:i:s");<br>         $result = M("AddonApplyRecord")->add($data);<br> <br>         M("AddonApplyConfig")->where(array("id" => 1))->setInc("apply");<br>         if ($result) {<br>             $this->ajaxReturn($result);<br>         }<br>     }<br> <br> <br> }Index_index<!DOCTYPE html><br> <html lang="zh-cn"><br> <head><br>     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><br>     <meta charset="utf-8"><br>     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><br>     <title>{$config.name}</title><br>     <meta name="format-detection" content="telephone=no, address=no"><br>     <meta name="apple-mobile-web-app-capable" content="yes"><br>     <!-- apple devices fullscreen --><br>     <meta name="apple-touch-fullscreen" content="yes"><br>     <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><br>     <link href="__CSS__/bootstrap.min.css" rel="stylesheet"><br>     <link href="__CSS__/font-awesome.min.css" rel="stylesheet"><br>     <link href="__CSS__/animate.css" rel="stylesheet"><br>     <link href="__CSS__/common.css" rel="stylesheet"><br>     <link href="__CSS__/sign.css" rel="stylesheet"><br> <br>     <script type="text/javascript" src="__JS__/jquery.min.js"></script><br>     <script type="text/javascript" src="__JS__/bootstrap.min.js"></script><br> <br>     <style type="text/css"><br>         #page_tag_load {<br>             display: none;<br>             font-size: 14px;<br>             position: fixed;<br>             bottom: 70px;<br>             height: 16px;<br>             margin-left: -29px;<br>             left: 50%<br>         }<br>     </style><br> </head><br> <body><br> <div class="container container-fill"><br>     <div class="pcenter-main"><br>         <div class="head"><br>             <div class="pdetail"><br>                 <div class="img-circle"><img src="{$user.avater}"></div><br>                 <div class="pull-left"><br>                     <span class="name">{$user.username}</span><br>                     <span class="type">会员ID: {$user.id}</span><br>                 </div><br>             </div><br>             <div class="head-nav"><br>                 <a class="head-nav-list"<br /> href="">累计报名<span>{$config.apply}</span></a><br>                 <a class="head-nav-list"<br /> href="">访问量<span>{$config.visiter}</span></a><br>             </div><br>         </div><br>     </div><br>     <div class="scroll-container"><br>         <div class="wrapper"><br>             <ul class="list-group"><br>                 <li class="list-group-item" style="padding: 0px 0px;border-bottom: 1px solid #ccc;"><br>                     <div class="con"><br>                         <div class="list-hd"><br>                             <h5>项目:</h5><span>{$config.event}</span><br>                         </div><br>                     </div><br>                 </li><br>                 <li class="list-group-item" style="padding: 1px 0px;border-bottom: 1px solid #ccc;"><br>                     <div class="con"><br>                         <div class="list-hd"><br>                             <h5>时间:</h5><span>{$config.time_range}</span><br>                         </div><br>                     </div><br>                 </li><br>                 <li class="list-group-item" style="padding: 0px;"><br>                     <div class="con"><br>                         <div class="list-hd"><br>                             <h5>项目介绍:</h5><span>{$config.introduce}</span><br>                         </div><br>                     </div><br>                 </li><br>             </ul><br>         </div><br>     </div><br>     <ul class="nav nav-bardown nav-justified" style="z-index:10;"><br>         <li><a><span class="btn btn-default" style="border-radius: 50px;padding: 11.5px 30px;" onclick="submitApply();">点击报名</span></a></li><br>     </ul><br> <br>     <div id="page_tag_load"><img src="__IMG__/ajax-loader.gif" alt="loader"></div><br> <br>     <div id="cover2" style="display: none; position: fixed; width: 100%; height: 100%;"></div><br>     <div class="tc_c2" id="join_box"<br /> style="left: 0px; bottom: 0px; z-index: 3000; position: fixed; display: none;width: 100%;"><br>         <div class="join_box_Xq_out" style="max-height: 641px;"><br>             <div class="tc_c_close"><br>                 <div><img title="关闭" onclick="hidePop(this);" ontouchstart="" src="__IMG__/share_qr_close3.png"></div><br>             </div><br>             <div class="join_box_Xq"><br>                 <ul id="ul_join_property" class="pop_massage"><br>                     <li><br>                         <div class="optionsName">姓名</div><br>                         <div class="inpoutK"><br>                             <input value="{$contact.name}" type="text" class="font0" name="name" id="name"><br>                         </div><br>                     </li><br>                     <li><br>                         <div class="optionsName">手机</div><br>                         <div class="inpoutK"><br>                             <input value="{$contact.phone}" type="text" class="font0" name="phone" id="phone"><br>                         </div><br>                     </li><br>                     <li><br>                         <div class="optionsName">地址</div><br>                         <div class="inpoutK"><br>                             <input value="{$contact.address}" type="text" class="font0" name="address" id="address"><br>                         </div><br>                     </li><br>                     <li><br>                         <div class="optionsName">项目</div><br>                         <div class="inpoutK"><br>                             <!--<input value="{$contact.address}" type="text" class="font0" name="address" id="address">--><br>                             <select name="event" style="width: 98%;" id="event"><br>                                 <volist name="event" id="event"><br>                                     <option value="{$event}">{$event}</option><br>                                 </volist><br>                             </select><br>                         </div><br>                     </li><br>                     <li><br>                         <div class="optionsName">备注</div><br>                         <div class="inpoutK"><br>                             <input value="" type="text" class="font0" name="note" id="note"><br>                         </div><br>                     </li><br>                 </ul><br>             </div><br> <br>             <div class="tc_c_btn2" ontouchstart="" id="xdBtn"><br>                 <a title="返回" class="fanHui" href="javascript:void(0);" ontouchstart="" onclick="_joinBox._prev()"<br /> style="display: none;"></a><br> <br>                 <div class="join_Btn"><br>                     <input id="input_submit" class="blueBtn" type="submit" value="我要报名"<br /> style="display: none; width: 100%;"><br>                     <a style="width: 100%;" id="a_submit" class="blueBtn font02" href="javascript:void(0);"<br /> onclick="submitOrder()">提交</a><br>                 </div><br>             </div><br> <br>         </div><br>     </div><br> </div><br> <script type="text/javascript"><br> Function submitApply(){<br> ​​​​$('#cover2').show();<br>           $('#join_box').show();<br> }<br> function hidePop(){<br> ​​​​$("#join_box").hide();<br> ​​​​$("#cover2").hide();<br> }<br> var submitFlag = true;<br> Function submitOrder(){<br> If (submitFlag == false) {<br> alert("Please do not repeat the operation!");<br>                  return;<br>          };<br>       var name = $('#name').val();<br>       var phone = $('#phone').val();<br>       var event = $('#event').val();<br>       var note = $('#note').val();<br>           var address = $('#address').val();<br> ​​​<br> <br> If (name.length == 0 || phone.length == 0) {<br> alert("Please check the entered information!");<br>                  return;<br>          };<br>          submitFlag = false;<br> <br>           $.ajax({<br>            type: "post",<br>    url: "{:u_addons('Apply://Index/addOrder')}",<br> Data: {<br>                 name: name,<br>                     phone: phone,<br>              event: event,<br>               note: note,<br> Address: address<br>              },<br> Success: function (data) {<br> If(data){<br>                    hidePop();<br> alert("Registration successful!");<br> location.reload();<br>                 }<br>              },<br>              beforeSend: function () {<br>                                                 $('#page_tag_load').show();<br>              },<br> Complete: function () {<br>                     $('#page_tag_load').hide();<br> Submitflag = true; <br>              }<br> <br>         });<br> }<br> </script><br> </body><br> </html> KoaHub.js -- Node.js web rapid development framework based on Koa.js platform
Official website: http://js.koahub.com
WeMall WeChat mall source code event registration plug-in code details

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template