jmx 9 rokov pred
rodič
commit
bcc8b34306

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/js/build/template.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/js/main.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/js/model/product.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/js/page/product.js


+ 11 - 11
www/webapp/o2o/js/build/template.js

@@ -1618,10 +1618,10 @@ $out+=$escape(extraServiceList.price);
 $out+='</span> </div> ';
 });
 return new String($out);
-});/*v:1*/
+});/*v:4*/
 template('product/index',function($data,$filename
 /**/) {
-'use strict';var $utils=this,$helpers=$utils.$helpers,showNavBar=$data.showNavBar,$escape=$utils.$escape,title=$data.title,type=$data.type,commentCounts=$data.commentCounts,isShowVideo=$data.isShowVideo,productClassName=$data.productClassName,$each=$utils.$each,picLists=$data.picLists,picList=$data.picList,$index=$data.$index,tips=$data.tips,desc=$data.desc,note=$data.note,fromHome=$data.fromHome,$out='';if(showNavBar ){
+'use strict';var $utils=this,$helpers=$utils.$helpers,showNavBar=$data.showNavBar,$escape=$utils.$escape,title=$data.title,type=$data.type,commentCounts=$data.commentCounts,isShowVideo=$data.isShowVideo,$each=$utils.$each,picLists=$data.picLists,pic=$data.pic,$index=$data.$index,tips=$data.tips,desc=$data.desc,note=$data.note,fromHome=$data.fromHome,$out='';if(showNavBar ){
 $out+=' <header class="bar bar-nav"> <a class="left-button back-button"> <div class="icon icon-left-nav"></div> </a> <h1 class="title">';
 $out+=$escape(title);
 $out+='</h1> </header> ';
@@ -1640,17 +1640,15 @@ $out+='> <div class="box-container type-container" id="descContainer"> <div clas
 if(isShowVideo){
 $out+=' <div class="video" style="margin-bottom: -8px;"> <iframe src="/webapp/static/introduce.html" id="iframe-service-introduce" frameborder="0" style="width: 100%"></iframe> </div> ';
 }
-$out+=' <div class="img-list ';
-$out+=$escape(productClassName.className);
-$out+='"> <div class="img-list-container"> ';
-$each(picLists.imglists,function(picList,$index){
+$out+=' <div class="img-list"> <div class="img-list-container"> ';
+$each(picLists,function(pic,$index){
 $out+=' <img src="';
-$out+=$escape(picLists.url);
-$out+='/';
-$out+=$escape(picList);
+$out+=$escape(pic);
 $out+='" alt=""> ';
 });
-$out+=' </div> </div> <div class="notes"> <div class="group-title-container"> <div class="group-title">注意事项</div> </div> <ul class="group-detail hide"> <li> <ul> ';
+$out+=' </div> </div> ';
+if(tips ){
+$out+=' <div class="notes"> <div class="group-title-container"> <div class="group-title">注意事项</div> </div> <ul class="group-detail hide"> <li> <ul> ';
 $each(tips.descs,function(desc,$index){
 $out+=' <li> <p>';
 $out+=$escape(desc);
@@ -1662,7 +1660,9 @@ $out+=' <li> <p>';
 $out+=$escape(note);
 $out+='</p> </li> ';
 });
-$out+=' </ul> </div> </div> </div> </div> ';
+$out+=' </ul> </div> ';
+}
+$out+=' </div> </div> </div> ';
 if(fromHome){
 $out+=' <div class="btn-container prevent-scroll"> <a class="btn btn-main btn-block btn-next">立即下单</a> </div> ';
 }

+ 6 - 119
www/webapp/o2o/js/model/product.js

@@ -46,7 +46,7 @@ define(['base', '$', 'api'], function (base, $, api) {
                 desc: [
                     {
                         "type": 1,
-                        "content": "http://odqeoyzxd.bkt.clouddn.com/image/image_rc.jpg"
+                        "content": "http://odqeoyzxd.bkt.clouddn.com/image/image_cm.jpg"
                     },
                     {
                         "type": 2,
@@ -140,7 +140,7 @@ define(['base', '$', 'api'], function (base, $, api) {
                 desc: [
                     {
                         "type": 1,
-                        "content": "http://odqeoyzxd.bkt.clouddn.com/image/image_sj.jpg"
+                        "content": "http://odqeoyzxd.bkt.clouddn.com/image/image_cm.jpg"
                     },
                     {
                         "type": 2,
@@ -173,11 +173,11 @@ define(['base', '$', 'api'], function (base, $, api) {
                 desc: [
                     {
                         "type": 1,
-                        "content": "http://odqeoyzxd.bkt.clouddn.com/image/image_rc.jpg"
+                        "content": "http://odqeoyzxd.bkt.clouddn.com/image/image_cm.jpg"
                     },
                     {
                         "type": 2,
-                        "content": "日常清洁"
+                        "content": "钟点工"
                     }
                 ],
                 price: 35
@@ -448,125 +448,12 @@ define(['base', '$', 'api'], function (base, $, api) {
 
     //获得商品照片组
     Product.prototype.getGroupPics = function (type) {
-        var imglists = [];
-        switch (type) {
-            case 1:// 洗澡-钟点工
-                imglists = [
-                    '20151030-1-1.jpg'
-                ];
-                break;
-            case 2: // 剃光-除螨杀菌
-                imglists = [
-                    '20151030-2-1.jpg'
-                ];
-                break;
-            case 3:// 美容-深度清洁
-                imglists = [
-                    '20151030-3-1.jpg'
-                ];
-                break;
-            case 4:// 洁牙-住家保姆
-                imglists = [
-                    '20151030-4-1.jpg'
-                ];
-                break;
-            case 5:// SPA-日常清洁
-                imglists = [
-                    '20151202-5-1.jpg'
-                ];
-                break;
-            case 6:// 训犬-育儿嫂
-                imglists = [
-                    '20151224-6-1.jpg'
-                ];
-                break;
-            case 7:// 断尾-月子套餐
-                imglists = [
-                    '20160106-7-1.jpg'
-                ];
-                break;
-            case 8:// 碳酸浴-金牌月嫂
-                imglists = [
-                    '20160111-8-1.jpg'
-                ];
-                break;
-            case 11:// 驱虫-催乳服务
-                imglists = [
-                    '20151030-6-1.jpg'
-                ];
-                break;
-            case 12:
-                imglists = [
-                    '20151030-7-1.jpg'
-                ];
-                break;
-            case 13:
-                imglists = [
-                    '20151030-8-1.jpg'
-                ];
-            default:
-                break;
-        }
-        return {
-            imglists: imglists,
-            url: 'http://wozhua-others.qiniudn.com'
-        }
+        return [this.list[parseInt(type)].desc[0].content];
     }
 
     //得到商品名称组
     Product.prototype.getGroupName = function (type) {
-        var name = '';
-
-        switch (type) {
-            case 1:
-                name = '宠物洗澡';
-                /*宠物洗澡*/
-                break;
-            case 2:
-                name = '宠物剃光';
-                /*宠物剃光*/
-                break;
-            case 3:
-                name = '宠物美容';
-                /*宠物美容*/
-                break;
-            case 4:
-                name = '宠物洁牙';
-                /*宠物洁牙*/
-                break;
-            case 5:
-                name = '宠物SPA';
-                /*宠物SPA*/
-                break;
-            case 6:
-                name = '宠物训犬';
-                /*宠物训犬*/
-                break;
-            case 7:
-                name = '宠物断尾';
-                /*宠物断尾*/
-                break;
-            case 8:
-                name = '碳酸浴';
-                /*碳酸浴*/
-                break;
-            case 11:
-                name = '宠物驱虫';
-                /*宠物驱虫*/
-                break;
-            case 12:
-                name = '宠物药浴';
-                /*宠物药浴*/
-                break;
-            case 13:
-                name = '一次性局部染色';
-                /*一次性局部染色*/
-                break;
-            default:
-                break;
-        }
-
-        return name;
+        return this.list[parseInt(type)].desc[1].content;
     };
 
     //获得详细的组名

+ 14 - 24
www/webapp/o2o/js/page/product.js

@@ -1,5 +1,5 @@
 define(['$', 'template', 'product', 'cart', 'api', 'order', 'user', 'config', 'review', 'native'], function ($, template, product, cart, api, order, user, config, review, native) {
-    function back(event, type) {
+    function back(event) {
         event.preventDefault();
         var hash = 'placeOrder';
         if (cachePageData.fromHome) {
@@ -62,14 +62,14 @@ define(['$', 'template', 'product', 'cart', 'api', 'order', 'user', 'config', 'r
                 if (isShowVideo()) {
                     $('#iframe-service-introduce', $view).contents().find('video')[0].pause();
                 }
-                back.call(this, event, cachePageData.productType);
+                back.call(this, event);
             }, $view);
 
             $view.on('tapBackButton', function (event) {
                 if (isShowVideo()) {
                     $('#iframe-service-introduce', $view).contents().find('video')[0].pause();
                 }
-                back.call(this, event, cachePageData.productType);
+                back.call(this, event);
             });
 
             //返回
@@ -77,13 +77,13 @@ define(['$', 'template', 'product', 'cart', 'api', 'order', 'user', 'config', 'r
                 if (isShowVideo()) {
                     $('#iframe-service-introduce', $view).contents().find('video')[0].pause();
                 }
-                back.call(this, event, cachePageData.productType);
+                back.call(this, event);
             });
 
             // 提示信息
             $.newTouch('.btn-product-info', function (event) {
                 $doc.trigger('spa:navigate', {
-                    hash: 'product-info/' + cachePageData.productType,
+                    hash: 'product-info/' + cachePageData.product.type,
                     pushData: {
                         needReload: cachePageData.needReload,
                         fromHome: cachePageData.fromHome
@@ -131,10 +131,9 @@ define(['$', 'template', 'product', 'cart', 'api', 'order', 'user', 'config', 'r
                     case 2:
                         $('#reviewContainer').show();
                         if (cachePageData.needReloadReview) {
-                            var productType = cachePageData.productType;
                             cachePageData.needReloadReview = false;
                             $doc.trigger('spa:openloader');
-                            review.getList(productType, function (res) {
+                            review.getList(cachePageData.product.type, function (res) {
                                 $doc.trigger('spa:closeloader');
                                 var hasMore = true;
                                 if (res.current_page >= res.sum_page) {
@@ -165,7 +164,7 @@ define(['$', 'template', 'product', 'cart', 'api', 'order', 'user', 'config', 'r
             $.newTouch('.img-preview', function (event) {
                 var current = $(this).attr('data-src');
                 var i = $(this).parents('.table-view-cell').index();
-                var imgList = review['reviewDatas'][cachePageData.productType]['list'][i]['pics'];
+                var imgList = review['reviewDatas'][cachePageData.product.type]['list'][i]['pics'];
                 var imgLists = [];
                 imgList.forEach(function (item, index) {
                     imgLists.push(item.url)
@@ -176,7 +175,7 @@ define(['$', 'template', 'product', 'cart', 'api', 'order', 'user', 'config', 'r
             //加载更多
             $.newTouch('.btn-more-review', function (event) {
                 $doc.trigger('spa:openloader');
-                review.getList(cachePageData.productType, function (res) {
+                review.getList(cachePageData.product.type, function (res) {
                     $doc.trigger('spa:closeloader');
                     if (res.success) {
                         var hasMore = true;
@@ -195,12 +194,10 @@ define(['$', 'template', 'product', 'cart', 'api', 'order', 'user', 'config', 'r
                     $('#iframe-service-introduce', $view).contents().find('video')[0].pause();
                 }
                 event.preventDefault();
-                var productType = cachePageData.productType;
                 $doc.trigger('spa:navigate', {
                     hash: 'placeOrder',
                     pushData: {
-                        productType: productType,
-                        serviceType: productType,
+                        product: cachePageData.product,
                         needReset: true
                     }
                 });
@@ -222,14 +219,12 @@ define(['$', 'template', 'product', 'cart', 'api', 'order', 'user', 'config', 'r
             var pushData = pageData.pushData;
 
             //渲染空页面
-            cachePageData.productType = pushData.produc.type;
+            cachePageData.product = pushData.produc;
             cachePageData.needReload = pushData.needReload;
-            cachePageData.fromHome = pushData.fromHome;
             if (cachePageData.needReload) {
                 cachePageData.needReloadReview = true;
                 var commentCounts = 0;
-                var productType = cachePageData.productType;
-                var fromHome = cachePageData.fromHome;
+                var productType = cachePageData.product.type;
                 $doc.trigger('spa:openloader');
                 review.getList(productType, function (res) {
                     $doc.trigger('spa:closeloader');
@@ -237,21 +232,16 @@ define(['$', 'template', 'product', 'cart', 'api', 'order', 'user', 'config', 'r
                     if (res.success) {
                         commentCounts = res.sum_count;
                         var d = new Image();
-                        var url = product.getGroupPics(productType).imglists[0];
-                        d.src = product.getGroupPics(productType).url + '/' + url;
+                        d.src = product.getGroupPics(productType)[0];
                         d.onload = function () {
                             var tpl = template('product/index', {
                                 type: productType,
                                 title: product.getGroupName(productType),
-                                fullName: product.getGroupFullName(productType),
-                                productClassName: product.getProductTitle(productType),
-                                tips: product.getGroupDesc(productType),
+                                // tips: product.getGroupDesc(productType),
                                 picLists: product.getGroupPics(productType),
-                                clientW: document.body.clientWidth * 2,
                                 commentCounts: commentCounts,
-                                fromHome: fromHome,
                                 showNavBar: !config.isWX && !config.isChubao,
-                                isShowVideo: isShowVideo()
+                                // isShowVideo: isShowVideo()
                             });
                             $('.spa-page-body', $view).html(tpl);
                             if (cachePageData.scroll) {

+ 5 - 3
www/webapp/o2o/tpl/product/index.html

@@ -26,13 +26,14 @@
                 <iframe src="/webapp/static/introduce.html" id="iframe-service-introduce" frameborder="0" style="width: 100%"></iframe>
               </div>
               {{/if}}
-              <div class="img-list {{productClassName.className}}">
+              <div class="img-list">
                 <div class="img-list-container">
-                  {{ each picLists.imglists as picList}}
-                  <img src="{{picLists.url}}/{{picList}}" alt="">
+                  {{ each picLists as pic}}
+                  <img src="{{pic}}" alt="">
                   {{/each}}
                 </div>
               </div>
+              {{ if tips }}
               <div class="notes">
                 <div class="group-title-container">
                   <div class="group-title">注意事项</div>
@@ -54,6 +55,7 @@
                   {{/each}}
                 </ul>
               </div>
+              {{/if}}
             </div>
           </div>
         </div>

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov