wemall开源商城免费商城系统部分代码,下面分享部分代码,供学习者学习;
开源版把install文件夹下的install.lock删除之后可进行自动安装
后台访问地址:http:// www.xxx.com/index.php?m=Admin&c=Index&a=index
前台访问地址:http:// www.xxx.com/ index.php?m=App&c=Index&a=index
菜单管理:click类型时不设置URL,点击事件为BUY,可触发自定义回复,view类型可设置url,点击类型不设置
url是前台访问地址:http:// www.xxx.com/ index.php?m=App&c=Index&a=index
index.php
<?php // 应用入口文件 // 检测PHP环境 if(version_compare(PHP_VERSION,'5.3.0','<')) die('require PHP > 5.3.0 !'); // 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false define('APP_DEBUG',True); define('APP_VERSION', '3.5.2'); define('APP_VERSION_TIME', '2016.10.15'); // 定义应用目录 define('APP_PATH','./Application/'); define('PUBLIC_PATH', './Public/'); /** * 系统安装及开发模式检测 */ if (!file_exists('./Install/install.lock')) { header('Location: ./Install/index.php'); exit (); } include "vendor/autoload.php"; // 引入ThinkPHP入口文件 require './ThinkPHP/ThinkPHP.php';
Index_index.html
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>{$info.name}</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <link href="__CSS__/foods.css" rel="stylesheet"type="text/css"> <script type="text/javascript" src="__JS__/jquery.min.js"></script> <script type="text/javascript" src="__JS__/wemall.js"></script> <script type="text/javascript" src="__JS__/alert.js"></script> <script type="text/javascript"> var appurl = '__APP__'; var rooturl = '__ROOT__'; var indexurl = '{:U("App/Index/index")}'; </script> </head> <body class="sanckbg mode_webapp"> <div id="menu-container" style="display: block;"> <div class="menu_header"> <div class="menu_topbar"> <div id="menu" class="sort sort_on"> <a href="">{$info.name}</a> <ul> <volist name="menu" id="menuid"> <li><a href="javascript:showProducts('{$menuid.id}')">{$menuid.name}</a></li> </volist> <li><a href="javascript:showAll()">所有商品</a></li> </ul> </div> <a class="head_btn_right" href="javascript:showMenu();"><i class="menu_header_home"></i> </a> </div> </div> <div class="gonggao"> <div class="hot"> <strong>公告</strong> </div> <div class="content">{$info.notification}</div> </div> <section class="menu"> <section class="list listimg"> <dl> <dt>菜单</dt> <div class="ccbg"> <volist name="goods" id="goodsvo"> <dd menu="{$goodsvo.menu_id}"> <div class="tupian"> <img src="__PUBLIC__{$goodsvo.savepath}{$goodsvo.image}" onclick="showDetail('{$goodsvo.id}');"> <a href="javascript:doProduct('{$goodsvo.id}','{$goodsvo.name}','{$goodsvo.price}');" class="add"><p class="dish2">{$goodsvo.name}</p> <p class="price2">{$goodsvo.price}元/份</p> <p> <del>{$goodsvo.old_price}元/份</del> </p></a> </div> <a href="javascript:doProduct('{$goodsvo.id}','{$goodsvo.name}','{$goodsvo.price}');" id="{$goodsvo.id}" class="reduce" style="display: block;"><b class="ico_reduce">减一份</b></a> </dd> </volist> </div> </dl> </section> <div id="mcover" onclick="document.getElementById('mcover').style.display='';"> <div id="Popup" style="display: block;"> <div class="imgPopup"> <img id="detailpic" src=""> <h3 id="detailtitle"></h3> <p class="jianjie" id="detailinfo"></p> </div> </div> <a class="close" onclick="document.getElementById('mcover').style.display='';">X</a> </div> </section> </div> <div id="cart-container" style="display: none;"> <div class="menu_header"> <div class="menu_topbar"> <div id="menu" class="sort"> <a href="">购物车</a> </div> </div> </div> <section class="order"> <div class="orderlist"> <ul id="ullist"> <dt>已选购的</dt> </ul> <ul id="cartinfo"> <dt>购物车总计</dt> <li class="ccbg2" id="emptyLii">已选:<span id="totalNum">0</span>份 共计:¥<span id="totalPrice">0</span>元</li> </ul> <div class="twobtn"> <div class="footerbtn"> <a class="del right3" href="javascript:home();">选购</a> </div> <div class="footerbtn"> <a class="submit left3" onclick="clearCache()">清空</a> </div> <div class="clr"></div> </div> </div> <form name="infoForm" id="infoForm" method="post" action=""> <div class="contact-info"> <ul> <li class="title">联系信息</li> <li> <table style="padding: 0; margin: 0; width: 100%;"> <tbody> <tr> <td width="80px"><label for="name" class="ui-input-text">联系人:</label></td> <td> <div class="ui-input-text"> <input id="name" name="name" placeholder="" value="{$users.username}" type="text" class="ui-input-text"> </div></td> </tr> <tr> <td width="80px"><label for="phone" class="ui-input-text">联系电话:</label></td> <td> <div class="ui-input-text"> <input id="phone" name="phone" placeholder="" value="{$users.phone}" type="tel" class="ui-input-text"> </div> </td> </tr> <tr> <td width="80px"><label for="pay" class="ui-input-text">支付方式:</label></td> <td colspan="2"><select name="pay" class="selectstyle" id="select1"> <option value="0">货到付款</option> <option value="1">微信支付</option> </select></td> </tr> <tr> <td width="80px"><label for="address" class="ui-input-text">地址:</label></td> <td><textarea id="address" name="address" placeholder="" value="" class="ui-input-text">{$users.address}</textarea> </td> </tr> <tr> <td width="80px"><label for="note" class="ui-input-text">备注:</label></td> <td><textarea name="note" placeholder="" class="ui-input-text"></textarea></td> </tr> </tbody> </table> <div class="footReturn"> <a id="showcard" class="submit" href="javascript:submitOrder();">确定提交</a> </div> </li> </ul> </div> </form> </section> <!-- 正在提交数据 --> <div id="menu-shadow" hidefocus="true" style="display: none; z-index: 10;"> <div class="btn-group" style="position: fixed; font-size: 12px; width: 220px; bottom: 80px; left: 50%; margin-left: -110px; z-index: 999;"> <div class="del" style="font-size: 14px;"> <img src="__IMG__/ajax-loader.gif" alt="loader">正在提交订单... </div> </div> </div> </div> <div id="user-container" style="display: none;"> <div class="menu_header"> <div class="menu_topbar"> <div id="menu" class="sort "> <a href="">查看我的订单</a> </div> </div> </div> <div class="cardexplain"> <div id="page_tag_load" hidefocus="true" style="display: none; z-index: 10;"> <div class="btn-group" style="position: fixed; font-size: 12px; width: 220px; bottom: 80px; left: 50%; margin-left: -110px; z-index: 999;"> <div class="del" style="font-size: 14px;"> <img src="__IMG__/ajax-loader.gif" alt="loader">正在获取订单... </div> </div> </div> <ul class="round"> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="cpbiaoge"> <tr> <th>订单编号</th> <th class="cc">订单金额</th> <th class="cc">支付状态</th> <th class="cc">发货状态</th> </tr> <tbody id="orderlistinsert"> <!--插入订单ul--> </tbody> </table> </ul> </div> </div> <div class="footermenu"> <ul> <li id="home"><a class="active" href="javascript:void(0);"> <img src="__IMG__/home.png"> <p>首页</p> </a></li> <li id="cart"><a href="javascript:void(0);"> <span class="num" id="cartN2">0</span> <img src="__IMG__/cart.png"> <p>购物车</p> </a></li> <li id="user"><a href="javascript:void(0);"> <img src="__IMG__/user.png"> <p>我的</p> </a></li> </ul> </div> </body> </html>
autoload_real.php
<?php // autoload_real.php @generated by Composer class ComposerAutoloaderInitcffe19dda1006f05515659a276e2fc8b { private static $loader; public static function loadClassLoader($class) { if ('Composer\Autoload\ClassLoader' === $class) { require __DIR__ . '/ClassLoader.php'; } } public static function getLoader() { if (null !== self::$loader) { return self::$loader; } spl_autoload_register(array('ComposerAutoloaderInitcffe19dda1006f05515659a276e2fc8b', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInitcffe19dda1006f05515659a276e2fc8b', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION'); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; call_user_func(\Composer\Autoload\ComposerStaticInitcffe19dda1006f05515659a276e2fc8b::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { $loader->set($namespace, $path); } $map = require __DIR__ . '/autoload_psr4.php'; foreach ($map as $namespace => $path) { $loader->setPsr4($namespace, $path); } $classMap = require __DIR__ . '/autoload_classmap.php'; if ($classMap) { $loader->addClassMap($classMap); } } $loader->register(true); return $loader; } }
开源商城免费商城系统下载地址:http://www.koahub.com/home/product/37
wemall 开源微商城 ,微信商城,商城源码,三级分销,微生鲜,微水果,微外卖,微订餐---专业的o2o系统
wemall地址:http://www.wemallshop.com
代码来源:http://js.koahub.com/home/feature/koa-jwt