Commits

ouxuedong committed 631eb7d

流程修改

  • Participants
  • Parent commits de2ba5b

Comments (0)

Files changed (8)

File src/env/lib/python2.7/site-packages/Jinja2-2.5.5-py2.7.egg/jinja2/debug.pyc

Binary file modified.

File src/models.py

     total_user = db.Column(db.Integer, nullable=False, default=10)
     # Comments to this coupon
     # comments = db.relationship('Comment', backref='comment', lazy='dynamic')
-
     status = db.Column(db.Integer, default=0)
     created_at = db.Column(db.DateTime, default=datetime.now())
     updated_at = db.Column(db.DateTime, default=datetime.now())

File src/static/css/main.css

 .round1 {-moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; behavior:url(../../../../PIE.htc); position:relative;}
 .shadow1 {-moz-box-shadow:4px 10px 14px #666666; -webkit-box-shadow:4px 10px 14px #666666; box-shadow:4px 10px 14px #666666; behavior:url(PIE.htc); position:relative;}
 
+
+.promoSehItem {
+overflow: hidden;
+zoom: 1;
+margin: 20px 0 10px;
+padding-bottom: 10px;
+border-bottom: 1px dashed #ccc;
+position: relative;
+}
+
+.promoSehItem .down,.promoSehItem .print {
+display: -moz-inline-box;
+display: inline-block;
+*display: inline;
+zoom: 1;
+vertical-align: middle;
+}
+
+.promoSehItem .down {
+background: url(img/promodown.png) no-repeat;
+width: 78px;
+height: 24px;
+margin-left: 10px;
+}
+
+
 .popup_main {width:262px; height:193px; background:#dfdfdf; padding:10px 13px; margin:10px auto}
 .popup_main h5 {font-size:15px; color:#30a75f; font-weight:bold; margin-bottom:22px}
 .popup_main h5 a {width:14px; height:14px; display:block; background:url(/static/img/closebtn.png) no-repeat 0 0; float:right}

File src/templates/_macros.html

     <div class="headsec ovfl-hidden"></div>
     <ul class="reset todayfeature ovfl-hidden">
 
-
         {% if coupons %}
         <ul>
             {% for coupon in coupons %}
 
 
 {% macro all_coupon_list(coupons) %}
-
-   <div id="maincont" class="ovfl-hidden">
-   <section class="leftsec fl">
-      
+    <div id="maincont" class="ovfl-hidden">
+    <section class="leftsec fl">
       <div class="todaydeal">
         <div id="deal">
             <div class="headsec ovfl-hidden">
             </div>
             <ul class="listing3">
             {% if coupons %}
+
                 {% for coupon in coupons %}
                     <li>
                         <div class="leftside fl"> 
                         <h2 class="head2">{{ coupon.desc }}</h2>
                             <div class="social">
                                 <div class="leftsec1 fl">{{ coupon.place }}<br>
-                                    <ul class="reset consec">
-                                    <li class="last"><a
-                                    href="http://maps.google.com/maps?q={{
-                                    coupon.place }}" target="_blank">查看地图</a></li>
-                                    </ul>
                                 </div>
-                            <div class="rigsec fr"> <a href="" class="greenbtn"
-                            ><span>下载优惠券</span></a> 
-                            </div>
+                                <div class="rigsec fr">
+
+
+
+                                    <input type="button" onclick="popup_show()"  value='下载优惠券'/>
+                                    <div class="sample_popup" id="popup" style="visibility: hidden; display: none;">
+                                        <div class="menu_form_header" id="popup_drag">
+                                            <img class="menu_form_exit"   id="popup_exit" />
+                                               请输入您的电话号码:
+                                        </div>
+                                        <div class="menu_form_body">
+                                            <form method="post" action="{{ url_for('downcoupon') }}">
+                                            <table>
+                                                <tr>
+                                                  我的电话号码:
+                                                  <td>
+                                                  <input id="phonenum" name="phonenum" class="field" type="text" onfocus="select();" />
+                                                  <input id="couponid" name="couponid" class="field" type="hidden" value="{{ coupon.key() }}"/>
+                                                  </td>
+                                                </tr>
+                                                <tr>
+                                                  <th> </th>
+                                                  <td><input class="btn" type="submit" value="发送" /></td>
+                                                </tr>
+                                            </table>
+                                            </form>
+                                        </div>
+                                    </div>
+
+
+                                    <!--a class="greenbtn" id="promo_129725" onclick="popup_show();" title="本券支持短信下载" rel="nofollow"><span>下载优惠券</span></a--> 
+
+                                </div>
                             </div>
                         </div>
                     </li>
                 {% endfor %}
+
             {% endif %}
-
             </ul>
        </div>
        </div>
-
     </section>
     </div>	
-
-
-
-
-
-
 {% endmacro %}
 
 

File src/templates/coupons.html

 {% extends "layout.html" %}
 {% from '_macros.html' import all_coupon_list %}
 
-{% block body -%}
+{% block css -%}
+    <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
+    <link rel="stylesheet" href="{{ url_for('static', filename='css/basic.css') }}">
 
-{{ all_coupon_list(coupons) }}
+    <style type="text/css">
+    div.sample_popup { z-index: +1; }
+    div.menu_form_header{
+    cursor:move
+    }
+    div.sample_popup div.menu_form_header
+    {
+      border: 1px solid black;
+      border-bottom: 0px;
+      cursor: default;
+      width: 200px;
+      height:      20px;
+      line-height: 19px;
+      vertical-align: middle;
+      text-decoration: none;
+      font-family: "Times New Roman", Serif;
+      font-weight: 900;
+      font-size: 13px;
+      color: #206040;
+    }
+    div.sample_popup div.menu_form_body
+    {
+      border: 1px solid black;
+      width: 200px;
+    }
+    div.sample_popup img.menu_form_exit
+    {
+      float: right;
+      margin: 4px 5px 0px 0px;
+      cursor: pointer;
+    }
+    div.sample_popup table
+    {
+      border-collapse: collapse;
+      width: 100%;
+    }
+    div.sample_popup th
+    {
+      width: 1%;
+      padding: 0px 5px 1px 0px;
+      text-align: left;
+      font-family: "Times New Roman", Serif;
+      font-weight: 900;
+      font-size: 13px;
+      color: #004060;
+    }
+    div.sample_popup td
+    {
+      width: 99%;
+      padding: 0px 0px 1px 0px;
+    }
+    div.sample_popup form
+    {
+      margin: 0px;
+      padding: 8px 10px 10px 10px;
+    }
+    div.sample_popup input.field
+    {
+      border: 1px solid #808080;
+      width: 95%;
+      font-family: Arial, Sans-Serif;
+      font-size: 12px;
+    }
+    div.sample_popup input.btn
+    {
+      margin-top: 2px;
+      border: 1px solid #808080;
+      background-color: #DDFFDD;
+      font-family: Verdana, Sans-Serif;
+      font-size: 11px;
+    }
+    a {
+     color: #FF0000;
+     text-decoration: none;
+    }
+    </style>
+{%- endblock %}
+
+{% block js_top -%}
+    <script src="{{ url_for('static', filename='js/libs/modernizr-2.0.min.js') }}"></script>
+    <script src="{{ url_for('static', filename='js/libs/respond.min.js') }}"></script>
+
+    <script language="javascript">
+        var popup_dragging = false;
+        var popup_target;
+        var popup_mouseX;
+        var popup_mouseY;
+        var popup_mouseposX;
+        var popup_mouseposY;
+        var popup_oldfunction;
+        function popup_display(x)
+        {
+          var win = window.open();
+          for (var i in x) win.document.write(i+' = '+x[i]+'<br>');
+        }
+        function popup_mousedown(e)
+        {
+          var ie = navigator.appName == "Microsoft Internet Explorer";
+          if ( ie  &&  window.event.button != 1) return;
+          if (!ie  &&  e.button            != 0) return;
+          popup_dragging = true;
+          popup_target   = this['target'];
+          popup_mouseX   = ie ? window.event.clientX : e.clientX;
+          popup_mouseY   = ie ? window.event.clientY : e.clientY;
+          if (ie)
+               popup_oldfunction = document.onselectstart;
+          else popup_oldfunction  = document.onmousedown;
+          if (ie)
+               document.onselectstart = new Function("return false;");
+          else document.onmousedown   = new Function("return false;");
+        }
+        function popup_mousemove(e)
+        {
+          if (!popup_dragging) return;
+          var ie      = navigator.appName == "Microsoft Internet Explorer";
+          var element = document.getElementById(popup_target);
+          var mouseX = ie ? window.event.clientX : e.clientX;
+          var mouseY = ie ? window.event.clientY : e.clientY;
+          element.style.left = (element.offsetLeft+mouseX-popup_mouseX)+'px';
+          element.style.top  = (element.offsetTop +mouseY-popup_mouseY)+'px';
+          popup_mouseX = ie ? window.event.clientX : e.clientX;
+          popup_mouseY = ie ? window.event.clientY : e.clientY;
+        }
+
+        function popup_mouseup(e)
+        {
+          if (!popup_dragging) return;
+          popup_dragging = false;
+          var ie = navigator.appName == "Microsoft Internet Explorer";
+          var element = document.getElementById(popup_target);
+          if (ie)
+               document.onselectstart = popup_oldfunction;
+          else document.onmousedown   = popup_oldfunction;
+        }
+        function popup_exit(e)
+        {
+          var ie = navigator.appName == "Microsoft Internet Explorer";
+          var element = document.getElementById(popup_target);
+          popup_mouseup(e);
+          element.style.visibility = 'hidden';
+          element.style.display    = 'none';
+        }
+        function popup_show()
+        {
+          element      = document.getElementById('popup');
+          drag_element = document.getElementById('popup_drag');
+          exit_element = document.getElementById('popup_exit');
+          element.style.position   = "absolute";
+          element.style.visibility = "visible";
+          element.style.display    = "block";
+          element.style.left = (document.documentElement.scrollLeft+popup_mouseposX-90)+'px';
+          element.style.top  = (document.documentElement.scrollTop +popup_mouseposY+25)+'px';
+          drag_element['target']   = 'popup';
+          drag_element.onmousedown = popup_mousedown;
+          exit_element.onclick     = popup_exit;
+        }
+        function popup_mousepos(e)
+        {
+          var ie = navigator.appName == "Microsoft Internet Explorer";
+          popup_mouseposX = ie ? window.event.clientX : e.clientX;
+          popup_mouseposY = ie ? window.event.clientY : e.clientY;
+        }
+        if (navigator.appName == "Microsoft Internet Explorer")
+             document.attachEvent('onmousedown', popup_mousepos);
+        else document.addEventListener('mousedown', popup_mousepos, false);
+        if (navigator.appName == "Microsoft Internet Explorer")
+             document.attachEvent('onmousemove', popup_mousemove);
+        else document.addEventListener('mousemove', popup_mousemove, false);
+        if (navigator.appName == "Microsoft Internet Explorer")
+             document.attachEvent('onmouseup', popup_mouseup);
+        else document.addEventListener('mouseup', popup_mouseup, false);
+    </script> 
 
 {%- endblock %}
+
+{% block body -%}
+    {{ all_coupon_list(coupons) }}
+{%- endblock %}

File src/templates/layout.html

     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
     <!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->
+    <!-- CSS: implied media="all" -->
 
-    <!-- CSS: implied media="all" -->
     {% block css -%}
     <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
     <link rel="stylesheet" href="{{ url_for('static', filename='css/basic.css') }}">
     {%- endblock %}
 
     <!-- More ideas for your <head> here: h5bp.com/docs/#head-Tips -->
-
     <!-- All JavaScript at the bottom, except for Modernizr and Respond.
     Modernizr enables HTML5 elements & feature detects; Respond is a polyfill for min/max-width CSS3 Media Queries
     For optimal performance, use a custom Modernizr build: www.modernizr.com/download/ -->
     <script src="{{ url_for('static', filename='js/libs/modernizr-2.0.min.js') }}"></script>
     <script src="{{ url_for('static', filename='js/libs/respond.min.js') }}"></script>
 
-    <!--script type="text/javascript" src="{{ url_for('static', filename='js/libs/city_select.js') }}"></script>
+    {%- endblock %}
 
-    <script type="text/javascript">
-        function selectcity(cityid){
-            window.location.replace("{{request.url}}"+cityid);
-        }
-        
-        function selectcity(city_id){
-            alert (city_id);
-            self.location={{ url_for('index', cityid = city_id) }};
-        }
-    </script-->
-
-    {%- endblock %}
 </head>
 
 <body>
             {% block header -%}
 
             <div class="headtop">
-            <!--section class="fr"--> 
-            <table border="0" cellspacing="0" cellpadding="0" align="left">
-                <!--tr-->
+            <!--table border="0" cellspacing="0" cellpadding="0" align="left">
                   <td>
                       <ul class="socialicon fl reset">
                         <li><a href="mailto:?subject=&amp;body=http://localhost:8080/" class="email"></a></li>
                       <a href="javascript:void(0);" onclick="javascript:setconfirm();">注 册</a></div>
                       </li>
                       </ul>
-                    <!--div class="clr"></div-->
                  </td>
-                <!--/tr-->
-              </table>
-            <!--/section-->
+              </table-->
 
 
             <div class="clr"></div>
             <nav class="fl">
             <ul class="topnav">
                  
-                <li><a href="http://www.dailygobble.com/how-it-works" ><span>这就是"空置率killer"</span></a></li>
-                <li><a href="http://www.dailygobble.com/deal"  class="active" ><span>今天的空置单</span></a></li>
-                <li><a href="http://www.dailygobble.com/my-gobbles/ro" ><span>我为空置率作贡献</span></a></li>
-
+                <li><a href="" ><span>使用介绍</span></a></li>
                 <li class="last" style="padding-right:0px;">
                 <span class="dropdownbg2">
-
                 <form class='city_form' action="{{ request.url }}" method='post'>
                 <table>
                     <select name='cityid' class="select" onchange="submit();">
 
 
     <!-- mathiasbynens.be/notes/async-analytics-snippet Change UA-XXXXX-X to be your site's ID -->
-    <!--
-    <script>
-        var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview'],['_trackPageLoadTime']];
-        (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
-            g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
-            s.parentNode.insertBefore(g,s)}(document,'script'));
-    </script>
-    -->
+
 
 </body>
 </html>

File src/templates/order_coupon.html

+hello1

File src/vacancy.py

     if request.method == 'POST':
         cityid = request.form['cityid']
     if cityid == 'all' or cityid == '':
-        # upcoming_coupons = Coupon.all().fetch(limit=4)
         upcoming_coupons = Coupon.get_upcoming_coupons(4, '')
     else:
-        # upcoming_coupons = Coupon.all().filter('coupon_area', cityid).fetch(limit=4)
         upcoming_coupons = Coupon.get_upcoming_coupons(4, cityid)
- 
     return render_template('index.html',upcoming_coupons=upcoming_coupons)
 
 
+@app.route('/coupons', methods=['POST', 'GET'])
+def coupons():
+    cityid = ''
+    if request.method == 'POST':
+        cityid = request.form['cityid']
+    if cityid == 'all' or cityid == '':
+        coupons = Coupon.get_all_coupons('')
+    else:
+        coupons = Coupon.get_all_coupons(cityid)
+    return render_template('coupons.html',coupons=coupons)
+
+
 @app.route('/explore')
 def explore():
     return render_template('explore.html')
 def getsmsurl(url_type):
     adress = ''
     if url_type == 'first_choise':
-        adress = "http://utf8.sms.webchinese.cn/?Uid=test&Key=fa3baf734c5600e6f67a&smsMob="
+        adress = "http://utf8.sms.webchinese.cn/?Uid=baygle&Key=fa3baf734c5600e6f67a&smsMob="
     if url_type == 'back_up':
         adress = "http://www.asdfasfasdfa.com/?smsMob="
     return adress 
     return result
 
 
-@app.route('/downcoupon/<couponid>/<phonenum>')
-def downcoupon(couponid, phonenum):
+@app.route('/downcoupon', methods=['GET','POST'])
+def downcoupon():
+    couponid = ''
+    phonenum = ''
+    if request.method == 'POST':
+        couponid = request.form['couponid'].strip()
+        phonenum = request.form['phonenum'].strip()
     if not couponid:
         abort
     if not phonenum:
     return render_template('downcoupon.html', result=result)
 
 
-@app.route('/coupons')
-def coupons():
-    coupons = Coupon.get_upcoming_coupons('', '')
-    return render_template('coupons.html',coupons=coupons)
-
-
 @app.route('/user')
 @login_required
 def user():
             return redirect(url_for('user'))
     return render_template('user.html', email=email, errors=g.errmsgs) 
 
+
+@app.route('/order_coupon')
+def order_coupon():
+    return render_template('order_coupon.html')
+
+
 @app.route('/search')
 def search():
     return render_template('index.html')