Commit 341c264860fa57813af18461b5f07d1bf73dae08
1 parent
529162f2
123
Showing
5 changed files
with
141 additions
and
0 deletions
packageA/pages/distribution/shop/g_filter.wxs
0 → 100644
1 | +var g_filters = { | |
2 | + //-- 判断是不是有等级价 -- | |
3 | + is_has_rank:function(rank_switch,item){ | |
4 | + if(!rank_switch) return false; | |
5 | + if(item.cardprice1 || item.cardprice2 || item.cardprice3) {return true} | |
6 | + return false; | |
7 | + }, | |
8 | + | |
9 | + //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- | |
10 | + get_card_price:function(goods,all_card,type){ | |
11 | + var price1=parseFloat(goods['cardprice1']); | |
12 | + var price2 = parseFloat(goods['cardprice2']); | |
13 | + var price3 = parseFloat(goods['cardprice3']); | |
14 | + if(!all_card){ | |
15 | + if(type==0) return 0; | |
16 | + return ""; | |
17 | + } | |
18 | + | |
19 | + var min_price=null; | |
20 | + var min_name=null; | |
21 | + //---设置对应的价格名字---- | |
22 | + for(var i=0;i<3;i++) { | |
23 | + var vl=all_card[i]; | |
24 | + if(!vl) continue; | |
25 | + | |
26 | + if(vl['CorrPrice']=="Price1" && price1>0) | |
27 | + { | |
28 | + if(min_price==null) { | |
29 | + min_price=price1;min_name=vl['CardName']; | |
30 | + } | |
31 | + else if(price1<min_price) { | |
32 | + min_price=price1;min_name=vl['CardName']; | |
33 | + } | |
34 | + } | |
35 | + if(vl['CorrPrice']=="Price2" && price2>0) | |
36 | + { | |
37 | + if(min_price==null) { | |
38 | + min_price=price2;min_name=vl['CardName']; | |
39 | + } | |
40 | + else if(price2<min_price) { | |
41 | + min_price=price2;min_name=vl['CardName']; | |
42 | + } | |
43 | + } | |
44 | + | |
45 | + if(vl['CorrPrice']=="Price3" && price3>0) | |
46 | + { | |
47 | + if(min_price==null) { | |
48 | + min_price=price3;min_name=vl['CardName']; | |
49 | + } | |
50 | + else if(price3<min_price) { | |
51 | + min_price=price3;min_name=vl['CardName']; | |
52 | + } | |
53 | + } | |
54 | + | |
55 | + } | |
56 | + if(min_price==null){ | |
57 | + if(type==0) return 0; | |
58 | + return ""; | |
59 | + } | |
60 | + | |
61 | + if(type==0) return min_price; | |
62 | + if(min_name.length>4 ) min_name=min_name.substring(0, 8); | |
63 | + return min_name; | |
64 | + }, | |
65 | +} | |
66 | +module.exports = { | |
67 | + is_has_rank:g_filters.is_has_rank, | |
68 | + get_card_price:g_filters.get_card_price, | |
69 | +} | |
0 | 70 | \ No newline at end of file | ... | ... |
packageA/pages/service_share/service_share.js
0 → 100644
1 | +// packageA//pages/service_share/service_share.js | |
2 | +Page({ | |
3 | + | |
4 | + /** | |
5 | + * 页面的初始数据 | |
6 | + */ | |
7 | + data: { | |
8 | + | |
9 | + }, | |
10 | + | |
11 | + /** | |
12 | + * 生命周期函数--监听页面加载 | |
13 | + */ | |
14 | + onLoad: function (options) { | |
15 | + | |
16 | + }, | |
17 | + | |
18 | + /** | |
19 | + * 生命周期函数--监听页面初次渲染完成 | |
20 | + */ | |
21 | + onReady: function () { | |
22 | + | |
23 | + }, | |
24 | + | |
25 | + /** | |
26 | + * 生命周期函数--监听页面显示 | |
27 | + */ | |
28 | + onShow: function () { | |
29 | + | |
30 | + }, | |
31 | + | |
32 | + /** | |
33 | + * 生命周期函数--监听页面隐藏 | |
34 | + */ | |
35 | + onHide: function () { | |
36 | + | |
37 | + }, | |
38 | + | |
39 | + /** | |
40 | + * 生命周期函数--监听页面卸载 | |
41 | + */ | |
42 | + onUnload: function () { | |
43 | + | |
44 | + }, | |
45 | + | |
46 | + /** | |
47 | + * 页面相关事件处理函数--监听用户下拉动作 | |
48 | + */ | |
49 | + onPullDownRefresh: function () { | |
50 | + | |
51 | + }, | |
52 | + | |
53 | + /** | |
54 | + * 页面上拉触底事件的处理函数 | |
55 | + */ | |
56 | + onReachBottom: function () { | |
57 | + | |
58 | + }, | |
59 | + | |
60 | + /** | |
61 | + * 用户点击右上角分享 | |
62 | + */ | |
63 | + onShareAppMessage: function () { | |
64 | + | |
65 | + } | |
66 | +}) | |
0 | 67 | \ No newline at end of file | ... | ... |
packageA/pages/service_share/service_share.json
0 → 100644
packageA/pages/service_share/service_share.wxml
0 → 100644
packageA/pages/service_share/service_share.wxss
0 → 100644