作者 wangxuyu

换电脑前上传

@@ -338,7 +338,7 @@ input, textarea { @@ -338,7 +338,7 @@ input, textarea {
338 -moz-osx-font-smoothing: grayscale; 338 -moz-osx-font-smoothing: grayscale;
339 } 339 }
340 .icon-aaa::before{ 340 .icon-aaa::before{
341 - content: "\e605" 341 + content: "\e605"
342 } 342 }
343 .icon-vip:before { 343 .icon-vip:before {
344 content: "\e62f"; 344 content: "\e62f";
@@ -2,654 +2,654 @@ @@ -2,654 +2,654 @@
2 const app = getApp(); 2 const app = getApp();
3 const WxParse = require('../../../wxParse/wxParse/wxParse.js'); 3 const WxParse = require('../../../wxParse/wxParse/wxParse.js');
4 Page({ 4 Page({
5 -  
6 - /**  
7 - * 页面的初始数据  
8 - */  
9 - data: {  
10 - imgUrl: app.globalData.imgUrl,  
11 - shoucang: false,  
12 - active: true,  
13 - show: false,  
14 - shows: false,  
15 - id: 0,  
16 - goods: [],  
17 - ids: [],  
18 - idss: [],  
19 - status: 0,  
20 - cart_count: 0,  
21 - skuid: '',  
22 - num: 1,  
23 - id_arr: [],  
24 - gPrice: 0,  
25 - collocation: [],  
26 - goods_star: 1,  
27 - star_arr: [],  
28 - commentCount: 0,  
29 - favorite: 0,  
30 - totalPrice: 0,  
31 - is_group: 0,  
32 - day: 0,  
33 - hour: 0,  
34 - minute: 0,  
35 - second: 0,  
36 - skuid_arr: [],  
37 - skuid_price: 0,  
38 - old_skuid_price: 0,  
39 - vip_skuid_price: 0,  
40 - yyhTop: 0,  
41 - basicInfo: false,  
42 5
43 - one: 11,  
44 - two: 22,  
45 - statestatus: 0,  
46 - groupList: [],  
47 - yesno: false,  
48 - stock:0,  
49 - is_vip:0,  
50 - string:'',  
51 - gggPrice: null  
52 - },  
53 - //进入评论详情  
54 - go_comment_detail(e){  
55 - var id = e.currentTarget.dataset.id  
56 - wx.navigateTo({  
57 - url: '../user_comment_detail/user_comment_detail?id='+id, 6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + imgUrl: app.globalData.imgUrl,
  11 + shoucang: false,
  12 + active: true,
  13 + show: false,
  14 + shows: false,
  15 + id: 0,
  16 + goods: [],
  17 + ids: [],
  18 + idss: [],
  19 + status: 0,
  20 + cart_count: 0,
  21 + skuid: '',
  22 + num: 1,
  23 + id_arr: [],
  24 + gPrice: 0,
  25 + collocation: [],
  26 + goods_star: 1,
  27 + star_arr: [],
  28 + commentCount: 0,
  29 + favorite: 0,
  30 + totalPrice: 0,
  31 + is_group: 0,
  32 + day: 0,
  33 + hour: 0,
  34 + minute: 0,
  35 + second: 0,
  36 + skuid_arr: [],
  37 + skuid_price: 0,
  38 + old_skuid_price: 0,
  39 + vip_skuid_price: 0,
  40 + yyhTop: 0,
  41 + basicInfo: false,
  42 +
  43 + one: 11,
  44 + two: 22,
  45 + statestatus: 0,
  46 + groupList: [],
  47 + yesno: false,
  48 + stock: 0,
  49 + is_vip: 0,
  50 + string: '',
  51 + gggPrice: null
  52 + },
  53 + //进入评论详情
  54 + go_comment_detail(e) {
  55 + var id = e.currentTarget.dataset.id
  56 + wx.navigateTo({
  57 + url: '../user_comment_detail/user_comment_detail?id=' + id,
  58 + })
  59 + },
  60 + //进入基本参数
  61 + jumpBasicInfo() {
  62 + this.setData({
  63 + basicInfo: true
  64 + })
  65 + },
  66 + //进入评论列表
  67 + jump_user_comment(e) {
  68 + let id = e.currentTarget.dataset.id
  69 + wx.navigateTo({
  70 + url: '../user_comment/user_comment?id=' + this.data.id
  71 + })
  72 + },
  73 + //跳转至建议搭配商品详情
  74 + jump_collocation_detail(e) {
  75 + let id = e.currentTarget.dataset.jid;
  76 + console.log(id)
  77 + this.setData({
  78 + id: id
  79 + })
  80 + wx.pageScrollTo({
  81 + scrollTop: 0,
  82 + duration: 0
  83 + })
  84 + this.fetchGoods()
  85 + },
  86 + //减少数量
  87 + dec_num() {
  88 + var num = this.data.num;
  89 + if (num <= 1) {
  90 + return;
  91 + } else {
  92 + num--
  93 + }
  94 + this.setData({
  95 + num: num
  96 + });
  97 + this.totalPrice()
  98 + },
  99 + //增加数量
  100 + add_num() {
  101 + var num = this.data.num;
  102 + num++
  103 + this.setData({
  104 + num: num
  105 + });
  106 + this.totalPrice();
  107 + },
  108 + //总价格
  109 + totalPrice() {
  110 + var that = this
  111 + var total = that.data.goods.info.price * that.data.num
  112 + that.setData({
  113 + totalPrice: total
  114 + })
  115 + },
  116 + //点击收藏
  117 + collection_true(e) {
  118 + let id = e.currentTarget.dataset.id
  119 + let that = this
  120 + let url = '/wxapp/product/setFavorites?id=' + id
  121 + let params = {
  122 + id: id
  123 + }
  124 + app.post(url).then(r => {
  125 + if (r.code == 1) {
  126 + wx.showToast({
  127 + title: r.msg,
  128 + icon: 'none'
58 }) 129 })
59 - },  
60 - //进入基本参数  
61 - jumpBasicInfo() {  
62 - this.setData({  
63 - basicInfo: true  
64 - })  
65 - },  
66 - //进入评论列表  
67 - jump_user_comment(e) {  
68 - let id = e.currentTarget.dataset.id  
69 - wx.navigateTo({  
70 - url: '../user_comment/user_comment?id=' + this.data.id  
71 - })  
72 - },  
73 - //跳转至建议搭配商品详情  
74 - jump_collocation_detail(e) {  
75 - let id = e.currentTarget.dataset.jid;  
76 - console.log(id)  
77 - this.setData({  
78 - id: id  
79 - })  
80 - wx.pageScrollTo({  
81 - scrollTop: 0,  
82 - duration:0  
83 - })  
84 - this.fetchGoods()  
85 - },  
86 - //减少数量  
87 - dec_num() {  
88 - var num = this.data.num;  
89 - if (num <= 1) {  
90 - return;  
91 - } else {  
92 - num--  
93 - }  
94 - this.setData({  
95 - num: num  
96 - });  
97 - this.totalPrice()  
98 - },  
99 - //增加数量  
100 - add_num() {  
101 - var num = this.data.num;  
102 - num++  
103 - this.setData({  
104 - num: num  
105 - });  
106 - this.totalPrice();  
107 - },  
108 - //总价格  
109 - totalPrice() {  
110 - var that = this  
111 - var total = that.data.goods.info.price * that.data.num  
112 - that.setData({  
113 - totalPrice: total  
114 - })  
115 - },  
116 - //点击收藏  
117 - collection_true(e) {  
118 - let id = e.currentTarget.dataset.id  
119 - let that = this  
120 - let url = '/wxapp/product/setFavorites?id=' + id  
121 - let params = {  
122 - id: id  
123 - }  
124 - app.post(url).then(r => {  
125 - if (r.code == 1) {  
126 - wx.showToast({  
127 - title: r.msg,  
128 - icon: 'none'  
129 - })  
130 - that.fetchGoods();  
131 - }  
132 - })  
133 - },  
134 - //促销进商品详情  
135 - jump_goodsDetial2(e) {  
136 - wx.navigateTo({  
137 - url: '../goodsDetial2/goodsDetial2?id=' + e.currentTarget.dataset.id  
138 - })  
139 - },  
140 - //加购筛选  
141 - changeIds(e) {  
142 - let t = this;  
143 - let goods = t.data.goods;  
144 - let new_arr = t.data.skuid_arr;  
145 - let listAll = t.data.goods.attr.attr_sku;  
146 - let list = listAll[e.currentTarget.dataset.parent].item;  
147 - let x = e.currentTarget.dataset.index;  
148 - let stock=t.data.stock  
149 - // 当前点击Id  
150 - let nowId = e.currentTarget.dataset.gid;  
151 - //当前点击value  
152 - let nowValue = e.currentTarget.dataset.item;  
153 - // 父级索引  
154 - let parent = e.currentTarget.dataset.parent;  
155 - // 子集索引  
156 - let nowIndex = e.currentTarget.dataset.index;  
157 - // 当前可否多选  
158 - let is_checkMore = false  
159 - let foo = new_arr.indexOf(nowId)  
160 - if (foo > -1) {  
161 - new_arr.splice(foo, 1)  
162 - } else {  
163 - goods.attr.attr_sku.forEach(function(ele, indexxxx) {  
164 - if (indexxxx == parent) {  
165 - for (let i = 0; i < ele.item.length; i++) {  
166 - let havId = goods.attr.attr_sku[indexxxx].item[i].id  
167 - let have = new_arr.indexOf(havId)  
168 - if (have > -1) {  
169 - new_arr.splice(have, 1)  
170 - }  
171 - }  
172 - }  
173 - })  
174 - }  
175 - // 当前点击父级值  
176 - let tempArry = JSON.parse(JSON.stringify(this.data.goods.attr.attr_sku[parent]));  
177 - // let tempArry=this.data.goods.attr.attr_sku[parent]  
178 - !tempArry.chooseIndex ? tempArry.chooseIndex = [] : '';  
179 - !tempArry.chooseValue ? tempArry.chooseValue = [] : '';  
180 - // 是否多选  
181 - if (is_checkMore) {} else {  
182 - tempArry.chooseValue.pop();  
183 - tempArry.chooseValue.push(nowValue);  
184 - tempArry.chooseIndex.pop();  
185 - tempArry.chooseIndex.push(nowId);  
186 - for (let obj of tempArry.item) {  
187 - obj.t = false  
188 - }  
189 - tempArry.item[nowIndex].t = true;  
190 - }  
191 - t.data.goods.attr.attr_sku[parent] = tempArry;  
192 - t.setData({  
193 - goods: t.data.goods  
194 - })  
195 - // let goods = t.data.goods;  
196 - let sys_attrprice = goods.sys_attrprice;  
197 - // let new_arr = [];  
198 - let new_arr_item = [];  
199 - let str = ''  
200 - let skuid = 0  
201 - let skuid_price = 0  
202 - let old_skuid_price = 0  
203 - let vip_skuid_price = 0  
204 - goods.attr.attr_sku.forEach(function(ele, indexx) {  
205 - if (indexx == parent) {  
206 - new_arr = new_arr.concat(ele.chooseIndex);  
207 - }  
208 - })  
209 - new_arr = new_arr.sort()  
210 - str = new_arr.join('_');  
211 - console.log(111)  
212 - console.log(str)  
213 - new_arr_item = new_arr_item.join(',');  
214 - new_arr_item = new_arr_item.replace(/,/g, " ");  
215 - var string = ''  
216 - var gggPrice = null  
217 - for (let i in sys_attrprice) {  
218 - if (i == str) {  
219 - skuid = sys_attrprice[i].skuid  
220 - skuid_price = sys_attrprice[i].price  
221 - old_skuid_price = sys_attrprice[i].old_price  
222 - vip_skuid_price = sys_attrprice[i].vip_price  
223 - stock = sys_attrprice[i].stock  
224 - string = sys_attrprice[i].sku_values  
225 - }  
226 - }  
227 - if(that.data.is_vip==1){  
228 - gggPrice = vip_skuid_price  
229 - } else {  
230 - gggPrice = old_skuid_price  
231 - }  
232 - this.setData({  
233 - id_arr: new_arr,  
234 - idss: new_arr,  
235 - skuid: skuid,  
236 - skuid_price: skuid_price,  
237 - old_skuid_price: old_skuid_price,  
238 - vip_skuid_price: vip_skuid_price,  
239 - skuid_arr: new_arr,  
240 - ids: new_arr_item,  
241 - stock:stock,  
242 - string: string,  
243 - gggPrice: gggPrice  
244 - });  
245 - },  
246 - //关闭弹窗  
247 - close_mask_cart() {  
248 - this.setData({  
249 - show: false  
250 - });  
251 - },  
252 - close_mask_info() {  
253 - this.setData({  
254 - basicInfo: false  
255 - });  
256 - },  
257 - close_mask_carts() {  
258 - this.setData({  
259 - shows: false  
260 - });  
261 - },  
262 - //点击我知道了  
263 - iKnow() {  
264 - this.setData({  
265 - basicInfo: false  
266 - });  
267 - },  
268 - //去结算  
269 - get_settle() {  
270 - if (isNaN(this.data.minute)) {  
271 - wx.showToast({  
272 - title: '活动已经结束',  
273 - icon: 'none'  
274 - })  
275 - return;  
276 - } else {  
277 - this.setData({  
278 - shows: true  
279 - });  
280 - }  
281 - },  
282 - //渲染是不是会员  
283 - fetchUser(){  
284 - let url = '/wxapp/user/index'  
285 - let that=this  
286 - app.post(url).then(res=>{  
287 - if(res.code==1){  
288 - that.setData({  
289 - is_vip:res.data.user.is_vip  
290 - })  
291 - that.fetchGoods()  
292 - }  
293 - })  
294 - },  
295 - //根据id获取内容  
296 - fetchGoods() {  
297 - let url = '/wxapp/product/getProductInfo';  
298 - // let goods_star=1;  
299 - let params = {  
300 - id: this.data.id  
301 - };  
302 - let that = this  
303 - let stock=null  
304 - let string = null  
305 - app.post(url, params).then(r => {  
306 - console.log(r);  
307 - WxParse.wxParse('content', 'html', r.data.info.content, this, 5);  
308 - for (let i = 0; i < r.data.attr.attr_sku.length; i++) {  
309 - for (let x = 0; x < r.data.attr.attr_sku[i].item.length; x++) {  
310 - r.data.attr.attr_sku[i].item[x].t = false;  
311 - }  
312 - }  
313 - let comment = r.data.comment  
314 - comment.forEach(function(ele, index) {  
315 - ele.stars_arr = []  
316 - for (let i = 1; i < ele.goods_stars + 1; i++) {  
317 - ele.stars_arr.push(i);  
318 - }  
319 - })  
320 - let arr = []  
321 - let skuid = 0  
322 - let skuid_price = 0  
323 - let old_skuid_price = 0  
324 - let vip_skuid_price = 0  
325 - r.data.attr.attr_sku.forEach(function(ele, index) {  
326 - ele.item[0].t = true;  
327 - arr.push(ele.item[0].id)  
328 - })  
329 - arr = arr.sort()  
330 - let str = arr.join('_');  
331 - let sys_attrprice = r.data.sys_attrprice  
332 - for (let i in sys_attrprice) {  
333 - if (i == str) {  
334 - skuid = sys_attrprice[i].skuid  
335 - skuid_price = sys_attrprice[i].price  
336 - old_skuid_price = sys_attrprice[i].old_price  
337 - vip_skuid_price = sys_attrprice[i].vip_price  
338 - stock = sys_attrprice[i].stock  
339 - string =sys_attrprice[i].sku_values  
340 - }  
341 - }  
342 - var gggPrice = null  
343 - if(that.data.is_vip==1){  
344 - gggPrice = vip_skuid_price  
345 - }else{  
346 - gggPrice = old_skuid_price  
347 - }  
348 - r.data.comment.forEach(function(ele, index) {  
349 - that.setData({  
350 - goods_star: ele.goods_stars  
351 - })  
352 - });  
353 - r.data.comment.forEach(function(ele, index) {  
354 - ele.create_time = app.timeFormate(ele.create_time, 'YYMMDD');  
355 - });  
356 - console.log(r.data.vips.cashback_price)  
357 - r.data.vips.cashback_price +='0'  
358 - r.data.vips.cashback_price = r.data.vips.cashback_price.substr(0, 4)  
359 - var zuihoujiage = ''  
360 - if (that.data.is_vip == 1) {  
361 - zuihoujiage = r.data.info.vip_price  
362 - } else {  
363 - zuihoujiage = r.data.info.price  
364 - }  
365 - if (r.data.groupType) {  
366 - console.log('团购')  
367 - var days = ''  
368 - var hours = ''  
369 - var minutes = ''  
370 - var seconds = ''  
371 - var percent = 0 130 + that.fetchGoods();
  131 + }
  132 + })
  133 + },
  134 + //促销进商品详情
  135 + jump_goodsDetial2(e) {
  136 + wx.navigateTo({
  137 + url: '../goodsDetial2/goodsDetial2?id=' + e.currentTarget.dataset.id
  138 + })
  139 + },
  140 + //加购筛选
  141 + changeIds(e) {
  142 + let t = this;
  143 + let goods = t.data.goods;
  144 + let new_arr = t.data.skuid_arr;
  145 + let listAll = t.data.goods.attr.attr_sku;
  146 + let list = listAll[e.currentTarget.dataset.parent].item;
  147 + let x = e.currentTarget.dataset.index;
  148 + let stock = t.data.stock
  149 + // 当前点击Id
  150 + let nowId = e.currentTarget.dataset.gid;
  151 + //当前点击value
  152 + let nowValue = e.currentTarget.dataset.item;
  153 + // 父级索引
  154 + let parent = e.currentTarget.dataset.parent;
  155 + // 子集索引
  156 + let nowIndex = e.currentTarget.dataset.index;
  157 + // 当前可否多选
  158 + let is_checkMore = false
  159 + let foo = new_arr.indexOf(nowId)
  160 + if (foo > -1) {
  161 + new_arr.splice(foo, 1)
  162 + } else {
  163 + goods.attr.attr_sku.forEach(function(ele, indexxxx) {
  164 + if (indexxxx == parent) {
  165 + for (let i = 0; i < ele.item.length; i++) {
  166 + let havId = goods.attr.attr_sku[indexxxx].item[i].id
  167 + let have = new_arr.indexOf(havId)
  168 + if (have > -1) {
  169 + new_arr.splice(have, 1)
  170 + }
  171 + }
  172 + }
  173 + })
  174 + }
  175 + // 当前点击父级值
  176 + let tempArry = JSON.parse(JSON.stringify(this.data.goods.attr.attr_sku[parent]));
  177 + // let tempArry=this.data.goods.attr.attr_sku[parent]
  178 + !tempArry.chooseIndex ? tempArry.chooseIndex = [] : '';
  179 + !tempArry.chooseValue ? tempArry.chooseValue = [] : '';
  180 + // 是否多选
  181 + if (is_checkMore) {} else {
  182 + tempArry.chooseValue.pop();
  183 + tempArry.chooseValue.push(nowValue);
  184 + tempArry.chooseIndex.pop();
  185 + tempArry.chooseIndex.push(nowId);
  186 + for (let obj of tempArry.item) {
  187 + obj.t = false
  188 + }
  189 + tempArry.item[nowIndex].t = true;
  190 + }
  191 + t.data.goods.attr.attr_sku[parent] = tempArry;
  192 + t.setData({
  193 + goods: t.data.goods
  194 + })
  195 + // let goods = t.data.goods;
  196 + let sys_attrprice = goods.sys_attrprice;
  197 + // let new_arr = [];
  198 + let new_arr_item = [];
  199 + let str = ''
  200 + let skuid = 0
  201 + let skuid_price = 0
  202 + let old_skuid_price = 0
  203 + let vip_skuid_price = 0
  204 + goods.attr.attr_sku.forEach(function(ele, indexx) {
  205 + if (indexx == parent) {
  206 + new_arr = new_arr.concat(ele.chooseIndex);
  207 + }
  208 + })
  209 + new_arr = new_arr.sort()
  210 + str = new_arr.join('_');
  211 + console.log(111)
  212 + console.log(str)
  213 + new_arr_item = new_arr_item.join(',');
  214 + new_arr_item = new_arr_item.replace(/,/g, " ");
  215 + var string = ''
  216 + var gggPrice = null
  217 + for (let i in sys_attrprice) {
  218 + if (i == str) {
  219 + skuid = sys_attrprice[i].skuid
  220 + skuid_price = sys_attrprice[i].price
  221 + old_skuid_price = sys_attrprice[i].old_price
  222 + vip_skuid_price = sys_attrprice[i].vip_price
  223 + stock = sys_attrprice[i].stock
  224 + string = sys_attrprice[i].sku_values
  225 + }
  226 + }
  227 + if (that.data.is_vip == 1) {
  228 + gggPrice = vip_skuid_price
  229 + } else {
  230 + gggPrice = old_skuid_price
  231 + }
  232 + this.setData({
  233 + id_arr: new_arr,
  234 + idss: new_arr,
  235 + skuid: skuid,
  236 + skuid_price: skuid_price,
  237 + old_skuid_price: old_skuid_price,
  238 + vip_skuid_price: vip_skuid_price,
  239 + skuid_arr: new_arr,
  240 + ids: new_arr_item,
  241 + stock: stock,
  242 + string: string,
  243 + gggPrice: gggPrice
  244 + });
  245 + },
  246 + //关闭弹窗
  247 + close_mask_cart() {
  248 + this.setData({
  249 + show: false
  250 + });
  251 + },
  252 + close_mask_info() {
  253 + this.setData({
  254 + basicInfo: false
  255 + });
  256 + },
  257 + close_mask_carts() {
  258 + this.setData({
  259 + shows: false
  260 + });
  261 + },
  262 + //点击我知道了
  263 + iKnow() {
  264 + this.setData({
  265 + basicInfo: false
  266 + });
  267 + },
  268 + //去结算
  269 + get_settle() {
  270 + if (isNaN(this.data.minute)) {
  271 + wx.showToast({
  272 + title: '活动已经结束',
  273 + icon: 'none'
  274 + })
  275 + return;
  276 + } else {
  277 + this.setData({
  278 + shows: true
  279 + });
  280 + }
  281 + },
  282 + //渲染是不是会员
  283 + fetchUser() {
  284 + let url = '/wxapp/user/index'
  285 + let that = this
  286 + app.post(url).then(res => {
  287 + if (res.code == 1) {
  288 + that.setData({
  289 + is_vip: res.data.user.is_vip
  290 + })
  291 + that.fetchGoods()
  292 + }
  293 + })
  294 + },
  295 + //根据id获取内容
  296 + fetchGoods() {
  297 + let url = '/wxapp/product/getProductInfo';
  298 + // let goods_star=1;
  299 + let params = {
  300 + id: this.data.id
  301 + };
  302 + let that = this
  303 + let stock = null
  304 + let string = null
  305 + app.post(url, params).then(r => {
  306 + console.log(r);
  307 + WxParse.wxParse('content', 'html', r.data.info.content, this, 5);
  308 + for (let i = 0; i < r.data.attr.attr_sku.length; i++) {
  309 + for (let x = 0; x < r.data.attr.attr_sku[i].item.length; x++) {
  310 + r.data.attr.attr_sku[i].item[x].t = false;
  311 + }
  312 + }
  313 + let comment = r.data.comment
  314 + comment.forEach(function(ele, index) {
  315 + ele.stars_arr = []
  316 + for (let i = 1; i < ele.goods_stars + 1; i++) {
  317 + ele.stars_arr.push(i);
  318 + }
  319 + })
  320 + let arr = []
  321 + let skuid = 0
  322 + let skuid_price = 0
  323 + let old_skuid_price = 0
  324 + let vip_skuid_price = 0
  325 + r.data.attr.attr_sku.forEach(function(ele, index) {
  326 + ele.item[0].t = true;
  327 + arr.push(ele.item[0].id)
  328 + })
  329 + arr = arr.sort()
  330 + let str = arr.join('_');
  331 + let sys_attrprice = r.data.sys_attrprice
  332 + for (let i in sys_attrprice) {
  333 + if (i == str) {
  334 + skuid = sys_attrprice[i].skuid
  335 + skuid_price = sys_attrprice[i].price
  336 + old_skuid_price = sys_attrprice[i].old_price
  337 + vip_skuid_price = sys_attrprice[i].vip_price
  338 + stock = sys_attrprice[i].stock
  339 + string = sys_attrprice[i].sku_values
  340 + }
  341 + }
  342 + var gggPrice = null
  343 + if (that.data.is_vip == 1) {
  344 + gggPrice = vip_skuid_price
  345 + } else {
  346 + gggPrice = old_skuid_price
  347 + }
  348 + r.data.comment.forEach(function(ele, index) {
  349 + that.setData({
  350 + goods_star: ele.goods_stars
  351 + })
  352 + });
  353 + r.data.comment.forEach(function(ele, index) {
  354 + ele.create_time = app.timeFormate(ele.create_time, 'YYMMDD');
  355 + });
  356 + console.log(r.data.vips.cashback_price)
  357 + r.data.vips.cashback_price += '0'
  358 + r.data.vips.cashback_price = r.data.vips.cashback_price.substr(0, 4)
  359 + var zuihoujiage = ''
  360 + if (that.data.is_vip == 1) {
  361 + zuihoujiage = r.data.info.vip_price
  362 + } else {
  363 + zuihoujiage = r.data.info.price
  364 + }
  365 + if (r.data.groupType) {
  366 + console.log('团购')
  367 + var days = ''
  368 + var hours = ''
  369 + var minutes = ''
  370 + var seconds = ''
  371 + var percent = 0
  372 +
  373 + function time() {
  374 + var cut_time = r.data.groupType.count_down_time
  375 + days = Math.floor((cut_time) / (60 * 60 * 24));
  376 + hours = Math.floor((cut_time) / (60 * 60)) % 24;
  377 + minutes = Math.floor((cut_time) / (60)) % 60;
  378 + seconds = cut_time % 60;
  379 + percent = Math.floor(r.data.info.group_number * 100 / r.data.info.group_min_number)
  380 + }
  381 + time();
  382 + setInterval(time, 1000);
  383 + that.setData({
  384 + day: days,
  385 + hour: hours,
  386 + minute: minutes,
  387 + second: seconds,
  388 + percent: percent,
  389 + goods: r.data,
  390 + gPrice: zuihoujiage,
  391 + gggPrice: gggPrice,
  392 + collocation: r.data.collocation,
  393 + comment: r.data.comment,
  394 + skuid: skuid,
  395 + is_group: r.data.info.group_min_number,
  396 + id_arr: arr,
  397 + skuid_arr: arr,
  398 + yesno: true,
  399 + stock: stock,
  400 + string: string
  401 + });
  402 + } else {
  403 + console.log("不是团购")
  404 + that.setData({
  405 + yesno: false,
  406 + goods: r.data,
  407 + gPrice: zuihoujiage,
  408 + gggPrice: gggPrice,
  409 + collocation: r.data.collocation,
  410 + comment: r.data.comment,
  411 + favorite: r.data.is_favorite,
  412 + skuid_price: skuid_price,
  413 + old_skuid_price: old_skuid_price,
  414 + vip_skuid_price: vip_skuid_price,
  415 + skuid: skuid,
  416 + skuid_arr: arr,
  417 + id_arr: arr,
  418 + stock: stock,
  419 + string: string
  420 + });
  421 + }
  422 + });
  423 + },
372 424
373 - function time() {  
374 - var cut_time = r.data.groupType.count_down_time  
375 - days = Math.floor((cut_time) / (60 * 60 * 24));  
376 - hours = Math.floor((cut_time) / (60 * 60)) % 24;  
377 - minutes = Math.floor((cut_time) / (60)) % 60;  
378 - seconds = cut_time % 60;  
379 - percent = Math.floor(r.data.info.group_number * 100 / r.data.info.group_min_number)  
380 - }  
381 - time();  
382 - setInterval(time, 1000);  
383 - that.setData({  
384 - day: days,  
385 - hour: hours,  
386 - minute: minutes,  
387 - second: seconds,  
388 - percent: percent,  
389 - goods: r.data,  
390 - gPrice: zuihoujiage,  
391 - gggPrice: gggPrice,  
392 - collocation: r.data.collocation,  
393 - comment: r.data.comment,  
394 - skuid: skuid,  
395 - is_group: r.data.info.group_min_number,  
396 - id_arr: arr,  
397 - skuid_arr: arr,  
398 - yesno: true,  
399 - stock: stock,  
400 - string: string  
401 - });  
402 - } else {  
403 - console.log("不是团购")  
404 - that.setData({  
405 - yesno: false,  
406 - goods: r.data,  
407 - gPrice: zuihoujiage,  
408 - gggPrice: gggPrice,  
409 - collocation: r.data.collocation,  
410 - comment: r.data.comment,  
411 - favorite: r.data.is_favorite,  
412 - skuid_price: skuid_price,  
413 - old_skuid_price: old_skuid_price,  
414 - vip_skuid_price: vip_skuid_price,  
415 - skuid: skuid,  
416 - skuid_arr: arr,  
417 - id_arr: arr,  
418 - stock: stock,  
419 - string: string  
420 - });  
421 - }  
422 - });  
423 - }, 425 + /**
  426 + * 生命周期函数--监听页面加载
  427 + */
  428 + onLoad: function(options) {
  429 + var that = this
  430 + // var query = wx.createSelectorQuery();
  431 + // var offset = query.select('.itme_list5');
  432 + // var yyh = query.select('#yyh');
  433 + // var top=0
  434 + // yyh.boundingClientRect(function(res){
  435 + // top=res.top
  436 + // that.setData({
  437 + // yyhTop: top
  438 + // });
  439 + // }).exec()
  440 + that.setData({
  441 + id: options.id,
  442 + })
  443 + this.fetchUser()
  444 + },
  445 + // 返回上一页
  446 + get_back() {
  447 + wx.navigateBack({})
  448 + },
  449 + // 跳转图文食谱
  450 + get_recipe() {
  451 + wx.navigateTo({
  452 + url: '../production_steps/production_steps?id=' + this.data.id,
  453 + })
  454 + },
  455 + // 跳转购物车
  456 + get_car() {
  457 + this.setData({
  458 + show: true
  459 + });
  460 + },
424 461
425 - /**  
426 - * 生命周期函数--监听页面加载  
427 - */  
428 - onLoad: function(options) {  
429 - var that = this  
430 - // var query = wx.createSelectorQuery();  
431 - // var offset = query.select('.itme_list5');  
432 - // var yyh = query.select('#yyh');  
433 - // var top=0  
434 - // yyh.boundingClientRect(function(res){  
435 - // top=res.top  
436 - // that.setData({  
437 - // yyhTop: top  
438 - // });  
439 - // }).exec()  
440 - that.setData({  
441 - id: options.id, 462 + //隐藏mask
  463 + hide_mask(e) {
  464 + var that = this
  465 + if (that.data.skuid != '') {
  466 + that.setData({
  467 + show: false
  468 + });
  469 + let url = '/wxapp/cart/addCart'
  470 + let params = {
  471 + skuid: that.data.skuid,
  472 + num: that.data.num
  473 + }
  474 + if (that.data.stock > 0) {
  475 + if (that.data.num <= e.currentTarget.dataset.limit || e.currentTarget.dataset.limit == 0) {
  476 + app.post(url, params).then(r => {
  477 + if (r.code == 1) {
  478 + wx.showToast({
  479 + title: '成功加入购物车',
  480 + icon: 'none'
  481 + })
  482 + that.fetchGoods();
  483 + } else {
  484 + wx.showToast({
  485 + title: r.msg,
  486 + icon: 'none'
  487 + })
  488 + }
  489 + });
  490 + } else {
  491 + wx.showToast({
  492 + title: '限购' + e.currentTarget.dataset.limit + '件',
  493 + icon: 'none'
  494 + })
  495 + return;
  496 + }
  497 + } else {
  498 + console.log(454545)
  499 + wx.showToast({
  500 + title: '已经售罄',
  501 + icon: 'none'
  502 + })
  503 + }
  504 + } else {
  505 + console.log(that.data.skuid + "shangpinzuhe")
  506 + wx.showToast({
  507 + title: '请先选择商品属性组合',
  508 + icon: 'none'
  509 + })
  510 + }
  511 + },
  512 + hide_masks() {
  513 + var that = this
  514 + var minimum = that.data.goods.minimum_price
  515 + var pp = that.data.gPrice
  516 + console.log(pp)
  517 + pp = Math.round(pp)
  518 + console.log(pp)
  519 + var gPrice = that.data.num * pp
  520 + console.log(gPrice)
  521 + if (that.data.skuid != '') {
  522 + that.setData({
  523 + shows: false
  524 + });
  525 + var str = ''
  526 + str = that.data.id_arr.join(',');
  527 + if (gPrice >= minimum) {
  528 + if (that.data.stock > 0) {
  529 + if (that.data.goods.info.limit_numer == that.data.num || that.data.goods.info.limit_numer == 0) {
  530 + if (that.data.id_arr.length > 1) {
  531 + if (that.data.is_group == 0) {
  532 + wx.navigateTo({
  533 + url: '../../my/settle_account/settle_account?ids=' + that.data.skuid + '&gid=' + that.data.id + '&num=' + that.data.num + '&gPrice=' + gPrice
442 }) 534 })
443 - this.fetchUser()  
444 - },  
445 - // 返回上一页  
446 - get_back() {  
447 - wx.navigateBack({})  
448 - },  
449 - // 跳转图文食谱  
450 - get_recipe() { 535 + } else {
451 wx.navigateTo({ 536 wx.navigateTo({
452 - url: '../production_steps/production_steps?id=' + this.data.id, 537 + url: '../../my/settle_account/settle_account?ids=' + that.data.skuid + '&gid=' + that.data.id + '&num=' + that.data.num + '&gPrice=' + gPrice + '&is_group=' + that.data.is_group
453 }) 538 })
454 - },  
455 - // 跳转购物车  
456 - get_car() {  
457 - this.setData({  
458 - show: true  
459 - });  
460 - },  
461 -  
462 - //隐藏mask  
463 - hide_mask(e) {  
464 - var that = this  
465 - if (that.data.skuid != '') {  
466 - that.setData({  
467 - show: false  
468 - });  
469 - let url = '/wxapp/cart/addCart'  
470 - let params = {  
471 - skuid: that.data.skuid,  
472 - num: that.data.num  
473 - }  
474 - if(that.data.stock>0){  
475 - if (that.data.num <= e.currentTarget.dataset.limit || e.currentTarget.dataset.limit == 0) {  
476 - app.post(url, params).then(r => {  
477 - if (r.code == 1) {  
478 - wx.showToast({  
479 - title: '成功加入购物车',  
480 - icon: 'none'  
481 - })  
482 - that.fetchGoods();  
483 - } else {  
484 - wx.showToast({  
485 - title: r.msg,  
486 - icon: 'none'  
487 - })  
488 - }  
489 - });  
490 - } else {  
491 - wx.showToast({  
492 - title: '限购' + e.currentTarget.dataset.limit + '件',  
493 - icon: 'none'  
494 - })  
495 - return;  
496 - }  
497 - }else{  
498 - console.log(454545)  
499 - wx.showToast({  
500 - title: '已经售罄',  
501 - icon:'none'  
502 - })  
503 - }  
504 - } else {  
505 - console.log(that.data.skuid + "shangpinzuhe")  
506 - wx.showToast({  
507 - title: '请先选择商品属性组合',  
508 - icon: 'none'  
509 - })  
510 - }  
511 - },  
512 - hide_masks() {  
513 - var that = this  
514 - var minimum=that.data.goods.minimum_price  
515 - var pp=that.data.gPrice  
516 - console.log(pp)  
517 - pp = Math.round(pp)  
518 - console.log(pp)  
519 - var gPrice = that.data.num * pp  
520 - console.log(gPrice)  
521 - if (that.data.skuid != '') {  
522 - that.setData({  
523 - shows: false  
524 - });  
525 - var str = ''  
526 - str = that.data.id_arr.join(',');  
527 - if(gPrice>=minimum){  
528 - if (that.data.stock > 0) {  
529 - if (that.data.goods.info.limit_numer == that.data.num || that.data.goods.info.limit_numer == 0) {  
530 - if (that.data.id_arr.length > 1) {  
531 - if (that.data.is_group == 0) {  
532 - wx.navigateTo({  
533 - url: '../../my/settle_account/settle_account?ids=' + that.data.skuid + '&gid=' + that.data.id + '&num=' + that.data.num + '&gPrice=' + gPrice  
534 - })  
535 - } else {  
536 - wx.navigateTo({  
537 - url: '../../my/settle_account/settle_account?ids=' + that.data.skuid + '&gid=' + that.data.id + '&num=' + that.data.num + '&gPrice=' + gPrice + '&is_group=' + that.data.is_group  
538 - })  
539 - }  
540 - }  
541 - } else {  
542 - wx.showToast({  
543 - title: '限购' + that.data.goods.info.limit_numer + '件',  
544 - icon: 'none'  
545 - })  
546 - return;  
547 - }  
548 - } else {  
549 - console.log(8989)  
550 - wx.showToast({  
551 - title: '已经售罄',  
552 - icon: 'none'  
553 - })  
554 - return;  
555 - }  
556 - }else{  
557 - wx.showToast({  
558 - title: '商品实付'+minimum+'元起送',  
559 - icon:'none'  
560 - })  
561 - }  
562 - } else {  
563 - wx.showToast({  
564 - title: '请先选择商品属性组合',  
565 - icon: 'none'  
566 - })  
567 - }  
568 - },  
569 - //attr选择规格  
570 - chooseStandard() {  
571 - this.setData({  
572 - show: true  
573 - });  
574 - },  
575 - //跳至图文详情  
576 - jump_detail() {  
577 - this.setData({  
578 - active: false,  
579 - statestatus: 22  
580 - });  
581 - let top = this.data.yyhTop  
582 - // wx.pageScrollTo({  
583 - // scrollTop: top,  
584 - // duration: 300  
585 - // })  
586 - },  
587 - jump_goods() {  
588 - this.setData({  
589 - active: true,  
590 - statestatus: 11  
591 - });  
592 - // wx.pageScrollTo({  
593 - // scrollTop: 0,  
594 - // duration: 300  
595 - // })  
596 - },  
597 - //收藏  
598 - collection() {  
599 - this.setData({  
600 - shoucang: !this.data.shoucang  
601 - });  
602 - },  
603 - /**  
604 - * 生命周期函数--监听页面初次渲染完成  
605 - */  
606 - onReady: function() { 539 + }
  540 + }
  541 + } else {
  542 + wx.showToast({
  543 + title: '限购' + that.data.goods.info.limit_numer + '件',
  544 + icon: 'none'
  545 + })
  546 + return;
  547 + }
  548 + } else {
  549 + console.log(8989)
  550 + wx.showToast({
  551 + title: '已经售罄',
  552 + icon: 'none'
  553 + })
  554 + return;
  555 + }
  556 + } else {
  557 + wx.showToast({
  558 + title: '商品实付' + minimum + '元起送',
  559 + icon: 'none'
  560 + })
  561 + }
  562 + } else {
  563 + wx.showToast({
  564 + title: '请先选择商品属性组合',
  565 + icon: 'none'
  566 + })
  567 + }
  568 + },
  569 + //attr选择规格
  570 + chooseStandard() {
  571 + this.setData({
  572 + show: true
  573 + });
  574 + },
  575 + //跳至图文详情
  576 + jump_detail() {
  577 + this.setData({
  578 + active: false,
  579 + statestatus: 22
  580 + });
  581 + let top = this.data.yyhTop
  582 + // wx.pageScrollTo({
  583 + // scrollTop: top,
  584 + // duration: 300
  585 + // })
  586 + },
  587 + jump_goods() {
  588 + this.setData({
  589 + active: true,
  590 + statestatus: 11
  591 + });
  592 + // wx.pageScrollTo({
  593 + // scrollTop: 0,
  594 + // duration: 300
  595 + // })
  596 + },
  597 + //收藏
  598 + collection() {
  599 + this.setData({
  600 + shoucang: !this.data.shoucang
  601 + });
  602 + },
  603 + /**
  604 + * 生命周期函数--监听页面初次渲染完成
  605 + */
  606 + onReady: function() {
607 607
608 - }, 608 + },
609 609
610 - /**  
611 - * 生命周期函数--监听页面显示  
612 - */  
613 - onShow: function() {  
614 - this.fetchUser()  
615 - }, 610 + /**
  611 + * 生命周期函数--监听页面显示
  612 + */
  613 + onShow: function() {
  614 + this.fetchUser()
  615 + },
616 616
617 - /**  
618 - * 生命周期函数--监听页面隐藏  
619 - */  
620 - onHide: function() { 617 + /**
  618 + * 生命周期函数--监听页面隐藏
  619 + */
  620 + onHide: function() {
621 621
622 - }, 622 + },
623 623
624 - /**  
625 - * 生命周期函数--监听页面卸载  
626 - */  
627 - onUnload: function() { 624 + /**
  625 + * 生命周期函数--监听页面卸载
  626 + */
  627 + onUnload: function() {
628 628
629 - }, 629 + },
630 630
631 - /**  
632 - * 页面相关事件处理函数--监听用户下拉动作  
633 - */  
634 - onPullDownRefresh: function() { 631 + /**
  632 + * 页面相关事件处理函数--监听用户下拉动作
  633 + */
  634 + onPullDownRefresh: function() {
635 635
636 - }, 636 + },
637 637
638 - /**  
639 - * 页面上拉触底事件的处理函数  
640 - */  
641 - onReachBottom: function() { 638 + /**
  639 + * 页面上拉触底事件的处理函数
  640 + */
  641 + onReachBottom: function() {
642 642
643 - }, 643 + },
644 644
645 - /**  
646 - * 用户点击右上角分享  
647 - */  
648 - onShareAppMessage: function() {  
649 - return {  
650 - path: '/pages/start/start?share_id=' + app.globalData.user_id,  
651 - imgUrl: '',  
652 - title: ''  
653 - }  
654 - } 645 + /**
  646 + * 用户点击右上角分享
  647 + */
  648 + onShareAppMessage: function() {
  649 + return {
  650 + path: '/pages/start/start?share_id=' + app.globalData.user_id,
  651 + imgUrl: '',
  652 + title: ''
  653 + }
  654 + }
655 }) 655 })
1 -  
2 const a = getApp(); 1 const a = getApp();
3 Page({ 2 Page({
4 3
5 - /**  
6 - * 页面的初始数据  
7 - */  
8 - data: {  
9 - imgUrl: a.globalData.imgUrl  
10 - },  
11 -  
12 - /**  
13 - * 生命周期函数--监听页面加载  
14 - */  
15 - onLoad: function (options) {  
16 - console.log(options)  
17 - if (options.share_id){  
18 - this.setData({  
19 - share_id: options.share_id  
20 - })  
21 - }  
22 - this.getKey();  
23 - },  
24 - // getSessionKey  
25 - getKey() {  
26 - let url = '/wxapp/public/getSessionKey',t = this;  
27 - wx.login({  
28 - success: function (res) {  
29 - let params = {  
30 - code: res.code  
31 - };  
32 - a.post(url,params,true).then(r=>{  
33 - t.setData({  
34 - sessionKey: r.data.session_key,  
35 - openId: r.data.openid,  
36 - unionid: r.data.unionid,  
37 - })  
38 - wx.setStorageSync('openId', r.data.openid);  
39 - wx.setStorageSync('session_key', r.data.session_key);  
40 - wx.setStorageSync('unionid', r.data.unionid);  
41 - })  
42 - },  
43 - fail: function (res) { },  
44 - complete: function (res) { },  
45 - })  
46 - },  
47 - getUserInfo(e) {  
48 - let url = '/wxapp/public/login',params = {  
49 - session_key: this.data.sessionKey,  
50 - encrypted_data: e.detail.encryptedData,  
51 - iv: e.detail.iv,  
52 - fromUserId: this.data.share_id ? this.data.share_id:'0'  
53 - };  
54 - a.post(url,params).then(r=>{  
55 - console.log(r)  
56 - if(r.code==1){  
57 - wx.setStorageSync('token', r.data.token);  
58 - a.globalData.user_id = r.data.user_id  
59 - console.log(r.data);  
60 - wx.switchTab({  
61 - url: '/pages/index/index'  
62 - })  
63 - }else{  
64 - wx.showToast({  
65 - title: '网络错误',  
66 - icon:'none'  
67 - })  
68 - }  
69 - })  
70 - },  
71 -  
72 -  
73 - /**  
74 - * 生命周期函数--监听页面初次渲染完成  
75 - */  
76 - onReady: function () {  
77 -  
78 - },  
79 -  
80 - /**  
81 - * 生命周期函数--监听页面显示  
82 - */  
83 - onShow: function () {  
84 -  
85 - },  
86 -  
87 - /**  
88 - * 生命周期函数--监听页面隐藏  
89 - */  
90 - onHide: function () {  
91 -  
92 - },  
93 -  
94 - /**  
95 - * 生命周期函数--监听页面卸载  
96 - */  
97 - onUnload: function () {  
98 -  
99 - },  
100 -  
101 - /**  
102 - * 页面相关事件处理函数--监听用户下拉动作  
103 - */  
104 - onPullDownRefresh: function () {  
105 -  
106 - },  
107 -  
108 - /**  
109 - * 页面上拉触底事件的处理函数  
110 - */  
111 - onReachBottom: function () {  
112 -  
113 - },  
114 -  
115 - /**  
116 - * 用户点击右上角分享  
117 - */  
118 - onShareAppMessage: function () {  
119 -  
120 - } 4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 + imgUrl: a.globalData.imgUrl
  9 + },
  10 +
  11 + /**
  12 + * 生命周期函数--监听页面加载
  13 + */
  14 + onLoad: function(options) {
  15 + console.log(options)
  16 + if (options.share_id) {
  17 + this.setData({
  18 + share_id: options.share_id
  19 + })
  20 + }
  21 + this.getKey();
  22 + },
  23 + // getSessionKey
  24 + getKey() {
  25 + let url = '/wxapp/public/getSessionKey',
  26 + t = this;
  27 + wx.login({
  28 + success: function(res) {
  29 + let params = {
  30 + code: res.code
  31 + };
  32 + a.post(url, params, true).then(r => {
  33 + t.setData({
  34 + sessionKey: r.data.session_key,
  35 + openId: r.data.openid,
  36 + unionid: r.data.unionid,
  37 + })
  38 + wx.setStorageSync('openId', r.data.openid);
  39 + wx.setStorageSync('session_key', r.data.session_key);
  40 + wx.setStorageSync('unionid', r.data.unionid);
  41 + })
  42 + },
  43 + fail: function(res) {},
  44 + complete: function(res) {},
  45 + })
  46 + },
  47 + getUserInfo(e) {
  48 + let url = '/wxapp/public/login',
  49 + params = {
  50 + session_key: this.data.sessionKey,
  51 + encrypted_data: e.detail.encryptedData,
  52 + iv: e.detail.iv,
  53 + fromUserId: this.data.share_id ? this.data.share_id : '0'
  54 + };
  55 + a.post(url, params).then(r => {
  56 + console.log(r)
  57 + if (r.code == 1) {
  58 + wx.setStorageSync('token', r.data.token);
  59 + a.globalData.user_id = r.data.user_id
  60 + console.log(r.data);
  61 + wx.switchTab({
  62 + url: '/pages/index/index'
  63 + })
  64 + } else {
  65 + wx.showToast({
  66 + title: '网络错误',
  67 + icon: 'none'
  68 + })
  69 + }
  70 + })
  71 + },
  72 +
  73 +
  74 + /**
  75 + * 生命周期函数--监听页面初次渲染完成
  76 + */
  77 + onReady: function() {
  78 +
  79 + },
  80 +
  81 + /**
  82 + * 生命周期函数--监听页面显示
  83 + */
  84 + onShow: function() {
  85 +
  86 + },
  87 +
  88 + /**
  89 + * 生命周期函数--监听页面隐藏
  90 + */
  91 + onHide: function() {
  92 +
  93 + },
  94 +
  95 + /**
  96 + * 生命周期函数--监听页面卸载
  97 + */
  98 + onUnload: function() {
  99 +
  100 + },
  101 +
  102 + /**
  103 + * 页面相关事件处理函数--监听用户下拉动作
  104 + */
  105 + onPullDownRefresh: function() {
  106 +
  107 + },
  108 +
  109 + /**
  110 + * 页面上拉触底事件的处理函数
  111 + */
  112 + onReachBottom: function() {
  113 +
  114 + },
  115 +
  116 + /**
  117 + * 用户点击右上角分享
  118 + */
  119 + onShareAppMessage: function() {
  120 +
  121 + }
121 }) 122 })
1 <!--pages/vip/vip_index/vip_index.wxml--> 1 <!--pages/vip/vip_index/vip_index.wxml-->
2 <view class='page {{mask||back_shop?"active":""}}'> 2 <view class='page {{mask||back_shop?"active":""}}'>
3 - <view class='vip_one {{user.user.is_vip==1?"":"active"}}'>  
4 - <!-- <image src='../../imgs/vip_index.png' class='vip_one_image'></image> -->  
5 - <view class='banner_top'>  
6 - <view class='iconfont icon-fanhui' catchtap='get_my'></view>  
7 - <view class='hello'>会员中心</view>  
8 - <view class='charge_code' catchtap="cancel_mask">省钱计算器</view>  
9 - </view>  
10 - <view class='vip_one_center'>  
11 - <view class='vip_box {{user.user.is_vip==1?"":"active"}}'>  
12 - <view class='vip_avatar'>  
13 - <image src='{{user.user.avatar}}'></image>  
14 - </view>  
15 - <view class='vip_name'>  
16 - <view class='vip_name_one'>{{user.user.user_nickname}}</view>  
17 - <view>  
18 - <view class='vip_name_two' wx:if='{{user.user.is_vip==1}}'>HIGO会员</view>  
19 - <view class='vip_name_two' wx:else>普通会员</view>  
20 - </view>  
21 - </view>  
22 - <view class='vipvipvip'>  
23 - <view>  
24 - <text wx:if='{{user.user.is_vip==1}}'>{{user.vip_expire_time}}天</text>  
25 - <text wx:else>尚未开通</text>  
26 - </view>  
27 - <view class='vip_time'>会员有效期</view>  
28 - </view>  
29 - </view>  
30 - <view class='vip_line'></view>  
31 - <view class='vip_upgrade'>  
32 - <text>升级超级会员\t\t每单返{{user.cashback}}%现金\t\t更享{{user.slide.length}}大特权</text>  
33 - </view>  
34 - </view>  
35 - 3 + <view class='vip_one {{user.user.is_vip==1?"":"active"}}'>
  4 + <!-- <image src='../../imgs/vip_index.png' class='vip_one_image'></image> -->
  5 + <view class='banner_top'>
  6 + <view class='iconfont icon-fanhui' catchtap='get_my'></view>
  7 + <view class='hello'>会员中心</view>
  8 + <view class='charge_code' catchtap="cancel_mask">省钱计算器</view>
  9 + </view>
  10 + <view class='vip_one_center'>
  11 + <view class='vip_box {{user.user.is_vip==1?"":"active"}}'>
  12 + <view class='vip_avatar'>
  13 + <image src='{{user.user.avatar}}'></image>
36 </view> 14 </view>
37 - <view class='bigbig {{user.user.is_vip==1?"":"active"}}'>  
38 - <view class='vip_one-bottom'>  
39 - <view class='vip_one_bottom_auto'>  
40 - <image src='{{imgUrl}}vip_left.png'></image>  
41 - <text>会员特权</text>  
42 - <image src='{{imgUrl}}vip_right.png'></image>  
43 - </view>  
44 - </view>  
45 - <view class='vip_two'>  
46 - <view class='vip_two_one' bindtap='show_back_shop' data-index='{{index}}' wx:for-index='index' wx:for='{{user.slide}}' wx:key='{{item.id}}'>  
47 - <view class='vip_two_one_icon'>  
48 - <image src='{{item.icon}}'></image>  
49 - </view>  
50 - <view class='vip_two_one_font'>{{item.title}}</view>  
51 - </view> 15 + <view class='vip_name'>
  16 + <view class='vip_name_one'>{{user.user.user_nickname}}</view>
  17 + <view>
  18 + <view class='vip_name_two' wx:if='{{user.user.is_vip==1}}'>HIGO会员</view>
  19 + <view class='vip_name_two' wx:else>普通会员</view>
  20 + </view>
52 </view> 21 </view>
53 - </view>  
54 - <view class='vip_three'>  
55 - <view class='vip_three_one'>  
56 - <view class='vip_three_one_left'>开通SVIP超级</view>  
57 - <view class='vip_three_one_right' bindtap='jump_detail_vip'>  
58 - <view class='wenhao'>  
59 - <image src='{{imgUrl}}wenhao.png'></image>  
60 - </view>  
61 - <view class='wenhao_right'>尊享会员说明</view>  
62 - </view>  
63 - </view>  
64 - <view class='vip_three_two'>  
65 - <view class='vip_three_two_item {{id==item.id?"active":""}}' wx:for='{{user.vips}}' wx:key='{{item.id}}' wx:for-index='index' bindtap='change_vip_id' data-id='{{item.id}}'>  
66 - <view class='trilateral' wx:if='{{id==item.id}}'>  
67 - <view class='iconfont icon-duigou'></view>  
68 - </view>  
69 - <view class='grade_vip_name'>{{item.title}}</view>  
70 - <view class='grade_vip_count'>{{item.remark}}</view>  
71 - <view class='grade_vip_price'>  
72 - <text>¥</text> {{item.sale_price}}  
73 - </view>  
74 - </view>  
75 - </view> 22 + <view class='vipvipvip'>
  23 + <view>
  24 + <text wx:if='{{user.user.is_vip==1}}'>{{user.vip_expire_time}}天</text>
  25 + <text wx:else>尚未开通</text>
  26 + </view>
  27 + <view class='vip_time'>会员有效期</view>
76 </view> 28 </view>
77 - <view class='vip_four' bindtap='pay_vip'>升级尊享会员,每单返{{user.cashback}}%现金</view> 29 + </view>
  30 + <view class='vip_line'></view>
  31 + <view class='vip_upgrade'>
  32 + <text>升级超级会员\t\t每单返{{user.cashback}}%现金\t\t更享{{user.slide.length}}大特权</text>
  33 + </view>
  34 + </view>
  35 +
  36 + </view>
  37 + <view class='bigbig {{user.user.is_vip==1?"":"active"}}'>
  38 + <view class='vip_one-bottom'>
  39 + <view class='vip_one_bottom_auto'>
  40 + <image src='{{imgUrl}}vip_left.png'></image>
  41 + <text>会员特权</text>
  42 + <image src='{{imgUrl}}vip_right.png'></image>
  43 + </view>
  44 + </view>
  45 + <view class='vip_two'>
  46 + <view class='vip_two_one' bindtap='show_back_shop' data-index='{{index}}' wx:for-index='index' wx:for='{{user.slide}}' wx:key='{{item.id}}'>
  47 + <view class='vip_two_one_icon'>
  48 + <image src='{{item.icon}}'></image>
  49 + </view>
  50 + <view class='vip_two_one_font'>{{item.title}}</view>
  51 + </view>
  52 + </view>
  53 + </view>
  54 + <view class='vip_three'>
  55 + <view class='vip_three_one'>
  56 + <view class='vip_three_one_left'>开通SVIP超级</view>
  57 + <view class='vip_three_one_right' bindtap='jump_detail_vip'>
  58 + <view class='wenhao'>
  59 + <image src='{{imgUrl}}wenhao.png'></image>
  60 + </view>
  61 + <view class='wenhao_right'>尊享会员说明</view>
  62 + </view>
  63 + </view>
  64 + <view class='vip_three_two'>
  65 + <view class='vip_three_two_item {{id==item.id?"active":""}}' wx:for='{{user.vips}}' wx:key='{{item.id}}' wx:for-index='index' bindtap='change_vip_id' data-id='{{item.id}}'>
  66 + <view class='trilateral' wx:if='{{id==item.id}}'>
  67 + <view class='iconfont icon-duigou'></view>
  68 + </view>
  69 + <view class='grade_vip_name'>{{item.title}}</view>
  70 + <view class='grade_vip_count'>{{item.remark}}</view>
  71 + <view class='grade_vip_price'>
  72 + <text>¥</text> {{item.sale_price}}
  73 + </view>
  74 + </view>
  75 + </view>
  76 + </view>
  77 + <view class='vip_four' bindtap='pay_vip'>升级尊享会员,每单返{{user.cashback}}%现金</view>
78 </view> 78 </view>
79 <!-- 省钱计算器--> 79 <!-- 省钱计算器-->
80 <view class='vip_mask' wx:if='{{mask}}'> 80 <view class='vip_mask' wx:if='{{mask}}'>
81 - <view class='vip_mask_diceng'>  
82 - <image src='{{imgUrl}}queen_crown.png' class='queen_crown'></image>  
83 - <view class='iconfont icon-quxiao cancel_mask' bindtap='opposite_mask'></view>  
84 - <view class='vip_mask_one'>  
85 - <view class='vip_mask_one_one'>会员有效期:{{user.vip_expire_time}}天</view>  
86 - <view class='vip_mask_one_two'>会员期间曾为您节省</view>  
87 - <view class='vip_mask_one_three'>  
88 - <text>¥</text> {{user.sheng_price}}  
89 - </view>  
90 - </view>  
91 - <view class='vip_mask_two'>  
92 - <view class='vip_mask_two_item'>  
93 - <view class='vip_mask_two_item_left'>  
94 - <view class='back_price'>购物返现</view>  
95 - <view class='back_price_content'>单单返现{{user.cashback}}%无上限</view>  
96 - </view>  
97 - <view class='vip_mask_two_item_right'>¥{{user. cashback_price}}</view>  
98 - </view>  
99 - <view class='vip_mask_two_item'>  
100 - <view class='vip_mask_two_item_left'>  
101 - <view class='back_price'>会员专享红包</view>  
102 - <view class='back_price_content'>各种优惠享不停</view>  
103 - </view>  
104 - <view class='vip_mask_two_item_right'>¥0.00</view>  
105 - </view>  
106 - <view class='vip_mask_two_item'>  
107 - <view class='vip_mask_two_item_left'>  
108 - <view class='back_price'>商品会员价</view>  
109 - <view class='back_price_content'>优质商品专属优惠</view>  
110 - </view>  
111 - <view class='vip_mask_two_item_right'>¥{{user.diff_price}}</view>  
112 - </view>  
113 - </view>  
114 - <view class='vip_mask_three' bindtap='becomeMonthVip'>成为月度会员,每单返{{user.cashback}}%现金</view> 81 + <view class='vip_mask_diceng'>
  82 + <image src='{{imgUrl}}queen_crown.png' class='queen_crown'></image>
  83 + <view class='iconfont icon-quxiao cancel_mask' bindtap='opposite_mask'></view>
  84 + <view class='vip_mask_one'>
  85 + <view class='vip_mask_one_one'>会员有效期:{{user.vip_expire_time}}天</view>
  86 + <view class='vip_mask_one_two'>会员期间曾为您节省</view>
  87 + <view class='vip_mask_one_three'>
  88 + <text>¥</text> {{user.sheng_price}}
  89 + </view>
  90 + </view>
  91 + <view class='vip_mask_two'>
  92 + <view class='vip_mask_two_item'>
  93 + <view class='vip_mask_two_item_left'>
  94 + <view class='back_price'>购物返现</view>
  95 + <view class='back_price_content'>单单返现{{user.cashback}}%无上限</view>
  96 + </view>
  97 + <view class='vip_mask_two_item_right'>¥{{user. cashback_price}}</view>
  98 + </view>
  99 + <view class='vip_mask_two_item'>
  100 + <view class='vip_mask_two_item_left'>
  101 + <view class='back_price'>会员专享红包</view>
  102 + <view class='back_price_content'>各种优惠享不停</view>
115 </view> 103 </view>
  104 + <view class='vip_mask_two_item_right'>¥0.00</view>
  105 + </view>
  106 + <view class='vip_mask_two_item'>
  107 + <view class='vip_mask_two_item_left'>
  108 + <view class='back_price'>商品会员价</view>
  109 + <view class='back_price_content'>优质商品专属优惠</view>
  110 + </view>
  111 + <view class='vip_mask_two_item_right'>¥{{user.diff_price}}</view>
  112 + </view>
  113 + </view>
  114 + <view class='vip_mask_three' bindtap='becomeMonthVip'>成为月度会员,每单返{{user.cashback}}%现金</view>
  115 + </view>
116 </view> 116 </view>
117 <!-- 购物返现弹框 --> 117 <!-- 购物返现弹框 -->
118 <view wx:if='{{back_shop}}'> 118 <view wx:if='{{back_shop}}'>
119 - <view class='back_shop'>  
120 - <view class='swiper_box'>  
121 - <swiper previous-margin='80rpx' next-margin='40rpx' circular='true' display-multiple-items='1' current='{{current}}' class='swiper_banner_box' bindchange='bindChange'>  
122 - <block wx:for='{{slide}}' wx:key='{{item.id}}' wx:for-index='index'>  
123 - <swiper-item>  
124 - <view class="img_box {{current == index ? 'active': ''}}">  
125 - <image src='{{item.image}}' class="slide-image {{current == index ? 'active': ''}}"></image>  
126 - </view>  
127 - </swiper-item>  
128 - </block>  
129 - </swiper>  
130 - <view class="dots">  
131 - <block wx:for="{{slide}}" wx:key="item.id" wx:for-index='index'>  
132 - <view class="dot {{current == index ? ' active' : ''}}"></view>  
133 - </block>  
134 - </view>  
135 - </view>  
136 - <view class='exit_back_shop' bindtap='hide_back_shop'>退出</view>  
137 - </view> 119 + <view class='back_shop'>
  120 + <view class='swiper_box'>
  121 + <swiper previous-margin='80rpx' next-margin='40rpx' circular='true' display-multiple-items='1' current='{{current}}' class='swiper_banner_box' bindchange='bindChange'>
  122 + <block wx:for='{{slide}}' wx:key='{{item.id}}' wx:for-index='index'>
  123 + <swiper-item>
  124 + <view class="img_box {{current == index ? 'active': ''}}">
  125 + <image src='{{item.image}}' class="slide-image {{current == index ? 'active': ''}}"></image>
  126 + </view>
  127 + </swiper-item>
  128 + </block>
  129 + </swiper>
  130 + <view class="dots">
  131 + <block wx:for="{{slide}}" wx:key="item.id" wx:for-index='index'>
  132 + <view class="dot {{current == index ? ' active' : ''}}"></view>
  133 + </block>
  134 + </view>
  135 + </view>
  136 + <view class='exit_back_shop' bindtap='hide_back_shop'>退出</view>
  137 + </view>
138 </view> 138 </view>
139 <!-- 专享客服弹框--> 139 <!-- 专享客服弹框-->
140 <view wx:if='{{customer_service}}'> 140 <view wx:if='{{customer_service}}'>
141 - <view class='back_shop'>  
142 - <view class='swiper_box'>  
143 - <swiper previous-margin='40rpx' next-margin='60rpx' circular='true' display-multiple-items='1' current='{{current}}' class='swiper_banner_box' bindchange='bindChange'>  
144 - <swiper-item wx:for='{{slide}}' wx:key='{{item.id}}' wx:for-index='index' class="swiper-item">  
145 - <view class="img_box {{current == index ? 'active': ''}}">  
146 - <image src='{{item.image}}' class="slide-image {{current == index ? 'active': ''}}"></image>  
147 - <view class="slide_font {{current == index ? 'active': ''}}">  
148 - <text>尊享会员</text> 每一单都可以享受5%现金返现,订单签收后,返现金额将直接存入你的余额账户,返利金额无上限。这里的字符数将控制在65字以内。  
149 - </view>  
150 - <view class="slide_fonts {{current == index ? 'active': ''}}">  
151 - <text class='slide_fonts_text'><text>温馨提示</text>\n01\t尊享会员返现金额为订单实付金额的5%\n02\t返现金额不可提现,可用于下次消费</text>  
152 - </view>  
153 - </view>  
154 - </swiper-item>  
155 - </swiper>  
156 - <view class="dots">  
157 - <block wx:for="{{slide}}" wx:key="item.id" wx:for-index='index'>  
158 - <view class="dot{{current == index ? ' active' : ''}}"></view>  
159 - </block>  
160 - </view>  
161 - </view>  
162 - <view class='exit_back_shop' bindtap='hide_customer_service'>退出</view>  
163 - </view> 141 + <view class='back_shop'>
  142 + <view class='swiper_box'>
  143 + <swiper previous-margin='40rpx' next-margin='60rpx' circular='true' display-multiple-items='1' current='{{current}}' class='swiper_banner_box' bindchange='bindChange'>
  144 + <swiper-item wx:for='{{slide}}' wx:key='{{item.id}}' wx:for-index='index' class="swiper-item">
  145 + <view class="img_box {{current == index ? 'active': ''}}">
  146 + <image src='{{item.image}}' class="slide-image {{current == index ? 'active': ''}}"></image>
  147 + <view class="slide_font {{current == index ? 'active': ''}}">
  148 + <text>尊享会员</text> 每一单都可以享受5%现金返现,订单签收后,返现金额将直接存入你的余额账户,返利金额无上限。这里的字符数将控制在65字以内。
  149 + </view>
  150 + <view class="slide_fonts {{current == index ? 'active': ''}}">
  151 + <text class='slide_fonts_text'><text>温馨提示</text>\n01\t尊享会员返现金额为订单实付金额的5%\n02\t返现金额不可提现,可用于下次消费</text>
  152 + </view>
  153 + </view>
  154 + </swiper-item>
  155 + </swiper>
  156 + <view class="dots">
  157 + <block wx:for="{{slide}}" wx:key="item.id" wx:for-index='index'>
  158 + <view class="dot{{current == index ? ' active' : ''}}"></view>
  159 + </block>
  160 + </view>
  161 + </view>
  162 + <view class='exit_back_shop' bindtap='hide_customer_service'>退出</view>
  163 + </view>
164 </view> 164 </view>
165 <!-- 无门槛券弹框--> 165 <!-- 无门槛券弹框-->
166 <view wx:if='{{coupons}}'> 166 <view wx:if='{{coupons}}'>
167 - <view class='back_shop'>  
168 - <view class='swiper_box'>  
169 - <swiper previous-margin='40rpx' next-margin='60rpx' circular='true' display-multiple-items='1' current='{{current}}' class='swiper_banner_box' bindchange='bindChange'>  
170 - <swiper-item wx:for='{{slide}}' wx:key='{{item.id}}' wx:for-index='index' class="swiper-item">  
171 - <view class="img_box {{current == index ? 'active': ''}}">  
172 - <image src='{{item.image}}' class="slide-image {{current == index ? 'active': ''}}"></image>  
173 - <view class="slide_font {{current == index ? 'active': ''}}">  
174 - <text>尊享会员</text> 每一单都可以享受5%现金返现,订单签收后,返现金额将直接存入你的余额账户,返利金额无上限。这里的字符数将控制在65字以内。  
175 - </view>  
176 - <view class="slide_fonts {{current == index ? 'active': ''}}">  
177 - <text class='slide_fonts_text'><text>温馨提示</text>\n01\t尊享会员返现金额为订单实付金额的5%\n02\t返现金额不可提现,可用于下次消费</text>  
178 - </view>  
179 - </view>  
180 - </swiper-item>  
181 - </swiper>  
182 - <view class="dots">  
183 - <block wx:for="{{slide}}" wx:key="item.id" wx:for-index='index'>  
184 - <view class="dot{{current == index ? ' active' : ''}}"></view>  
185 - </block>  
186 - </view>  
187 - </view>  
188 - <view class='exit_back_shop' bindtap='hide_coupons'>退出</view>  
189 - </view> 167 + <view class='back_shop'>
  168 + <view class='swiper_box'>
  169 + <swiper previous-margin='40rpx' next-margin='60rpx' circular='true' display-multiple-items='1' current='{{current}}' class='swiper_banner_box' bindchange='bindChange'>
  170 + <swiper-item wx:for='{{slide}}' wx:key='{{item.id}}' wx:for-index='index' class="swiper-item">
  171 + <view class="img_box {{current == index ? 'active': ''}}">
  172 + <image src='{{item.image}}' class="slide-image {{current == index ? 'active': ''}}"></image>
  173 + <view class="slide_font {{current == index ? 'active': ''}}">
  174 + <text>尊享会员</text> 每一单都可以享受5%现金返现,订单签收后,返现金额将直接存入你的余额账户,返利金额无上限。这里的字符数将控制在65字以内。
  175 + </view>
  176 + <view class="slide_fonts {{current == index ? 'active': ''}}">
  177 + <text class='slide_fonts_text'><text>温馨提示</text>\n01\t尊享会员返现金额为订单实付金额的5%\n02\t返现金额不可提现,可用于下次消费</text>
  178 + </view>
  179 + </view>
  180 + </swiper-item>
  181 + </swiper>
  182 + <view class="dots">
  183 + <block wx:for="{{slide}}" wx:key="item.id" wx:for-index='index'>
  184 + <view class="dot{{current == index ? ' active' : ''}}"></view>
  185 + </block>
  186 + </view>
  187 + </view>
  188 + <view class='exit_back_shop' bindtap='hide_coupons'>退出</view>
  189 + </view>
190 </view> 190 </view>
191 <!-- 无门槛券弹框--> 191 <!-- 无门槛券弹框-->
192 <view wx:if='{{more}}'> 192 <view wx:if='{{more}}'>
193 - <view class='back_shop'>  
194 - <view class='swiper_box'>  
195 - <swiper previous-margin='40rpx' next-margin='60rpx' circular='true' display-multiple-items='1' current='{{current}}' class='swiper_banner_box' bindchange='bindChange'>  
196 - <swiper-item wx:for='{{slide}}' wx:key='{{item.id}}' wx:for-index='index' class="swiper-item">  
197 - <view class="img_box {{current == index ? 'active': ''}}">  
198 - <image src='{{item.image}}' class="slide-image {{current == index ? 'active': ''}}"></image>  
199 - <view class="slide_font {{current == index ? 'active': ''}}">  
200 - <text>尊享会员</text> 每一单都可以享受5%现金返现,订单签收后,返现金额将直接存入你的余额账户,返利金额无上限。这里的字符数将控制在65字以内。  
201 - </view>  
202 - <view class="slide_fonts {{current == index ? 'active': ''}}">  
203 - <text class='slide_fonts_text'><text>温馨提示</text>\n01\t尊享会员返现金额为订单实付金额的5%\n02\t返现金额不可提现,可用于下次消费</text>  
204 - </view>  
205 - </view>  
206 - </swiper-item>  
207 - </swiper>  
208 - <view class="dots">  
209 - <block wx:for="{{slide}}" wx:key="item.id" wx:for-index='index'>  
210 - <view class="dot{{current == index ? ' active' : ''}}"></view>  
211 - </block>  
212 - </view>  
213 - </view>  
214 - <view class='exit_back_shop' bindtap='hide_more'>退出</view>  
215 - </view> 193 + <view class='back_shop'>
  194 + <view class='swiper_box'>
  195 + <swiper previous-margin='40rpx' next-margin='60rpx' circular='true' display-multiple-items='1' current='{{current}}' class='swiper_banner_box' bindchange='bindChange'>
  196 + <swiper-item wx:for='{{slide}}' wx:key='{{item.id}}' wx:for-index='index' class="swiper-item">
  197 + <view class="img_box {{current == index ? 'active': ''}}">
  198 + <image src='{{item.image}}' class="slide-image {{current == index ? 'active': ''}}"></image>
  199 + <view class="slide_font {{current == index ? 'active': ''}}">
  200 + <text>尊享会员</text> 每一单都可以享受5%现金返现,订单签收后,返现金额将直接存入你的余额账户,返利金额无上限。这里的字符数将控制在65字以内。
  201 + </view>
  202 + <view class="slide_fonts {{current == index ? 'active': ''}}">
  203 + <text class='slide_fonts_text'><text>温馨提示</text>\n01\t尊享会员返现金额为订单实付金额的5%\n02\t返现金额不可提现,可用于下次消费</text>
  204 + </view>
  205 + </view>
  206 + </swiper-item>
  207 + </swiper>
  208 + <view class="dots">
  209 + <block wx:for="{{slide}}" wx:key="item.id" wx:for-index='index'>
  210 + <view class="dot{{current == index ? ' active' : ''}}"></view>
  211 + </block>
  212 + </view>
  213 + </view>
  214 + <view class='exit_back_shop' bindtap='hide_more'>退出</view>
  215 + </view>
216 </view> 216 </view>
@@ -496,8 +496,8 @@ margin-bottom:2rpx; @@ -496,8 +496,8 @@ margin-bottom:2rpx;
496 margin-top:0; 496 margin-top:0;
497 } 497 }
498 .slide-image{ 498 .slide-image{
499 - width: 100%;  
500 - height: 100% 499 + width: 100%;
  500 + height: 100%
501 } 501 }
502 .slide_font{ 502 .slide_font{
503 width: 600rpx; 503 width: 600rpx;