-
mentioned in commit 786364833ef10d37b4938dee1151ba4e3b7ed3f2
-
Status changed to merged
-
Dev See merge request !478
-
2. 指定单品优惠券的使用优化
-
Dev See merge request !477
-
2. 在兑换优惠券之前要有一个提示框 3. 平摊算法调用接口的优化
Showing
27 changed files
components/diy_advertising/diy_advertising.wxml
... | ... | @@ -410,11 +410,17 @@ |
410 | 410 | <block wx:for="{{object.data}}" wx:for-index="index" > |
411 | 411 | |
412 | 412 | <navigator url="{{item.wxapp_imgurl}}" class="s1_gk_a1" wx:if="{{g_filter.has_char(item.wxapp_imgurl,'plugin')>=0}}"> |
413 | - <swiper-item><image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" /></swiper-item> | |
413 | + <swiper-item> | |
414 | + <image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" /> | |
415 | + <view class="title">{{item.title}}</view> | |
416 | + </swiper-item> | |
414 | 417 | </navigator> |
415 | 418 | |
416 | 419 | <view data-url="{{item.wxapp_imgurl}}" class="s1_gk_a1" bindtap="go_url" wx:else> |
417 | - <swiper-item><image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" /></swiper-item> | |
420 | + <swiper-item> | |
421 | + <image src="{{item.src}}" bindload="imageLoad" data-index="{{index}}" class="slide-image" mode="widthFix" /> | |
422 | + <view class="title">{{item.title}}</view> | |
423 | + </swiper-item> | |
418 | 424 | </view> |
419 | 425 | |
420 | 426 | </block> | ... | ... |
components/diy_advertising/diy_advertising.wxss
... | ... | @@ -331,3 +331,5 @@ |
331 | 331 | } |
332 | 332 | .clicle{ width: 20rpx; height: 20rpx} |
333 | 333 | .dots{ position: absolute; bottom: 10rpx; width: 100%; display: flex; justify-content: center} |
334 | +.title{ position: absolute; left: 0; bottom: 0; background-color: rgba(6,6,6,0.5); font-size: 30rpx; | |
335 | + text-indent: 10rpx;width: 100%; height: 50rpx; line-height: 50rpx; color: #fff} | ... | ... |
components/diy_service/diy_service.js
0 → 100644
1 | +Component({ | |
2 | + properties: { | |
3 | + // 这里定义了innerText属性,属性值可以在组件使用时指定 | |
4 | + object:{ | |
5 | + type: Object, | |
6 | + value:null | |
7 | + }, | |
8 | + }, | |
9 | + data: { | |
10 | + iurl:getApp().globalData.setting.imghost | |
11 | + }, | |
12 | + | |
13 | + lifetimes: { | |
14 | + attached: function() { | |
15 | + var th=this; | |
16 | + //----获取系统参数----- | |
17 | + getApp().getConfig2(function(e) { | |
18 | + var json_d = JSON.parse(e.switch_list); | |
19 | + th.setData({ sys_switch:json_d, }) | |
20 | + }) | |
21 | + } | |
22 | + }, | |
23 | + | |
24 | + methods: { | |
25 | + berror:function(e){ | |
26 | + var iurl=getApp().globalData.setting.imghost; | |
27 | + var ob={}; | |
28 | + var txt="object.title_img"; | |
29 | + ob[txt] = iurl +'/miniapp/images/logo.png'; | |
30 | + this.setData(ob); | |
31 | + }, | |
32 | + | |
33 | + //-- 跳到绑定注册会员 -- | |
34 | + go_user:function(){ | |
35 | + getApp().goto('/pages/getphone/getphone'); | |
36 | + return false; | |
37 | + }, | |
38 | + | |
39 | + //---------联系客服------------ | |
40 | + contactService: function() { | |
41 | + getApp().getConfig(function(t) { | |
42 | + if (t.store_tel == undefined) { | |
43 | + getApp().request.get("/api/weshop/store/get/" + os.stoid, { | |
44 | + isShowLoading: 1, | |
45 | + data: {}, | |
46 | + success: function(rs) { | |
47 | + getApp().globalData.config = rs.data.data; | |
48 | + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { | |
49 | + getApp().my_warnning("商家未设置电话", 0, th); | |
50 | + return false; | |
51 | + } | |
52 | + wx.makePhoneCall({ phoneNumber: rs.data.data.store_tel, }) | |
53 | + } | |
54 | + }) | |
55 | + } else { | |
56 | + wx.makePhoneCall({ phoneNumber: t.store_tel, }) | |
57 | + } | |
58 | + }); | |
59 | + }, | |
60 | + } | |
61 | +}) | ... | ... |
components/diy_service/diy_service.json
0 → 100644
components/diy_service/diy_service.wxml
0 → 100644
1 | +<!--有在线客户 和 打电话--> | |
2 | +<block wx:if="{{sys_switch.weapp_customertype}}"> | |
3 | + <!-- 判断是不是有登陆 --> | |
4 | + <view wx:if="{{userInfo}}" class="custom-service" bindtap="go_user" > | |
5 | + <view style="text-align: center;"> | |
6 | + <image class="cs-img" src="{{object.img}}"></image> | |
7 | + <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view> | |
8 | + </view> | |
9 | + </view> | |
10 | + | |
11 | + <button wx:else class="custom-service" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | |
12 | + <view style="text-align: center;"> | |
13 | + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
14 | + <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view> | |
15 | + </view> | |
16 | + </button> | |
17 | +</block> | |
18 | + | |
19 | +<block wx:else> | |
20 | + <view class="custom-service cart-ico new_split" bindtap="contactService"> | |
21 | + <view style="text-align: center;"> | |
22 | + <image class="cs-img" src="{{object.img}}"></image> | |
23 | + <view class="s_title" wx:if="{{object.title!=''}}">{{object.title}}</view> | |
24 | + </view> | |
25 | + </view> | |
26 | +</block> | |
0 | 27 | \ No newline at end of file | ... | ... |
components/diy_service/diy_service.wxss
0 → 100644
1 | +.custom-service{ width: 116rpx; height: 116rpx; border-radius: 50%; background-color: #fff;z-index: 100; | |
2 | + border: 1px solid #adadad; box-shadow: 0 0 10px 2px #adadad; line-height: 28rpx; | |
3 | + position: fixed; top: 40%; right: 2rpx; display: flex;align-items: center;justify-content: center;} | |
4 | + | |
5 | + .cs-img{ width: 36rpx; height: 36rpx;} | |
6 | +.s_title{ font-size: 20rpx;} | |
0 | 7 | \ No newline at end of file | ... | ... |
packageA/pages/quan_list/quan_list.js
... | ... | @@ -19,6 +19,7 @@ Page({ |
19 | 19 | loading:0, |
20 | 20 | get_item:null, |
21 | 21 | show_success:0, |
22 | + getcurday:null, | |
22 | 23 | }, |
23 | 24 | //------初始化加载---------- |
24 | 25 | onLoad: function(t) { |
... | ... | @@ -36,6 +37,8 @@ Page({ |
36 | 37 | //券的模拟数据 |
37 | 38 | //var data = [{ is_get:0,money:50,condition:500,id:1,name: "券名字", endtype: 0, use_start_time: 1579596090, use_end_time: 1611218490, everyone_num: 2,interval_time:1,color:"red"}]; |
38 | 39 | //th.setData({dataList: data}); |
40 | + | |
41 | + this.setData({getcurday:ut.gettimestamp()}); | |
39 | 42 | }, |
40 | 43 | |
41 | 44 | onHide: function() { | ... | ... |
packageA/pages/quan_list/quan_list.wxml
... | ... | @@ -18,11 +18,12 @@ |
18 | 18 | <view class="right fs24 co_g pding" style="background-image:url({{iurl}}/miniapp/images/coupon_img/white.png); position: relative"> |
19 | 19 | <view class="fs28 co_b" style="margin-top: 15rpx">{{item.name}}</view> |
20 | 20 | <view style="margin-top: 5rpx">所有门店通用</view> |
21 | - <view wx:if="{{item.endtype==0}}">有效期 | |
22 | - <text wx:if="{{item.use_start_time>0}}"> {{filters.format_time(item.use_start_time)}}</text>至 | |
21 | + <view wx:if="{{item.endtype==0}}">有效期 | |
22 | + <text wx:if="{{item.starttype==1 && item.startdays>0}}">{{filters.format_time(getcurday+3600*24*item.startdays)}}</text> | |
23 | + <text wx:if="{{item.starttype==0 && item.use_start_time>0}}"> {{filters.format_time(item.use_start_time)}}</text>至 | |
23 | 24 | <text wx:if="{{item.use_start_time>0}}"> {{filters.format_time(item.use_end_time)}}</text><text wx:else>不限</text> |
24 | 25 | </view> |
25 | - <view wx:else>有效期<text wx:if="{{item.days>0}}">{{item.days}}天</text><text wx:else>不限</text></view> | |
26 | + <view wx:else>有效期 <text wx:if="{{item.starttype==1 && item.startdays>0}}">{{filters.format_time(getcurday+3600*24*item.startdays)}}至</text> <text wx:if="{{item.days>0}}">{{filters.format_time(getcurday+3600*24*item.days)}}</text><text wx:else>不限</text></view> | |
26 | 27 | <view>每人限领:<text wx:if="{{item.everyone_num>0}}">{{item.everyone_num}}</text><text wx:else>不限</text></view> |
27 | 28 | <!-- 领取按钮 --> |
28 | 29 | <view data-ind="{{index}}" data-cid="{{item.id}}" catchtap="get_quan"> | ... | ... |
packageA/pages/quan_pro/quan_pro.js
... | ... | @@ -14,6 +14,7 @@ Page({ |
14 | 14 | q_data: null, |
15 | 15 | id:null, |
16 | 16 | config2:null, |
17 | + getcurday:null | |
17 | 18 | |
18 | 19 | }, |
19 | 20 | //------初始化加载---------- |
... | ... | @@ -38,6 +39,8 @@ Page({ |
38 | 39 | th.setData({q_data:res.data.data.pageData[0]}); |
39 | 40 | } |
40 | 41 | }); |
42 | + | |
43 | + th.setData({getcurday:ut.gettimestamp()}); | |
41 | 44 | }, |
42 | 45 | |
43 | 46 | onHide: function() { | ... | ... |
packageA/pages/quan_pro/quan_pro.wxml
... | ... | @@ -23,11 +23,15 @@ |
23 | 23 | <view class="fs28">满{{filters.toFix(q_data.condition,2)}}可用</view> |
24 | 24 | </view> |
25 | 25 | </view> |
26 | - <view wx:if="{{item.endtype==0}}" class="lower fs30">有效期 | |
27 | - <text wx:if="{{q_data.use_start_time>0}}"> {{filters.format_time(q_data.use_start_time)}}</text>至 | |
28 | - <text wx:if="{{q_data.use_start_time>0}}"> {{filters.format_time(q_data.use_end_time)}}</text><text wx:else>不限</text> | |
26 | + <view wx:if="{{q_data.endtype==0}}" class="lower fs30">有效期 | |
27 | + <text wx:if="{{q_data.startdays>0 && q_data.starttype==1}}"> {{filters.format_time(getcurday+3600*24*q_data.startdays)}}</text> | |
28 | + <text wx:if="{{q_data.use_start_time>0 && q_data.starttype==0}}"> {{filters.format_time(q_data.use_start_time)}}</text>至 | |
29 | + <text wx:if="{{q_data.use_end_time>0}}"> {{filters.format_time(q_data.use_end_time)}}</text><text wx:else>不限</text> | |
29 | 30 | </view> |
30 | - <view wx:else class="lower fs30">有效期<text wx:if="{{q_data.days>0}}">{{q_data.days}}天</text><text wx:else>不限</text></view> | |
31 | + <view wx:else class="lower fs30">有效期 | |
32 | + | |
33 | + <text wx:if="{{q_data.startdays>0 && q_data.starttype==1}}"> {{filters.format_time(getcurday+3600*24*q_data.startdays)}}至</text> | |
34 | + <text wx:if="{{q_data.days>0}}"> {{filters.format_time(getcurday+3600*24*q_data.days)}}</text><text wx:else>不限</text></view> | |
31 | 35 | |
32 | 36 | </view> |
33 | 37 | </view> | ... | ... |
pages/cart/cart2/c_filter.wxs
... | ... | @@ -15,6 +15,7 @@ var filters = { |
15 | 15 | if(ind==2) return "blue"; |
16 | 16 | if(ind==11) return "green"; |
17 | 17 | if(ind==12) return "blue"; |
18 | + if(ind==20) return "green"; | |
18 | 19 | return ""; |
19 | 20 | }, |
20 | 21 | setbgcolor: function (ind) { |
... | ... | @@ -23,6 +24,7 @@ var filters = { |
23 | 24 | if (ind == 2) return "#a3bcff"; |
24 | 25 | if (ind == 11) return "#59e1d2"; |
25 | 26 | if (ind == 12) return "#a3bcff"; |
27 | + if (ind == 20) return "#6d87cd"; | |
26 | 28 | return ""; |
27 | 29 | }, |
28 | 30 | |
... | ... | @@ -32,6 +34,7 @@ var filters = { |
32 | 34 | if (ind == 2) return "品类"; |
33 | 35 | if (ind == 11) return "用途"; |
34 | 36 | if (ind == 12) return "分类1"; |
37 | + if (ind == 20) return "指定单品"; | |
35 | 38 | return ""; |
36 | 39 | }, |
37 | 40 | get_type_card:function(ind){ |
... | ... | @@ -40,6 +43,7 @@ var filters = { |
40 | 43 | if (ind == 2) return "指定品类"; |
41 | 44 | if (ind == 11) return "指定用途"; |
42 | 45 | if (ind == 12) return "指定分类1"; |
46 | + if (ind == 20) return "指定单品"; | |
43 | 47 | return ""; |
44 | 48 | }, |
45 | 49 | format_huiche:function (text) { | ... | ... |
pages/cart/cart2/cart2.js
... | ... | @@ -706,16 +706,43 @@ Page({ |
706 | 706 | cart_item.prom_pt_json=[{"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}]; |
707 | 707 | } |
708 | 708 | |
709 | + //-- 如果系统要平摊到单品 -- | |
710 | + //if(!th.data.ispt_goods){ | |
711 | + var pt_data={ | |
712 | + 'prom_id':item_map.prom_id, | |
713 | + 'dis': parseFloat((item_map.price-item_map.prom_price).toFixed(2)), | |
714 | + 'goods':item_map.goods | |
715 | + } | |
716 | + | |
717 | + var pt_res=null; | |
718 | + await getApp().request.promisePost("/api/weshop/order/getGoodsSplit",{is_json:1,data:pt_data}).then(res=>{ | |
719 | + if(res.data.code==0){ pt_res=res.data.data; } | |
720 | + }) | |
721 | + if(pt_res){ | |
722 | + for (var io in item_map.goods){ | |
723 | + //平摊赋值 | |
724 | + item_map.goods[io].account_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account; | |
725 | + item_map.goods[io].account_yu_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account_yu; | |
726 | + if(!th.data.ispt_goods){ | |
727 | + item_map.goods[io].account=item_map.goods[io].account_fir; | |
728 | + item_map.goods[io].account_yu=item_map.goods[io].account_yu_fir; | |
729 | + } | |
730 | + } | |
731 | + } | |
732 | + // } | |
733 | + | |
709 | 734 | o_price-=(item_map.price-item_map.prom_price); |
710 | 735 | //如果有限制使用优惠券,就要减掉参与的活动商品的钱 |
711 | 736 | if(!item_map.is_xz_yh) q_conditin=o_price; |
712 | 737 | } |
713 | - | |
738 | + | |
714 | 739 | //--------循环计算商品是不是包邮,是不是使用优惠券,此时循环是商品从表----------- |
715 | 740 | for(var j=0;j<item.length;j++){ |
716 | 741 | if(item[j].prom_type==3 && item[j].prom_id==item_map.prom_id){ |
717 | 742 | item[j].is_xz_yh= item_map.is_xz_yh; |
718 | 743 | item[j].is_past= item_map.is_past; |
744 | + item[j].account_fir= th.item_map_get_goods(item[j].goods_id,item_map).account_fir; | |
745 | + item[j].account_yu_fir= th.item_map_get_goods(item[j].goods_id,item_map).account_yu_fir; | |
719 | 746 | item[j].account= th.item_map_get_goods(item[j].goods_id,item_map).account; |
720 | 747 | item[j].account_yu= th.item_map_get_goods(item[j].goods_id,item_map).account_yu; |
721 | 748 | } |
... | ... | @@ -1473,6 +1500,29 @@ Page({ |
1473 | 1500 | return false; |
1474 | 1501 | } |
1475 | 1502 | } |
1503 | + | |
1504 | + //--- 如果有优惠促销的金额,要把金额先平摊下去 --- | |
1505 | + if(th.data.formData.cut_price>0 && !th.data.ispt_goods){ | |
1506 | + var g_arr=new Array(); | |
1507 | + g_arr.push(goods); | |
1508 | + var pt_data={ | |
1509 | + 'prom_id':goods.prom_id, | |
1510 | + 'dis': parseFloat(th.data.formData.cut_price), | |
1511 | + 'goods':g_arr, | |
1512 | + } | |
1513 | + | |
1514 | + var pt_res=null; | |
1515 | + await getApp().request.promisePost("/api/weshop/order/getGoodsSplit",{is_json:1,data:pt_data}).then(res=>{ | |
1516 | + if(res.data.code==0){ pt_res=res.data.data; } | |
1517 | + }) | |
1518 | + if(pt_res){ | |
1519 | + //平摊赋值 | |
1520 | + goods.account=pt_res[0].fisrt_account; | |
1521 | + goods.account_yu=pt_res[0].fisrt_account_yu; | |
1522 | + } | |
1523 | + } | |
1524 | + | |
1525 | + | |
1476 | 1526 | //--组装优惠券的钱-- |
1477 | 1527 | if(th.data.formData.coupon_price){ |
1478 | 1528 | item.coupon_price=th.data.formData.coupon_price; |
... | ... | @@ -1653,6 +1703,13 @@ Page({ |
1653 | 1703 | } |
1654 | 1704 | } |
1655 | 1705 | |
1706 | + //把优惠的平摊结果写进去 | |
1707 | + if(g_item.account>=0 || g_item.account_yu!=0){ | |
1708 | + if(g_item.account>=0) goods.account=g_item.account; | |
1709 | + if(g_item.account_yu!=0) goods.account_yu=g_item.account_yu; | |
1710 | + item.is_discount_amount=1; | |
1711 | + } | |
1712 | + | |
1656 | 1713 | //导购ID |
1657 | 1714 | if(g_item.guide_id){ |
1658 | 1715 | goods.guide_id=g_item.guide_id; |
... | ... | @@ -2082,17 +2139,60 @@ Page({ |
2082 | 2139 | |
2083 | 2140 | /*--点击选择券--*/ |
2084 | 2141 | sele_quan_item:function(e) { |
2142 | + | |
2143 | + var ind = e.currentTarget.dataset.ind; | |
2144 | + var quan_item=this.data.selected_quan_list[ind]; | |
2145 | + var pickid=this.data.selected_quan_pick; //现在选择的是哪一个门店 | |
2146 | + //--如果券是单品使用的时候-- | |
2147 | + if(quan_item.UseObjectType=="20"){ | |
2148 | + //---只有多件购买的时候才要计算,//购物车购买和搭配勾的时候--- | |
2149 | + var gg=getApp().get_b_now(); | |
2150 | + if(this.data.is_b_now==0 || this.data.gg.prom_type==5){ | |
2151 | + var arr=this.data.order_prom_list_cart; | |
2152 | + var t_pk_item=null; | |
2153 | + for(var ii in arr){ | |
2154 | + var ep=arr[ii]; | |
2155 | + if(pickid==ep.pickup_id){ | |
2156 | + t_pk_item=ep; break; | |
2157 | + } | |
2158 | + } | |
2159 | + //--寻找券指定的商品-- | |
2160 | + var gd=null; | |
2161 | + if(t_pk_item){ | |
2162 | + var goods=t_pk_item.goods; | |
2163 | + for(var gid in goods){ | |
2164 | + if(quan_item.UseObjectID==goods[gid].erpwareid){ gd=goods[gid]; } | |
2165 | + } | |
2166 | + } | |
2167 | + if(!gd){ | |
2168 | + getApp().my_warnning("未找到指定商品使用",0,this,600); | |
2169 | + return false; | |
2170 | + } | |
2171 | + //计算价格,如果有平摊的实收要计算实收的金额 | |
2172 | + var item_price=gd.goods_price*gd.goods_num; | |
2173 | + //-- 如果有平摊下去,有实收价格的时候,就要用account_fir来计算价格 -- | |
2174 | + if(gd.account_fir!=null && gd.account_fir!=undefined){ | |
2175 | + item_price=gd.account_fir*gd.goods_num; | |
2176 | + } | |
2177 | + | |
2178 | + if(item_price< parseFloat(quan_item.BuySum)){ | |
2179 | + getApp().my_warnning("该单品金额没有大于等于"+quan_item.BuySum+"元时不能使用优惠券",0,this,600); | |
2180 | + return false; | |
2181 | + } | |
2182 | + } | |
2183 | + } | |
2184 | + | |
2085 | 2185 | var no_use=e.currentTarget.dataset.no, quanlist=this.data.selected_quan_list; |
2086 | 2186 | //---所有的券的显示红色选择都清理一遍--- |
2087 | - for(var ind in quanlist){ | |
2088 | - quanlist[ind].show_red=0; | |
2187 | + for(var i in quanlist){ | |
2188 | + quanlist[i].show_red=0; | |
2089 | 2189 | } |
2090 | 2190 | this.setData({selected_quan_list:quanlist}); |
2091 | 2191 | var by_quanlist=this.data.get_by_quan_list; |
2092 | 2192 | if(by_quanlist){ |
2093 | 2193 | //---所有的券的显示红色选择都清理一遍--- |
2094 | - for(var ind in by_quanlist){ | |
2095 | - by_quanlist[ind].show_red=0; | |
2194 | + for(var inb in by_quanlist){ | |
2195 | + by_quanlist[inb].show_red=0; | |
2096 | 2196 | } |
2097 | 2197 | this.setData({get_by_quan_list:by_quanlist}); |
2098 | 2198 | } |
... | ... | @@ -2121,11 +2221,9 @@ Page({ |
2121 | 2221 | return; |
2122 | 2222 | } |
2123 | 2223 | |
2124 | - var ind = e.currentTarget.dataset.ind; | |
2125 | - | |
2126 | - var quan_item = this.data.selected_quan_list[ind]; | |
2224 | + | |
2225 | + | |
2127 | 2226 | var txt = "selected_quan_list[" + ind + "].show_red"; |
2128 | - | |
2129 | 2227 | var obj = {}; |
2130 | 2228 | obj[txt] = 1; |
2131 | 2229 | if (quan_item.show_red) { |
... | ... | @@ -2474,7 +2572,12 @@ Page({ |
2474 | 2572 | } |
2475 | 2573 | is_xz_yh=0; |
2476 | 2574 | var item_price=gd.goods_price*gd.goods_num; |
2575 | + //-- 如果有平摊下去,有实收价格的时候,就要用account来计算价格 -- | |
2576 | + if(gd.account_fir!=null && gd.account_fir!=undefined){ | |
2577 | + item_price=gd.account_fir*gd.goods_num; | |
2578 | + } | |
2477 | 2579 | ckeck_quan_price+=item_price; |
2580 | + | |
2478 | 2581 | //--组装价格list-- |
2479 | 2582 | if (check_quan_price_list) { |
2480 | 2583 | check_quan_price_list += "," +item_price; |
... | ... | @@ -2755,11 +2858,17 @@ Page({ |
2755 | 2858 | }, |
2756 | 2859 | |
2757 | 2860 | //从优惠的映射中拿出商品从表的item |
2758 | - item_map_get_goods:function(goods_id,map){ | |
2759 | - for(var i in map.goods){ | |
2760 | - if(map.goods[i].goods_id==goods_id) return map.goods[i]; | |
2761 | - } | |
2762 | - } | |
2861 | + item_map_get_goods:function(goods_id,map){ | |
2862 | + for(var i in map.goods){ | |
2863 | + if(map.goods[i].goods_id==goods_id) return map.goods[i]; | |
2864 | + } | |
2865 | + }, | |
2866 | + //从优惠的映射中拿出商品从表的item | |
2867 | + arr_get_goods:function(goods_id,arr){ | |
2868 | + for(var i in arr){ | |
2869 | + if(arr[i].goods_id==goods_id) return arr[i]; | |
2870 | + } | |
2871 | + } | |
2763 | 2872 | |
2764 | 2873 | |
2765 | 2874 | }); | ... | ... |
pages/index/index/index.json
... | ... | @@ -16,6 +16,7 @@ |
16 | 16 | "richtext": "/components/diy_richtext/diy_richtext", |
17 | 17 | "assist":"/components/diy_assist/diy_assist", |
18 | 18 | "picMax": "/components/diy_picMax/diy_picMax", |
19 | - "mvideo": "/components/diy_video/diy_video" | |
19 | + "mvideo": "/components/diy_video/diy_video", | |
20 | + "service": "/components/diy_service/diy_service" | |
20 | 21 | } |
21 | 22 | } |
22 | 23 | \ No newline at end of file | ... | ... |
pages/index/index/index.wxml
... | ... | @@ -339,7 +339,12 @@ |
339 | 339 | <!--图片组合--> |
340 | 340 | <block wx:if="{{item.ename=='picMix'}}"> |
341 | 341 | <picMax object="{{item.content}}"></picMax> |
342 | - </block> | |
342 | + </block> | |
343 | + <!--在线上客服--> | |
344 | + <block wx:if="{{item.ename=='onlineService'}}"> | |
345 | + <service object="{{item.content}}"></service> | |
346 | + </block> | |
347 | + | |
343 | 348 | </view> |
344 | 349 | </block> |
345 | 350 | </view> | ... | ... |
pages/template/index.json
... | ... | @@ -17,6 +17,7 @@ |
17 | 17 | "richtext": "/components/diy_richtext/diy_richtext", |
18 | 18 | "assist":"/components/diy_assist/diy_assist", |
19 | 19 | "picMax": "/components/diy_picMax/diy_picMax", |
20 | - "mvideo": "/components/diy_video/diy_video" | |
20 | + "mvideo": "/components/diy_video/diy_video", | |
21 | + "service": "/components/diy_service/diy_service" | |
21 | 22 | } |
22 | 23 | } |
23 | 24 | \ No newline at end of file | ... | ... |
pages/template/index.wxml
... | ... | @@ -53,6 +53,10 @@ |
53 | 53 | <block wx:if="{{item.ename=='picMix'}}"> |
54 | 54 | <picMax object="{{item.content}}"></picMax> |
55 | 55 | </block> |
56 | + <!--在线上客服--> | |
57 | + <block wx:if="{{item.ename=='onlineService'}}"> | |
58 | + <service object="{{item.content}}"></service> | |
59 | + </block> | |
56 | 60 | </view> |
57 | 61 | </block> |
58 | 62 | </view> | ... | ... |
pages/user/Detailed/Detailed.js
... | ... | @@ -33,6 +33,10 @@ Page({ |
33 | 33 | imagePath:"", //分享的生成图片 |
34 | 34 | |
35 | 35 | canvasHidden:true, |
36 | + isBind:true, | |
37 | + isBinds:true, | |
38 | + | |
39 | + input_val:null, | |
36 | 40 | }, |
37 | 41 | |
38 | 42 | /** |
... | ... | @@ -108,20 +112,36 @@ Page({ |
108 | 112 | |
109 | 113 | selectDetailed: function() { |
110 | 114 | var th = this, e = th; |
115 | + var r_data={ | |
116 | + storeId: o.stoid, | |
117 | + userId: r.user_id, | |
118 | + page: th.data.page, | |
119 | + pageSize: th.data.pageSize | |
120 | + }; | |
121 | + | |
122 | + if(th.data.datet!="" && th.data.datet){ | |
123 | + r_data.Sdate=th.data.datet; | |
124 | + } | |
125 | + if(th.data.dates!="" && th.data.dates){ | |
126 | + r_data.Edate=th.data.dates; | |
127 | + } | |
128 | + if(th.data.input_val!="" && th.data.input_val){ | |
129 | + r_data.MobileTel=th.data.input_val; | |
130 | + } | |
131 | + | |
111 | 132 | getApp().request.promiseGet("/api/weshop/plus/vip/mem/referee/page", { |
112 | - data: { | |
113 | - storeId: o.stoid, | |
114 | - userId: r.user_id, | |
115 | - page: th.data.page, | |
116 | - pageSize: th.data.pageSize | |
117 | - } | |
133 | + data:r_data | |
118 | 134 | }).then(res => { |
119 | - | |
120 | - th.setData({isDetailed:1}) | |
135 | + | |
136 | + setTimeout(function () { | |
137 | + th.setData({isDetailed: 1 }); | |
138 | + },300) | |
121 | 139 | if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0) { |
122 | 140 | th.data.page++;//当前页数+1 |
123 | 141 | var arr1 = th.data.arrayDetailed;//获取明细数组 |
124 | 142 | var arr2 = res.data.data.pageData;//获取当前查询数据 |
143 | + if(!arr1) arr1=[]; | |
144 | + | |
125 | 145 | var arr3 = [...arr1, ...arr2];//把当前查询数组拼接到原本数组后面 |
126 | 146 | var ismore = 0; |
127 | 147 | if (arr3.length == res.data.data.total) ismore = 1 //数据已加载完判断 |
... | ... | @@ -129,8 +149,9 @@ Page({ |
129 | 149 | arrayDetailed: arr3, |
130 | 150 | total: res.data.data.total, |
131 | 151 | ismore: ismore, |
132 | - isDetailed: 1 | |
133 | 152 | }) |
153 | + | |
154 | + | |
134 | 155 | } |
135 | 156 | }) |
136 | 157 | |
... | ... | @@ -152,7 +173,6 @@ Page({ |
152 | 173 | * 页面上拉触底事件的处理函数 |
153 | 174 | */ |
154 | 175 | onReachBottom: function() { |
155 | - | |
156 | 176 | if (this.data.total <= this.data.pageSize) return; |
157 | 177 | if (this.data.ismore) { |
158 | 178 | t.my_warnning("加载完啦!", 0, this); |
... | ... | @@ -183,7 +203,7 @@ Page({ |
183 | 203 | var privilege_o = th.data.privilege_o;//勋章图片 |
184 | 204 | var img_square=th.data.img_square; |
185 | 205 | var app = getApp(); |
186 | - var user=app.globalData.userInfo; | |
206 | + var user=app.globalData.userInfo; | |
187 | 207 | var unit = th.data.screenWidth / 750 * 1.35; |
188 | 208 | var scene = getApp().globalData.user_id; |
189 | 209 | var nickname = user.nickname; |
... | ... | @@ -368,10 +388,7 @@ Page({ |
368 | 388 | },300) |
369 | 389 | }) |
370 | 390 | }) |
371 | - | |
372 | - | |
373 | - | |
374 | - | |
391 | + | |
375 | 392 | } |
376 | 393 | |
377 | 394 | }) |
... | ... | @@ -435,9 +452,66 @@ Page({ |
435 | 452 | |
436 | 453 | }) |
437 | 454 | }, |
438 | - | |
439 | - | |
440 | - | |
441 | - | |
442 | - | |
455 | + | |
456 | + | |
457 | + //起始时间 | |
458 | + bindDateChenge: function(e) { | |
459 | + var isBind = false; | |
460 | + this.setData({ | |
461 | + datet: e.detail.value, | |
462 | + isBind: isBind | |
463 | + }); | |
464 | + }, | |
465 | + // 结束时间 | |
466 | + bindDateChenges: function(e) { | |
467 | + var isBinds = false; | |
468 | + this.setData({ | |
469 | + dates: e.detail.value, | |
470 | + isBinds: isBinds | |
471 | + }); | |
472 | + }, | |
473 | + //catchtap阻止冒泡,点击清除开始时间的按钮 | |
474 | + eliminate: function() { | |
475 | + var isBind = true; | |
476 | + var data = ""; | |
477 | + this.setData({ | |
478 | + datet: data, | |
479 | + isBind: isBind | |
480 | + }) | |
481 | + }, | |
482 | + //catchtap阻止冒泡,点击清除结束时间的按钮 | |
483 | + eliminates: function() { | |
484 | + var isBinds = true; | |
485 | + var dates = ""; | |
486 | + this.setData({ | |
487 | + dates: dates, | |
488 | + isBinds: isBinds | |
489 | + }) | |
490 | + }, | |
491 | + | |
492 | + get_input:function (e) { | |
493 | + this.data.input_val=e.detail.value; | |
494 | + }, | |
495 | + | |
496 | + //点击的搜索事件 | |
497 | + get_search:function () { | |
498 | + var th=this; | |
499 | + | |
500 | + if(th.data.datet && th.data.dates){ | |
501 | + var oDate1 = new Date(th.data.datet); | |
502 | + var oDate2 = new Date(th.data.dates); | |
503 | + if(oDate2<oDate1){ | |
504 | + getApp().my_warnning("结束时间不能小于开始时间",0,th); | |
505 | + return false; | |
506 | + } | |
507 | + } | |
508 | + this.data.total = 0; | |
509 | + this.data.page = 1; | |
510 | + this.data.ismore = 0; | |
511 | + this.setData({isDetailed:0}); | |
512 | + th.setData({arrayDetailed:[]}); | |
513 | + th.selectDetailed(); | |
514 | + } | |
515 | + | |
516 | + | |
443 | 517 | }) |
444 | 518 | \ No newline at end of file | ... | ... |
pages/user/Detailed/Detailed.wxml
1 | +<view class="big-rim"> | |
2 | + <form bindsubmit='get_search'> | |
3 | + <view class="min-rim"> | |
4 | + <view class="rq">日期:</view> | |
5 | + | |
6 | + <picker class='pi' mode="date" value='{{datet}}' start="2019/1/1" bindchange='bindDateChenge'> | |
7 | + <view class="rq-rim"> | |
8 | + <view class='kssj'><text class="wz"name="datat"value='{{datet}}'bindinput='watchPassWord'>{{datet}}</text></view> | |
9 | + <!-- 清除输入框中的内容--> | |
10 | + <view hidden='{{isBind}}' class="qc-rim"> | |
11 | + <button class="empty" catchtap="eliminate">x</button> | |
12 | + </view> | |
13 | + </view> | |
14 | + </picker> | |
15 | + | |
16 | + <view class="zi">至 </view> | |
17 | + <picker class="pis"mode="date" value='{{dates}}' start="2019/1/1" end="" bindchange='bindDateChenges'> | |
18 | + <view class="kssj"> | |
19 | + <text class='wz' name="datas" value='{{dates}}'>{{dates}}</text> | |
20 | + </view> | |
21 | + <!-- 清除输入框中的内容 --> | |
22 | + <view class="end-rim" hidden="{{isBinds}}"> | |
23 | + <button class="end" catchtap="eliminates">x</button> | |
24 | + </view> | |
25 | + </picker> | |
26 | + </view> | |
27 | + | |
28 | + <view class="xknr-rim"> | |
29 | + <view class="cxnr">查询内容 </view> | |
30 | + <view class='top'> | |
31 | + <input class="input" maxlength="13" bindinput="get_input" placeholder="输入手机号"/> | |
32 | + </view> | |
33 | + </view> | |
34 | + <button class="botton" form-type='submit' data-query='{{item}}'>查询明细</button> | |
35 | + </form> | |
36 | +</view> | |
37 | + | |
1 | 38 | <view wx:if="{{arrayDetailed.length>0}}"> |
2 | 39 | <view class="flex-space-between fs28 title"> |
3 | 40 | <view class="flex-vertical Nickname"> | ... | ... |
pages/user/Detailed/Detailed.wxss
... | ... | @@ -14,7 +14,6 @@ |
14 | 14 | } |
15 | 15 | |
16 | 16 | |
17 | - | |
18 | 17 | .phone { |
19 | 18 | width: 250rpx; |
20 | 19 | } |
... | ... | @@ -59,4 +58,247 @@ |
59 | 58 | height: 56rpx; |
60 | 59 | background-color: rgb(255, 72, 72); |
61 | 60 | border-radius: 40rpx; |
61 | +} | |
62 | + | |
63 | + | |
64 | +.big-rim{ | |
65 | + margin-top: 15rpx; | |
66 | + width: 100%; | |
67 | + height: 305rpx; | |
68 | + border-bottom: 8px solid #EEEEEE; | |
69 | +} | |
70 | +/* 单据时间 */ | |
71 | +.time{ | |
72 | + | |
73 | + font-size: 25rpx; | |
74 | + color: #999999; | |
75 | + width: 100%; | |
76 | +} | |
77 | +.min-rim{ | |
78 | + display: flex; | |
79 | + width: 100%; | |
80 | + height: auto; | |
81 | + margin-left: 30rpx; | |
82 | +} | |
83 | +/* 日期 */ | |
84 | +.rq{ | |
85 | + height: 25rpx; | |
86 | + font-size: 28rpx; | |
87 | + margin-top:12rpx; | |
88 | + font-family:'SimHei',Arial; | |
89 | +} | |
90 | +/* 日期控件 */ | |
91 | +.pi{ | |
92 | + width:200rpx; | |
93 | + height:auto; | |
94 | + margin-left:10rpx; | |
95 | + | |
96 | +} | |
97 | +.pis{ | |
98 | + width:200rpx; | |
99 | + height:auto; | |
100 | + margin-left:30rpx; | |
101 | +} | |
102 | +/* 日期边框 */ | |
103 | +.rq-rim{ | |
104 | + position:relative; | |
105 | + left:0; | |
106 | + top:0 | |
107 | +} | |
108 | +/* 开始时间边框*/ | |
109 | +.kssj{ | |
110 | + display: inline-block; | |
111 | + height: 50rpx; | |
112 | + background-color: #EEEEEE; | |
113 | + border: 1px solid #DADADA; | |
114 | + width:200rpx; | |
115 | + border-radius: 3px; | |
116 | + line-height:40rpx; | |
117 | + position:relative; | |
118 | + top:0rpx; | |
119 | + left:0rpx; | |
120 | + | |
121 | +} | |
122 | +/* 开始时间的文字 */ | |
123 | +.wz{ | |
124 | + display: inline-block; | |
125 | + font-size: 25rpx; | |
126 | + color: #333; | |
127 | +} | |
128 | + | |
129 | +/* 开始清空按钮的 边框*/ | |
130 | +.qc-rim{ | |
131 | + position:absolute; | |
132 | + top:10rpx; | |
133 | + left:173rpx; | |
134 | + | |
135 | +} | |
136 | +/* 结束时间清空输入框的按钮的边框 */ | |
137 | +.end-rim{ | |
138 | + position: absolute; | |
139 | + top: 23rpx; | |
140 | + left:547rpx; | |
141 | + width: 25rpx; | |
142 | + height: 25rpx; | |
143 | +} | |
144 | +/* 查询内容 */ | |
145 | +.cxnr{ | |
146 | + margin-left:30rpx; | |
147 | + font-size:28rpx; | |
148 | + font-family: 'SimHei',Arial; | |
149 | +} | |
150 | +/* 至 */ | |
151 | +.zi{ | |
152 | + margin-top:14rpx; | |
153 | + font-weight:600; | |
154 | + font-size:28rpx; | |
155 | + font-family: 'SimHei',Arial; | |
156 | + margin-left:30rpx; | |
157 | +} | |
158 | +/* 结束时间 */ | |
159 | + | |
160 | +.jssj{ | |
161 | + padding-left: 10rpx; | |
162 | + margin-left: 30rpx; | |
163 | + padding-bottom: 10rpx; | |
164 | + height: 35rpx; | |
165 | + font-size: 25rpx; | |
166 | + color: #333; | |
167 | + background-color: #EEEEEE; | |
168 | + border: 1px solid #DADADA; | |
169 | + width:85%; | |
170 | + border-radius: 5px; | |
171 | + | |
172 | +} | |
173 | +/* 查询内容的备考的边框 */ | |
174 | +.xknr-rim{ | |
175 | + display: flex; | |
176 | + width: 100%; | |
177 | + height: 55rpx; | |
178 | + line-height:105rpx; | |
179 | + margin-top:20rpx; | |
180 | +} | |
181 | +/* 明细查询 */ | |
182 | +.botton{ | |
183 | + margin-left: 30rpx; | |
184 | + margin-top: 50rpx; | |
185 | + background-color: #C4182E; | |
186 | + width: 95%; | |
187 | + border-radius:10rpx; | |
188 | + text-align: center; | |
189 | + height: 70rpx; | |
190 | + line-height: 70rpx; | |
191 | + color: #FFF; | |
192 | + font-size: 29rpx; | |
193 | + border: none; | |
194 | + font-family: 'SimHei',Arial; | |
195 | +} | |
196 | + | |
197 | +/*开始时间清空输入框的按钮*/ | |
198 | +.empty{ | |
199 | + width: 25rpx; | |
200 | + height: 25rpx; | |
201 | + border-radius:50%; | |
202 | + background: #767676; | |
203 | + color: #fff; | |
204 | + font-size: 25rpx; | |
205 | + text-align: center; | |
206 | + line-height:19rpx; | |
207 | +} | |
208 | +/*结束时间清空输入框的按钮*/ | |
209 | +.end{ | |
210 | + width: 25rpx; | |
211 | + height: 25rpx; | |
212 | + border-radius:50%; | |
213 | + background: #767676; | |
214 | + color: #fff; | |
215 | + font-size: 25rpx; | |
216 | + text-align: center; | |
217 | + line-height:19rpx; | |
218 | +} | |
219 | + | |
220 | +/* 顶部 */ | |
221 | +.top{ | |
222 | + width: 170rpx; | |
223 | + height: 50rpx; | |
224 | + padding: 0 10rpx; | |
225 | + line-height: 50rpx; | |
226 | + font-size: 34rpx; | |
227 | + margin-top: 25rpx; | |
228 | + border-radius:3rpx; | |
229 | +} | |
230 | +.images{ | |
231 | + width:35rpx; | |
232 | + height:35rpx; | |
233 | + margin-left:-9rpx; | |
234 | + margin-top:6rpx; | |
235 | +} | |
236 | +.rim-images{ | |
237 | + width: 62rpx; | |
238 | + height: 46rpx; | |
239 | + line-height: 37rpx; | |
240 | + /* border-style: inset;padding:4rpx;text-align: center; */ | |
241 | + background: #f1f1f1; | |
242 | + border-color:#000000; | |
243 | + border-width: 1rpx; | |
244 | + transform:translateX(28%); | |
245 | + margin-top:-3rpx; | |
246 | + border-radius:5rpx; | |
247 | +} | |
248 | +/* 下拉框 */ | |
249 | +.top-selected{ | |
250 | + width: 100%; | |
251 | + display: flex; | |
252 | + align-items: center; | |
253 | + justify-content: space-between; | |
254 | + border: 1px solid #ccc; | |
255 | + padding: 0 10rpx; | |
256 | + font-size: 30rpx; | |
257 | + background:#eeeeee; | |
258 | + height:50rpx; | |
259 | + border-radius:6rpx; | |
260 | + | |
261 | +} | |
262 | +.texts{ | |
263 | + margin:0 auto; | |
264 | + font-size: 25rpx; | |
265 | +} | |
266 | + | |
267 | +/* 下拉内容 */ | |
268 | +.select-box { | |
269 | + background-color: #eeeeee; | |
270 | + width:190rpx; | |
271 | + position: relative; | |
272 | + z-index:1; | |
273 | + overflow: hidden; | |
274 | + text-align: left; | |
275 | + animation: myfirst 0.5s; | |
276 | + font-size: 25rpx; | |
277 | + border: 1px solid #DADADA; | |
278 | +} | |
279 | +.select_one { | |
280 | + padding-left: 20rpx; | |
281 | + width: 100%; | |
282 | + height: 60rpx; | |
283 | + line-height: 60rpx; | |
284 | +} | |
285 | +/* 注释 */ | |
286 | +.zs{ | |
287 | + margin-left: 30rpx; | |
288 | + font-size: 25rpx; | |
289 | + color: #999999; | |
290 | + font-family: 'SimHei',Arial; | |
291 | + margin-top: 42rpx; | |
292 | + margin-bottom: 30rpx; | |
293 | +} | |
294 | + | |
295 | +.input{ | |
296 | + width: 300rpx; | |
297 | + background-color: #EEEEEE; | |
298 | + border-radius: 10rpx; | |
299 | + font-size: 24rpx; | |
300 | + text-indent: 5rpx; | |
301 | + height: 56rpx; | |
302 | + border: 1rpx solid #ccc; | |
303 | + | |
62 | 304 | } |
63 | 305 | \ No newline at end of file | ... | ... |
pages/user/coupons/exchange/exchange.js
... | ... | @@ -60,9 +60,17 @@ Page({ |
60 | 60 | * 点击兑换 |
61 | 61 | */ |
62 | 62 | async click(e) { |
63 | - var monye=e.currentTarget.dataset.monye; | |
64 | - var integr=e.currentTarget.dataset.integr; | |
65 | - //var integr = "-" + integr; | |
63 | + var th=this; | |
64 | + this.data.monye=e.currentTarget.dataset.monye; | |
65 | + this.data.integr=e.currentTarget.dataset.integr; | |
66 | + var my_con = this.selectComponent("#my_con"); //组件的id | |
67 | + var title="是否使用"+th.data.integr+"积分兑换代金券面值"+th.data.monye+"元"; | |
68 | + my_con.open(title, "确定", "取消", th.sure_pay, null) | |
69 | + }, | |
70 | + | |
71 | + sure_pay:function(){ | |
72 | + var monye=this.data.monye; | |
73 | + var integr=this.data.integr; | |
66 | 74 | |
67 | 75 | var user_id = getApp().globalData.user_id; |
68 | 76 | console.log(integr,"是什么微卷",typeof integr,monye); |
... | ... | @@ -81,10 +89,11 @@ Page({ |
81 | 89 | getApp().showWarning("积分不足"); |
82 | 90 | } |
83 | 91 | } |
84 | - | |
85 | - }) | |
86 | 92 | |
93 | + }) | |
87 | 94 | }, |
95 | + | |
96 | + | |
88 | 97 | /** |
89 | 98 | * 生命周期函数--监听页面显示 |
90 | 99 | */ | ... | ... |
pages/user/coupons/exchange/exchange.json
pages/user/coupons/exchange/exchange.wxml
... | ... | @@ -8,4 +8,5 @@ |
8 | 8 | <view class='mb20'>{{result.Integral}}积分兑换{{filter.getNum(result.ToSum)}}元微券</view> |
9 | 9 | <view class='jf-btn' bindtap='click' data-monye='{{result.ToSum}}' data-integr="{{result.Integral}}">立即兑换</view> |
10 | 10 | </view> |
11 | -</block> | |
12 | 11 | \ No newline at end of file |
12 | +</block> | |
13 | +<my_confirm id="my_con"></my_confirm> | |
13 | 14 | \ No newline at end of file | ... | ... |
pages/user/userinfo/userinfo.js
... | ... | @@ -812,7 +812,7 @@ Page({ |
812 | 812 | } |
813 | 813 | var identity_card = th.data.identity_card; //身份证 |
814 | 814 | |
815 | - if (identity_card != "" && !(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identity_card))) { | |
815 | + if (identity_card!=null && identity_card!=undefined && identity_card != "" && !(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identity_card))) { | |
816 | 816 | getApp().my_warnning("身份证号码错误", 0, th); |
817 | 817 | return false; |
818 | 818 | } | ... | ... |
pages/user/userqy/userqy.js
... | ... | @@ -27,6 +27,7 @@ Page({ |
27 | 27 | is_full:0, //是否满级 |
28 | 28 | |
29 | 29 | cur_g_num:0,//当前级需要多少钱 |
30 | + userqy_color:null,//颜色值 | |
30 | 31 | }, |
31 | 32 | |
32 | 33 | swiperChange: function (e) { |
... | ... | @@ -57,6 +58,14 @@ Page({ |
57 | 58 | var gl_data=getApp().globalData; |
58 | 59 | var sw_cur_id=0; |
59 | 60 | var th=this; |
61 | + //颜色值 | |
62 | + getApp().getConfig2(function(e) { | |
63 | + var getuserqy_color=e.userqy_color; | |
64 | + if (getuserqy_color) getuserqy_color = JSON.parse(getuserqy_color) | |
65 | + if(getuserqy_color){ | |
66 | + th.setData({userqy_color:getuserqy_color}) | |
67 | + } | |
68 | + }) | |
60 | 69 | //获取成长值 |
61 | 70 | await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get",{ |
62 | 71 | data:{ storeId:os.stoid,userId:gl_data.user_id } | ... | ... |
pages/user/userqy/userqy.wxml
... | ... | @@ -2,22 +2,22 @@ |
2 | 2 | <view class="xc-userqy-frame"> |
3 | 3 | <!-- 顶部 --> |
4 | 4 | <view class='user-frame rel'> |
5 | - <image class="arc" src="{{iurl}}/miniapp/images/userqy/user_userqy_arc.jpg"></image> | |
5 | + <view class="arc" style="background:{{userqy_color.first_bgcolor}}"></view> | |
6 | 6 | <image class="user-img circle abs" src="{{userinfo.head_pic?userinfo.head_pic:defaultAvatar}}"> </image> |
7 | - <view class="user-name abs "> | |
7 | + <view class="user-name abs " style="color:{{userqy_color.font_color}}"> | |
8 | 8 | {{userinfo.nickname}} <view class="hvip"><image class="vip-mem" src="{{iurl}}/miniapp/images/vip_hg0.png"></image>{{GradeName}}</view> |
9 | 9 | </view> |
10 | 10 | <!-- 当前是什么等级卡 --> |
11 | 11 | |
12 | 12 | <view class='flex abs xc-grow-frame' bindtap='go_cz'> |
13 | - <view class="four-level-word new xc-grow-val">成长值</view> | |
14 | - <view class="progress-bar-not" > | |
15 | - <view class="progress-bar-yes" wx:if="{{cz_val>full_cz_val}}" style='width:100%'></view> | |
16 | - <view class="progress-bar-yes" wx:else style='width:{{cz_val/need_money*100}}%'></view> | |
13 | + <view class="four-level-word new xc-grow-val" style="color:{{userqy_color.font_color}}; background:{{userqy_color.secord_bgcolor}}">成长值</view> | |
14 | + <view class="progress-bar-not"> | |
15 | + <view class="progress-bar-yes" wx:if="{{cz_val>full_cz_val}}" style='width:100%;background:{{userqy_color.secord_bgcolor}}'></view> | |
16 | + <view class="progress-bar-yes" wx:else style='width:{{cz_val/need_money*100}}%;background:{{userqy_color.secord_bgcolor}}'></view> | |
17 | 17 | </view> |
18 | 18 | |
19 | - <view class="progress-bar-val four-level-word new" wx:if="{{cz_val<full_cz_val}}">{{filter.pInt(cz_val)}} / {{need_money}}</view> | |
20 | - <view class="progress-bar-val four-level-word new" wx:else>{{filter.pInt(cz_val)}}</view> | |
19 | + <view class="progress-bar-val four-level-word new" style="color:{{userqy_color.font_color}}; " wx:if="{{cz_val<full_cz_val}}" >{{filter.pInt(cz_val)}} / {{need_money}}</view> | |
20 | + <view class="progress-bar-val four-level-word new" style="color:{{userqy_color.font_color}}; " wx:else>{{filter.pInt(cz_val)}}</view> | |
21 | 21 | |
22 | 22 | </view> |
23 | 23 | ... | ... |
pages/user/userqy/userqy.wxss
... | ... | @@ -9,7 +9,13 @@ |
9 | 9 | } |
10 | 10 | .xc-userqy-frame .user-frame .arc{ |
11 | 11 | width: 750rpx; |
12 | - height: 444rpx; | |
12 | + height: 444rpx; | |
13 | + left: -20%; | |
14 | + top: 0; | |
15 | + z-index: -1; | |
16 | + content: ''; | |
17 | + border-radius: 0 0 20% 20%; | |
18 | + background: #ff7295; | |
13 | 19 | |
14 | 20 | } |
15 | 21 | .xc-userqy-frame .user-frame .user-img{ | ... | ... |
utils/request.js
... | ... | @@ -191,13 +191,19 @@ module.exports = { |
191 | 191 | promisePost:function(url,data){ |
192 | 192 | var th=this; |
193 | 193 | if(url.indexOf("http")==-1) url=getApp().globalData.setting.url +url; |
194 | + var post_data=data.data; | |
195 | + var header={"content-type": "application/x-www-form-urlencoded" }; | |
196 | + if(data.is_json){ | |
197 | + header={ 'content-type': 'application/json'}; | |
198 | + post_data=JSON.stringify(post_data); | |
199 | + } | |
194 | 200 | return new Promise((resolve, reject) => { |
195 | 201 | data.isShowLoading && th.showLoading(); |
196 | 202 | wx.request({ |
197 | 203 | url, |
198 | 204 | method: 'POST', |
199 | - header: {"content-type": "application/x-www-form-urlencoded" }, | |
200 | - data:data.data, | |
205 | + header: header, | |
206 | + data:post_data, | |
201 | 207 | success(res) { |
202 | 208 | data.isShowLoading && th.hideLoading(); |
203 | 209 | resolve(res); | ... | ... |