Commit aa76f298d957baa4ad14fcaefad983cd1f4d61c3
1 parent
a1806b79
续费分享页面
Showing
4 changed files
with
1052 additions
and
0 deletions
pages/user/cardinfo/cardinfo.js
0 → 100644
1 | +var e = function (e) { | ||
2 | + return e && e.__esModule ? e : { | ||
3 | + default: e | ||
4 | + }; | ||
5 | +}(require("../../../utils/LoadMore.js")), | ||
6 | + t = getApp(), | ||
7 | + a = t.request, | ||
8 | + o = t.globalData.setting, | ||
9 | + os = o, | ||
10 | + i = require("../../../utils/util.js"), | ||
11 | + ut = i, | ||
12 | + s = require("../../../utils/common.js"), | ||
13 | + w = require("../../../utils/wxParse/wxParse.js"), | ||
14 | + n = new e.default(); | ||
15 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
16 | +var api = require('../../../api/api.js'); | ||
17 | +//wx.downloadFile把线上地址设为本地地址 | ||
18 | +Page({ | ||
19 | + | ||
20 | + /** | ||
21 | + * 页面的初始数据 | ||
22 | + */ | ||
23 | + data: { | ||
24 | + images: [o.imghost + "/miniapp/images/plus/card_one.jpg", o.imghost + "/miniapp/images/plus/card_two.jpg", o.imghost + "/miniapp/images/plus/card_three.jpg"], | ||
25 | + | ||
26 | + url: o.imghost, | ||
27 | + screenWidth: 0, | ||
28 | + screenheight: 0, | ||
29 | + canvasHidden:1, | ||
30 | + shareImgPath: null, | ||
31 | + is_plusCard: "",//卡的列表 | ||
32 | + imagePath: "", | ||
33 | + user: null,//会员的数据 | ||
34 | + is_card: 0,//用于判断是否是续费页和购买页面 0不是puls会员 | ||
35 | + content: "",//等级卡规则 | ||
36 | + is_card_rule: "",//等级卡规则判断用 | ||
37 | + big_card: null,//最大的卡 | ||
38 | + divide_into:"",//分佣 | ||
39 | + is_loading:"",//判断分享只执行一次 | ||
40 | + bas_ming:"",//分享的卡的图片 | ||
41 | + head_pic:"",//会员头像 | ||
42 | + img_money:"",//缓存VIP的图片 | ||
43 | + img_Ancrown:"",//会员权益 | ||
44 | + img_Identification:"",//缓存标识的图片 | ||
45 | + img_square:"",//缓存方块的图片 | ||
46 | + privilege_o:"",//卡的勋章图 | ||
47 | + cardid: "",//会员卡的id | ||
48 | + user_card: null,//会员买的卡 | ||
49 | + free:null,//分佣的数据 | ||
50 | + | ||
51 | + | ||
52 | + }, | ||
53 | + // uers_card:function () { | ||
54 | + // getApp().request.get("/api/weshop/plus/vip/mem/bership/get" + os.stoid+, { | ||
55 | + // success: function (res) { | ||
56 | + // var is_cardrule = res.data.data.cardrules; | ||
57 | + // w.wxParse("content", "html", is_cardrule, that, 6); | ||
58 | + // that.setData({ | ||
59 | + // is_card_rule: is_cardrule | ||
60 | + // }); | ||
61 | + // } | ||
62 | + // }); | ||
63 | + // }, | ||
64 | + | ||
65 | + // 邀请的人及分成 | ||
66 | + // divide_into:function(){ | ||
67 | + // var th=this; | ||
68 | + // getApp().request.get("/api/weshop/plus/vip/mem/freeze/money", { | ||
69 | + // data:{ | ||
70 | + // userId: getApp().globalData.user_id, | ||
71 | + // storeId: os.stoid, | ||
72 | + | ||
73 | + // },success: function (res) { | ||
74 | + | ||
75 | + // var divide_into=res.data.data; | ||
76 | + // console.log("邀请的人及分成5555555",res.data); | ||
77 | + // th.setData({ divide_into: divide_into}); | ||
78 | + // } | ||
79 | + // }); | ||
80 | + // }, | ||
81 | + | ||
82 | + | ||
83 | + | ||
84 | + /** | ||
85 | + * 生命周期函数--监听页面加载 | ||
86 | + */ | ||
87 | + onLoad: function (options) { | ||
88 | + var that = this; | ||
89 | + | ||
90 | + //同步初始化 | ||
91 | + that.init(); | ||
92 | + | ||
93 | + //获取最大的卡类 | ||
94 | + // that.getPlusCardType(); | ||
95 | + | ||
96 | + //商家配置信息 是等级卡的说明 | ||
97 | + // getApp().request.get("/api/weshop/storeconfig/get/"+ os.stoid, { | ||
98 | + // success: function (res) { | ||
99 | + // var is_cardrule = res.data.data.cardrules; | ||
100 | + // w.wxParse("content", "html", is_cardrule, that, 6); | ||
101 | + // that.setData({ | ||
102 | + // is_card_rule: is_cardrule | ||
103 | + // }); | ||
104 | + // } | ||
105 | + // }); | ||
106 | + //会员信息 | ||
107 | + // getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, { | ||
108 | + | ||
109 | + // success: function (res) { | ||
110 | + // //把网络图片缓存到本地 | ||
111 | + // var user = res.data.data; | ||
112 | + // var url = that.data.url; | ||
113 | + // console.log("是什么东西", user); | ||
114 | + // var img_money = url + "/images/userinfo/money.jpg"; | ||
115 | + // var img_Ancrown = url + "/images/userinfo/Ancrown.jpg"; | ||
116 | + // var img_Identification = url + "/images/userinfo/Identification.jpg"; | ||
117 | + // var img_square = url + "/images/userinfo/square.jpg"; | ||
118 | + // console.log(user.head_pic, img_money, img_Ancrown, img_Identification, img_square); | ||
119 | + // var big_card = that.data.big_card; | ||
120 | + // console.log(big_card,"ssssssss"); | ||
121 | + // wx.getImageInfo({ | ||
122 | + // src: big_card.CardImg, | ||
123 | + // success: function (res) { | ||
124 | + // //回调写法 | ||
125 | + // var bas_ming = res.path; | ||
126 | + // that.setData({ bas_ming: bas_ming}); | ||
127 | + // } | ||
128 | + // }) | ||
129 | + // wx.getImageInfo({ | ||
130 | + // src: user.CardImg, | ||
131 | + // success: function (res) { | ||
132 | + // //回调写法 | ||
133 | + // var bas_ming = res.path; | ||
134 | + // that.setData({ bas_ming: bas_ming }); | ||
135 | + // } | ||
136 | + // }) | ||
137 | + | ||
138 | + | ||
139 | + // console.log("会员数据",user); | ||
140 | + // that.setData({user: user}); | ||
141 | + // var big_card= that.big_card; | ||
142 | + // if (user != null && user != "" && user != undefined && big_card != null && user != "" && user != undefined){ | ||
143 | + // //画图 | ||
144 | + // that.saveImageToPhotosAlbum(); | ||
145 | + // } | ||
146 | + // } | ||
147 | + // }); | ||
148 | + | ||
149 | + | ||
150 | + //获取用户设备信息,屏幕宽度 | ||
151 | + wx.getSystemInfo({ | ||
152 | + success: res => { | ||
153 | + that.setData({ | ||
154 | + screenWidth: res.screenWidth | ||
155 | + }) | ||
156 | + } | ||
157 | + }) | ||
158 | + | ||
159 | + // this.saveImageToPhotosAlbum(); | ||
160 | + // this.puls_user(); | ||
161 | + | ||
162 | + | ||
163 | + }, | ||
164 | + | ||
165 | + | ||
166 | +//------------程序初始化入口 同步------------- | ||
167 | + async init() { | ||
168 | + var ee = this, th = ee; | ||
169 | + | ||
170 | + //-------------会员卡的获取------------- | ||
171 | + await getApp().request.promiseGet("/api/weshop/plus/vip/mem/list", | ||
172 | + { | ||
173 | + data: { | ||
174 | + storeId: os.stoid, | ||
175 | + userId: getApp().globalData.user_id, | ||
176 | + }, | ||
177 | + }).then(res => { | ||
178 | + | ||
179 | + var GradeCardID = res.data.data[0].GradeCardID | ||
180 | + console.log(GradeCardID, "卡的id", res.data.data[0]); | ||
181 | + ee.setData({cardid: GradeCardID}); | ||
182 | + | ||
183 | + }) | ||
184 | + //-----------会员分佣------------------- | ||
185 | + await getApp().request.promiseGet("/api/weshop/plus/vip/mem/freeze/money?userId=" + getApp().globalData.user_id + "&storeId=" + os.stoid, { | ||
186 | + }).then(res => { | ||
187 | + console.log("分佣的数据", res.data.data); | ||
188 | + if (res.data.code==0){ | ||
189 | + ee.setData({ free:res.data.data}); | ||
190 | + }else{ | ||
191 | + ee.setData({ free: 0 }); | ||
192 | + } | ||
193 | + | ||
194 | + }) | ||
195 | + //-----------会员的卡类------------------- | ||
196 | + await getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/get?storeId=" + os.stoid + "&CardId=" + ee.data.cardid, { | ||
197 | + }).then(res => { | ||
198 | + var user_card= res.data.data; | ||
199 | + console.log(user_card,"会员的卡类"); | ||
200 | + ee.setData({user_card: user_card}); | ||
201 | + }) | ||
202 | + //-----------等级卡说明------------------- | ||
203 | + await getApp().request.promiseGet("/api/weshop/storeconfig/get/"+ os.stoid, { | ||
204 | + }).then(res => { | ||
205 | + var is_cardrule = res.data.data.cardrules; | ||
206 | + w.wxParse("content", "html", is_cardrule, ee, 6); | ||
207 | + ee.setData({ | ||
208 | + is_card_rule: is_cardrule | ||
209 | + }); | ||
210 | + | ||
211 | + }) | ||
212 | +//----------------------------获取最大的卡类----------------------- | ||
213 | + await getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + o.stoid, { | ||
214 | + | ||
215 | + }).then(res => { | ||
216 | + var plusCard = res.data.data; | ||
217 | + var big_card = null; | ||
218 | + var big_cards = null; | ||
219 | + console.log(plusCard, "数据什么的", res); | ||
220 | + for (var i = 0; i < plusCard.length; i++) { | ||
221 | + big_cards = Math.max(plusCard[i].CardFee) | ||
222 | + if (plusCard[i].CardFee == big_cards) { | ||
223 | + big_card = plusCard[i] | ||
224 | + } | ||
225 | + } | ||
226 | + console.log(big_cards, "是什么东西", big_card); | ||
227 | + | ||
228 | + ee.setData({ | ||
229 | + is_plusCard: plusCard, | ||
230 | + big_card: big_card | ||
231 | + }) | ||
232 | + | ||
233 | + }) | ||
234 | + | ||
235 | + | ||
236 | + | ||
237 | + | ||
238 | + //-----------------获取会员信息------------------------------- | ||
239 | + await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id,{ | ||
240 | + | ||
241 | + }).then(res => { | ||
242 | + var user = res.data.data; | ||
243 | + var url = ee.data.url; | ||
244 | + console.log("是什么东西", url); | ||
245 | + var img_money = url + "/miniapp/images/plus/share/money.png"; | ||
246 | + var img_Ancrown = url + "/miniapp/images/plus/share/Ancrown.png"; | ||
247 | + var img_Identification = url + "/miniapp/images/plus/share/Identification.png"; | ||
248 | + var img_square = url + "/miniapp/images/plus/share/square.png"; | ||
249 | + var privilege_o = url + "/miniapp/images/plus/share/privilege_o.png"; | ||
250 | + console.log("图片转换",img_money); | ||
251 | + var big_card = ee.data.big_card; | ||
252 | + ee.setData({ | ||
253 | + user: user, | ||
254 | + img_money: img_money, | ||
255 | + img_Ancrown: img_Ancrown , | ||
256 | + img_Identification: img_Identification, | ||
257 | + img_square, img_square , | ||
258 | + privilege_o, privilege_o | ||
259 | + | ||
260 | + }); | ||
261 | + //缓存分享卡的图片 | ||
262 | + wx.getImageInfo({ | ||
263 | + src: big_card.CardImg, | ||
264 | + success: function (res) { | ||
265 | + //回调写法 | ||
266 | + var bas_ming = res.path; | ||
267 | + ee.setData({ bas_ming: bas_ming}); | ||
268 | + } | ||
269 | + }) | ||
270 | + //缓存会员头像的图片 | ||
271 | + wx.getImageInfo({ | ||
272 | + src: user.head_pic, | ||
273 | + success: function (res) { | ||
274 | + //回调写法 | ||
275 | + var user_head= res.path; | ||
276 | + ee.setData({ head_pic: user_head }); | ||
277 | + } | ||
278 | + }) | ||
279 | + }) | ||
280 | + //--------------------缓存vip价格的图片--------------- | ||
281 | + wx.getImageInfo({ | ||
282 | + src:ee.data.img_money, | ||
283 | + success: function (res) { | ||
284 | + //回调写法 | ||
285 | + var img_money = res.path; | ||
286 | + ee.setData({ img_money: img_money}); | ||
287 | + } | ||
288 | + }) | ||
289 | + //--------------------缓存权益的图片--------------- | ||
290 | + wx.getImageInfo({ | ||
291 | + src: ee.data.img_Ancrown, | ||
292 | + success: function (res) { | ||
293 | + //回调写法 | ||
294 | + var img_Ancrown = res.path; | ||
295 | + ee.setData({ img_Ancrown: img_Ancrown }); | ||
296 | + } | ||
297 | + }) | ||
298 | + //--------------------缓存标识的图片--------------- | ||
299 | + wx.getImageInfo({ | ||
300 | + src: ee.data.img_Identification, | ||
301 | + success: function (res) { | ||
302 | + //回调写法 | ||
303 | + var img_Identification = res.path; | ||
304 | + ee.setData({ img_Identification: img_Identification }); | ||
305 | + } | ||
306 | + }) | ||
307 | + | ||
308 | + //--------------------卡的勋章--------------- | ||
309 | + wx.getImageInfo({ | ||
310 | + src: ee.data.privilege_o, | ||
311 | + success: function (res) { | ||
312 | + //回调写法 | ||
313 | + var privilege_o = res.path; | ||
314 | + ee.setData({ privilege_o: privilege_o }); | ||
315 | + } | ||
316 | + }) | ||
317 | + | ||
318 | + | ||
319 | + //--------------------方块图--------------- | ||
320 | + wx.getImageInfo({ | ||
321 | + src: ee.data.img_square, | ||
322 | + success: function (res) { | ||
323 | + //回调写法 | ||
324 | + var img_square = res.path; | ||
325 | + ee.setData({ img_square: img_square}); | ||
326 | + } | ||
327 | + }) | ||
328 | + //初始分享图页面 | ||
329 | + // ee.saveImageToPhotosAlbum(); | ||
330 | + }, | ||
331 | + | ||
332 | + //-----Plus会员获取----------- | ||
333 | + // puls_user: function () { | ||
334 | + | ||
335 | + // var th = this; | ||
336 | + // getApp().request.get("/api/weshop/plus/vip/mem/list", { | ||
337 | + // data: { | ||
338 | + // storeId: os.stoid, | ||
339 | + // userId: getApp().globalData.user_id, | ||
340 | + // }, | ||
341 | + // success: function (su) { | ||
342 | + // if (su.data.code == 0) { | ||
343 | + // var cardname = su.data.data[0].MemCardName; | ||
344 | + // console.log("卡的名字", cardname); | ||
345 | + // th.setData({ pulscardname: cardname }); | ||
346 | + // } | ||
347 | + // } | ||
348 | + // }); | ||
349 | + // }, | ||
350 | + | ||
351 | + | ||
352 | + //打开分享图片 | ||
353 | + Share_pictures: function () { | ||
354 | + | ||
355 | + this.setData({ | ||
356 | + canvasHidden: false | ||
357 | + }) | ||
358 | + this.saveImageToPhotosAlbum(); | ||
359 | + }, | ||
360 | + | ||
361 | + | ||
362 | + | ||
363 | + // //获取最大的卡类 | ||
364 | + // getPlusCardType: function (e) { | ||
365 | + // var storid = o.stoid; | ||
366 | + // var th = this; | ||
367 | + // getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { | ||
368 | + // var plusCard = res.data.data; | ||
369 | + // var big_card=null; | ||
370 | + // var big_cards = null; | ||
371 | + // console.log(plusCard, "数据什么的", res); | ||
372 | + // for (var i = 0; i < plusCard.length; i++) { | ||
373 | + // big_cards= Math.max(plusCard[i].CardFee) | ||
374 | + // if (plusCard[i].CardFee ==big_cards){ | ||
375 | + // big_card = plusCard[i] | ||
376 | + // } | ||
377 | + // } | ||
378 | + // console.log(big_cards, "是什么东西", big_card); | ||
379 | + | ||
380 | + // th.setData({ | ||
381 | + // is_plusCard: plusCard, | ||
382 | + // big_card: big_card | ||
383 | + // }) | ||
384 | + // }) | ||
385 | + | ||
386 | + // }, | ||
387 | + /** | ||
388 | + * 生命周期函数--监听页面初次渲染完成 | ||
389 | + */ | ||
390 | + saveImageToPhotosAlbum: function () { | ||
391 | + if (this.data.imagePath != "") { | ||
392 | + wx.previewImage({ | ||
393 | + urls: [this.data.imagePath], | ||
394 | + }) | ||
395 | + return; | ||
396 | + } | ||
397 | + // if(this.data.is_loading) return false ; | ||
398 | + this.data.is_loading=1; | ||
399 | + | ||
400 | + wx.showLoading({ | ||
401 | + title: '生成中...', | ||
402 | + }) | ||
403 | + | ||
404 | + var th = this; | ||
405 | + //设置画板显示,才能开始绘图 | ||
406 | + var card_ming=th.data.bas_ming;//卡的图片 | ||
407 | + var user = th.data.user;//会员资料; | ||
408 | + var big_card= th.data.big_card;//获取最大的卡 | ||
409 | + var user_head = th.data.head_pic;//会员头像 | ||
410 | + var img_money = th.data.img_money;//缓存vip的价格 | ||
411 | + var img_Ancrown = th.data.img_Ancrown;//会员权益的图片 | ||
412 | + var img_Identification = th.data.img_Identification;//会员标识 | ||
413 | + var privilege_o = th.data.privilege_o;//勋章图片 | ||
414 | + var img_square=th.data.img_square; | ||
415 | + console.log("user的会员资料", user); | ||
416 | + console.log("最大的卡", big_card); | ||
417 | + console.log("会员头像", card_ming); | ||
418 | + console.log("缓存vip的价格", img_money); | ||
419 | + console.log(" 会员标识", img_Ancrown); | ||
420 | + console.log("/勋章图片", privilege_o); | ||
421 | + var app = getApp(); | ||
422 | + var unit = th.data.screenWidth / 750 * 1.35; | ||
423 | + var scene = getApp().globalData.user_id; | ||
424 | + console.log("二维码主键",scene); | ||
425 | + ///二微码 | ||
426 | + var vpath="", | ||
427 | + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | ||
428 | + os.stoid + "?sceneValue=" + scene + "&pageValue=pages/user/plus/plus"; | ||
429 | + wx.getImageInfo({ | ||
430 | + src: path3, | ||
431 | + success: function (res) { | ||
432 | + //回调写法 | ||
433 | + th.get_head_temp(th.get_goods_temp, function () { | ||
434 | + vpath = res.path; | ||
435 | + }) | ||
436 | + } | ||
437 | + }) | ||
438 | + console.log("生成二维码", path3); | ||
439 | + //开启画布 | ||
440 | + const ctx = wx.createCanvasContext('myCanvas'); | ||
441 | + //先画背景 | ||
442 | + ctx.drawImage("../../../images/plus/share/mackground.png", 0, 0, 554 * unit, 930 * unit); | ||
443 | + ctx.setFontSize(26 * unit); | ||
444 | + ctx.setFillStyle("rgb(0,0,0)"); | ||
445 | + ctx.fillText(user.nickname, 155 * unit, 75 * unit, 200 * unit); | ||
446 | + | ||
447 | + var tj_path = "../../../images/userinfo/q_tj.png"; | ||
448 | + ctx.drawImage(tj_path, 385 * unit, 45 * unit, 90 * unit, 30 * unit); | ||
449 | + ctx.setFontSize(18 * unit); | ||
450 | + ctx.setFillStyle("rgb(255,255,255)"); | ||
451 | + ctx.fillText("强烈推荐", 394 * unit, 65 * unit); | ||
452 | + | ||
453 | + ctx.setStrokeStyle("rgb(255,255,255)"); | ||
454 | + ctx.setLineDash([5 * unit, 5 * unit], 5 * unit); | ||
455 | + ctx.beginPath(); | ||
456 | + ctx.moveTo(0, 125 * unit); | ||
457 | + ctx.lineTo(554 * unit, 125 * unit); | ||
458 | + ctx.stroke(); | ||
459 | + | ||
460 | + var x = 55 * unit, | ||
461 | + y = 165 * unit, | ||
462 | + w = 444 * unit, | ||
463 | + h = 220 * unit, | ||
464 | + r = 14 * unit; | ||
465 | + ctx.save(); | ||
466 | + // 开始绘制 | ||
467 | + ctx.beginPath(); | ||
468 | + // 因为边缘描边存在锯齿,最好指定使用 transparent 填充 | ||
469 | + // 这里是使用 fill 还是 stroke都可以,二选一即可 | ||
470 | + ctx.setFillStyle('rgb(237,188,150)') | ||
471 | + // ctx.setStrokeStyle('transparent') | ||
472 | + // 左上角 | ||
473 | + ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5) | ||
474 | + | ||
475 | + // border-top | ||
476 | + ctx.moveTo(x + r, y) | ||
477 | + ctx.lineTo(x + w - r, y) | ||
478 | + ctx.lineTo(x + w, y + r) | ||
479 | + // 右上角 | ||
480 | + ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2) | ||
481 | + | ||
482 | + // border-right | ||
483 | + ctx.lineTo(x + w, y + h - r) | ||
484 | + ctx.lineTo(x + w - r, y + h) | ||
485 | + // 右下角 | ||
486 | + ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5) | ||
487 | + | ||
488 | + // border-bottom | ||
489 | + ctx.lineTo(x + r, y + h) | ||
490 | + ctx.lineTo(x, y + h - r) | ||
491 | + // 左下角 | ||
492 | + ctx.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI) | ||
493 | + | ||
494 | + // border-left | ||
495 | + ctx.lineTo(x, y + r) | ||
496 | + ctx.lineTo(x + r, y) | ||
497 | + | ||
498 | + // 这里是使用 fill 还是 stroke都可以,二选一即可,但是需要与上面对应 | ||
499 | + ctx.fill() | ||
500 | + | ||
501 | + ctx.clip(); //画了圆 再剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 | ||
502 | + ctx.drawImage(card_ming, x, y, 444 * unit, 220 * unit); // 推进去图片 | ||
503 | + ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制 | ||
504 | + | ||
505 | + ctx.beginPath(); | ||
506 | + // 卡图片 | ||
507 | + // ctx.drawImage("../../../images/plus/share/one.jpg", 55 * unit, 165 * unit, 444 * unit, 220 * unit,); | ||
508 | + ctx.setFontSize(26 * unit); | ||
509 | + ctx.setFillStyle('rgb(218,194,169)'); | ||
510 | + ctx.fillText(big_card.CardName, 80 * unit, 215 * unit); | ||
511 | + ctx.setFontSize(18 * unit); | ||
512 | + ctx.setFillStyle('rgb(218,194,169)'); | ||
513 | + ctx.fillText("开通会员年卡仅" + big_card.CardFee+"元", 80 * unit, 240 * unit); | ||
514 | + | ||
515 | + ctx.drawImage(privilege_o, 80 * unit, 343 * unit, 20 * unit, 20 * unit); | ||
516 | + | ||
517 | + ctx.setFontSize(14 * unit); | ||
518 | + ctx.setFillStyle('rgb(218,194,169)'); | ||
519 | + ctx.fillText("根据大家购买数据,您成为超级会员预计可省¥3031元", 105 * unit, 360 * unit); | ||
520 | + | ||
521 | + ctx.rect(70 * unit, 425 * unit, 182 * unit, 1 * unit); | ||
522 | + ctx.setFillStyle('rgb(218,194,169)'); | ||
523 | + ctx.fill(); | ||
524 | + | ||
525 | + ctx.drawImage(img_square, 267 * unit, 420 * unit, 13 * unit, 13 * unit); | ||
526 | + | ||
527 | + ctx.beginPath(); | ||
528 | + ctx.rect(295 * unit, 425 * unit, 182 * unit, 1 * unit); | ||
529 | + ctx.setFillStyle('rgb(218,194,169)'); | ||
530 | + ctx.fill(); | ||
531 | + | ||
532 | + ctx.drawImage(img_square, 80 * unit, 470 * unit, 10 * unit, 10 * unit); | ||
533 | + ctx.setFontSize(24 * unit); | ||
534 | + ctx.setFillStyle("rgb(198,165,126)"); | ||
535 | + ctx.fillText("超级VIP权益", 100 * unit, 475 * unit); | ||
536 | + | ||
537 | + ctx.setFontSize(20 * unit); | ||
538 | + ctx.setFillStyle("rgb(198,165,126)"); | ||
539 | + ctx.fillText("超级会员专属权益", 100 * unit, 505 * unit); | ||
540 | + ctx.drawImage(img_Ancrown, 355 * unit, 440 * unit, 65 * unit, 65 * unit); | ||
541 | + | ||
542 | + ctx.rect(85 * unit, 530 * unit, 375 * unit, 1 * unit) | ||
543 | + ctx.setFillStyle('rgb(218,194,169)') | ||
544 | + ctx.fill(); | ||
545 | + | ||
546 | + ctx.drawImage(img_square, 80 * unit, 575 * unit, 10 * unit, 10 * unit); | ||
547 | + ctx.setFontSize(24 * unit); | ||
548 | + ctx.setFillStyle("rgb(198,165,126)"); | ||
549 | + ctx.fillText("超级VIP标识", 100 * unit, 580 * unit); | ||
550 | + | ||
551 | + ctx.setFontSize(20 * unit); | ||
552 | + ctx.setFillStyle("rgb(198,165,126)"); | ||
553 | + ctx.fillText("彰显尊贵身份的象征", 100 * unit, 610 * unit); | ||
554 | + ctx.drawImage(img_Identification, 355 * unit, 548 * unit, 65 * unit, 65 * unit); | ||
555 | + | ||
556 | + ctx.rect(85 * unit, 635 * unit, 375 * unit, 1 * unit); | ||
557 | + ctx.setFillStyle('rgb(218,194,169)'); | ||
558 | + ctx.fill(); | ||
559 | + | ||
560 | + ctx.drawImage(img_square, 80 * unit, 695 * unit, 10 * unit, 10 * unit); | ||
561 | + ctx.setFontSize(24 * unit); | ||
562 | + ctx.setFillStyle("rgb(198,165,126)"); | ||
563 | + ctx.fillText("超级VIP价格", 100 * unit, 695 * unit); | ||
564 | + | ||
565 | + ctx.setFontSize(20 * unit); | ||
566 | + ctx.setFillStyle("rgb(198,165,126)"); | ||
567 | + ctx.fillText("享受专属会员超低价", 100 * unit, 725 * unit); | ||
568 | + ctx.drawImage(img_money, 355 * unit, 660 * unit, 65 * unit, 65 * unit); | ||
569 | + | ||
570 | + ctx.rect(85 * unit, 750 * unit, 375 * unit, 1 * unit) | ||
571 | + ctx.setFillStyle('rgb(218,194,169)') | ||
572 | + ctx.fill(); | ||
573 | + | ||
574 | + ctx.drawImage(vpath, 100 * unit, 780 * unit, 110 * unit, 110 * unit); | ||
575 | + | ||
576 | + ctx.setFontSize(20 * unit); | ||
577 | + ctx.setFillStyle("#000"); | ||
578 | + ctx.fillText("解锁新权益 精彩享不停", 230 * unit, 825 * unit); | ||
579 | + | ||
580 | + ctx.setFontSize(20 * unit); | ||
581 | + ctx.setFillStyle("#000"); | ||
582 | + ctx.fillText("长按识别二维码,立即开通!", 230 * unit, 865 * unit); | ||
583 | + | ||
584 | + //---绘制圆形要放在最后---- | ||
585 | + ctx.save(); | ||
586 | + ctx.beginPath(); | ||
587 | + var h_x = 60 * unit; | ||
588 | + var h_y = 24 * unit; | ||
589 | + var h_r = 40 * unit; | ||
590 | + var cx = h_x + h_r; | ||
591 | + var cy = h_y + h_r; | ||
592 | + ctx.arc(cx, cy, h_r, 0, Math.PI * 2, false); | ||
593 | + ctx.closePath(); | ||
594 | + ctx.fill(); | ||
595 | + ctx.clip(); | ||
596 | + ctx.drawImage(user_head, h_x, h_y, h_r * 2, h_r * 2); | ||
597 | + ctx.restore(); | ||
598 | + | ||
599 | + var x = 345 * unit, | ||
600 | + y = 190 * unit, | ||
601 | + w = 105 * unit, | ||
602 | + h = 30 * unit, | ||
603 | + r = 14 * unit; | ||
604 | + ctx.save(); | ||
605 | + // 开始绘制 | ||
606 | + ctx.beginPath(); | ||
607 | + // 因为边缘描边存在锯齿,最好指定使用 transparent 填充 | ||
608 | + // 这里是使用 fill 还是 stroke都可以,二选一即可 | ||
609 | + ctx.setFillStyle('rgb(237,188,150)') | ||
610 | + // ctx.setStrokeStyle('transparent') | ||
611 | + // 左上角 | ||
612 | + ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5) | ||
613 | + | ||
614 | + // border-top | ||
615 | + ctx.moveTo(x + r, y) | ||
616 | + ctx.lineTo(x + w - r, y) | ||
617 | + ctx.lineTo(x + w, y + r) | ||
618 | + // 右上角 | ||
619 | + ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2) | ||
620 | + | ||
621 | + // border-right | ||
622 | + ctx.lineTo(x + w, y + h - r) | ||
623 | + ctx.lineTo(x + w - r, y + h) | ||
624 | + // 右下角 | ||
625 | + ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5) | ||
626 | + | ||
627 | + // border-bottom | ||
628 | + ctx.lineTo(x + r, y + h) | ||
629 | + ctx.lineTo(x, y + h - r) | ||
630 | + // 左下角 | ||
631 | + ctx.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI) | ||
632 | + | ||
633 | + // border-left | ||
634 | + ctx.lineTo(x, y + r) | ||
635 | + ctx.lineTo(x + r, y) | ||
636 | + | ||
637 | + // 这里是使用 fill 还是 stroke都可以,二选一即可,但是需要与上面对应 | ||
638 | + ctx.fill() | ||
639 | + | ||
640 | + ctx.setFontSize(18 * unit); | ||
641 | + ctx.setFillStyle("#000"); | ||
642 | + ctx.fillText("立即开通", 362 * unit, 212 * unit); | ||
643 | + | ||
644 | + //绘制图片 | ||
645 | + ctx.draw(false, | ||
646 | + wx.canvasToTempFilePath({ | ||
647 | + x: 0, | ||
648 | + y: 0, | ||
649 | + width: 750, | ||
650 | + height: 930, | ||
651 | + destWidth: 1.2 * 750 * 750 / th.data.screenWidth, | ||
652 | + destHeight: 1.2 * 1217 * 750 / th.data.screenWidth, | ||
653 | + canvasId: 'myCanvas', | ||
654 | + success: function (res) { | ||
655 | + wx.hideLoading();//关闭生成中的方法 | ||
656 | + th.data.is_loading=0; | ||
657 | + | ||
658 | + console.log("sssssssssssssssssssssssss" + res.tempFilePath); | ||
659 | + var tempFilePath = res.tempFilePath; | ||
660 | + th.setData({ | ||
661 | + imagePath: tempFilePath, | ||
662 | + maskHidden: false, | ||
663 | + canvasHidden: true | ||
664 | + }); | ||
665 | + wx.previewImage({ | ||
666 | + urls: [res.tempFilePath], | ||
667 | + }) | ||
668 | + if (!res.tempFilePath) { | ||
669 | + wx.showModal({ | ||
670 | + title: '提示', | ||
671 | + content: '图片绘制中,请稍后重试', | ||
672 | + showCancel: false | ||
673 | + }) | ||
674 | + } | ||
675 | + | ||
676 | + } | ||
677 | + | ||
678 | + })) | ||
679 | + | ||
680 | + | ||
681 | + }, | ||
682 | + //--获取商品图片的本地缓存,回调写法-- | ||
683 | + get_goods_temp: function (tt) { | ||
684 | + var ee = this; | ||
685 | + if (ee.data.share_goods_img) { | ||
686 | + tt(); | ||
687 | + return false; | ||
688 | + } | ||
689 | + //获取商品是分享图信息 | ||
690 | + wx.getImageInfo({ | ||
691 | + src: ee.data.data.original_img, | ||
692 | + success: function (res) { | ||
693 | + //res.path是网络图片的本地地址 | ||
694 | + ee.data.share_goods_img = res.path; | ||
695 | + tt(); | ||
696 | + }, | ||
697 | + fail: function (res) { | ||
698 | + ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 | ||
699 | + tt(); | ||
700 | + } | ||
701 | + }); | ||
702 | + }, | ||
703 | + | ||
704 | + /** | ||
705 | + * 生命周期函数--监听页面显示 | ||
706 | + */ | ||
707 | + onShow: function () { | ||
708 | + | ||
709 | + var goods_list = this.selectComponent("#goods_list"); //组件的id | ||
710 | + goods_list.get_list(); | ||
711 | + }, | ||
712 | + | ||
713 | + /** | ||
714 | + * 生命周期函数--监听页面隐藏 | ||
715 | + */ | ||
716 | + onHide: function () { | ||
717 | + | ||
718 | + }, | ||
719 | + | ||
720 | + /** | ||
721 | + * 生命周期函数--监听页面卸载 | ||
722 | + */ | ||
723 | + onUnload: function () { | ||
724 | + | ||
725 | + }, | ||
726 | + | ||
727 | + /** | ||
728 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
729 | + */ | ||
730 | + onPullDownRefresh: function () { | ||
731 | + | ||
732 | + }, | ||
733 | + | ||
734 | + /** | ||
735 | + * 页面上拉触底事件的处理函数 | ||
736 | + */ | ||
737 | + onReachBottom: function () { | ||
738 | + var goods_list = this.selectComponent("#goods_list"); //组件的id | ||
739 | + goods_list.get_list(); | ||
740 | + this.setData({ | ||
741 | + j: true | ||
742 | + }) | ||
743 | + }, | ||
744 | + | ||
745 | + /** | ||
746 | + * 用户点击右上角分享 | ||
747 | + */ | ||
748 | + onShareAppMessage: function () { | ||
749 | + | ||
750 | + }, | ||
751 | + //开通会员 | ||
752 | + Opening: function () { | ||
753 | + this.setData({ | ||
754 | + j: true | ||
755 | + }) | ||
756 | + }, | ||
757 | + //返回会员页面 | ||
758 | + OpeningClose: function () { | ||
759 | + this.setData({ | ||
760 | + j: false | ||
761 | + }) | ||
762 | + } | ||
763 | + | ||
764 | +}) | ||
0 | \ No newline at end of file | 765 | \ No newline at end of file |
pages/user/cardinfo/cardinfo.json
0 → 100644
pages/user/cardinfo/cardinfo.wxml
0 → 100644
1 | +<import src="../../../utils/wxParse/wxParse.wxml"></import> | ||
2 | + | ||
3 | + <view> | ||
4 | + <image class="Member_bk" src="{{url}}/miniapp/images/plus/page_bk.png"></image> | ||
5 | +</view> | ||
6 | + | ||
7 | + | ||
8 | + <view class="MemberPlus"style="background-image:url('{{user_card.CardImg}}');background-size: 100% 100%;background-repead:no-repead;"> | ||
9 | + | ||
10 | + <view class="flex-space-between"> | ||
11 | + <view style="color:{{user_card.CardColor}}"> | ||
12 | + <view class="fs36" style="font-weight:bold">{{user_card.CardName}}</view> | ||
13 | + <view class="fs22">会员将在{{user_card.ExpiryDate}}到期</view> | ||
14 | + </view> | ||
15 | + <view class="renew fs28" style="background:{{user_card.CardColor}}">立即续费 | ||
16 | + </view> | ||
17 | + | ||
18 | + </view> | ||
19 | + | ||
20 | + <view class="flex-vertical-between xs fs24"> | ||
21 | + | ||
22 | + <view class="flex" style=" overflow:hidden"> | ||
23 | + <view class="Member"style="background-image:url('{{url}}/miniapp/images/plus/privilege_o.png');filter: drop-shadow( 40rpx 0rpx 0rpx {{user_card.CardColor}});"></view> | ||
24 | + <view style="color:{{user_card.CardColor}}">正在享受{{user_card.CardName}}会员特权 | ||
25 | + </view> | ||
26 | + </view> | ||
27 | + <view class="flex-vertical" bindtap="Share_pictures"> | ||
28 | + <view style="color:{{user_card.CardColor}}">邀请新朋友</view> | ||
29 | + <image class="share" src="{{url}}/miniapp/images/plus/Forward.png"></image> | ||
30 | + </view> | ||
31 | + </view> | ||
32 | + | ||
33 | + </view> | ||
34 | + <view class="flex-vertical-between Invitation fs30"> | ||
35 | + | ||
36 | + <view class="flex"> | ||
37 | + 已邀请 | ||
38 | + <view class="Invitation_count">{{free==0?"0":free.RefereeNumber}}人</view> | ||
39 | + 可提现 | ||
40 | + <view class="Invitation_my">{{free==0?"0":free.RefereeMoney}}元</view> | ||
41 | + </view> | ||
42 | + | ||
43 | + <view class="flex"> | ||
44 | + <view class="Detailed flex-center"> | ||
45 | + <navigator url="/pages/user/Detailed/Detailed">明细</navigator> | ||
46 | + </view> | ||
47 | + <view class="Invitation_Cash">立即提现</view> | ||
48 | + | ||
49 | + </view> | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + </view> | ||
57 | + | ||
58 | + <!-- 会员礼遇 --> | ||
59 | + <view class="Courtesy"> | ||
60 | + | ||
61 | + <!-- 标题 --> | ||
62 | + <view class="flex-center" style="width:100%;height:200rpx;"> | ||
63 | + <view> | ||
64 | + <view wx:if="{{false}}" class="Courtesy_title flex-center fs36">开通PLUSI会员尊享礼遇 | ||
65 | + </view> | ||
66 | + <view wx:else class="Courtesy_title flex-center fs36">PLUSI会员尊享礼遇 </view> | ||
67 | + | ||
68 | + | ||
69 | + <view class="flex-center"> | ||
70 | + <image class="Courtesy_image" src="{{url}}/miniapp/images/plus/Courtesy.png"></image> | ||
71 | + | ||
72 | + <view wx:if="{{false}}" class="Courtesy_can fs24">PLUSI会员可享以下特权 | ||
73 | + </view> | ||
74 | + <view wx:else class="Courtesy_can fs24">解锁新权益 精彩享不停 | ||
75 | + </view> | ||
76 | + | ||
77 | + <image class="Courtesy_image" src="{{url}}/miniapp/images/plus/Courtesy.png"></image> | ||
78 | + </view> | ||
79 | + </view> | ||
80 | + </view> | ||
81 | + | ||
82 | + <!-- 会员权益内容 --> | ||
83 | + <view class="Courtesy_comment"> | ||
84 | + <view class="wxParse"> | ||
85 | + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> | ||
86 | + </view> | ||
87 | + </view> | ||
88 | + </view> | ||
89 | + | ||
90 | + | ||
91 | +<!-- 好物推荐 --> | ||
92 | + <!-- 好物推荐 --> | ||
93 | + <view class="title"> | ||
94 | + <!-- 标题 --> | ||
95 | + <view> | ||
96 | + <!-- 中文名标题 --> | ||
97 | + <view class="China flex-level"> | ||
98 | + <view class="line flex-vertical"> | ||
99 | + <view class="one"></view> | ||
100 | + <view class="two"></view> | ||
101 | + <view class="three"></view> | ||
102 | + </view> | ||
103 | + | ||
104 | + <view class="Recommend flex-level" bindtap="requestList">好物推荐</view> | ||
105 | + | ||
106 | + <view class="line flex-vertical"> | ||
107 | + <view class="three"></view> | ||
108 | + <view class="two"></view> | ||
109 | + <view class="one"></view> | ||
110 | + </view> | ||
111 | + </view> | ||
112 | + | ||
113 | + <!-- 英文标题 --> | ||
114 | + <view class="english flex-center"> | ||
115 | + <view class="silk"></view> | ||
116 | + <view class="esh five-level-word">GOOD HOT THING</view> | ||
117 | + <view class="silk"></view> | ||
118 | + </view> | ||
119 | + | ||
120 | + </view> | ||
121 | + <!-- 商品列表组件 --> | ||
122 | + <goods_recommend id="goods_list"></goods_recommend> | ||
123 | + <!-- 商品列表 --> | ||
124 | + | ||
125 | + </view> | ||
126 | + | ||
127 | + | ||
128 | + <!-- 画布 --> | ||
129 | +<canvas canvas-id='myCanvas' style="width:750rpx;height:1260rpx;"wx:if='{{!canvasHidden}}'></canvas> | ||
130 | + | ||
131 | +<warn id="warn"></warn> | ||
0 | \ No newline at end of file | 132 | \ No newline at end of file |
pages/user/cardinfo/cardinfo.wxss
0 → 100644
1 | + @import "../../../utils/wxParse/wxParse.wxss"; | ||
2 | + .Member_bk { | ||
3 | + position:relative; | ||
4 | + z-index: 0; | ||
5 | + width: 100%; | ||
6 | + height: 100%; | ||
7 | +} | ||
8 | +.MemberPlus { | ||
9 | + width: 618rpx; | ||
10 | + height: 290rpx; | ||
11 | + border-radius: 18rpx; | ||
12 | + box-shadow: 0rpx 0rpx 10rpx #888; | ||
13 | + margin: 0rpx 35rpx; | ||
14 | + color: #ffa786; | ||
15 | + padding: 0rpx 31rpx; | ||
16 | + padding-top: 60rpx; | ||
17 | + background-size: 100%; | ||
18 | +} | ||
19 | +.renew { | ||
20 | + width: 190rpx; | ||
21 | + height: 50rpx; | ||
22 | + border-radius: 18rpx; | ||
23 | + background-color: rgb(237, 189, 150); | ||
24 | + text-align: center; | ||
25 | + line-height: 50rpx; | ||
26 | + color: #000; | ||
27 | + margin-top: 7rpx; | ||
28 | + | ||
29 | +} | ||
30 | +.xs { | ||
31 | + margin-top: 130rpx; | ||
32 | +} | ||
33 | +.MemberPlus .privilege { | ||
34 | + width: 30rpx; | ||
35 | + height: 30rpx; | ||
36 | + margin-right: 7rpx; | ||
37 | +} | ||
38 | +.MemberPlus .share { | ||
39 | + width: 30rpx; | ||
40 | + height: 30rpx; | ||
41 | + margin-left: 7rpx; | ||
42 | +} | ||
43 | +.Invitation { | ||
44 | + padding: 0rpx 31rpx; | ||
45 | + box-shadow: 0rpx 0rpx 10rpx #888; | ||
46 | + height: 95rpx; | ||
47 | + background-color: rgb(255, 255, 255); | ||
48 | + z-index: 6; | ||
49 | + position: relative; | ||
50 | + margin-top: -15rpx; | ||
51 | +} | ||
52 | +.Invitation .Invitation_count, .Invitation_my { | ||
53 | + color: rgb(237, 189, 153); | ||
54 | +} | ||
55 | +.Invitation .Detailed { | ||
56 | + color: rgb(237, 189, 150); | ||
57 | + text-decoration: underline; | ||
58 | +} | ||
59 | +.Invitation .Invitation_Cash { | ||
60 | + width: 150rpx; | ||
61 | + height: 45rpx; | ||
62 | + line-height: 45rpx; | ||
63 | + text-align: center; | ||
64 | + border-radius: 25rpx; | ||
65 | + margin-left: 30rpx; | ||
66 | + background-color: rgb(237, 189, 150); | ||
67 | + color: rgb(255, 255, 255); | ||
68 | +} | ||
69 | +.swiper, .Courtesy, .title { | ||
70 | + position: relative; | ||
71 | + z-index: 3; | ||
72 | +} | ||
73 | +.Courtesy_title { | ||
74 | + color: rgb(173, 137, 79); | ||
75 | + font-weight: bold; | ||
76 | + margin-bottom: 10rpx; | ||
77 | + letter-spacing: 2rpx; | ||
78 | +} | ||
79 | +.Courtesy_image { | ||
80 | + width: 50rpx; | ||
81 | + height: 25rpx; | ||
82 | + margin-top: 8rpx; | ||
83 | +} | ||
84 | +.Courtesy_can { | ||
85 | + margin: 0rpx 7rpx; | ||
86 | + color: rgb(94, 93, 91); | ||
87 | + font-weight: bold; | ||
88 | +} | ||
89 | + | ||
90 | + | ||
91 | +/* 热门好物 */ | ||
92 | + | ||
93 | +.title .China { | ||
94 | + width: 100%; | ||
95 | + margin-top: 60rpx; | ||
96 | + margin-bottom: 10rpx; | ||
97 | + line-height: 0rpx; | ||
98 | +} | ||
99 | + | ||
100 | +.title .China .line view { | ||
101 | + width: 2rpx; | ||
102 | +} | ||
103 | + | ||
104 | +.title .China .line { | ||
105 | + height: 40rpx; | ||
106 | + color: rgb(51, 51, 51); | ||
107 | +} | ||
108 | + | ||
109 | +.title .China .line view { | ||
110 | + border-left: 3rpx solid #000; | ||
111 | + margin-left: 5rpx; | ||
112 | +} | ||
113 | + | ||
114 | +.title .China .line .one { | ||
115 | + height: 23rpx; | ||
116 | +} | ||
117 | + | ||
118 | +.title .China .line .two { | ||
119 | + height: 15rpx; | ||
120 | +} | ||
121 | + | ||
122 | +.title .China .line .three { | ||
123 | + height: 18rpx; | ||
124 | +} | ||
125 | + | ||
126 | +.title .China .Recommend { | ||
127 | + margin: 0rpx 20rpx; | ||
128 | + font-size: 28rpx; | ||
129 | + line-height: 39rpx; | ||
130 | + font-weight: bold; | ||
131 | +} | ||
132 | + | ||
133 | +.title .english .silk { | ||
134 | + width: 214rpx; | ||
135 | + height: 2rpx; | ||
136 | + background-color: #000; | ||
137 | +} | ||
138 | + | ||
139 | +.title .english .esh { | ||
140 | + margin: 0rpx 15rpx; | ||
141 | +} | ||
142 | +.Member { | ||
143 | + width: 30rpx; | ||
144 | + height: 30rpx; | ||
145 | + margin-right: 5rpx; | ||
146 | + background-size: 100% 100%; | ||
147 | +position: relative; | ||
148 | +left: -40rpx; | ||
149 | + | ||
150 | +} | ||
0 | \ No newline at end of file | 151 | \ No newline at end of file |