Commit 9352fc9f0c87df9b61f5d2af3a4f9bbaf3cb7c3e

Authored by yvan.ni
1 parent 32d41c0b

会员中心自定义的优化

components/diy_user_my_rights/diy_user_my_rights.js
... ... @@ -9,15 +9,29 @@ Component({
9 9 type: Object,
10 10 value: null
11 11 },
12   -
  12 + b_gift:{
  13 + type: Object,
  14 + value: null
  15 + },
13 16 },
14 17 data: {
15 18 iurl:os.imghost,
16 19 qy_list:[]
17 20 },
18 21 methods: {
19   - // 这里是一个自定义方法
20   - customMethod() { }
  22 +
  23 + //
  24 + clike_banne: function () {
  25 + var th = this;
  26 + var actId = th.properties.b_gift.actId;
  27 + var giftbagid = th.properties.b_gift.giftbagid;
  28 +
  29 + if (actId != "" && giftbagid != "") {
  30 + getApp().goto("/pages/giftpack/birthdaygift/birthdaygift?actId=" + actId + "&gifbagid=" + giftbagid + "&orderType=" + 3);
  31 + } else {
  32 + getApp().showWarning("请稍后重试");
  33 + }
  34 + },
21 35 },
22 36 observers: {
23 37 // 监听 num1 和 num2 数据的变化
... ... @@ -34,7 +48,6 @@ Component({
34 48 }
35 49 this.setData({qy_list:arr})
36 50 }
37   -
38 51 }
39 52 },
40 53  
... ...
components/diy_user_my_rights/diy_user_my_rights.wxml
... ... @@ -48,4 +48,12 @@
48 48 未找到数据
49 49 </view>
50 50 </block>
51   -</view>
52 51 \ No newline at end of file
  52 +</view>
  53 +
  54 + <!-- 生日营销 is_banner-->
  55 +<block wx:if="{{b_gift}}">
  56 + <view class="t-c banner-frame" bindtap="clike_banne">
  57 + <image class="banner-img" src="{{b_gift.actImg==''?iurl+'/miniapp/images/user/banner-img.jpg':iurl+b_gift.actImg}}">
  58 + </image>
  59 + </view>
  60 +</block>
53 61 \ No newline at end of file
... ...
components/diy_user_my_rights/diy_user_my_rights.wxss
... ... @@ -82,3 +82,23 @@
82 82 width: 60rpx;
83 83 height: 60rpx;
84 84 }
  85 +
  86 +/*---生日营销的显示 ---*/
  87 +.banner-img {
  88 + width: 95%;
  89 + height: 140rpx;
  90 + border-radius: 10px 10px 0px 0px;
  91 + margin-bottom: -5rpx;
  92 +
  93 +}
  94 +
  95 +.banner-frame {
  96 + width: 100%;
  97 + background: #f2f2f2;
  98 +}
  99 +
  100 +button::after {
  101 + border: 0
  102 +}
  103 +
  104 +
... ...
components/diy_user_order/diy_user_order.js
  1 +var os = getApp().globalData.setting;
1 2 Component({
2 3 properties: {
3 4 object: {
... ... @@ -8,8 +9,7 @@ Component({
8 9  
9 10 },
10 11 data: {
11   - // 这里是一些组件内部数据
12   - someData: {}
  12 + iurl:os.imghost,
13 13 },
14 14 methods: {
15 15 // 这里是一个自定义方法
... ...
components/diy_user_order/diy_user_order.wxml
1   -<view class='assist' style='height:{{object.height*2}}rpx;background-color:{{object.bgcolor}}'></view>
2 1 \ No newline at end of file
  2 +<view class="xc-after-sale rel">
  3 + <!-- 顶上的一栏 -->
  4 + <view class="xc-equity-title flex-level" wx:if="{{object.is_title}}">
  5 + <view class="xc-title-frame flex ai-center">
  6 + <view class="flex-vertical xc-title-content" bindtap="go_order" data-url="/pages/user/order_list/order_list">
  7 + <image class="xc-title-img" src="{{iurl}}/miniapp/images/hdindan.png" style="width: 50rpx; height: 55rpx;margin-right: 5rpx"></image>
  8 + <view class="three-level-word">我的订单</view>
  9 + </view>
  10 + <!-- 物流信息提醒 -->
  11 + <view class="fs26 c-5 pdl60" wx:if="{{countDadaOrder && countDadaOrder != 0}}" bindtap="go_order" data-url="/pages/user/order_list/order_list?index=1"><text class="iconfont icon-dingwei"></text>您有<text class="c-red">{{countDadaOrder}}</text>个同城配送订单</view>
  12 + </view>
  13 + <view class="three-level-word xc-more-frame flex-vertical" bindtap="go_order" data-url="/pages/user/order_list/order_list">
  14 + <view class="three-level-word xc-more">更多</view>
  15 + <view class="bg_right xc-more-click bcolor"></view>
  16 + </view>
  17 + </view>
  18 + <!-- 内容的一栏 -->
  19 + <view class="xc-after-sale-left flex-center-around">
  20 + <block wx:for="{{object.list}}">
  21 + <!-- 判断自定义的判断显示-->
  22 + <block wx:if="{{item.show}}">
  23 + <block wx:if="{{item.name=='待付款'}}">
  24 + <view class="t-c margin-auto rel" bindtap="go_order" data-url="/pages/user/order_list/order_list?type=1">
  25 + <image mode="heightFix" wx:if="{{object.is_icon}}" class="xc-no-money" src="{{iurl}}/miniapp/images/daifuk.png"></image>
  26 + <view class=" xc-word-color four-level-word">待付款</view>
  27 + <text class="order-num" hidden='{{toji.wait_pay>0?"":"true"}}'>{{toji.wait_pay}}</text>
  28 + </view>
  29 + </block>
  30 + <block wx:if="{{item.name=='待发货'}}">
  31 + <view class="t-c margin-auto rel" bindtap="go_order" data-url="/pages/user/order_list/order_list?type=2">
  32 + <image mode="heightFix" wx:if="{{object.is_icon}}" class="xc-send" src="{{iurl}}/miniapp/images/dfahuo.png?v=1"></image>
  33 + <view class="xc-word-color four-level-word">待发货</view>
  34 + <text class="order-num" hidden='{{toji.wait_send>0?"":"true"}}'>{{toji.wait_send}}</text>
  35 + </view>
  36 +
  37 + </block>
  38 + <block wx:if="{{item.name=='待收货'}}">
  39 + <view class="t-c margin-auto rel" bindtap="go_order" data-url="/pages/user/order_list/order_list?type=3">
  40 + <image mode="heightFix" wx:if="{{object.is_icon}}" class="xc-await" src="{{iurl}}/miniapp/images/shouhuo1.png"></image>
  41 + <view class="xc-word-color four-level-word">待收货</view>
  42 + <text class="order-num" hidden='{{toji.wait_receive>0?"":"true"}}'>{{toji.wait_receive}}</text>
  43 + </view>
  44 +
  45 + </block>
  46 + <block wx:if="{{item.name=='待评论'}}">
  47 + <view class="t-c margin-auto rel" bindtap="go_order" data-url="/pages/user/order_list/order_list?type=4">
  48 + <image mode="heightFix" wx:if="{{object.is_icon}}" class="xc-no-money" src="{{iurl}}/miniapp/images/dpr1.png"></image>
  49 + <view class="xc-word-color four-level-word">待评论</view>
  50 + <text class="order-num" hidden='{{toji.wait_pj>0?"":"true"}}'>{{toji.wait_pj}}</text>
  51 + </view>
  52 +
  53 + </block>
  54 + <block wx:if="{{item.name=='售后/退款'}}">
  55 + <view class="t-c margin-auto rel" style='margin-left:30rpx;' bindtap="go_order" data-url="/packageF/pages/user/return_goods_list/return_goods_list">
  56 + <image mode="heightFix" wx:if="{{object.is_icon}}" class="xc-no-money" src="{{iurl}}/miniapp/images/shouh1.png"></image>
  57 + <view style='height:36rpx;'> </view>
  58 + <view class="xc-word-color four-level-word abs">售后/退款</view>
  59 + </view>
  60 + </block>
  61 + </block>
  62 + </block>
  63 + </view>
  64 + <view style="clear: both"></view>
  65 +</view>
... ...
components/diy_user_order/diy_user_order.wxss
1   -.assist{
  1 +@import '../../app.wxss';
  2 +.xc-after-sale {
2 3 width: 100%;
3   - /*border:1px solid #00F;*/
4   -}
5 4 \ No newline at end of file
  5 + border-bottom: 10px solid #f2f2f2;
  6 +}
  7 +.xc-after-sale-left {
  8 + width: 96%;
  9 + height: 100%;
  10 + margin-top: 40rpx;
  11 + margin-bottom: 25rpx;
  12 +}
  13 +
  14 +
  15 +.xc-equity-title {
  16 + width: 100%;
  17 + height: 79rpx;
  18 + border-bottom: 1rpx solid #f2f2f2;
  19 +}
  20 +.xc-title-img {
  21 + width: 50rpx;
  22 + height: 50rpx;
  23 + margin-left: 20rpx;
  24 +}
  25 +
  26 +
  27 +.xc-title-frame {
  28 + width: 85%;
  29 + height: 100%;
  30 +}
  31 +.xc-title-content {
  32 + height: 100%;
  33 +}
  34 +.xc-more-frame {
  35 + width: 16.1%;
  36 + height: 100%;
  37 +}
  38 +.xc-more {
  39 + color: #878787;
  40 +}
  41 +
  42 +.xc-more-click {
  43 + width: 15rpx;
  44 + height: 15rpx;
  45 + margin-left: 10rpx;
  46 + color: #898989;
  47 +}
  48 +
  49 +
  50 +.bg_right.bcolor,
  51 +.bg_left.bcolor {
  52 + border-color: #333;
  53 +}
  54 +
  55 +.bg_right.mt {
  56 + margin-top: -9rpx;
  57 +}
  58 +
  59 +.bg_right.mt2 {
  60 + margin-top: -5rpx;
  61 +}
  62 +
  63 +.xc-no-money {
  64 + width: auto;
  65 + height: 50rpx;
  66 +}
  67 +
  68 +.xc-send {
  69 + width: auto;
  70 + height: 50rpx;
  71 +}
  72 +.xc-await {
  73 + width: auto;
  74 + height: 50rpx;
  75 +}
  76 +
  77 +
  78 +.xc-word-color {
  79 + color: #595758;
  80 + top: 61rpx;
  81 + width: 110rpx;
  82 + right: -28rpx;
  83 +}
  84 +.order-num {
  85 + position: absolute;
  86 + right: 0rpx;
  87 + top: -18rpx;
  88 + width: 35rpx;
  89 + height: 35rpx;
  90 + line-height: 35rpx;
  91 + font-size: 22rpx;
  92 + border-radius: 50%;
  93 + background-color: rgba(217, 81, 99, 0.9);
  94 + color: #fff;
  95 +}
... ...
components/diy_user_tools_services/diy_user_tools_services.wxml
1   -<wxs src="filter.wxs" module="util"></wxs>
2 1 <!-- 工具与服务 -->
3 2 <view class="xc-tool-service">
4 3 <view class="xc-tool-service-title flex-vertical" wx:if="{{object.is_title}}">
... ...
packageG/pages/user_template/index.js
1   -
2 1 var t = getApp(),
3   - a = t.request,
4   - os = t.globalData.setting,
5   - ut = require("../../../utils/util.js"),
6   - com = require("../../../utils/common.js");
7   - var regeneratorRuntime = require('../../../utils/runtime.js');
  2 + a = t.request,
  3 + os = t.globalData.setting,
  4 + ut = require("../../../utils/util.js"),
  5 + com = require("../../../utils/common.js");
  6 +var regeneratorRuntime = require('../../../utils/runtime.js');
8 7 const rq = require("../../../utils/request.js");
9   - var appd = getApp().globalData;
  8 +var appd = getApp().globalData;
10 9  
11 10 Page({
12   - data: {
13   - url: os.imghost,
14   - temp_id:0,
15   - goodsGroupArr:[],
16   - pulscardname:'',
17   - rfmName:'成长值',
18   -
19   - byquan: 0,
20   - yuer: 0,
21   - udata:{},
22   -
23   - is_assistance: 0, //助力活动
24   - },
25   -
26   - onLoad: function(e) {
27   - var th = this;
28   - this.data.temp_id=e.scene;
29   - if(!this.data.temp_id) wx.showModal({ title:"未读取到模板ID" ,})
30   -
31   - var first_leader = e.first_leader;
32   - if (first_leader) {
33   - //-- user_id代过来免登录 --
34   - getApp().globalData.first_leader = first_leader;
35   - //调用接口判断是不是会员
36   - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
37   - if (res.data.code == 0) {
38   - getApp().globalData.guide_id = res.data.data.id;
39   - getApp().globalData.guide_pick_id= res.data.data.pickup_id
40   - }
41   - })
42   - }
43   -
44   - if(!getApp().globalData.userInfo) {
45   - getApp().goto('/packageE/pages/togoin/togoin');
46   - }
47   -
48   - },
49   -
50   - async onShow() {
51   - getApp().check_can_share();
52   - var th = this;
53   -
54   - /*-------系统是否开通等级卡,会员是等级卡-----*/
55   - getApp().getConfig2(function (e) {
56   - var t_swi = e.switch_list;
57   - if (t_swi) t_swi = JSON.parse(t_swi)
58   - if (t_swi) {
59   - th.setData({sys_switch: t_swi});
60   - var user_tool = [];
61   - if (t_swi.usertool) user_tool = JSON.parse(t_swi.usertool);
62   - th.setData({c_list: user_tool});
63   -
64   - if (parseInt(t_swi.rank_switch) == 2) {
65   - var userInfo = th.data.userInfo;
66   - if (userInfo && userInfo.card_field != null && userInfo.card_field != undefined && userInfo.card_field != "") {
67   - var now = ut.gettimestamp();
68   - var str = userInfo.card_expiredate;
69   - var end = new Date(str);
70   - end = Date.parse(end) / 1000;
71   - //---判断是不是有过期---
72   - if (now < end) {
73   - th.setData({
74   - is_dengji: 1
75   - })
76   - } else {
77   - th.setData({
78   - is_dengji: 3
79   - })
80   - }
81   - } else {
82   - th.setData({
83   - is_dengji: 2
84   - })
85   - }
86   - }
87   - }
88   - })
89   -
90   - //--初始化是否有打勾,--
91   - getApp().request.get("/api/weshop/users/grade/vip/init/get", {
92   - data: {
93   - storeId: os.stoid
94   - },
95   - success: function (rs) {
96   - if (rs.data.code == 0 && rs.data.data.isBool) {
97   - th.setData({ is_init: 1 });
98   - /*-----获取会员权益列表-----*/
99   - rq.get("/api/weshop/users/grade/vipprivilegeinfo/page", {
100   - isShowLoading: 0,
101   - data: {
102   - storeId: os.stoid,
103   - pageSize: 100
104   - },
105   - success: async function (res) {
106   -
107   - //判断有没有值,没有值返回
108   - if (!ut.ajax_ok(res)) return false;
109   -
110   - var arr_data = res.data.data.pageData;
111   - var gid = null,
112   - g_qy_list = null,
113   - cz_vals = 0,
114   - need_money = 0,
115   - backClass = null,
116   - GradeName = '';
117   -
118   - var app_d=getApp().globalData;
119   -
120   - //获取成长值
121   - await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get", {
122   - data: {
123   - storeId: os.stoid,
124   - userId: app_d.user_id
125   - }
126   - }).then(res => {
127   - if (res.data.code == 0 && res.data.data) {
128   - gid = res.data.data.GradeId;
129   - var cz_val = res.data.data.GradeSum;
130   - cz_vals = parseInt(cz_val);
131   - GradeName = res.data.data.GradeName;
132   - }
133   - //th.setData({ cz_val: cz_vals, GradeName: res.data.data.GradeName, is_init: is_init, gradeId: gid});
134   - })
135   - var obj = {
136   - cz_val: cz_vals,
137   - GradeName: GradeName,
138   - gradeId: gid,
139   - is_grad_get: 1
140   - };
141   -
142   - // 获取最大值
143   - await getApp().request.promiseGet("/api/weshop/users/grade/vipgradeinfo/page", {
144   - data: {
145   - storeId: os.stoid
146   - }
147   - }).then(res => {
148   - if (res.data.data)
149   - backClass = res.data.data.pageData;
150   - if (backClass) {
151   - var full_cz_val = backClass[backClass.length - 1].BuyGradeSum;
152   - obj.full_cz_val = full_cz_val
153   - }
154   - })
155   -
156   - //--会员权益中心页的修改--
157   - for (var i in backClass) {
158   - var im = backClass[i];
159   - if (cz_vals < im.BuyGradeSum && need_money == 0) {
160   - need_money = im.BuyGradeSum;
161   - obj.need_money = need_money;
162   - }
163   - }
164   -
165   - //获取当前等级的特权
166   - await getApp().request.promiseGet("/api/weshop/users/grade/privilegeform/list/page", {
167   - data: {
168   - storeId: os.stoid,
169   - GradeId: gid,
170   - userId: app_d.user_id,
171   - pageSize: 100
172   - }
173   - }).then(res => {
174   - if (res.data.data)
175   - g_qy_list = res.data.data.pageData;
176   - });
177   -
178   - for (var i in arr_data) {
179   - var item = arr_data[i];
180   - var FromId = th.check_is_has_qy(item, g_qy_list);
181   - arr_data[i].ishas = 0;
182   - if (FromId) {
183   - arr_data[i].ishas = 1;
184   - arr_data[i].FromId = FromId;
185   - }
186   - }
187   - arr_data.sort(function (a, b) {
188   - return b.ishas - a.ishas
189   - })
190   -
191   - //4个4个一组
192   - var arr = new Array();
193   - for (var i = 0; i < arr_data.length; i += 4) {
194   - arr.push(arr_data.slice(i, i + 4));
195   - }
196   - //th.setData({ qy_list: arr, need_money: need_money});
197   - obj.qy_list = arr;
198   - obj.old_qy_list = arr_data;
199   - th.setData(obj);
200   - obj.is_init=1;
201   - th.setData({qy_data:obj})
202   - }
203   - })
204   - }
205   - }
206   - })
207   - this.puls_user();
208   - this.getVison();
209   -
210   - //-----获取线下会员的预存款和优惠券的数量-----
211   - getApp().request.get("/api/weshop/users/getinfo/" + os.stoid + "/" +getApp().globalData.user_id, {
212   - isShowLoading: 0,
213   - success: function (su) {
214   - if (su.data.code == 0 && su.data.data) {
215   - var data = su.data.data;
216   - if (!data) data = {};
217   - data.cashcount = parseInt(data.cashcount);
218   - th.setData({
219   - udata: data,
220   - });
221   - }
222   -
223   - }
224   - })
225   -
226   - //-----获取会员提现金额-----
227   - getApp().request.get("/api/weshop/withdrawals/summoney", {
228   - isShowLoading: 0,
229   - data: {
230   - user_id: getApp().globalData.user_id,
231   - store_id: os.stoid,
232   - status: 0
233   - },
234   - success: function (su) {
235   - if (su.data.code == 0) {
236   -
237   - let user=getApp().globalData.userInfo;
238   - var yuer = parseFloat(user.user_money - user.frozen_money - su.data.data.summoney).toFixed(2);
239   - th.setData({
240   - txmon: su.data.data.summoney,
241   - yuer: yuer
242   - });
243   - }
244   - }
245   - })
246   -
247   - /*-----获取会员包邮券的数量-----*/
248   - getApp().request.get("/api/weshop/userfeemail/page", {
249   - isShowLoading: 0,
250   - data: {
251   - user_id:getApp().globalData.user_id,
252   - store_id: os.stoid,
253   - pageSize: 1,
254   - isuse: 0
255   - },
256   - success: function (su) {
257   - if (su.data.code == 0) {
258   - th.setData({
259   - byquan: parseInt(su.data.data.total)
260   - });
261   - }
262   - }
263   - });
264   -
265   - //判断一下是不是助力活动
266   - this.is_assistance();
267   - //获取工具
268   - await this.init_user_tool();
269   -
270   -
271   - //获取自定义模板
272   - await this.init_load();
273   -
274   -
275   - },
  11 + data: {
  12 + url: os.imghost,
  13 + temp_id: 0,
  14 + goodsGroupArr: [],
  15 + pulscardname: '',
  16 + rfmName: '成长值',
  17 +
  18 + byquan: 0,
  19 + yuer: 0,
  20 + udata: {},
  21 +
  22 + is_assistance: 0, //助力活动
  23 + b_gift:null //
  24 + },
276 25  
277   - //获取商品模块实例
278   - newGoodsGroup(){
279   - let arr=[]
280   - if (this.data.template_arr.length == 0) {
281   - return
282   - }
283   - this.data.template_arr.map((item,index)=>{
284   - if (item.ename == 'goodsGroup') {
285   - arr.push(`goodsGroup${index}`)
286   - }
287   - })
288   - if (arr.length > 0) {
289   - this.setData({
290   - goodsGroupArr : arr
291   - })
292   - arr.map(item=>{
293   - let a = '.'+item
294   - this[item] = this.selectComponent(a);
295   - })
296   - }
297   - },
298   - //当隐藏的时候就关闭计时器
299   - onHide: function() {
300   -
301   - },
302   - //同步初始加载
303   - async init_load() {
304   - var th = this;
305   - //因为营销版本的功能包含了自定义模板的功能,是同时的
306   - //读取全局是否有弄自定义模板
307   - await getApp().request.promiseGet("/api/weshop/store_module/get/"+th.data.temp_id+"/8",{1:1} ).then(res => {
308   - var data = res.data.data;
309   - if (data) {
310   - var temp_data = data;
311   - wx.setNavigationBarTitle({
312   - title: temp_data.page_title,
313   - });
314   - var t_arr = JSON.parse(temp_data.json_str);
315   - th.setData({
316   - share_title:temp_data.page_title,
317   - template_arr: t_arr,
318   - isTemplate: 1,
319   - bgcolor_t: temp_data.bkcolor
  26 + onLoad: function (e) {
  27 + var th = this;
  28 + this.data.temp_id = e.scene;
  29 + if (!this.data.temp_id) wx.showModal({title: "未读取到模板ID",})
  30 +
  31 + var first_leader = e.first_leader;
  32 + if (first_leader) {
  33 + //-- user_id代过来免登录 --
  34 + getApp().globalData.first_leader = first_leader;
  35 + //调用接口判断是不是会员
  36 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  37 + if (res.data.code == 0) {
  38 + getApp().globalData.guide_id = res.data.data.id;
  39 + getApp().globalData.guide_pick_id = res.data.data.pickup_id
  40 + }
  41 + })
  42 + }
  43 +
  44 + if (!getApp().globalData.userInfo) {
  45 + getApp().goto('/packageE/pages/togoin/togoin');
  46 + }
  47 +
  48 + },
  49 +
  50 + async onShow() {
  51 + getApp().check_can_share();
  52 + var th = this;
  53 +
  54 + /*-------系统是否开通等级卡,会员是等级卡-----*/
  55 + getApp().getConfig2(function (e) {
  56 + var t_swi = e.switch_list;
  57 + if (t_swi) t_swi = JSON.parse(t_swi)
  58 + if (t_swi) {
  59 + th.setData({sys_switch: t_swi});
  60 + var user_tool = [];
  61 + if (t_swi.usertool) user_tool = JSON.parse(t_swi.usertool);
  62 + th.setData({c_list: user_tool});
  63 +
  64 + if (parseInt(t_swi.rank_switch) == 2) {
  65 + var userInfo = th.data.userInfo;
  66 + if (userInfo && userInfo.card_field != null && userInfo.card_field != undefined && userInfo.card_field != "") {
  67 + var now = ut.gettimestamp();
  68 + var str = userInfo.card_expiredate;
  69 + var end = new Date(str);
  70 + end = Date.parse(end) / 1000;
  71 + //---判断是不是有过期---
  72 + if (now < end) {
  73 + th.setData({
  74 + is_dengji: 1
  75 + })
  76 + } else {
  77 + th.setData({
  78 + is_dengji: 3
  79 + })
  80 + }
  81 + } else {
  82 + th.setData({
  83 + is_dengji: 2
  84 + })
  85 + }
  86 + }
  87 + }
  88 + })
  89 +
  90 + //--我的权益初始化是否有打勾,--
  91 + getApp().request.get("/api/weshop/users/grade/vip/init/get", {
  92 + data: {
  93 + storeId: os.stoid
  94 + },
  95 + success: function (rs) {
  96 + if (rs.data.code == 0 && rs.data.data.isBool) {
  97 + th.setData({is_init: 1});
  98 + /*-----获取会员权益列表-----*/
  99 + rq.get("/api/weshop/users/grade/vipprivilegeinfo/page", {
  100 + isShowLoading: 0,
  101 + data: {
  102 + storeId: os.stoid,
  103 + pageSize: 100
  104 + },
  105 + success: async function (res) {
  106 +
  107 + //判断有没有值,没有值返回
  108 + if (!ut.ajax_ok(res)) return false;
  109 +
  110 + var arr_data = res.data.data.pageData;
  111 + var gid = null,
  112 + g_qy_list = null,
  113 + cz_vals = 0,
  114 + need_money = 0,
  115 + backClass = null,
  116 + GradeName = '';
  117 +
  118 + var app_d = getApp().globalData;
  119 +
  120 + //获取成长值
  121 + await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get", {
  122 + data: {
  123 + storeId: os.stoid,
  124 + userId: app_d.user_id
  125 + }
  126 + }).then(res => {
  127 + if (res.data.code == 0 && res.data.data) {
  128 + gid = res.data.data.GradeId;
  129 + var cz_val = res.data.data.GradeSum;
  130 + cz_vals = parseInt(cz_val);
  131 + GradeName = res.data.data.GradeName;
  132 + }
  133 + //th.setData({ cz_val: cz_vals, GradeName: res.data.data.GradeName, is_init: is_init, gradeId: gid});
  134 + })
  135 + var obj = {
  136 + cz_val: cz_vals,
  137 + GradeName: GradeName,
  138 + gradeId: gid,
  139 + is_grad_get: 1
  140 + };
  141 +
  142 + // 获取最大值
  143 + await getApp().request.promiseGet("/api/weshop/users/grade/vipgradeinfo/page", {
  144 + data: {
  145 + storeId: os.stoid
  146 + }
  147 + }).then(res => {
  148 + if (res.data.data)
  149 + backClass = res.data.data.pageData;
  150 + if (backClass) {
  151 + var full_cz_val = backClass[backClass.length - 1].BuyGradeSum;
  152 + obj.full_cz_val = full_cz_val
  153 + }
  154 + })
  155 +
  156 + //--会员权益中心页的修改--
  157 + for (var i in backClass) {
  158 + var im = backClass[i];
  159 + if (cz_vals < im.BuyGradeSum && need_money == 0) {
  160 + need_money = im.BuyGradeSum;
  161 + obj.need_money = need_money;
  162 + }
  163 + }
  164 +
  165 + //获取当前等级的特权
  166 + await getApp().request.promiseGet("/api/weshop/users/grade/privilegeform/list/page", {
  167 + data: {
  168 + storeId: os.stoid,
  169 + GradeId: gid,
  170 + userId: app_d.user_id,
  171 + pageSize: 100
  172 + }
  173 + }).then(res => {
  174 + if (res.data.data)
  175 + g_qy_list = res.data.data.pageData;
  176 + });
  177 +
  178 + for (var i in arr_data) {
  179 + var item = arr_data[i];
  180 + var FromId = th.check_is_has_qy(item, g_qy_list);
  181 + arr_data[i].ishas = 0;
  182 + if (FromId) {
  183 + arr_data[i].ishas = 1;
  184 + arr_data[i].FromId = FromId;
  185 + }
  186 + }
  187 + arr_data.sort(function (a, b) {
  188 + return b.ishas - a.ishas
  189 + })
  190 +
  191 + //4个4个一组
  192 + var arr = new Array();
  193 + for (var i = 0; i < arr_data.length; i += 4) {
  194 + arr.push(arr_data.slice(i, i + 4));
  195 + }
  196 + //th.setData({ qy_list: arr, need_money: need_money});
  197 + obj.qy_list = arr;
  198 + obj.old_qy_list = arr_data;
  199 + th.setData(obj);
  200 + obj.is_init = 1;
  201 + th.setData({qy_data: obj})
  202 + }
  203 + })
  204 + }
  205 + }
  206 + })
  207 + this.puls_user();
  208 + this.getVison();
  209 +
  210 + //-----获取线下会员的预存款和优惠券的数量-----
  211 + getApp().request.get("/api/weshop/users/getinfo/" + os.stoid + "/" + getApp().globalData.user_id, {
  212 + isShowLoading: 0,
  213 + success: function (su) {
  214 + if (su.data.code == 0 && su.data.data) {
  215 + var data = su.data.data;
  216 + if (!data) data = {};
  217 + data.cashcount = parseInt(data.cashcount);
  218 + th.setData({
  219 + udata: data,
  220 + });
  221 + }
  222 +
  223 + }
  224 + })
  225 +
  226 + //-----获取会员提现金额-----
  227 + getApp().request.get("/api/weshop/withdrawals/summoney", {
  228 + isShowLoading: 0,
  229 + data: {
  230 + user_id: getApp().globalData.user_id,
  231 + store_id: os.stoid,
  232 + status: 0
  233 + },
  234 + success: function (su) {
  235 + if (su.data.code == 0) {
  236 +
  237 + let user = getApp().globalData.userInfo;
  238 + var yuer = parseFloat(user.user_money - user.frozen_money - su.data.data.summoney).toFixed(2);
  239 + th.setData({
  240 + txmon: su.data.data.summoney,
  241 + yuer: yuer
  242 + });
  243 + }
  244 + }
  245 + })
  246 +
  247 + /*-----获取会员包邮券的数量-----*/
  248 + getApp().request.get("/api/weshop/userfeemail/page", {
  249 + isShowLoading: 0,
  250 + data: {
  251 + user_id: getApp().globalData.user_id,
  252 + store_id: os.stoid,
  253 + pageSize: 1,
  254 + isuse: 0
  255 + },
  256 + success: function (su) {
  257 + if (su.data.code == 0) {
  258 + th.setData({
  259 + byquan: parseInt(su.data.data.total)
  260 + });
  261 + }
  262 + }
320 263 });
321   - setTimeout(()=>{
322   - th.newGoodsGroup()
323   - },1000)
324 264  
325   - //---如果有设定顶部的颜色的时候--
326   - if(temp_data.top_color && temp_data.top_color!='null' ){
  265 + //判断一下是不是助力活动
  266 + this.is_assistance();
  267 + //获取工具
  268 + await this.init_user_tool();
  269 + //获取一下生日相关
  270 + this.birthday();
  271 +
  272 +
  273 + //获取自定义模板
  274 + await this.init_load();
  275 +
327 276  
328   - var top_w_color="#ffffff";
329   - if(temp_data.top_word_color && temp_data.top_word_color=='black'){
330   - top_w_color="#000000";
  277 + },
  278 +
  279 + //获取商品模块实例
  280 + newGoodsGroup() {
  281 + let arr = []
  282 + if (this.data.template_arr.length == 0) {
  283 + return
  284 + }
  285 + this.data.template_arr.map((item, index) => {
  286 + if (item.ename == 'goodsGroup') {
  287 + arr.push(`goodsGroup${index}`)
331 288 }
  289 + })
  290 + if (arr.length > 0) {
  291 + this.setData({
  292 + goodsGroupArr: arr
  293 + })
  294 + arr.map(item => {
  295 + let a = '.' + item
  296 + this[item] = this.selectComponent(a);
  297 + })
  298 + }
  299 + },
  300 + //当隐藏的时候就关闭计时器
  301 + onHide: function () {
  302 +
  303 + },
  304 + //同步初始加载
  305 + async init_load() {
  306 + var th = this;
  307 + //因为营销版本的功能包含了自定义模板的功能,是同时的
  308 + //读取全局是否有弄自定义模板
  309 + await getApp().request.promiseGet("/api/weshop/store_module/get/" + th.data.temp_id + "/8", {1: 1}).then(res => {
  310 + var data = res.data.data;
  311 + if (data) {
  312 + var temp_data = data;
  313 + wx.setNavigationBarTitle({
  314 + title: temp_data.page_title,
  315 + });
  316 + var t_arr = JSON.parse(temp_data.json_str);
  317 + th.setData({
  318 + share_title: temp_data.page_title,
  319 + template_arr: t_arr,
  320 + isTemplate: 1,
  321 + bgcolor_t: temp_data.bkcolor
  322 + });
  323 + setTimeout(() => {
  324 + th.newGoodsGroup()
  325 + }, 1000)
  326 +
  327 + //---如果有设定顶部的颜色的时候--
  328 + if (temp_data.top_color && temp_data.top_color != 'null') {
  329 +
  330 + var top_w_color = "#ffffff";
  331 + if (temp_data.top_word_color && temp_data.top_word_color == 'black') {
  332 + top_w_color = "#000000";
  333 + }
  334 +
  335 + wx.setNavigationBarColor({
  336 + frontColor: top_w_color, // 必写项
  337 + backgroundColor: temp_data.top_color, // 必写项
  338 + })
  339 + }
  340 +
  341 + }
  342 + })
  343 + },
  344 +
  345 + onPullDownRefresh: function (e) {
  346 +
  347 + },
  348 +
  349 +
  350 + onShareAppMessage: async function (e) {
  351 + var th = this;
  352 + getApp().globalData.no_clear = 1;
  353 + getApp().getConfig(await function (e) {
  354 + th.setData({
  355 + store_config: e
  356 + })
  357 + }.bind(this))
332 358  
333   - wx.setNavigationBarColor({
334   - frontColor: top_w_color, // 必写项
335   - backgroundColor: temp_data.top_color, // 必写项
336   - })
  359 + var url = `pages/template/index?sence=` + this.data.temp_id;
  360 + var userInfo = getApp().globalData.userInfo;
  361 + //是分销商才带
  362 + if (userInfo) {
  363 + url += "&first_leader=" + userInfo.user_id;
337 364 }
338   -
339   - }
340   - })
341   - },
342   -
343   - onPullDownRefresh: function(e) {
344   -
345   - },
346   -
347   -
348   - onShareAppMessage:async function(e) {
349   - var th=this;
350   - getApp().globalData.no_clear=1;
351   - getApp().getConfig(await function(e){
352   - th.setData({
353   - store_config:e
354   - })
355   - }.bind(this))
356   -
357   - var url= `pages/template/index?sence=`+this.data.temp_id;
358   - var userInfo = getApp().globalData.userInfo;
359   - //是分销商才带
360   - if (userInfo) {
361   - url += "&first_leader=" + userInfo.user_id;
362   - }
363   -
364   - var ob = {
365   - title: this.data.share_title,
366   - path: url,
367   - //imageUrl:this.data.url+this.data.store_config.store_logo,
368   - };
369   - return ob;
370   - },
371   -
372   - /**
373   - * 用户分享朋友圈
374   - */
375   - async onShareTimeline(){
376   -
377   - var th=this;
378   - getApp().globalData.no_clear=1;
379   - getApp().getConfig(await function(e){
380   - th.setData({
381   - store_config:e
382   - })
383   - }.bind(this))
384   - var {share_title,temp_id,store_config} = this.data;
385   - var url= `sence=${temp_id}`;
386   -
387   - var userInfo = getApp().globalData.userInfo;
388   - //是分销商才带
389   - if (userInfo) {
390   - url += "&first_leader=" + userInfo.user_id;
391   - }
392   -
393   - var ob = {
394   - title:share_title,
395   - query:url,
396   - //imageUrl:this.data.url+store_config.store_logo,
397   - };
398   - console.log(ob);
399   - return ob;
400   -},
  365 +
  366 + var ob = {
  367 + title: this.data.share_title,
  368 + path: url,
  369 + //imageUrl:this.data.url+this.data.store_config.store_logo,
  370 + };
  371 + return ob;
  372 + },
  373 +
  374 + /**
  375 + * 用户分享朋友圈
  376 + */
  377 + async onShareTimeline() {
  378 +
  379 + var th = this;
  380 + getApp().globalData.no_clear = 1;
  381 + getApp().getConfig(await function (e) {
  382 + th.setData({
  383 + store_config: e
  384 + })
  385 + }.bind(this))
  386 + var {share_title, temp_id, store_config} = this.data;
  387 + var url = `sence=${temp_id}`;
  388 +
  389 + var userInfo = getApp().globalData.userInfo;
  390 + //是分销商才带
  391 + if (userInfo) {
  392 + url += "&first_leader=" + userInfo.user_id;
  393 + }
  394 +
  395 + var ob = {
  396 + title: share_title,
  397 + query: url,
  398 + //imageUrl:this.data.url+store_config.store_logo,
  399 + };
  400 + console.log(ob);
  401 + return ob;
  402 + },
401 403  
402 404 //---加载更多是靠这个函数----
403   - onReachBottom: function() {
404   - if(getApp().globalData.func_list)
405   - {
406   - for(let i in getApp().globalData.func_list){
407   - let item=getApp().globalData.func_list[i];
408   - item.re_show();
  405 + onReachBottom: function () {
  406 + if (getApp().globalData.func_list) {
  407 + for (let i in getApp().globalData.func_list) {
  408 + let item = getApp().globalData.func_list[i];
  409 + item.re_show();
409 410 }
410   - }
  411 + }
411 412  
412 413 //自定义时商品自动加载更多
413   - let goodsGroupArr = this.data.goodsGroupArr
414   - if (this.data.isTemplate && goodsGroupArr.length >0) {
415   - goodsGroupArr.map(item=>{
416   - this[item].automore()
417   - })
418   - }
  414 + let goodsGroupArr = this.data.goodsGroupArr
  415 + if (this.data.isTemplate && goodsGroupArr.length > 0) {
  416 + goodsGroupArr.map(item => {
  417 + this[item].automore()
  418 + })
  419 + }
419 420  
420 421 var e = getApp().globalData.userInfo;
421 422 if (e != undefined && e != null && e.mobile) {
... ... @@ -429,14 +430,14 @@ Page({
429 430 },
430 431  
431 432 //-----Plus会员获取-----------
432   - puls_user: function() {
  433 + puls_user: function () {
433 434 var th = this;
434 435 getApp().request.get("/api/weshop/plus/vip/mem/list", {
435 436 data: {
436 437 storeId: os.stoid,
437 438 userId: getApp().globalData.user_id,
438 439 },
439   - success: function(su) {
  440 + success: function (su) {
440 441 if (su.data.code == 0) {
441 442 var cardname = su.data.data[0].MemCardName;
442 443 th.setData({
... ... @@ -459,20 +460,20 @@ Page({
459 460 },
460 461  
461 462 //获取会员权益等级是否升级
462   - getVison(){
  463 + getVison() {
463 464 let isRfm = wx.getStorageSync('isRfm')
464 465 if (isRfm) {
465 466 this.setData({
466   - rfmName:'综合分'
  467 + rfmName: '综合分'
467 468 })
468   - }else{
  469 + } else {
469 470 rq.get(`/api/weshop/users/grade/vip/getSysPara?storeId=${os.stoid}&classInfo=IsUpRMF`, {
470   - success: (res)=>{
  471 + success: (res) => {
471 472 console.log('会员权益等级升级查询-------');
472 473 console.log(res);
473   - if (res.data.code == 0 && res.data.data && res.data.data.IsBool){
  474 + if (res.data.code == 0 && res.data.data && res.data.data.IsBool) {
474 475 this.setData({
475   - rfmName:'综合分'
  476 + rfmName: '综合分'
476 477 })
477 478 wx.setStorageSync('isRfm', true)
478 479 }
... ... @@ -486,8 +487,7 @@ Page({
486 487 init_user_tool: async function () {
487 488 var d_list = null;
488 489 //读取user_tool按钮图标
489   - await getApp().promiseGet("/api/weshop/userTool/page?pageSize=100&store_id=" + os.stoid, {
490   - }).then(res => {
  490 + await getApp().promiseGet("/api/weshop/userTool/page?pageSize=100&store_id=" + os.stoid, {}).then(res => {
491 491 if (ut.ajax_ok(res)) {
492 492 d_list = res.data.data.pageData;
493 493 }
... ... @@ -498,17 +498,16 @@ Page({
498 498 let distribut_end_time = await getApp().user_tools_endTime(2);//过滤掉分销到期的
499 499 await getApp().promiseGet("/api/weshop/storeDistribut/get/" + os.stoid, {}).then(rs => {
500 500 if (rs.data.code == 0 || !rs.data.data) {
501   - var is_ok=1;
502   -
503   - if(!distribut_end_time){
504   - is_ok=0;
505   - }
506   - else if(!rs.data.data){
507   - is_ok=0;
508   - }else{
509   - var dis=rs.data.data;
510   - if(!dis || dis.switch == 0){
511   - is_ok=0;
  501 + var is_ok = 1;
  502 +
  503 + if (!distribut_end_time) {
  504 + is_ok = 0;
  505 + } else if (!rs.data.data) {
  506 + is_ok = 0;
  507 + } else {
  508 + var dis = rs.data.data;
  509 + if (!dis || dis.switch == 0) {
  510 + is_ok = 0;
512 511 }
513 512 }
514 513  
... ... @@ -530,11 +529,11 @@ Page({
530 529 }
531 530 }
532 531 })
533   - this.setData({ user_tool: d_list });
  532 + this.setData({user_tool: d_list});
534 533 },
535 534  
536 535 // 判断助力活动是不是存在
537   - is_assistance: function () {
  536 + is_assistance: function () {
538 537 var th = this, r = Math.random() * 100;
539 538 getApp().promiseGet("/api/weshop/marketing/help/act/judge", {
540 539 data: {
... ... @@ -542,20 +541,37 @@ Page({
542 541 userId: getApp().globalData.user_id,
543 542 r: r,
544 543 }
545   - }).then(res=>{
546   - var code = res.data.code;
547   - if (code == 0) {
548   - th.setData({
549   - is_assistance: 1
550   - });
551   - } else {
552   - th.setData({
553   - is_assistance: 0
554   - });
555   - }
556   - })
  544 + }).then(res => {
  545 + var code = res.data.code;
  546 + if (code == 0) {
  547 + th.setData({
  548 + is_assistance: 1
  549 + });
  550 + } else {
  551 + th.setData({
  552 + is_assistance: 0
  553 + });
  554 + }
  555 + })
557 556 },
558 557  
559   -
560   -
  558 + // 判断生日营销的页面是不是存在
  559 + birthday: function () {
  560 + var th = this;
  561 + getApp().request.get("/api/weshop/marketing/birthday/act/judge", {
  562 + data: { storeId: os.stoid, userId: getApp().globalData.user_id },
  563 + success: function (res) {
  564 + var code = res.data.code;
  565 + if (code == 0) {
  566 + var giftbagid = res.data.data.giftBagId;
  567 + var actId = res.data.data.id;
  568 + var actImg = res.data.data.actImg;
  569 + th.setData({ b_gift:{ giftbagid: giftbagid, actId: actId, actImg: actImg } });
  570 + }
  571 +
  572 + }
  573 + })
  574 + },
  575 +
  576 +
561 577 });
562 578 \ No newline at end of file
... ...
packageG/pages/user_template/index.wxml
... ... @@ -21,7 +21,7 @@
21 21 </block>
22 22 <!-- 我的权益 -->
23 23 <block wx:if="{{item.ename=='my_rights'}}">
24   - <diy_user_my_rights object="{{item.content}}" qy_data="{{qy_data}}" ></diy_user_my_rights>
  24 + <diy_user_my_rights object="{{item.content}}" qy_data="{{qy_data}}" b_gift="{{b_gift}}" ></diy_user_my_rights>
25 25 </block>
26 26 <!-- 工具与服务 -->
27 27 <block wx:if="{{item.ename=='tools_services'}}">
... ...
pages/user/index/index.js
... ... @@ -943,7 +943,7 @@ Page({
943 943 var giftbagid = res.data.data.giftBagId;
944 944 var actId = res.data.data.id;
945 945 var actImg = res.data.data.actImg;
946   - th.setData({ giftbagid: giftbagid, actId: actId, actImg: actImg });
  946 + th.setData({ giftbagid: giftbagid, actId: actId, actImg: actImg, b_gift:{ giftbagid: giftbagid, actId: actId, actImg: actImg } });
947 947 th.setData({ is_banner: 1 });
948 948 }
949 949  
... ...