From 3bc16a1d3afee0d1ba5c39b1415309e1fe2c63a1 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 11 六月 2020 10:13:17 +0800 Subject: [PATCH] Merge branch 'master' of ssh://193.112.35.168:29418/flqFront --- AppInside/cloudPushOrder/cloudPushOrderManage.html | 255 ++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 211 insertions(+), 44 deletions(-) diff --git a/AppInside/cloudPushOrder/cloudPushOrderManage.html b/AppInside/cloudPushOrder/cloudPushOrderManage.html index 6404128..6977fd3 100644 --- a/AppInside/cloudPushOrder/cloudPushOrderManage.html +++ b/AppInside/cloudPushOrder/cloudPushOrderManage.html @@ -15,6 +15,12 @@ <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> <script src="http://img.flqapp.com/resource/js/app2019112217.js"></script> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> + <link href="css/load.css" rel="stylesheet" /> + <style type="text/css"> + [v-cloak] { + display: none !important; + } + </style> </head> <body> <div id="root"> @@ -37,7 +43,7 @@ </div> <!-- 浜戝彂鍗曠鐞� --> - <div v-if="selectTabType==1" class="div_cloudPushOrderManage"> + <div v-if="selectTabType==1" class="div_cloudPushOrderManage" v-cloak> <div class="div_top_header"> <div class="" style="display: -webkit-flex;"> <img :src="userInfo.portrait" class="headPortrait"> @@ -55,7 +61,7 @@ </div> </div> <!-- 浜戝彂鍗曠鐞嗘湭鐧诲綍 --> - <div v-if="!isWxLogin" class="div_cloudPushOrderManage_notLogin"> + <div v-if="!isWxLogin" class="div_cloudPushOrderManage_notLogin" v-cloak> <div class="div_cloudPushOrderManage_notLogin_content1"> <div class="login_wx" @click="loginWX()"> <p>鐧诲綍寰俊</p> @@ -113,7 +119,7 @@ </div> </div> <!-- 浜戝彂鍗曠鐞嗗凡缁忕櫥褰� --> - <div v-if="isWxLogin" class="div_cloudPushOrderManage_login"> + <div v-if="isWxLogin" class="div_cloudPushOrderManage_login" v-cloak> <div class="div_cloudPushOrderManage_login_content1"> <div style="display: -webkit-flex; justify-content: space-between;"> <div> @@ -170,7 +176,8 @@ <div style="height: 0.2rem;"></div> </div> - <div v-if="selectTabType==2" class="div_goodsLibrary"> + <!-- 鍙戝崟鍟嗗搧搴� --> + <div v-if="selectTabType==2" class="div_goodsLibrary" v-cloak> <div class="div_goodsLibrary_content1"> <div> <div style="color: #333333;font-size: 0.34rem;height: 0.34rem; display: -webkit-flex;align-items: center;margin-left: 0.25rem;margin-top: 0.23rem;"> @@ -180,7 +187,10 @@ 瀹樻柟绮鹃��1涓皬鏃跺唴浠呭彂閫佷竴涓晢鍝侊紙9:00~21:00锛� </div> </div> - <img src="img/icon_off.png" style="width: 1.02rem;height: 0.62rem;margin-top: 0.27rem;margin-right: 0.2rem;"> + <img v-if="!official" src="img/icon_off.png" style="width: 1.02rem;height: 0.62rem;margin-top: 0.27rem;margin-right: 0.2rem;" + @click="openGFRecomend"> + <img v-else src="img/icon_on.png" style="width: 1.02rem;height: 0.62rem;margin-top: 0.27rem;margin-right: 0.2rem;" + @click="openGFRecomend"> </div> <div class="div_goodsLibrary_content2"> @@ -192,49 +202,74 @@ 鍗抽�夊嵆鍙戯紝娉ㄩ噸璐ㄩ噺涓嶈拷姹傛暟閲忥紝閬垮厤楠氭壈缇ゅ弸 </div> </div> - <img src="img/icon_off.png" style="width: 1.02rem;height: 0.62rem;margin-top: 0.27rem;margin-right: 0.2rem;"> + <img v-if="!custom" src="img/icon_off.png" style="width: 1.02rem;height: 0.62rem;margin-top: 0.27rem;margin-right: 0.2rem;" + @click="openFSGoods"> + <img v-else src="img/icon_on.png" style="width: 1.02rem;height: 0.62rem;margin-top: 0.27rem;margin-right: 0.2rem;" + @click="openFSGoods"> </div> <div class="div_goodsLibraryList"> - <div class="div_item_goodsLibrary" v-for="(item, index) in goodsList"> - <div> - <img v-bind:src="goodsList.img" class="goodsimg" /> - </div> + <div class="div_item_goodsLibrary" v-for="(item, index) in goodsList"> + + <div class="div_goodsBG"> + <img v-bind:src="item.goods.picUrl" class="goodsimg" /> + <img v-if="item.goods.state==2" src="img/icon_send.png" class="topleftImg"> + <img v-else-if="item.goods.state==1" src="img/icon_ydown.png" class="topleftImg"> + </div> + <div class="div_item_rightBg"> <div class="div_goods_title_bg"> - <img src="img/icon_tb.png"> - <span class="goods_title">{{item.title}}</span> + + <img v-if="item.goods.shopType==10" src="img/icon_tb.png"> + <img v-else-if="item.goods.shopType==11" src="img/icon_tm.png"> + <img v-else-if="item.goods.shopType==20" src="img/icon_jd.png"> + <img v-else-if="item.goods.shopType==30" src="img/icon_pdd.png" style="width: 0.81rem;"> + <img v-else-if="item.goods.shopType==40" src="img/icon_wph.png" style="width: 0.9rem;"> + <img v-else-if="item.goods.shopType==50" src="img/icon_sn.png" style="width: 1.12rem;"> + + <span v-if="item.goods.shopType==30" class="goods_title" style="text-indent: 0.93rem;">{{item.goods.title}}</span> + <span v-else-if="item.goods.shopType==40" class="goods_title" style="text-indent: 1.02rem;">{{item.goods.title}}</span> + <span v-else-if="item.goods.shopType==50" class="goods_title" style="text-indent: 1.24rem;">{{item.goods.title}}</span> + <span v-else class="goods_title">{{item.goods.title}}</span> </div> - <div class="div_goods_labels_bg"> - <div class="div_goods_label1"> 鍏泭瀹濊礉 </div> + <div v-if="item.goods.labels" class="div_goods_labels_bg"> + <div class="div_goods_label1"> {{item.goods.labels[0].content}} </div> <div class="div_goods_label2"> 澶忓鐖嗘 </div> - </div> + </div> + <div class="div_store_bg"> - <img src="img/icon_store.png"> - <div>{{item.store}}</div> + <img v-if="item.goods.shopInfo" src="img/icon_store.png"> + <div v-if="item.goods.shopInfo">{{item.goods.shopInfo.shopName}}</div> </div> <div class="div_coupon_bg"> - <div v-if="item.type==1" style="color: white;font-size: 0.24rem;font-weight: bold;width: 0.41rem;height: 0.36rem;background-color: #E5005C;display: flex;align-items: center;justify-content: center;border-radius: 0.06rem 0 0 0.06rem;"> + <div v-if="item.goods.shopType!=40&&item.goods.hasCoupon" style="color: white;font-size: 0.24rem;font-weight: bold;width: 0.41rem;height: 0.36rem;background-color: #E5005C;display: flex;align-items: center;justify-content: center;border-radius: 0.06rem 0 0 0.06rem;"> 鍒� </div> - <div v-else style="color: white;font-size: 0.24rem;background-color: #E5005C;border-radius: 0.06rem;"> - 2.5鎶� + <div v-else-if="item.goods.shopType==40" style="color: white;font-size: 0.24rem;background-color: #E5005C;border-radius: 0.06rem;"> + {{item.goods.discount}} </div> - <div v-if="item.type==1" class="coupon_money"> 锟�15 </div> - <div class="fanli_title"> 杩旓骏9.9 </div> + <div v-if="item.goods.shopType!=40&&item.goods.hasCoupon" class="coupon_money"> 锟{item.goods.couponInfo.amount}} + </div> + + <div class="fanli_title"> 杩攞{item.goods.moneyInfo.fanliMoney}} </div> </div> <div class="div_payment_sales_bg"> <div>锟�</div> - <div>0</div> - <div>锟�78.9</div> - <div v-if="item.type==1">鏈堥攢 8968</div> + + <div v-if="item.goods.couponPrice">{{item.goods.couponPrice}}</div> + <div v-else>{{item.goods.zkPrice}}</div> + + <div>锟{item.goods.zkPrice}}</div> + <div v-if="item.goods.shopType!=40">鏈堥攢 {{item.goods.salesCount}}</div> </div> </div> </div> </div> + + </div> <div class="dialogmask_notOpen"> @@ -242,7 +277,7 @@ <img src="img/icon_close.png" @click="hiddenDialog()"> <div class="dialog_title">鏈紑閫氭彁閱�</div> <div class="dialog_content">浜戝彂鍗曢鍏堣鐧诲綍寰俊锛屼笖闇�瑕佽喘涔颁簯鍙戝崟鏈嶅姟锛屽畬鎴愯缃悗锛屾墠浼氳嚜鍔ㄥ彂鍗�/鍙戝湀銆�</div> - <div class="dialog_commit" @click="commitAddTxRecord">鍘诲紑閫�</div> + <div class="dialog_commit" @click="pushOpenVip">鍘诲紑閫�</div> </div> </div> @@ -272,8 +307,11 @@ </div> </div> + <div v-show="selectTabType==2" class="loading-more"></div> </div> </body> + + <script src="js/load.js"></script> <script> // "http://api.flqapp.com"; @@ -281,26 +319,32 @@ var host1 = "http://192.168.1.114:8848"; var check = null; var wId = null; + $(function() { var app = new Vue({ el: '#root', data: { + selectTabType: 1, + page: 1, openState: false, // 鏄惁浜嗗紑閫氫簯鍙戝崟鏉冮檺 isWxLogin: false, // 鏄惁鐧诲綍浜嗗井淇� circle: false, // 鏈嬪弸鍦�-鏄惁寮�鍚� qrCodeUrl: null, userInfo: {}, dataList: [{}, {}], - goodsList: [{ - title: '鐗涗粩澶栧濂砳ns娼槬绉嬭闊╃増瀹芥澗鐧炬惌鏄ュ2019鏂版娴佽娓�...', - store: '涓夊彧鏉鹃紶瀹樻柟鏃楄埌搴�', - type: 1 - }, { - title: '鐗涗粩澶栧濂砳ns娼槬绉嬭闊╃増瀹芥澗鐧炬惌鏄ュ2019鏂版娴佽娓�...', - store: '涓夊彧鏉鹃紶瀹樻柟鏃楄埌搴�', - type: 2 - }, ] + custom: false, // 浼樺厛鍙戦�佽嚜閫夊晢鍝佸簱 + official: false, // 鑷姩閲囬泦瀹樻柟鎺ㄨ崘 + count: 0, + goodsList: [ + // { + // goods: { + // shopInfo: { + // shopName: null + // } + // } + // }, + ] }, watch: { @@ -308,14 +352,20 @@ methods: { selectTab: function(type) { if (app.selectTabType == type) return; - $('.div_header_line_' + type).css('opacity', '1') - $('.div_header_' + type).css('color', '#E5005C') + $('.div_header_line_' + type).css('opacity', '1'); + $('.div_header_' + type).css('color', '#E5005C'); - $('.div_header_line_' + app.selectTabType).css('opacity', '0') - $('.div_header_' + app.selectTabType).css('color', '#000000') + $('.div_header_line_' + app.selectTabType).css('opacity', '0'); + $('.div_header_' + app.selectTabType).css('color', '#000000'); - app.selectTabType = type + document.body.scrollTop = document.documentElement.scrollTop = 0; + app.selectTabType = type; app.stopMacloginCheck(); + if (type == 2) { //鍒囨崲鍒板彂鍗曞晢鍝佸簱 + app.page = 1; + app.fetchGoodsList(); + + } }, hiddenDialog: function() { @@ -324,11 +374,11 @@ $('.dialogmask_wx').css('display', 'none') app.stopMacloginCheck(); }, - + // 寮�閫氫簯鍙戝崟 openCloudPushOrder: function() { yesApp.jumpWeb(host1 + '/flqFront/AppInside/cloudPushOrder/openCloudPushOrder.html', null); }, - + // 鐧诲綍寰俊 loginWX: function() { if (app.openState) { app.fetchQrcodeMaclogin(); @@ -336,6 +386,29 @@ } else { yesApp.jumpWeb(host1 + '/flqFront/AppInside/cloudPushOrder/openCloudPushOrder.html', null); } + }, + + openGFRecomend: function() { + if (app.openState) { + + + } else { + $('.dialogmask_notOpen').css('display', 'block') + } + }, + + openFSGoods: function() { + if (app.openState) { + + + } else { + $('.dialogmask_notOpen').css('display', 'block') + } + }, + + pushOpenVip: function() { + $('.dialogmask_notOpen').css('display', 'none') + yesApp.jumpWeb(host1 + '/flqFront/AppInside/cloudPushOrder/openCloudPushOrder.html', null); }, commitAddTxRecord: function() { @@ -359,6 +432,7 @@ yesApp.hideLoading(); if (result.code == 0) { wid = result.data.wId; + app.qrCodeUrl = result.data.qrCodeUrl; $('.dialogmask_wx').css('display', 'block'); app.setMacloginCheck(); @@ -387,7 +461,7 @@ var uid = yesApp.getUid(); var params = { uid: uid, - wId: wId + wId: wid }; params = yesApp.getRequestBaseParams(params); $.ajax({ @@ -420,7 +494,7 @@ stopMacloginCheck: function() { clearInterval(check); }, - + // 浜戝彂鍗曞紑閫氫俊鎭� fetcCloudInfo: function() { yesApp.showLoading(); var uid = yesApp.getUid(); @@ -458,10 +532,103 @@ } } }); + }, + + // 鍙戝崟鍟嗗搧搴� + fetchGoodsList: function() { + yesApp.showLoading(); + var uid = yesApp.getUid(); + var params = { + uid: uid, + page: app.page + }; + params = yesApp.getRequestBaseParams(params); + $.ajax({ + type: "GET", + data: JSON.parse(params), + url: host + "/fanli/api/v2/user/cloud/getGoodsList", + dataType: "jsonp", + async: false, + success: function(result) { + yesApp.hideLoading(); + if (result.code == 0) { + app.custom = result.data.custom; + app.official = result.data.official; + + if (app.page == 1) { + app.goodsList = new Array(); + } + app.page += 1; + app.count = result.data.count; + + var list = app.goodsList.concat(result.data.list); + app.goodsList = list; + + + + if (app.count <= app.goodsList.length) { + load.noMore(); + } + + } else { + yesApp.toast(result.msg); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + yesApp.hideLoading(); + if (textStatus === 'timeout') { + setTimeout(function() {}, 2000); + } + } + }); } } }); app.fetcCloudInfo(); }); + + //锛堟祻瑙堝櫒绐楀彛涓婅竟鐣屽唴瀹归珮搴︼級 + function getDocumentTop() { + var scrollTop = 0, + bodyScrollTop = 0, + documentScrollTop = 0; + if (document.body) { + bodyScrollTop = document.body.scrollTop; + } + if (document.documentElement) { + documentScrollTop = document.documentElement.scrollTop; + } + scrollTop = (bodyScrollTop - documentScrollTop > 0) ? bodyScrollTop : documentScrollTop; + console.log("scrollTop:" + scrollTop); + return scrollTop; + } + + //鍙绐楀彛楂樺害锛堝睆骞曞彲浠ョ湅瑙佺殑楂樺害锛� + function getWindowHeight() { + var windowHeight = 0; + if (document.compatMode == "CSS1Compat") { + windowHeight = document.documentElement.clientHeight; + } else { + windowHeight = document.body.clientHeight; + } + console.log("windowHeight:" + windowHeight); + return windowHeight; + } + + //婊氬姩鏉℃粴鍔ㄩ珮搴︼紙鍗虫暣涓綉椤电殑楂樺害锛� + function getScrollHeight() { + var scrollHeight = 0, + bodyScrollHeight = 0, + documentScrollHeight = 0; + if (document.body) { + bodyScrollHeight = document.body.scrollHeight; + } + if (document.documentElement) { + documentScrollHeight = document.documentElement.scrollHeight; + } + scrollHeight = (bodyScrollHeight - documentScrollHeight > 0) ? bodyScrollHeight : documentScrollHeight; + console.log("scrollHeight:" + scrollHeight); + return scrollHeight; + } </script> </html> -- Gitblit v1.8.0