e 8 years ago
parent
commit
3480fbb7f3

+ 10 - 2
www/webapp/o2o/css/placeOrder.css

@@ -245,10 +245,10 @@
 
 .spa-page-place-order #product-pic-bg {
     background-color: #f2f2f2;
+    position: relative;
 }
 
 .spa-page-place-order .product-name {
-    /*position: absolute;*/
     left: 0;
     right: 0;
     bottom: 0;
@@ -257,9 +257,17 @@
     line-height: 1.6rem;
     color: #fff;
     height: 1.4rem;
-    /*background: rgba(139, 195, 74, 0.80);*/
+    margin-top: -0.3rem;
     background: rgba(146,118,3,1);
 }
+#product-pic-bg .product-img{
+    position: absolute;
+    width: 30px;
+    height: 30px;
+    background-color: #190f0d;
+    bottom: 20px;
+    right: 20px;
+}
 
 .spa-page-place-order .product-name span {
     padding-right: 0.75rem;

File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/css/main.css


File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/build/template.js


File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/main.js


File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/model/product.js


+ 1 - 1
www/webapp/o2o/dist/js/page/home.js

@@ -1 +1 @@
-define(["$","template","IScroll","product","user","native","config","address"],function(e,t,n,r,i,s,o,u){function a(e){e.preventDefault(),s.back()}return{title:"壹管家上门服务",body:"",init:function(t,n){var o=this,u=e(document);e.newTouch(".back-button",function(e){a.call(this,e)},o),o.on("tapBackButton",function(e){a.call(this,e)}),e.newTouch(".service-telephone",function(e){e.preventDefault(),s.call("4000328170")},o),e.newTouch(".btn-banner-recharge",function(e){e.preventDefault(),u.trigger("spa:navigate",{hash:"recharge",pushData:{needReload:!0}})},o),e.newTouch(".btn-banner-coupon",function(e){e.preventDefault(),u.trigger("spa:navigate",{hash:"myCoupon"})},o),e.newTouch(".btn-product",function(t){t.preventDefault();var n=parseInt(e(this).attr("data-product-type"));u.trigger("spa:navigate",{hash:"placeOrder",pushData:{product:r.allList[n-1],needReset:!0}})},o),e.newTouch(".btn-action-my-order",function(e){e.preventDefault(),u.trigger("spa:navigate",{hash:""})},o),e.newTouch(".btn-action-coupon",function(e){e.preventDefault(),i.checkLogin(function(){u.trigger("spa:navigate",{hash:"mine",pushData:{needReset:!0}})})},o),n.resolve()},beforeopen:function(e,t){localStorage.removeItem("cart_products"),t.resolve(),s.switchPopGesture(!0)},afteropen:function(s,a){var f=this,l=e(document);if(!s.pushData.dontNeedReload){l.trigger("spa:openloader");var c=t("home/index",{showNavBar:!o.isWX&&!o.isChubao});e(".spa-page-body",f).html(c),setTimeout(function(){s.scroll=new n("#homeScroll");var e=new Swiper(".swiper-container",{autoplay:2500,pagination:".swiper-pagination",paginationClickable:!0})},500),r.getListAll(i.id),u.getList({request_from:"weixin",user_id:i.id}),l.trigger("spa:closeloader")}a.resolve(),s.prevPage=e(".spa-page-empty")},beforeclose:function(e,t){t.resolve(),s.switchPopGesture(!1)}}});
+define(["$","template","IScroll","product","user","native","config","address"],function(e,t,n,r,i,s,o,u){function a(e){e.preventDefault(),s.back()}return{title:"壹管家上门服务",body:"",init:function(t,n){var o=this,u=e(document);e.newTouch(".back-button",function(e){a.call(this,e)},o),o.on("tapBackButton",function(e){a.call(this,e)}),e.newTouch(".service-telephone",function(e){e.preventDefault(),s.call("4000328170")},o),e.newTouch(".btn-banner-recharge",function(e){e.preventDefault(),u.trigger("spa:navigate",{hash:"recharge",pushData:{needReload:!0}})},o),e.newTouch(".btn-banner-coupon",function(e){e.preventDefault(),u.trigger("spa:navigate",{hash:"myCoupon",pushData:{needReload:!0}})},o),e.newTouch(".btn-product",function(t){t.preventDefault();var n=parseInt(e(this).attr("data-product-type"));u.trigger("spa:navigate",{hash:"placeOrder",pushData:{product:r.allList[n-1],needReset:!0}})},o),e.newTouch(".btn-action-my-order",function(e){e.preventDefault(),u.trigger("spa:navigate",{hash:""})},o),e.newTouch(".btn-action-coupon",function(e){e.preventDefault(),i.checkLogin(function(){u.trigger("spa:navigate",{hash:"mine",pushData:{needReset:!0}})})},o),n.resolve()},beforeopen:function(e,t){localStorage.removeItem("cart_products"),t.resolve(),s.switchPopGesture(!0)},afteropen:function(s,a){var f=this,l=e(document);if(!s.pushData.dontNeedReload){l.trigger("spa:openloader");var c=t("home/index",{showNavBar:!o.isWX&&!o.isChubao});e(".spa-page-body",f).html(c),setTimeout(function(){s.scroll=new n("#homeScroll");var e=new Swiper(".swiper-container",{autoplay:2500,pagination:".swiper-pagination",paginationClickable:!0,simulateTouch:!1})},500),r.getListAll(i.id),u.getList({request_from:"weixin",user_id:i.id}),l.trigger("spa:closeloader")}a.resolve(),s.prevPage=e(".spa-page-empty")},beforeclose:function(e,t){t.resolve(),s.switchPopGesture(!1)}}});

File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/page/myCoupon.js


File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/page/placeOrder.js


+ 1 - 1
www/webapp/o2o/dist/js/page/rechargee.js

@@ -1 +1 @@
-define(["$","template","IScroll","recharge","native","config","user"],function(e,t,n,r,i,s,o){function u(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"mine",pushData:{dontNeedReload:!0}})}return{title:"充值卡",body:"",init:function(t,n){var i=this,s=e(document);i.on("swipeRight",function(e){u.call(this,e)}),e.newTouch(".back-button",function(e){u.call(this,e)},i),i.on("tapBackButton",function(e){u.call(this,e)}),e.newTouch(".btn-add-recharge",function(t){t.preventDefault(),s.trigger("spa:openloader");var n=e(this).attr("data-value");r.addRechargeorder({user_id:o.id,recharge_id:e(this).attr("data-id")},function(e){s.trigger("spa:closeloader"),e.success&&(o.orders[1].data.push({id:e.data._id.$id,products:[{product:{name:"充值"+n+"元"}}],final_price:e.data.price}),s.trigger("spa:navigate",{hash:"pay",pushData:{isRecharge:!0,orderID:e.data._id.$id,backHash:"recharge"}}))})},i),n.resolve()},beforeopen:function(e,t){t.resolve()},afteropen:function(i,o){var u=this,a=e(document);i.pushData.dontNeedReload||(a.trigger("spa:openloader"),r.getRechargeList(function(r){a.trigger("spa:closeloader");if(r.success){var o=t("recharge/index",{showNavBar:!s.isWX,recharges:r.data});e(".spa-page-body",u).html(o),setTimeout(function(){i.scroll=new n("#rechargeScroll")},500)}})),o.resolve()},beforeclose:function(e,t){t.resolve()}}});
+define(["$","template","IScroll","recharge","native","config","user"],function(e,t,n,r,i,s,o){function u(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}return{title:"充值卡",body:"",init:function(t,n){var i=this,s=e(document);i.on("swipeRight",function(e){history.go(-1)}),e.newTouch(".back-button",function(e){history.go(-1)},i),i.on("tapBackButton",function(e){history.go(-1)}),e.newTouch(".btn-add-recharge",function(t){t.preventDefault(),s.trigger("spa:openloader");var n=e(this).attr("data-value");r.addRechargeorder({user_id:o.id,recharge_id:e(this).attr("data-id")},function(e){s.trigger("spa:closeloader"),e.success&&(o.orders[1].data.push({id:e.data._id.$id,products:[{product:{name:"充值"+n+"元"}}],final_price:e.data.price}),s.trigger("spa:navigate",{hash:"pay",pushData:{isRecharge:!0,orderID:e.data._id.$id,backHash:"recharge"}}))})},i),n.resolve()},beforeopen:function(e,t){t.resolve()},afteropen:function(i,o){var u=this,a=e(document);i.pushData.dontNeedReload||(a.trigger("spa:openloader"),r.getRechargeList(function(r){a.trigger("spa:closeloader");if(r.success){var o=t("recharge/index",{showNavBar:!s.isWX,recharges:r.data});e(".spa-page-body",u).html(o),setTimeout(function(){i.scroll=new n("#rechargeScroll")},500)}})),o.resolve()},beforeclose:function(e,t){t.resolve()}}});

+ 5 - 7
www/webapp/o2o/js/build/template.js

@@ -852,7 +852,7 @@ $out+=' <p class="bold">联系电话: <a class="service-telephone">021-62109097<
 }
 $out+=' <br> </div> </div> </div> ';
 return new String($out);
-});/*v:66*/
+});/*v:68*/
 template('home/index',function($data,$filename
 /**/) {
 'use strict';var $utils=this,$helpers=$utils.$helpers,showNavBar=$data.showNavBar,$out='';if(showNavBar ){
@@ -1434,7 +1434,7 @@ $out+=' <div class="content"> <div class="box-container"> <div class="box-contai
 include('./list');
 $out+=' </ul> </div> <div class="result-item btn-container prevent-scroll"> <div class="cost"> 总计 <span class="order-cost" data-pay="0">¥ 0</span> </div> <a class="btn btn-main btn-block btn-place">确认预约</a> </div> </div> </div> </div> ';
 return new String($out);
-});/*v:75*/
+});/*v:77*/
 template('placeOrder/index',function($data,$filename
 /**/) {
 'use strict';var $utils=this,$helpers=$utils.$helpers,showNavBar=$data.showNavBar,$escape=$utils.$escape,title=$data.title,imgSrc=$data.imgSrc,extra=$data.extra,$each=$utils.$each,e=$data.e,$index=$data.$index,type=$data.type,petName=$data.petName,petWeight=$data.petWeight,extraServiceType=$data.extraServiceType,extraService=$data.extraService,extraServiceList=$data.extraServiceList,i=$data.i,beauticianName=$data.beauticianName,showCoupon=$data.showCoupon,productType=$data.productType,petPrice=$data.petPrice,precedence=$data.precedence,couponVal=$data.couponVal,balance=$data.balance,$out='';if(showNavBar ){
@@ -1442,13 +1442,11 @@ $out+=' <header class="bar bar-nav"> <a class="left-button back-button"> <div cl
 $out+=$escape(title);
 $out+='</h1> </header> ';
 }
-$out+=' <div class="content"> <div class="box-container"> <div class="box-container box box-vertical"> <div id="placeOrderScroll" class="scroll-container box-flex-1"> <div class="scroller"> <div class=""> <ul class="table-view product-pic-o2o"> <li id="product-pic-bg"> <!--<a class="navigate-right product-pic" style="background-image: url(';
+$out+=' <div class="content"> <div class="box-container"> <div class="box-container box box-vertical"> <div id="placeOrderScroll" class="scroll-container box-flex-1"> <div class="scroller"> <div class=""> <ul class="table-view product-pic-o2o"> <li id="product-pic-bg"> <img src="';
 $out+=$escape(imgSrc);
-$out+=');min-height: 250px;background-position: 50% 50%;"> </a>--> <img src="';
-$out+=$escape(imgSrc);
-$out+='" style="width: 100%;" alt=""> <div class="product-name" style="margin-top: -0.3rem">';
+$out+='" style="width: 100%;" alt=""> <div class="product-name">';
 $out+=$escape(title);
-$out+='详情及评价 <span>&gt;&gt;&gt;</span></div> </li> </ul>  ';
+$out+='详情及评价 <span id="hot">&gt;&gt;&gt;</span></div> <div class="product-img"></div> </li> </ul>  ';
 if(extra){
 $out+=' <div class="table-view main-service"> <p class="main-service-title">请选择</p> ';
 $each(extra,function(e,$index){

+ 0 - 2
www/webapp/o2o/js/model/product.js

@@ -1138,12 +1138,10 @@ define(['base', '$', 'api'], function (base, $, api) {
         //列出所有的产品
         Product.prototype.getListAll = function (userID, callback) {
             var that = this;
-            console.log(callback);
             api.getProductList({
                 user_id: userID,
                 // type: type
             }, function (res) {
-                console.log("lalal");
                 if (res.success) {
                     that.productList = {};
                     var petDic = {};

+ 11 - 7
www/webapp/o2o/js/page/home.js

@@ -45,8 +45,8 @@ define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config', 'addr
 
                 native.call('4000328170');
             }, $view);
-            //点击banner-1进入充值卡页
-            $.newTouch('.btn-banner-recharge',function(event){
+            //点击banner-1进入充值卡页
+            $.newTouch('.btn-banner-recharge', function (event) {
                 event.preventDefault();
                 $doc.trigger('spa:navigate', {
                     hash: 'recharge',
@@ -54,14 +54,17 @@ define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config', 'addr
                         needReload: true
                     }
                 });
-            },$view);
+            }, $view);
             //点击banner-2进入充值卡页面
-            $.newTouch('.btn-banner-coupon',function(event){
+            $.newTouch('.btn-banner-coupon', function (event) {
                 event.preventDefault();
                 $doc.trigger('spa:navigate', {
-                    hash: 'myCoupon'
+                    hash: 'myCoupon',
+                    pushData: {
+                        needReload: true
+                    }
                 });
-            },$view);
+            }, $view);
             /* 点击产品列表的某一项 */
             $.newTouch('.btn-product', function (event) {
                 event.preventDefault();
@@ -232,7 +235,8 @@ define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config', 'addr
                     var swiper = new Swiper('.swiper-container', {
                         autoplay: 2500,
                         pagination: '.swiper-pagination',
-                        paginationClickable: true
+                        paginationClickable: true,
+                        simulateTouch : false
                     });
                 }, 500);
 

+ 7 - 4
www/webapp/o2o/js/page/myCoupon.js

@@ -2,7 +2,7 @@ define(['$', 'template', 'user', 'config', 'IScroll'], function ($, template, us
     function back(event) {
         event.preventDefault();
         $(document).trigger('spa:navigate', {
-            hash: 'mine',
+            hash: '',
             pushData: {
                 dontNeedReload: true
             }
@@ -29,15 +29,18 @@ define(['$', 'template', 'user', 'config', 'IScroll'], function ($, template, us
 
             // 返回
             $view.on('swipeRight', function (event) {
-                back.call(this, event);
+                //back.call(this, event);
+                history.go(-1);
             });
 
             $.newTouch('.back-button', function (event) {
-                back.call(this, event);
+                //back.call(this, event);
+                history.go(-1);
             }, $view);
 
             $view.on('tapBackButton', function (event) {
-                back.call(this, event);
+                //back.call(this, event);
+                history.go(-1);
             });
 
             // 兑换

+ 19 - 1
www/webapp/o2o/js/page/placeOrder.js

@@ -251,6 +251,25 @@ define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', '
                 });
             }, $view);
 
+            /*特效*/
+            //var hot = document.getElementById('hot');
+            /*console.log($('#hot').style.color);*/
+            var hotS=1;
+            //$("#hot").fadeIn("slow");
+            //$('#hot').fadeOut("slow");
+            setInterval(function run() {
+                /*if(hotS==1){
+                    //$('#hot').css('display','none') ;
+                    $("#hot").fadeIn();
+                    hotS++;
+                }else {
+                    //$('#hot').css('display','inline') ;
+                    $('#hot').fadeOut();
+                    hotS=1;
+                }*/
+                $('.product-img').fadeToggle();
+
+            },1000);
             /* 点击选择extra。 */
             $.newTouch('.btn-main-service', function (event) {
                 /* on代表这一条的选中状态。如果已经选中了,就return。this的作用域是这一条extra。 */
@@ -774,7 +793,6 @@ define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', '
                 }
 
 
-
                 var payChannel = 'wx_pub';
 
                 /* 使备注输入框失去焦点,获取值 */

+ 7 - 4
www/webapp/o2o/js/page/rechargee.js

@@ -3,7 +3,7 @@ define(['$', 'template', 'IScroll', 'recharge', 'native', 'config', 'user'], fun
     function back(event) {
         event.preventDefault();
         $(document).trigger('spa:navigate', {
-            hash: 'mine',
+            hash: '',
             pushData: {
                 dontNeedReload: true
             }
@@ -24,15 +24,18 @@ define(['$', 'template', 'IScroll', 'recharge', 'native', 'config', 'user'], fun
 
             // 返回
             $view.on('swipeRight', function (event) {
-                back.call(this, event);
+                //back.call(this, event);
+                history.go(-1);
             });
 
             $.newTouch('.back-button', function (event) {
-                back.call(this, event);
+                //back.call(this, event);
+                history.go(-1);
             }, $view);
 
             $view.on('tapBackButton', function (event) {
-                back.call(this, event);
+                //back.call(this, event);
+                history.go(-1);
             });
 
             // 点击充值

+ 2 - 1
www/webapp/o2o/package.json

@@ -5,7 +5,8 @@
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1",
     "css": "node r.js -o cssIn=css/main.css out=dist/css/main.css optimizeCss=standard",
-    "js": "node r.js -o build.js"
+    "js": "node r.js -o build.js",
+    "html":"tmod tpl"
   },
   "author": "",
   "license": "ISC",

+ 2 - 4
www/webapp/o2o/tpl/placeOrder/index.html

@@ -15,11 +15,9 @@
                     <div class="">
                         <ul class="table-view product-pic-o2o">
                             <li id="product-pic-bg">
-                                <!--<a class="navigate-right product-pic"
-                                   style="background-image: url({{imgSrc}});min-height: 250px;background-position: 50% 50%;">
-                                </a>-->
                                 <img src="{{imgSrc}}" style="width: 100%;" alt="">
-                                <div class="product-name" style="margin-top: -0.3rem">{{title}}详情及评价 <span>&gt;&gt;&gt;</span></div>
+                                <div class="product-name">{{title}}详情及评价 <span id="hot">&gt;&gt;&gt;</span></div>
+                                <div class="product-img"></div>
                             </li>
                         </ul>
                         <!-- 选择extra -->

Some files were not shown because too many files changed in this diff