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,28 +21,23 @@ Component({ | ||
21 | clearInterval(this.data.full_screen); | 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 | properties: {}, | 26 | properties: {}, |
33 | methods: { | 27 | methods: { |
34 | close_full_screen(){ | 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 | go_full_ad(){ | 32 | go_full_ad(){ |
39 | if(!this.data.full_ad) return false; | 33 | if(!this.data.full_ad) return false; |
40 | if(!this.data.full_ad.ad_weapplink) return false; | 34 | if(!this.data.full_ad.ad_weapplink) return false; |
41 | getApp().goto(this.data.full_ad.ad_weapplink); | 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 | get_the_full_screen(){ | 37 | get_the_full_screen(){ |
45 | - if(this.data.full_ad) return false; | 38 | + if(this.data.full_ad) { |
39 | + return false; | ||
40 | + } | ||
46 | var th=this; | 41 | var th=this; |
47 | //获取全屏的广告 | 42 | //获取全屏的广告 |
48 | getApp().request.promiseGet("/api/weshop/ad/page?pid=1001&store_id=" + o.stoid,{ | 43 | getApp().request.promiseGet("/api/weshop/ad/page?pid=1001&store_id=" + o.stoid,{ |
@@ -53,8 +48,7 @@ Component({ | @@ -53,8 +48,7 @@ Component({ | ||
53 | th.setData({ | 48 | th.setData({ |
54 | is_full_screen_show:1, | 49 | is_full_screen_show:1, |
55 | full_ad:res.data.data.pageData[0], | 50 | full_ad:res.data.data.pageData[0], |
56 | - }) | ||
57 | - | 51 | + }) |
58 | //--定时关闭-- | 52 | //--定时关闭-- |
59 | th.data.full_screen=setInterval(function(){ | 53 | th.data.full_screen=setInterval(function(){ |
60 | if(!th.data.sec_show) { | 54 | if(!th.data.sec_show) { |
@@ -65,16 +59,8 @@ Component({ | @@ -65,16 +59,8 @@ Component({ | ||
65 | th.data.sec_show--; | 59 | th.data.sec_show--; |
66 | th.setData({sec_show:th.data.sec_show}); | 60 | th.setData({sec_show:th.data.sec_show}); |
67 | },1000) | 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 | <view wx:if="{{is_full_screen_show}}" class="full_screen" bindtap="go_full_ad" style="background-image: url('{{url+full_ad.ad_code}}');"> | 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 | <view catchtap="close_full_screen" class="skip_box">跳过 <text>{{sec_show}}</text></view> | 3 | <view catchtap="close_full_screen" class="skip_box">跳过 <text>{{sec_show}}</text></view> |
5 | </view> | 4 | </view> |
components/full_screen/full_screen.wxss
@@ -8,8 +8,6 @@ | @@ -8,8 +8,6 @@ | ||
8 | background-size: 100% 100%; | 8 | background-size: 100% 100%; |
9 | background-repeat: no-repeat; | 9 | background-repeat: no-repeat; |
10 | } | 10 | } |
11 | - | ||
12 | - | ||
13 | .skip_box{ | 11 | .skip_box{ |
14 | float: right; margin-top: 10rpx; margin-right: 10rpx; | 12 | float: right; margin-top: 10rpx; margin-right: 10rpx; |
15 | background-color: gainsboro; width: 120rpx; | 13 | background-color: gainsboro; width: 120rpx; |
components/goods_list/goods_list.js
@@ -37,7 +37,7 @@ Component({ | @@ -37,7 +37,7 @@ Component({ | ||
37 | getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, { | 37 | getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, { |
38 | isShowLoading:false, | 38 | isShowLoading:false, |
39 | success: function (e) { | 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 | getApp().globalData.userInfo = e.data.data; | 41 | getApp().globalData.userInfo = e.data.data; |
42 | getApp().getConfig2(function (e) { | 42 | getApp().getConfig2(function (e) { |
43 | var swithc_list = e.switch_list; | 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,6 +66,10 @@ Page({ | ||
66 | 66 | ||
67 | if (0 != t.is_new && t.is_new != undefined) { url += "&is_new=" + t.is_new; } | 67 | if (0 != t.is_new && t.is_new != undefined) { url += "&is_new=" + t.is_new; } |
68 | if (0 != t.is_hot && t.is_hot != undefined) { url += "&is_hot=" + t.is_hot; } | 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 | if(t.prom_type==3){ | 75 | if(t.prom_type==3){ |
pages/goods/goodsList/goodsList.wxml
@@ -28,7 +28,7 @@ | @@ -28,7 +28,7 @@ | ||
28 | </view> | 28 | </view> |
29 | 29 | ||
30 | </navigator> | 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 | <view class="ico-dg" wx:if="{{tabname=='final_price'}}"> | 33 | <view class="ico-dg" wx:if="{{tabname=='final_price'}}"> |
34 | <image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image> | 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,6 +107,7 @@ Page({ | ||
107 | if (0 != t.brand_id && t.brand_id!=undefined){ url += "&brand_id=" + t.brand_id;} | 107 | if (0 != t.brand_id && t.brand_id!=undefined){ url += "&brand_id=" + t.brand_id;} |
108 | if (0 != t.nation_id && t.nation_id!=undefined) { url += "&nation_id=" + t.nation_id;} | 108 | if (0 != t.nation_id && t.nation_id!=undefined) { url += "&nation_id=" + t.nation_id;} |
109 | if (0 != t.max_price && t.max_price!=undefined) { url += "&min_pirce=" + t.min_pirce + "&max_price=" + t.max_price;} | 109 | if (0 != t.max_price && t.max_price!=undefined) { url += "&min_pirce=" + t.min_pirce + "&max_price=" + t.max_price;} |
110 | + | ||
110 | if (url != this.data.baseUrl) return this.requestSearch(url); | 111 | if (url != this.data.baseUrl) return this.requestSearch(url); |
111 | this.openSearchModal(); | 112 | this.openSearchModal(); |
112 | 113 | ||
@@ -132,6 +133,10 @@ Page({ | @@ -132,6 +133,10 @@ Page({ | ||
132 | //-----------真的调用地址进行搜索------------ | 133 | //-----------真的调用地址进行搜索------------ |
133 | requestSearch: function(t) { | 134 | requestSearch: function(t) { |
134 | var a = this; | 135 | var a = this; |
136 | + | ||
137 | + if(getApp().globalData.userInfo){ | ||
138 | + t += "&user_id=" + getApp().globalData.userInfo.user_id; | ||
139 | + } | ||
135 | 140 | ||
136 | this.data.requestUrl = t, | 141 | this.data.requestUrl = t, |
137 | //t += "&orderField=" + a.data.tabname; | 142 | //t += "&orderField=" + a.data.tabname; |
pages/goods/search/search.wxml
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image> | 13 | <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image> |
14 | </view> | 14 | </view> |
15 | </navigator> | 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 | <view class="ico-dg" wx:if="{{tabname=='final_price'}}"> | 17 | <view class="ico-dg" wx:if="{{tabname=='final_price'}}"> |
18 | <image class="wh100" src="{{url}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image> | 18 | <image class="wh100" src="{{url}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image> |
19 | <image class="wh100" src="{{url}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image> | 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,16 +248,33 @@ Page({ | ||
248 | 248 | ||
249 | var th = this; | 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,7 +388,6 @@ Page({ | ||
371 | flash_data = e.data.data.pageData; | 388 | flash_data = e.data.data.pageData; |
372 | if (flash_data == null || flash_data.length <= 0) return false; | 389 | if (flash_data == null || flash_data.length <= 0) return false; |
373 | 390 | ||
374 | - | ||
375 | //当前时间戳 | 391 | //当前时间戳 |
376 | var nt = ut.gettimestamp(); | 392 | var nt = ut.gettimestamp(); |
377 | 393 | ||
@@ -506,17 +522,17 @@ Page({ | @@ -506,17 +522,17 @@ Page({ | ||
506 | th.is_new(); | 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 | setTimeout(function() { | 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 | <wxs module="filter" src="../../../utils/filter.wxs"></wxs> | 4 | <wxs module="filter" src="../../../utils/filter.wxs"></wxs> |
5 | + | ||
5 | <view class="container rel" wx:if="{{ishow}}"> | 6 | <view class="container rel" wx:if="{{ishow}}"> |
6 | <block wx:if="{{banner}}"> | 7 | <block wx:if="{{banner}}"> |
7 | <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image> | 8 | <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image> |
@@ -295,6 +296,8 @@ | @@ -295,6 +296,8 @@ | ||
295 | 296 | ||
296 | </view> | 297 | </view> |
297 | 298 | ||
299 | + | ||
300 | +<block wx:if="{{f_hidden}}"> | ||
298 | <!--是否是自定义--> | 301 | <!--是否是自定义--> |
299 | <view class="container" wx:if="{{isTemplate}}" style="background-color:{{bgcolor_t}}"> | 302 | <view class="container" wx:if="{{isTemplate}}" style="background-color:{{bgcolor_t}}"> |
300 | <!-- 置顶层 --> | 303 | <!-- 置顶层 --> |
@@ -390,6 +393,8 @@ | @@ -390,6 +393,8 @@ | ||
390 | </block> | 393 | </block> |
391 | </view> | 394 | </view> |
392 | 395 | ||
396 | +</block> | ||
397 | + | ||
393 | <!-- 蒙尘 --> | 398 | <!-- 蒙尘 --> |
394 | <block wx:if="{{is_disgraceful}}"> | 399 | <block wx:if="{{is_disgraceful}}"> |
395 | <view class="disgraceful"> | 400 | <view class="disgraceful"> |
@@ -397,13 +402,12 @@ | @@ -397,13 +402,12 @@ | ||
397 | <view class="newreceive flex-center"> | 402 | <view class="newreceive flex-center"> |
398 | <view> | 403 | <view> |
399 | <navigator bindtap="new_nav"> | 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 | </view> | 408 | </view> |
403 | </navigator> | 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 | </view> | 411 | </view> |
408 | </view> | 412 | </view> |
409 | </view> | 413 | </view> |
@@ -418,8 +422,6 @@ | @@ -418,8 +422,6 @@ | ||
418 | </view> | 422 | </view> |
419 | </view> | 423 | </view> |
420 | </block> | 424 | </block> |
421 | - | ||
422 | - | ||
423 | 425 | ||
424 | <block wx:if="{{showHongbaoSmall}}"> | 426 | <block wx:if="{{showHongbaoSmall}}"> |
425 | <view> | 427 | <view> |
@@ -427,9 +429,6 @@ | @@ -427,9 +429,6 @@ | ||
427 | </view> | 429 | </view> |
428 | </block> | 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,4 +966,14 @@ page { | ||
966 | /* transform: translateY(-50%); */ | 966 | /* transform: translateY(-50%); */ |
967 | z-index: 10000; | 967 | z-index: 10000; |
968 | } | 968 | } |
969 | -.dis_top{position: fixed; top: 0; left: 0; width: 100%; z-index: 100000;} | ||
970 | \ No newline at end of file | 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 | +} |