Commit fc0146911cf888547a3de19d6be258f7cbdccda8
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
12 changed files
with
77 additions
and
60 deletions
components/full_screen/full_screen.js
... | ... | @@ -21,28 +21,23 @@ Component({ |
21 | 21 | clearInterval(this.data.full_screen); |
22 | 22 | }, |
23 | 23 | }, |
24 | - | |
25 | - ready: function () { | |
26 | - var th=this; | |
27 | - setTimeout(function(){ | |
28 | - th.setData({hidden:1,}) | |
29 | - },2600) | |
30 | - }, | |
31 | - | |
24 | + | |
25 | + ready: function () {}, | |
32 | 26 | properties: {}, |
33 | 27 | methods: { |
34 | 28 | close_full_screen(){ |
35 | - this.setData({is_full_screen_show:0,sec_show:0,is_full_screen_men:0}); | |
29 | + this.setData({is_full_screen_show:0,sec_show:0}); | |
36 | 30 | }, |
37 | 31 | //-- 跳转到满屏广告的链接 -- |
38 | 32 | go_full_ad(){ |
39 | 33 | if(!this.data.full_ad) return false; |
40 | 34 | if(!this.data.full_ad.ad_weapplink) return false; |
41 | 35 | getApp().goto(this.data.full_ad.ad_weapplink); |
42 | - this.setData({is_full_screen_show:0,is_full_screen_men:0}); | |
43 | 36 | }, |
44 | 37 | get_the_full_screen(){ |
45 | - if(this.data.full_ad) return false; | |
38 | + if(this.data.full_ad) { | |
39 | + return false; | |
40 | + } | |
46 | 41 | var th=this; |
47 | 42 | //获取全屏的广告 |
48 | 43 | getApp().request.promiseGet("/api/weshop/ad/page?pid=1001&store_id=" + o.stoid,{ |
... | ... | @@ -53,8 +48,7 @@ Component({ |
53 | 48 | th.setData({ |
54 | 49 | is_full_screen_show:1, |
55 | 50 | full_ad:res.data.data.pageData[0], |
56 | - }) | |
57 | - | |
51 | + }) | |
58 | 52 | //--定时关闭-- |
59 | 53 | th.data.full_screen=setInterval(function(){ |
60 | 54 | if(!th.data.sec_show) { |
... | ... | @@ -65,16 +59,8 @@ Component({ |
65 | 59 | th.data.sec_show--; |
66 | 60 | th.setData({sec_show:th.data.sec_show}); |
67 | 61 | },1000) |
68 | - | |
69 | - | |
70 | - setTimeout(function(){ | |
71 | - th.setData({is_full_screen_men:0}); | |
72 | - },1000) | |
73 | - }else{ | |
74 | - th.setData({ | |
75 | - is_full_screen_men:0 | |
76 | - }) | |
77 | - } | |
62 | + | |
63 | + } | |
78 | 64 | }) |
79 | 65 | } |
80 | 66 | }, | ... | ... |
components/full_screen/full_screen.wxml
1 | 1 | <!-- 全屏控制 --> |
2 | -<view hidden="{{!is_full_screen_men || hidden}}" class="full_screen" style="background-color: #fff;"></view> | |
3 | 2 | <view wx:if="{{is_full_screen_show}}" class="full_screen" bindtap="go_full_ad" style="background-image: url('{{url+full_ad.ad_code}}');"> |
4 | 3 | <view catchtap="close_full_screen" class="skip_box">跳过 <text>{{sec_show}}</text></view> |
5 | 4 | </view> | ... | ... |
components/full_screen/full_screen.wxss
components/goods_list/goods_list.js
... | ... | @@ -37,7 +37,7 @@ Component({ |
37 | 37 | getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, { |
38 | 38 | isShowLoading:false, |
39 | 39 | success: function (e) { |
40 | - if(e.code==0 && e.data && e.data.data){ | |
40 | + if(e.data.code==0 && e.data && e.data.data){ | |
41 | 41 | getApp().globalData.userInfo = e.data.data; |
42 | 42 | getApp().getConfig2(function (e) { |
43 | 43 | var swithc_list = e.switch_list; | ... | ... |
images/banner.jpg deleted
33.7 KB
pages/goods/goodsList/goodsList.js
... | ... | @@ -66,6 +66,10 @@ Page({ |
66 | 66 | |
67 | 67 | if (0 != t.is_new && t.is_new != undefined) { url += "&is_new=" + t.is_new; } |
68 | 68 | if (0 != t.is_hot && t.is_hot != undefined) { url += "&is_hot=" + t.is_hot; } |
69 | + | |
70 | + if(getApp().globalData.userInfo){ | |
71 | + url += "&user_id=" + getApp().globalData.userInfo.user_id; | |
72 | + } | |
69 | 73 | |
70 | 74 | //优惠活动的凑单 |
71 | 75 | if(t.prom_type==3){ | ... | ... |
pages/goods/goodsList/goodsList.wxml
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | </view> |
29 | 29 | |
30 | 30 | </navigator> |
31 | - <navigator bindtap="changeTab" class="nav-item" data-href="prom_price" data-ad="{{adname}}"> | |
31 | + <navigator bindtap="changeTab" class="nav-item" data-href="final_price" data-ad="{{adname}}"> | |
32 | 32 | 价格 |
33 | 33 | <view class="ico-dg" wx:if="{{tabname=='final_price'}}"> |
34 | 34 | <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image> | ... | ... |
pages/goods/search/search.js
... | ... | @@ -107,6 +107,7 @@ Page({ |
107 | 107 | if (0 != t.brand_id && t.brand_id!=undefined){ url += "&brand_id=" + t.brand_id;} |
108 | 108 | if (0 != t.nation_id && t.nation_id!=undefined) { url += "&nation_id=" + t.nation_id;} |
109 | 109 | if (0 != t.max_price && t.max_price!=undefined) { url += "&min_pirce=" + t.min_pirce + "&max_price=" + t.max_price;} |
110 | + | |
110 | 111 | if (url != this.data.baseUrl) return this.requestSearch(url); |
111 | 112 | this.openSearchModal(); |
112 | 113 | |
... | ... | @@ -132,6 +133,10 @@ Page({ |
132 | 133 | //-----------真的调用地址进行搜索------------ |
133 | 134 | requestSearch: function(t) { |
134 | 135 | var a = this; |
136 | + | |
137 | + if(getApp().globalData.userInfo){ | |
138 | + t += "&user_id=" + getApp().globalData.userInfo.user_id; | |
139 | + } | |
135 | 140 | |
136 | 141 | this.data.requestUrl = t, |
137 | 142 | //t += "&orderField=" + a.data.tabname; | ... | ... |
pages/goods/search/search.wxml
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image> |
14 | 14 | </view> |
15 | 15 | </navigator> |
16 | - <navigator bindtap="changeTab" class="nav-item" data-href="prom_price" data-ad="{{adname}}">价格 | |
16 | + <navigator bindtap="changeTab" class="nav-item" data-href="final_price" data-ad="{{adname}}">价格 | |
17 | 17 | <view class="ico-dg" wx:if="{{tabname=='final_price'}}"> |
18 | 18 | <image class="wh100" src="{{url}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image> |
19 | 19 | <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image> | ... | ... |
pages/index/index/index.js
... | ... | @@ -248,16 +248,33 @@ Page({ |
248 | 248 | |
249 | 249 | var th = this; |
250 | 250 | |
251 | - var show=getApp().globalData.isLoad_ad; | |
252 | - var userInfo=getApp().globalData.userInfo; | |
251 | + var show=getApp().globalData.isLoad_ad; | |
252 | + setTimeout(function(){ | |
253 | + //user没有及时更新 | |
254 | + var userInfo=getApp().globalData.userInfo; | |
255 | + if(!userInfo || !userInfo.user_id) userInfo=null; | |
256 | + //有加载过一次首页,就显示 | |
257 | + if(show || userInfo || getApp().globalData.user_id){ | |
258 | + setTimeout(function(){ | |
259 | + var full_screen = th.selectComponent("#full_screen"); //组件的id | |
260 | + full_screen.get_the_full_screen(); | |
261 | + },800) | |
262 | + //动画效果 | |
263 | + if(!th.data.f_hidden){ | |
264 | + wx.showLoading({ | |
265 | + title:'加载中..' | |
266 | + }); | |
267 | + setTimeout(function(){ | |
268 | + th.setData({f_hidden:1}) | |
269 | + wx.hideLoading(); | |
270 | + },960) | |
271 | + } | |
272 | + }else{ | |
273 | + getApp().globalData.isLoad_ad=1; | |
274 | + } | |
275 | + },500) | |
276 | + | |
253 | 277 | |
254 | - //有加载过一次首页,就显示 | |
255 | - if(show || userInfo || getApp().globalData.user_id){ | |
256 | - var full_screen = th.selectComponent("#full_screen"); //组件的id | |
257 | - full_screen.get_the_full_screen(); | |
258 | - }else{ | |
259 | - getApp().globalData.isLoad_ad=1; | |
260 | - } | |
261 | 278 | |
262 | 279 | }, |
263 | 280 | //当隐藏的时候就关闭计时器 |
... | ... | @@ -371,7 +388,6 @@ Page({ |
371 | 388 | flash_data = e.data.data.pageData; |
372 | 389 | if (flash_data == null || flash_data.length <= 0) return false; |
373 | 390 | |
374 | - | |
375 | 391 | //当前时间戳 |
376 | 392 | var nt = ut.gettimestamp(); |
377 | 393 | |
... | ... | @@ -506,17 +522,17 @@ Page({ |
506 | 522 | th.is_new(); |
507 | 523 | } |
508 | 524 | |
509 | - setTimeout(function () { | |
510 | - if (getApp().globalData.user_id) getApp().requestCardNum(th); | |
511 | - },500) | |
525 | + setTimeout(function () { | |
526 | + if (getApp().globalData.user_id) getApp().requestCardNum(th); | |
527 | + },500) | |
512 | 528 | |
513 | 529 | }); |
514 | - | |
515 | - var goods_list = this.selectComponent("#goods_list"); //组件的id | |
516 | - goods_list.init(); | |
530 | + | |
517 | 531 | setTimeout(function() { |
518 | - goods_list.get_list(); | |
519 | - }, 300) | |
532 | + var goods_list = th.selectComponent("#goods_list"); //组件的id | |
533 | + goods_list.init(); | |
534 | + goods_list.get_list(); | |
535 | + }, 2000) | |
520 | 536 | }, |
521 | 537 | |
522 | 538 | //--判断小程序是否过期-- | ... | ... |
pages/index/index/index.wxml
1 | -<!-- <import src="../../tabbar/tabbar.wxml" /> --> | |
2 | -<!-- <template is="tabBar" data="{{tabBar}}"/> --> | |
1 | +<!-- <view hidden="{{f_hidden}}" class="full_screen" style="background-color: #fff;"></view> --> | |
2 | +<full_screen id="full_screen"></full_screen> | |
3 | 3 | <!--普通界面--> |
4 | 4 | <wxs module="filter" src="../../../utils/filter.wxs"></wxs> |
5 | + | |
5 | 6 | <view class="container rel" wx:if="{{ishow}}"> |
6 | 7 | <block wx:if="{{banner}}"> |
7 | 8 | <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image> |
... | ... | @@ -295,6 +296,8 @@ |
295 | 296 | |
296 | 297 | </view> |
297 | 298 | |
299 | + | |
300 | +<block wx:if="{{f_hidden}}"> | |
298 | 301 | <!--是否是自定义--> |
299 | 302 | <view class="container" wx:if="{{isTemplate}}" style="background-color:{{bgcolor_t}}"> |
300 | 303 | <!-- 置顶层 --> |
... | ... | @@ -390,6 +393,8 @@ |
390 | 393 | </block> |
391 | 394 | </view> |
392 | 395 | |
396 | +</block> | |
397 | + | |
393 | 398 | <!-- 蒙尘 --> |
394 | 399 | <block wx:if="{{is_disgraceful}}"> |
395 | 400 | <view class="disgraceful"> |
... | ... | @@ -397,13 +402,12 @@ |
397 | 402 | <view class="newreceive flex-center"> |
398 | 403 | <view> |
399 | 404 | <navigator bindtap="new_nav"> |
400 | - <view class="flex-level"> | |
401 | - <image class="receive" src="{{url}}{{new_image==''?'/miniapp/images/newpeople/newreceive.png':new_image}}"></image> | |
405 | + <view class="flex-level" style="position: relative;"> | |
406 | + <image class="receive" src="{{url}}{{new_image==''?'/miniapp/images/newpeople/newreceive.png':new_image}}"></image> | |
407 | + <image class="close" src="{{url}}/miniapp/images/plus/Close.png" catchtap="close_disgraceful" style="margin-top: -70rpx; right: -60rpx;"></image> | |
402 | 408 | </view> |
403 | 409 | </navigator> |
404 | - <view class="flex-level"> | |
405 | - <image class="close" src="{{url}}/miniapp/images/plus/Close.png" bindtap="close_disgraceful"></image> | |
406 | - </view> | |
410 | + <view class="flex-level"></view> | |
407 | 411 | </view> |
408 | 412 | </view> |
409 | 413 | </view> |
... | ... | @@ -418,8 +422,6 @@ |
418 | 422 | </view> |
419 | 423 | </view> |
420 | 424 | </block> |
421 | - | |
422 | - | |
423 | 425 | |
424 | 426 | <block wx:if="{{showHongbaoSmall}}"> |
425 | 427 | <view> |
... | ... | @@ -427,9 +429,6 @@ |
427 | 429 | </view> |
428 | 430 | </block> |
429 | 431 | |
430 | -<!-- <hongbao id="hongbao" bind:closeHongbao="closeHongbao" wx:if="{{showHongbao}}" url="{{url}}"></hongbao> --> | |
431 | -<full_screen id="full_screen"></full_screen> | |
432 | - | |
433 | 432 | |
434 | 433 | |
435 | 434 | ... | ... |
pages/index/index/index.wxss
... | ... | @@ -966,4 +966,14 @@ page { |
966 | 966 | /* transform: translateY(-50%); */ |
967 | 967 | z-index: 10000; |
968 | 968 | } |
969 | -.dis_top{position: fixed; top: 0; left: 0; width: 100%; z-index: 100000;} | |
970 | 969 | \ No newline at end of file |
970 | +.dis_top{position: fixed; top: 0; left: 0; width: 100%; z-index: 100000;} | |
971 | +.full_screen{ | |
972 | + position: fixed;left: 0;top: 0; | |
973 | + z-index: 1000000000000; | |
974 | + background-color: rgba(0,0,0,0.4); | |
975 | + width: 100%; | |
976 | + height: 100%; | |
977 | + background-position: center; | |
978 | + background-size: 100% 100%; | |
979 | + background-repeat: no-repeat; | |
980 | +} | ... | ... |