Commit 78f14073b9422f4daeddbba249c7bc06f45a79fc

Authored by 后端研发-苏明海
2 parents 172231a1 d4f24df0

Merge branch 'dev' into 'test'

Dev

See merge request !203
pages/user/labels/labels.js
@@ -10,11 +10,13 @@ Page({ @@ -10,11 +10,13 @@ Page({
10 */ 10 */
11 data: { 11 data: {
12 url: a.url, //接口网址 12 url: a.url, //接口网址
  13 + iurl: a.imghost,//图片前缀网址
13 interest_lables: [], //兴趣标签 14 interest_lables: [], //兴趣标签
14 check_label: [], //用户选中的标签集合 15 check_label: [], //用户选中的标签集合
15 user_label_val: "", //奖励多少 16 user_label_val: "", //奖励多少
16 user_label_type: "", //奖励类型(1积分,1成长值) 17 user_label_type: "", //奖励类型(1积分,1成长值)
17 is_modify: 0, //判断是第一次填写还是修改(0填写,1修改) 18 is_modify: 0, //判断是第一次填写还是修改(0填写,1修改)
  19 + isread:0,//是否读取
18 }, 20 },
19 //点击选择兴趣标签把值放到已选中 21 //点击选择兴趣标签把值放到已选中
20 click_label: function(e) { 22 click_label: function(e) {
@@ -110,11 +112,15 @@ Page({ @@ -110,11 +112,15 @@ Page({
110 }).then(res => { 112 }).then(res => {
111 if (res.data.code == 0) { 113 if (res.data.code == 0) {
112 th.setData({ 114 th.setData({
113 - interest_lables: res.data.data.pageData 115 + interest_lables: res.data.data.pageData,
  116 + isread:1
114 }) 117 })
115 th.query_checklabels(); 118 th.query_checklabels();
116 } else { 119 } else {
117 getApp().my_warnning("系统繁忙,请稍后再试", 0, th); 120 getApp().my_warnning("系统繁忙,请稍后再试", 0, th);
  121 + th.setData({
  122 + isread: 1
  123 + })
118 return false; 124 return false;
119 } 125 }
120 }) 126 })
@@ -149,7 +155,7 @@ Page({ @@ -149,7 +155,7 @@ Page({
149 } 155 }
150 } 156 }
151 //如何有之前有选择兴趣标签的话,再进来的话就是修改 157 //如何有之前有选择兴趣标签的话,再进来的话就是修改
152 - if (data.VipLabelId != "") { 158 + if (data.VipLabelId !='') {
153 th.setData({ 159 th.setData({
154 is_modify: 1 160 is_modify: 1
155 }) 161 })
@@ -169,16 +175,17 @@ Page({ @@ -169,16 +175,17 @@ Page({
169 var th = this; 175 var th = this;
170 var is_modify = th.data.is_modify; //是否是修改 176 var is_modify = th.data.is_modify; //是否是修改
171 var check_label = th.data.check_label; //用户选择 177 var check_label = th.data.check_label; //用户选择
  178 + var user_label_val = th.data.user_label_val; //选择标签奖励多少
172 var remark = "领取"; 179 var remark = "领取";
  180 + var user_label_type = th.data.user_label_type; //赠送类型
173 if (is_modify) { 181 if (is_modify) {
174 user_label_type = 0; 182 user_label_type = 0;
175 remark = "修改"; 183 remark = "修改";
  184 + user_label_val = 0;
176 } 185 }
177 if (check_label.length < 1) { 186 if (check_label.length < 1) {
178 getApp().my_warnning("完成兴趣标签才能" + remark + "哦~", 0, th); 187 getApp().my_warnning("完成兴趣标签才能" + remark + "哦~", 0, th);
179 } else { 188 } else {
180 - var user_label_val = th.data.user_label_val; //选择标签奖励多少  
181 - var user_label_type = th.data.user_label_type; //赠送类型  
182 var url = "/api/weshop/marketing/holiday/vip/interest/label/update"; //更新标签接口地址 189 var url = "/api/weshop/marketing/holiday/vip/interest/label/update"; //更新标签接口地址
183 var nav_url = "/pages/user/userinfo/userinfo"; //领取成功之后跳转页面 190 var nav_url = "/pages/user/userinfo/userinfo"; //领取成功之后跳转页面
184 var vipLabel = ""; //选择的标签名称 191 var vipLabel = ""; //选择的标签名称
@@ -196,7 +203,7 @@ Page({ @@ -196,7 +203,7 @@ Page({
196 } 203 }
197 } 204 }
198 var my_confirm = th.selectComponent("#my_confirm"); //组件的id 205 var my_confirm = th.selectComponent("#my_confirm"); //组件的id
199 - remark = "标签赠送"; 206 + remark = "兴趣标签赠送";
200 if (is_modify) { 207 if (is_modify) {
201 208
202 my_confirm.open_cancel(0); 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 <view class="lables padding"> 3 <view class="lables padding">
4 <!-- 兴趣标签标题 --> 4 <!-- 兴趣标签标题 -->
@@ -53,6 +53,18 @@ @@ -53,6 +53,18 @@
53 </block> 53 </block>
54 54
55 </view> 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 <warn id="warn"></warn> 69 <warn id="warn"></warn>
58 <my_confirm id="my_confirm"></my_confirm> 70 <my_confirm id="my_confirm"></my_confirm>
59 \ No newline at end of file 71 \ No newline at end of file
pages/user/labels/labels.wxss
@@ -87,4 +87,9 @@ page{ @@ -87,4 +87,9 @@ page{
87 } 87 }
88 .check_item{ 88 .check_item{
89 height: 30%; 89 height: 30%;
  90 +}
  91 +.no_labels{
  92 + width: 290rpx;
  93 + height: 220rpx;
  94 + margin-bottom:40rpx;
90 } 95 }
91 \ No newline at end of file 96 \ No newline at end of file