灌水 KoaHub 平台基于 Node.js 开发的 Koa router 路由插件代码信息详情

wemallshop · 2016年10月18日 · 785 次阅读

WeMall 微信商城源码插件会员卡代码是用于商业推广的比较有效的方式,分享了部分比较重要的代码,供技术员学习参考

Index_index.html

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>会员卡</title>
    <meta name="viewport"
          content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link href="__CSS__/card.css?i=2" rel="stylesheet" type="text/css">
</head>
<body id="card" style="">
<div id="overlay"></div>
<div class="cardcenter">
    <div class="card"><img class="cardbg" src="__IMG__/card_bg07.png">
        <img class="logo" src="http://wx.qlogo.cn/mmopen/KMt8YcxoTr7iaBlsovicVoDriciaLBcQtic7D4IyETkKusiasVicTJq5s2PianSUeg9HuVjGXQQQ9Pz07vyrdE7lMQ1EGw/0">
        <h1 style="color:#000000">VIP会员卡</h1>
        <strong class="pdo verify">
            <span style="float: left;margin-left: 10px;">
                <em>会员姓名</em><span style="font-size: 16px;">{$user.username}</span>
            </span>
            <span><em>会员卡号</em>
                <a style="text-decoration: none; color: rgb(10, 10, 10); ">{$user.id}</a>
            </span>
        </strong>
    </div>
    <p class="explain"><span>使用时向服务员出示此卡</span></p>
</div>
<div class="cardexplain">
    <div class="jifen-box" style="margin-top:13px;">
        <ul class="zongjifen">
            <li>
                <div class="fengexian"><p>账户</p><span>{$user.money}</span></div>
            </li>
            <li>
                <div class=""><p>积分</p><span>{$user.score}</span></div>
            </li>
        </ul>
        <div class="clr"></div>
    </div>
    <ul class="round" id="notice">
        <li><a href="{$config.notify_url}"><span>最新通知</span></a></li>
        <li><a href="{$config.about_url}"><span>会员卡说明</span></a></li>
    </ul>
    <ul class="round" id="powerandgift">
        <li><a href="{:U('App/Index/index')}#order"><span>消费记录</span></a></li>
        <li><a href="{:U('App/Index/index')}#order"><span>个人资料</span></a></li>
    </ul>
    <ul class="round">
        <li><a href=""><span>地址: {$config.address}</span></a></li>
        <li><a href="tel:{$config.tel}"><span>电话: {$config.tel}</span></a></li>
    </ul>
</div>
<div class="copyright" style="color: #666666">© 2014-2015 inuoer.com. All
    rights reserved.
</div>
</body>
</html>

Config_index.html


<section class="content-header">
    <h1>
        会员卡设置
        <small></small>
    </h1>
</section>

<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <!-- general form elements -->
            <div class="box box-danger">
                <div class="box-header with-border">
                    <h3 class="box-title">会员卡设置</h3>
                </div>
                <!-- form start -->
                <form class="form-horizontal" method="post" action="{:u_addons('Card://Admin/Config/add')}">
                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">最新通知链接</label>

                            <div class="col-sm-10">
                                <input class="form-control" name="notify_url" placeholder=""
                                       value="{$config.notify_url}"
                                       type="text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">地址</label>

                            <div class="col-sm-10">
                                <input class="form-control" name="address" placeholder=""
                                       value="{$config.address}"
                                       type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="control-label col-md-2">电话</label>

                            <div class="col-sm-10">
                                <input class="form-control" name="tel" placeholder="" value="{$config.tel}"
                                       type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员卡说明链接</label>

                            <div class="col-sm-10">
                                <input class="form-control" name="about_url" placeholder="" value="{$config.about_url}"
                                       type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">备注</label>

                            <div class="col-sm-10">
                                <input class="form-control" name="remark" placeholder="" value="{$config.remark}"
                                       type="text">
                            </div>
                        </div>
                    </div>
                    <!-- /.box-body -->

                    <div class="box-footer">
                        <div class="col-sm-2">
                            <button type="submit" class="btn btn-block btn-danger">保存</button>
                        </div>
                    </div>
                </form>
            </div>
            <!-- /.box -->

        </div>
        <!--/.col (right) -->
    </div>
</section>

IndexController.class.php

<?php
/**
 * Created by PhpStorm.
 * User: heqing
 * Date: 15/7/30
 * Time: 09:40
 */

namespace Addons\Card\Controller;

class IndexController extends InitController
{
    public function index()
    {
        $user = R("App/Public/oauthLogin");
        $this->assign("user", $user);

        $config = M("AddonCardConfig")->find();
        $this->assign("config", $config);
        $this->display('', false);
    }
}

代码来源: www.wemallshop.com

暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册