Commit 78f14073b9422f4daeddbba249c7bc06f45a79fc
Merge branch 'dev' into 'test'
Dev See merge request !203
Showing
3 changed files
with
30 additions
and
6 deletions
pages/user/labels/labels.js
... | ... | @@ -10,11 +10,13 @@ Page({ |
10 | 10 | */ |
11 | 11 | data: { |
12 | 12 | url: a.url, //接口网址 |
13 | + iurl: a.imghost,//图片前缀网址 | |
13 | 14 | interest_lables: [], //兴趣标签 |
14 | 15 | check_label: [], //用户选中的标签集合 |
15 | 16 | user_label_val: "", //奖励多少 |
16 | 17 | user_label_type: "", //奖励类型(1积分,1成长值) |
17 | 18 | is_modify: 0, //判断是第一次填写还是修改(0填写,1修改) |
19 | + isread:0,//是否读取 | |
18 | 20 | }, |
19 | 21 | //点击选择兴趣标签把值放到已选中 |
20 | 22 | click_label: function(e) { |
... | ... | @@ -110,11 +112,15 @@ Page({ |
110 | 112 | }).then(res => { |
111 | 113 | if (res.data.code == 0) { |
112 | 114 | th.setData({ |
113 | - interest_lables: res.data.data.pageData | |
115 | + interest_lables: res.data.data.pageData, | |
116 | + isread:1 | |
114 | 117 | }) |
115 | 118 | th.query_checklabels(); |
116 | 119 | } else { |
117 | 120 | getApp().my_warnning("系统繁忙,请稍后再试", 0, th); |
121 | + th.setData({ | |
122 | + isread: 1 | |
123 | + }) | |
118 | 124 | return false; |
119 | 125 | } |
120 | 126 | }) |
... | ... | @@ -149,7 +155,7 @@ Page({ |
149 | 155 | } |
150 | 156 | } |
151 | 157 | //如何有之前有选择兴趣标签的话,再进来的话就是修改 |
152 | - if (data.VipLabelId != "") { | |
158 | + if (data.VipLabelId !='') { | |
153 | 159 | th.setData({ |
154 | 160 | is_modify: 1 |
155 | 161 | }) |
... | ... | @@ -169,16 +175,17 @@ Page({ |
169 | 175 | var th = this; |
170 | 176 | var is_modify = th.data.is_modify; //是否是修改 |
171 | 177 | var check_label = th.data.check_label; //用户选择 |
178 | + var user_label_val = th.data.user_label_val; //选择标签奖励多少 | |
172 | 179 | var remark = "领取"; |
180 | + var user_label_type = th.data.user_label_type; //赠送类型 | |
173 | 181 | if (is_modify) { |
174 | 182 | user_label_type = 0; |
175 | 183 | remark = "修改"; |
184 | + user_label_val = 0; | |
176 | 185 | } |
177 | 186 | if (check_label.length < 1) { |
178 | 187 | getApp().my_warnning("完成兴趣标签才能" + remark + "哦~", 0, th); |
179 | 188 | } else { |
180 | - var user_label_val = th.data.user_label_val; //选择标签奖励多少 | |
181 | - var user_label_type = th.data.user_label_type; //赠送类型 | |
182 | 189 | var url = "/api/weshop/marketing/holiday/vip/interest/label/update"; //更新标签接口地址 |
183 | 190 | var nav_url = "/pages/user/userinfo/userinfo"; //领取成功之后跳转页面 |
184 | 191 | var vipLabel = ""; //选择的标签名称 |
... | ... | @@ -196,7 +203,7 @@ Page({ |
196 | 203 | } |
197 | 204 | } |
198 | 205 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
199 | - remark = "标签赠送"; | |
206 | + remark = "兴趣标签赠送"; | |
200 | 207 | if (is_modify) { |
201 | 208 | |
202 | 209 | my_confirm.open_cancel(0); | ... | ... |
pages/user/labels/labels.wxml
1 | -<view class="container"> | |
1 | +<view wx:if="{{interest_lables.length>0}}" class="container"> | |
2 | 2 | <!-- 兴趣标签集合 --> |
3 | 3 | <view class="lables padding"> |
4 | 4 | <!-- 兴趣标签标题 --> |
... | ... | @@ -53,6 +53,18 @@ |
53 | 53 | </block> |
54 | 54 | |
55 | 55 | </view> |
56 | + | |
57 | +<view wx:if="{{interest_lables.length<1 && isread}}" class="flex-center fs30" style="overflow: hidden;margin-top:40%;"> | |
58 | +<view> | |
59 | + <view class="flex-center"> | |
60 | + <image class="no_labels" src="{{iurl}}miniapp/images/yyservice/no_history.png"></image> | |
61 | + </view> | |
62 | + <view> | |
63 | + <view>商家还未设置标签,敬请期待!</view> | |
64 | + </view> | |
65 | + </view> | |
66 | +</view> | |
67 | + | |
56 | 68 | <!-- 引入提示组件 --> |
57 | 69 | <warn id="warn"></warn> |
58 | 70 | <my_confirm id="my_confirm"></my_confirm> |
59 | 71 | \ No newline at end of file | ... | ... |