Commit 7ae5ebe17df1ef1a2b045fe8a2be205c443fb519

Authored by iceling
2 parents 8162fbe2 6ed37320

Merge branch 'dev_20191114' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev_20191114

app.json
... ... @@ -68,8 +68,11 @@
68 68 "pages/user/user_spsy/user_spsy",
69 69 "pages/user/user_fw/user_fw",
70 70 "pages/user/user_coupon/user_coupon",
71   - "pages/user/grow_value/grow_value"
  71 + "pages/user/grow_value/grow_value",
72 72  
  73 + "pages/user/plus/plus",
  74 + "pages/user/cardinfo/cardinfo"
  75 +
73 76 ],
74 77 "window": {
75 78 "backgroundTextStyle": "light",
... ...
pages/getphone/getphone.js
... ... @@ -4,6 +4,13 @@ Page({
4 4 store:null,
5 5 imghots: os.imghost,
6 6 },
  7 +
  8 + onLoad: function (options) {
  9 + //--判断是否有接受到邀请人的ID--
  10 + if(options.first_leader){
  11 + this.setData({first_leader:options.first_leader});
  12 + }
  13 + },
7 14 onShow:function(){
8 15 var th=this,app = getApp();
9 16 var sessionKey = getApp().globalData.sessionKey;
... ... @@ -16,11 +23,8 @@ Page({
16 23 wx.navigateTo({ url: '/pages/togoin/togoin', })
17 24 return false;
18 25 }
19   -
20 26 var user_info=getApp().globalData.userInfo;
21   -
22 27 console.log("getphone");
23   - console.log(user_info);
24 28  
25 29 if(user_info!=null && user_info.mobile!=undefined && user_info.mobile!="" && user_info.mobile!=null){
26 30 wx.navigateBack({
... ... @@ -72,6 +76,11 @@ Page({
72 76 iv: e.iv,
73 77 store_id: getApp().globalData.setting.stoid,
74 78 };
  79 + //--如果有邀请人的时候--
  80 + if(th.data.first_leader){
  81 + dd.first_leader=th.data.first_leader;
  82 + }
  83 +
75 84 console.log(dd);
76 85 app.request.get("/api/weshop/users/thirdLogin", {
77 86 data: dd,
... ...
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 765 \ No newline at end of file
... ...
pages/user/cardinfo/cardinfo.json 0 → 100644
  1 + {
  2 + "usingComponents": {
  3 + "pop_txt": "/components/userqy_pop_up/userqy_pop_up",
  4 + "goods_recommend": "/components/goods_list/goods_list"
  5 + },
  6 + "navigationBarTitleText": "会员续费"
  7 +}
0 8 \ No newline at end of file
... ...
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 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 151 \ No newline at end of file
... ...
pages/user/deposit/prepaid/prepaid.wxml
... ... @@ -10,8 +10,8 @@
10 10 <view class="bz">备注:
11 11 <view class="yck">{{perpaid.ItemName}}</view>
12 12 </view>
13   - <view class="ljcz" bindtap="submit" data-name="{{perpaid.BeginSum}}
14   - data-advance="{{perpaid.AdvanceItemId}}"data-money="{{perpaid.NewSum}}">立即充值</view>
  13 + <view class="ljcz" bindtap="submit" data-name="{{perpaid.BeginSum}}"
  14 + data-advance="{{perpaid.AdvanceItemId }}" data-money="{{perpaid.NewSum}}">立即充值</view>
15 15 </image>
16 16 </block>
17 17  
... ...
pages/user/index/index.js
... ... @@ -12,25 +12,26 @@ Page({
12 12 * 页面的初始数据
13 13 */
14 14 data: {
15   - length:150,
16   - iurl: s.imghost,
17   - defaultAvatar:s.imghost+"/miniapp/images/no-head.jpg",
18   - userInfo:null,
19   - toji:null, //统计相关
20   - txmon:0,
21   - byquan: 0,
22   - yuer: 0,
23   -
24   - currentPage:1,
25   - recommend_list:[],
26   - tc_hide: true,
27   - sw_index:0,
28   - qy_list:null,
29   - gradeId:null,
30   - is_init:0,
31   -
32   - cz_val:0,
33   - full_cz_val:0,
  15 + length:150,
  16 + iurl: s.imghost,
  17 + defaultAvatar:s.imghost+"/miniapp/images/no-head.jpg",
  18 + userInfo:null,
  19 + toji:null, //统计相关
  20 + txmon:0,
  21 + byquan: 0,
  22 + yuer: 0,
  23 +
  24 + currentPage:1,
  25 + recommend_list:[],
  26 + tc_hide: true,
  27 + sw_index:0,
  28 + qy_list:null,
  29 + gradeId:null,
  30 + is_init:0,
  31 +
  32 + cz_val:0,
  33 + full_cz_val:0,
  34 + is_dengji:0, //是不是等级
34 35 },
35 36  
36 37 /**
... ... @@ -186,16 +187,24 @@ Page({
186 187  
187 188 /*-- 获取 --*/
188 189 th.requestRecommend();
  190 +
  191 + /*-------系统是否开通等级卡,会员是等级卡-----*/
  192 + getApp().getConfig2(function (e) {
  193 + var t_swi=e.switch_list;
  194 + if(t_swi) t_swi=JSON.parse(t_swi)
  195 + if(parseInt(t_swi.rank_switch)==2){
  196 + var userInfo=th.data.userInfo;
  197 + if(userInfo.card_field!=null && userInfo.card_field!=undefined && userInfo.card_field!="" ){
  198 + th.setData({is_dengji:1})
  199 + }else{
  200 + th.setData({is_dengji:2})
  201 + }
  202 + }
  203 + })
  204 +
189 205 }
190 206 });
191   - /*-------系统是否开通等级卡,会员是等级卡-----*/
192   - getApp().getConfig2(function (e) {
193   - var t_swi=e.switch_list;
194   - if(t_swi) t_swi=JSON.parse(t_swi)
195   - if(t_swi.rank_switch==2){
196 207  
197   - }
198   - })
199 208 },
200 209  
201 210 //判断会员是后有改服务项目
... ...
pages/user/index/index.wxml
... ... @@ -63,11 +63,11 @@
63 63 </image>
64 64  
65 65 </view>
66   - <view class="xc-add-member-frame flex-level rel addplus">
  66 + <view class="xc-add-member-frame flex-level rel addplus" wx:if="{{is_dengji==2}}">
67 67 <view class="xc-add-member flex-vertical four-level-word">
68 68 <image class="xc-icon" src="{{iurl}}/miniapp/images/user/user_vip.png"></image>
69   - <view class="member"> 加入会员</view>
70   - <view class="t-c xc-save-money"> 预计可省345元</view>
  69 + <view class="member"> 加入plus会员</view>
  70 + <view class="t-c xc-save-money"> 预计可省3031元</view>
71 71 <view class="xc-opening-button t-c" data-url="/pages/user/plus/plus" bindtap="goto">
72 72 <view class="xc-opening fs20">立即开通</view>
73 73 </view>
... ... @@ -180,9 +180,9 @@
180 180 <view class="fs26">联系客服</view>
181 181 </view>
182 182  
183   - <view class="item t-c" data-url="/pages/user/plus/plus" bindtap="goto">
  183 + <view class="item t-c" data-url="/pages/user/cardinfo/cardinfo" bindtap="goto" wx:if="{{is_dengji==1}}">
184 184 <image class="xc-center-img " src="{{iurl}}/miniapp/images/plus/privilege_o.png"></image>
185   - <view class="fs26">等级会员</view>
  185 + <view class="fs26">plus会员</view>
186 186 </view>
187 187  
188 188 <view class="item t-c" data-url="/pages/user/collect_list/collect_list" bindtap="goto">
... ...
pages/user/index/index.wxss
... ... @@ -156,7 +156,7 @@ height: 84rpx;
156 156 .xc-add-member .xc-icon{
157 157 width: 30rpx;
158 158 height: 30rpx;
159   - margin-left:50rpx;
  159 + margin-left:40rpx;
160 160  
161 161 }
162 162 .xc-add-member .member{
... ... @@ -172,7 +172,7 @@ height: 84rpx;
172 172  
173 173 .xc-add-member .xc-opening-button{
174 174 width: 120rpx;
175   - margin-left:180rpx;
  175 + margin-left:140rpx;
176 176 }
177 177  
178 178 .xc-opening{
... ...
pages/user/plus/plus.js
1   -var e = function(e) {
2   - return e && e.__esModule ? e : {
3   - default: e
4   - };
5   - }(require("../../../utils/LoadMore.js")),
6   - t = getApp(),
  1 +var t = getApp(),
7 2 a = t.request,
8   - o = t.globalData.setting,
  3 + o = t.globalData.setting,
9 4 os = o,
10 5 i = require("../../../utils/util.js"),
11 6 ut = i,
12 7 s = require("../../../utils/common.js"),
13   - n = new e.default();
14   -var regeneratorRuntime = require('../../../utils/runtime.js');
15   -var api = require('../../../api/api.js');
16   -//wx.downloadFile把线上地址设为本地地址
17   -Page({
  8 + w = require("../../../utils/wxParse/wxParse.js"),t_pay = require("../../../utils/pay2.js");
  9 + var regeneratorRuntime = require('../../../utils/runtime.js');
18 10  
  11 +Page({
19 12 /**
20 13 * 页面的初始数据
21 14 */
22 15 data: {
23   - 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"],
24 16 currentId: 0,
25 17 url: o.imghost,
26   - j: false,
27 18 screenWidth: 0,
28 19 screenheight: 0,
29 20 canvasHidden: true,
30 21 shareImgPath: null,
31   - plusCard: "",
32   - imagePath: ""
  22 + is_plusCard: "",//卡的列表
  23 + imagePath: "",
  24 + is_pulscardname: "",//plus会员的名字
  25 + is_card: 0,//用于判断是否是续费页和购买页面 0不是puls会员
  26 + content: "",//等级卡规则
  27 + is_card_rule: "",//等级卡规则判断用
  28 + is_show: 0, //页面要加载完才能显示
  29 + open_yq: 0, //显示打开邀请码的弹窗
  30 + by_index:null, //购买卡的下班
  31 +
  32 + isyaoqingma:0, //是否邀请码
  33 + is_salesman:0, //是否营业员
  34 + inp_recommon: null, //输入的邀请码
  35 + inp_serviceman: null, //输入的营业员
  36 + is_fengxiang: 0, //是不是分享过来的
  37 + def_recommon: null, //分享人的手机号
  38 + def_serviceman: null, //分享人的营业员
  39 + fir_leader:0,
  40 +
33 41 },
34   - swiperChange: function(e) {
  42 + swiperChange: function (e) {
35 43 var currentId = e.detail.current;
36 44 this.setData({
37 45 currentId: currentId
38 46 })
39   -
40 47 },
41 48 /**
42 49 * 生命周期函数--监听页面加载
43 50 */
44   - onLoad: function(options) {
45   - var that = this;
  51 + onLoad: function (options) {
  52 + var that = this;
  53 + var store_id=getApp().globalData.setting.stoid;
46 54 //获取用户设备信息,屏幕宽度
47 55 wx.getSystemInfo({
48 56 success: res => {
49   - that.setData({
50   - screenWidth: res.screenWidth
51   - })
  57 + that.setData({screenWidth: res.screenWidth})
52 58 }
53 59 })
54   - this.getPlusCardType();
55   - this.saveImageToPhotosAlbum();
56   - },
57   - //获取卡类
58   - getPlusCardType: function(e) {
59   - var storid = o.stoid;
60   - var th = this;
61   - getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
62   - th.setData({
63   - plusCard: res.data.data
64   - })
65   - })
66   -
67   - },
68   - /**
69   - * 生命周期函数--监听页面初次渲染完成
70   - */
71   - saveImageToPhotosAlbum: function() {
72   - wx.showLoading({
73   - title: '生成中...',
74   - })
75   - var th = this;
76   - var unit = th.data.screenWidth / 750 * 1.35;
77   - const ctx = wx.createCanvasContext('myCanvas');
78   - //设置画板显示,才能开始绘图
79   - th.setData({
80   -
81   - canvasHidden: false
82   - })
83   - ctx.drawImage("../../../images/plus/share/mackground.png", 0, 0, 554 * unit, 930 * unit);
84   - ctx.setFontSize(26 * unit);
85   - ctx.setFillStyle("rgb(0,0,0)");
86   - ctx.fillText("钱巧玲", 155 * unit, 75 * unit, 200 * unit);
87   -
88   - var tj_path = "../../../images/userinfo/q_tj.png";
89   - ctx.drawImage(tj_path, 385 * unit, 45 * unit, 90 * unit, 30 * unit);
90   - ctx.setFontSize(18 * unit);
91   - ctx.setFillStyle("rgb(255,255,255)");
92   - ctx.fillText("强烈推荐", 394 * unit, 65 * unit);
93   -
94   - ctx.setStrokeStyle("rgb(255,255,255)");
95   - ctx.setLineDash([5 * unit, 5 * unit], 5 * unit);
96   - ctx.beginPath();
97   - ctx.moveTo(0, 125 * unit);
98   - ctx.lineTo(554 * unit, 125 * unit);
99   - ctx.stroke();
100   -
101   - var x = 55 * unit,
102   - y = 165 * unit,
103   - w = 444 * unit,
104   - h = 220 * unit,
105   - r = 14 * unit;
106   - ctx.save();
107   - // 开始绘制
108   - ctx.beginPath();
109   - // 因为边缘描边存在锯齿,最好指定使用 transparent 填充
110   - // 这里是使用 fill 还是 stroke都可以,二选一即可
111   - ctx.setFillStyle('rgb(237,188,150)')
112   - // ctx.setStrokeStyle('transparent')
113   - // 左上角
114   - ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5)
115   -
116   - // border-top
117   - ctx.moveTo(x + r, y)
118   - ctx.lineTo(x + w - r, y)
119   - ctx.lineTo(x + w, y + r)
120   - // 右上角
121   - ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2)
122   -
123   - // border-right
124   - ctx.lineTo(x + w, y + h - r)
125   - ctx.lineTo(x + w - r, y + h)
126   - // 右下角
127   - ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5)
128   -
129   - // border-bottom
130   - ctx.lineTo(x + r, y + h)
131   - ctx.lineTo(x, y + h - r)
132   - // 左下角
133   - ctx.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI)
134   -
135   - // border-left
136   - ctx.lineTo(x, y + r)
137   - ctx.lineTo(x + r, y)
138   -
139   - // 这里是使用 fill 还是 stroke都可以,二选一即可,但是需要与上面对应
140   - ctx.fill()
141   -
142   - ctx.clip(); //画了圆 再剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内
143   - ctx.drawImage("../../../images/plus/share/one.jpg", x, y, 444 * unit, 220 * unit); // 推进去图片
144   - ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制
145   -
146   - ctx.beginPath();
147   - // 卡图片
148   - // ctx.drawImage("../../../images/plus/share/one.jpg", 55 * unit, 165 * unit, 444 * unit, 220 * unit,);
149   - ctx.setFontSize(26 * unit);
150   - ctx.setFillStyle("rgb(237,188,150)");
151   - ctx.fillText("PLUSI会员", 80 * unit, 215 * unit);
152   - ctx.setFontSize(18 * unit);
153   - ctx.setFillStyle("rgb(237,188,150)");
154   - ctx.fillText("开通会员年卡仅199元", 80 * unit, 240 * unit);
155   -
156   - ctx.drawImage("../../../images/plus/share/privilege_o.png", 80 * unit, 343 * unit, 20 * unit, 20 * unit);
157   -
158   - ctx.setFontSize(14 * unit);
159   - ctx.setFillStyle("rgb(237,188,150)");
160   - ctx.fillText("根据大家购买数据,您成为超级会员预计可省¥3031元", 105 * unit, 360 * unit);
161   -
162   - ctx.rect(70 * unit, 425 * unit, 182 * unit, 1 * unit);
163   - ctx.setFillStyle('rgb(218,194,169)');
164   - ctx.fill();
165   -
166   - ctx.drawImage("../../../images/plus/share/square.png", 267 * unit, 420 * unit, 13 * unit, 13 * unit);
167   -
168   - ctx.beginPath();
169   - ctx.rect(295 * unit, 425 * unit, 182 * unit, 1 * unit);
170   - ctx.setFillStyle('rgb(218,194,169)');
171   - ctx.fill();
172   -
173   - ctx.drawImage("../../../images/plus/share/square.png", 80 * unit, 470 * unit, 10 * unit, 10 * unit);
174   - ctx.setFontSize(24 * unit);
175   - ctx.setFillStyle("rgb(198,165,126)");
176   - ctx.fillText("超级VIP权益", 100 * unit, 475 * unit);
177   -
178   - ctx.setFontSize(20 * unit);
179   - ctx.setFillStyle("rgb(198,165,126)");
180   - ctx.fillText("超级会员专属权益", 100 * unit, 505 * unit);
181   - ctx.drawImage("../../../images/plus/share/Ancrown.png", 355 * unit, 440 * unit, 65 * unit, 65 * unit);
182   -
183   - ctx.rect(85 * unit, 530 * unit, 375 * unit, 1 * unit)
184   - ctx.setFillStyle('rgb(218,194,169)')
185   - ctx.fill();
186   -
187   - ctx.drawImage("../../../images/plus/share/square.png", 80 * unit, 575 * unit, 10 * unit, 10 * unit);
188   - ctx.setFontSize(24 * unit);
189   - ctx.setFillStyle("rgb(198,165,126)");
190   - ctx.fillText("超级VIP标识", 100 * unit, 580 * unit);
191   -
192   - ctx.setFontSize(20 * unit);
193   - ctx.setFillStyle("rgb(198,165,126)");
194   - ctx.fillText("彰显尊贵身份的象征", 100 * unit, 610 * unit);
195   - ctx.drawImage("../../../images/plus/share/Identification.png", 355 * unit, 548 * unit, 65 * unit, 65 * unit);
196   -
197   - ctx.rect(85 * unit, 635 * unit, 375 * unit, 1 * unit);
198   - ctx.setFillStyle('rgb(218,194,169)');
199   - ctx.fill();
200   -
201   - ctx.drawImage("../../../images/plus/share/square.png", 80 * unit, 695 * unit, 10 * unit, 10 * unit);
202   - ctx.setFontSize(24 * unit);
203   - ctx.setFillStyle("rgb(198,165,126)");
204   - ctx.fillText("超级VIP价格", 100 * unit, 695 * unit);
205   -
206   - ctx.setFontSize(20 * unit);
207   - ctx.setFillStyle("rgb(198,165,126)");
208   - ctx.fillText("享受专属会员超低价", 100 * unit, 725 * unit);
209   - ctx.drawImage("../../../images/plus/share/money.png", 355 * unit, 660 * unit, 65 * unit, 65 * unit);
210   -
211   - ctx.rect(85 * unit, 750 * unit, 375 * unit, 1 * unit)
212   - ctx.setFillStyle('rgb(218,194,169)')
213   - ctx.fill();
214   -
215   - ctx.drawImage("../../../images/userinfo/user_head.jpg", 100 * unit, 780 * unit, 110 * unit, 110 * unit);
216   -
217   - ctx.setFontSize(20 * unit);
218   - ctx.setFillStyle("#000");
219   - ctx.fillText("解锁新权益 精彩享不停", 230 * unit, 825 * unit);
220   -
221   - ctx.setFontSize(20 * unit);
222   - ctx.setFillStyle("#000");
223   - ctx.fillText("长按识别二维码,立即开通!", 230 * unit, 865 * unit);
224   -
225   - //---绘制圆形要放在最后----
226   - ctx.save();
227   - ctx.beginPath();
228   - var h_x = 60 * unit;
229   - var h_y = 24 * unit;
230   - var h_r = 40 * unit;
231   - var cx = h_x + h_r;
232   - var cy = h_y + h_r;
233   - ctx.arc(cx, cy, h_r, 0, Math.PI * 2, false);
234   - ctx.closePath();
235   - ctx.fill();
236   - ctx.clip();
237   - ctx.drawImage("../../../images/userinfo/user_head.jpg", h_x, h_y, h_r * 2, h_r * 2);
238   - ctx.restore();
239   -
240   - var x = 345 * unit,
241   - y = 190 * unit,
242   - w = 105 * unit,
243   - h = 30 * unit,
244   - r = 14 * unit;
245   - ctx.save();
246   - // 开始绘制
247   - ctx.beginPath();
248   - // 因为边缘描边存在锯齿,最好指定使用 transparent 填充
249   - // 这里是使用 fill 还是 stroke都可以,二选一即可
250   - ctx.setFillStyle('rgb(237,188,150)')
251   - // ctx.setStrokeStyle('transparent')
252   - // 左上角
253   - ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5)
254   -
255   - // border-top
256   - ctx.moveTo(x + r, y)
257   - ctx.lineTo(x + w - r, y)
258   - ctx.lineTo(x + w, y + r)
259   - // 右上角
260   - ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2)
261   -
262   - // border-right
263   - ctx.lineTo(x + w, y + h - r)
264   - ctx.lineTo(x + w - r, y + h)
265   - // 右下角
266   - ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5)
267   -
268   - // border-bottom
269   - ctx.lineTo(x + r, y + h)
270   - ctx.lineTo(x, y + h - r)
271   - // 左下角
272   - ctx.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI)
273   -
274   - // border-left
275   - ctx.lineTo(x, y + r)
276   - ctx.lineTo(x + r, y)
277   -
278   - // 这里是使用 fill 还是 stroke都可以,二选一即可,但是需要与上面对应
279   - ctx.fill()
280   - // ctx.stroke()
281   - ctx.closePath()
282   - // 剪切
283   - ctx.clip();
284   -
285   - ctx.setFontSize(18 * unit);
286   - ctx.setFillStyle("#000");
287   - ctx.fillText("立即开通", 362 * unit, 212 * unit);
288   -
289   - //绘制图片
290   - ctx.draw(false,
291   - wx.canvasToTempFilePath({
292   - x: 0,
293   - y: 0,
294   - width: 750,
295   - height: 930,
296   - destWidth: 1.2 * 750 * 750 / th.data.screenWidth,
297   - destHeight: 1.2 * 1217 * 750 / th.data.screenWidth,
298   - canvasId: 'myCanvas',
299   - success: function(res) {
300   - console.log("sssssssssssssssssssssssss" + res.tempFilePath);
301   - var tempFilePath = res.tempFilePath;
302   - th.setData({
303   - imagePath: tempFilePath,
304   - maskHidden: false,
305   - canvasHidden: true
306   - });
307   - wx.previewImage({
308   - urls: [res.tempFilePath],
309   - })
310   - if (!res.tempFilePath) {
311   - wx.showModal({
312   - title: '提示',
313   - content: '图片绘制中,请稍后重试',
314   - showCancel: false
315   - })
  60 + var fir_leader = options.scene;
  61 + that.setData({fir_leader:fir_leader})
  62 + if (fir_leader != null && fir_leader != undefined && fir_leader != "") {
  63 + var r_url="/api/weshop/plus/vip/mem/list?storeId=" + store_id + "&userId=" + fir_leader
  64 + getApp().request.get(r_url, {
  65 + success: function (res) {
  66 + var is_ok = 1;
  67 + if (res.data.code == -1) {
  68 + getApp().my_warnning("未找到分享会员", 0, that);
  69 + is_ok = 0;
  70 + that.back_user();
  71 + }
  72 + var user_information = res.data.data[0];
  73 + if (user_information['GradeCardID'] == null || user_information['GradeCardID'] == "" || user_information['GradeCardID'] == undefined) {
  74 + getApp().my_warnning("分享会员不是plus会员", 0, that);
  75 + is_ok = 0;
  76 + that.back_user();
  77 + }
  78 + //--获取当前的时间--
  79 + var now = ut.gettimestamp();
  80 + if (user_information['ExpiryDate']) {
  81 + var str = user_information['ExpiryDate'].replace(/-/g, '/');
  82 + var end = new Date(str);
  83 + end = Date.parse(end) / 1000;
  84 + if (end < now) {
  85 + getApp().my_warnning("分享plus会员已经过期", 0, that);
  86 + is_ok = 0;
  87 + that.back_user();
  88 + }
  89 + } else {
  90 + getApp().my_warnning("分享plus会员已经过期", 0, that);
  91 + is_ok = 0;
  92 + that.back_user();
  93 + }
  94 + if (is_ok == 1) {
  95 + that.setData({def_recommon: user_information.MobileTel, def_serviceman: user_information.StaffNo,is_fengxiang:1})
  96 + //--先判断会员状态--
  97 + var user_info=getApp().globalData.userInfo;
  98 + if(user_info==null || user_info.mobile==undefined || user_info.mobile=="" || user_info.mobile==null){
  99 + wx.navigateTo({ url: '/pages/getphone/getphone?first_leader='+fir_leader, })
  100 + return false;
  101 + }
  102 + }
316 103 }
317   - wx.hideLoading();
318   - }
  104 + });
  105 + }
319 106  
320   - }))
  107 + //-----------商家配置信息----- 等级卡规则,是否又开邀请码,营业员------------
  108 + getApp().request.get("/api/weshop/storeconfig/get/" + store_id, {
  109 + success: function (res) {
  110 + var is_cardrule = res.data.data.cardrules;
  111 + var switch_list= res.data.data.switch_list;
  112 + var swi_arr=JSON.parse(switch_list);
321 113  
  114 + w.wxParse("content", "html", is_cardrule, that, 6);
  115 + that.setData({
  116 + is_card_rule: is_cardrule,
  117 + isyaoqingma:parseInt(swi_arr.isyaoqingma),
  118 + is_salesman:parseInt(swi_arr.is_staffno)
  119 + });
  120 + }
  121 + });
322 122 },
  123 +
323 124 /**
324 125 * 生命周期函数--监听页面显示
325 126 */
326   - onShow: function() {
327   - var goods_list = this.selectComponent("#goods_list"); //组件的id
328   - goods_list.get_list();
  127 + onShow: function () {
  128 + this.getPlusCardType();
329 129 },
330 130  
331 131 /**
332 132 * 生命周期函数--监听页面隐藏
333 133 */
334   - onHide: function() {
  134 + onHide: function () {
335 135  
336 136 },
337   -
338   - /**
339   - * 生命周期函数--监听页面卸载
340   - */
341   - onUnload: function() {
342   -
343   - },
344   -
345   - /**
346   - * 页面相关事件处理函数--监听用户下拉动作
347   - */
348   - onPullDownRefresh: function() {
349   -
350   - },
351   -
352 137 /**
353 138 * 页面上拉触底事件的处理函数
354 139 */
355   - onReachBottom: function() {
  140 + onReachBottom: function () {
356 141 var goods_list = this.selectComponent("#goods_list"); //组件的id
357 142 goods_list.get_list();
358   - this.setData({
359   - j: true
360   - })
361 143 },
362 144  
363   - /**
364   - * 用户点击右上角分享
365   - */
366   - onShareAppMessage: function() {
  145 + //--- 获取卡类列表 ---
  146 + getPlusCardType: function (e) {
  147 + var storid = o.stoid;
  148 + var th = this;
  149 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
  150 + var plusCard = res.data.data;
  151 + var arr = [1219, 2089, 3031];
  152 + var new_arr = new Array();
  153 + for (var i = 0; i < plusCard.length; i++) {
  154 + //plusCard[i].free=arr[i];
  155 + var item = {"fee": plusCard[i].CardFee, 'index': i}
  156 + new_arr.push(item);
  157 + }
  158 + //根據距離遠近排序,越近在前面,升序
  159 + new_arr.sort(function (a, b) {
  160 + if (a.fee < b.fee) {
  161 + return -1;
  162 + } else if (a.fee == b.fee) {
  163 + return 0;
  164 + } else {
  165 + return 1;
  166 + }
  167 + });
  168 + //---给数组添加立省多少钱---
  169 + for (i = 0; i < plusCard.length; i++) {
  170 + for (var j = 0; j < new_arr.length; j++) {
  171 + if (i == new_arr[j].index) {
  172 + plusCard[i].free = arr[j];
  173 + break;
  174 + }
  175 + }
  176 + }
  177 + th.setData({
  178 + is_plusCard: plusCard, is_show: 1
  179 + })
  180 + var goods_list = th.selectComponent("#goods_list"); //组件的id
  181 + goods_list.get_list();
367 182  
  183 + })
368 184 },
369   - //开通会员
370   - Opening: function() {
371   - this.setData({
372   - j: true
  185 +
  186 + //--开通会员---接受前端index,弹起窗口---
  187 + Opening: function (e) {
  188 + var th = this;
  189 + th.data.by_index = e.currentTarget.dataset.ind;
  190 +
  191 + if (th.data.is_fengxiang) {
  192 + th.buy_card();
  193 + } else {
  194 + //--如果后台都没有勾邀请码,营业员,立即购买--
  195 + if (!th.data.isyaoqingma && !th.data.is_salesman) {th.buy_card(); return false;}
  196 + th.setData({open_yq: 1})
  197 + }
  198 + },
  199 +
  200 + //--立即购买卡--
  201 + buy_card: async function () {
  202 + var th = this;
  203 + var is_card = 0;
  204 + //--商家是不是有等级卡功能,开通的人数是不是够用,开通是时间是不是到期--
  205 + await getApp().request.promiseGet("/api/weshop/plus/plus/card/register",
  206 + {data: {storeId: os.stoid}}).then(res => {
  207 + if (res.data.code == 0) is_card = 1;
373 208 })
  209 + if (is_card == 0) getApp().my_warnning("请联系商家升级plus功能", 0, th);
  210 + var item = th.data.is_plusCard[th.data.by_index];
  211 + var req = {};
  212 + req.cardId = item.CardId;
  213 + req.rechargeType = 3;
  214 + //如果不是你导购,也不是等级会员分享
  215 + if (th.data.is_fengxiang == 1) {
  216 + if (th.data.def_recommon) req.recommon = th.data.def_recommon
  217 + if (th.data.def_serviceman) req.serviceman = th.data.def_serviceman
  218 + } else {
  219 + //---后台要求要输入邀请码---
  220 + if (th.data.isyaoqingma) {
  221 + if (!th.data.inp_recommon) {
  222 + getApp().my_warnning("请输入邀请码", 0, th);
  223 + return false;
  224 + }
  225 + req.recommon = th.data.inp_recommon
  226 + }
  227 + //--后台要求要输入营业员--
  228 + if (th.data.is_salesman) {
  229 + if (!th.data.inp_serviceman) {
  230 + getApp().my_warnning("请输入营业员", 0, th);
  231 + return false;
  232 + }
  233 + req.serviceman = th.data.inp_serviceman
  234 + }
  235 + }
  236 + req.storeId = os.stoid;
  237 + req.userId = getApp().globalData.user_id;
  238 + //--如果有邀请码,和营业员的情况下--
  239 + if(req.recommon || req.serviceman ) {
  240 + var req_data = {storeId: os.stoid, userId: req.userId};
  241 + if(req.recommon) req_data.inviteCode=req.recommon;
  242 + if(req.serviceman) req_data.staffNo=req.serviceman;
  243 + getApp().request.get("/api/weshop/plus/vip/mem/referee/code/check", {
  244 + data:req_data,
  245 + success:function(res){
  246 + if(res.data.code==0) {
  247 + t_pay.pay(req, th.success, function () {
  248 + getApp().my_warnning("支付失败", 0, th);
  249 + });
  250 + }else{
  251 + getApp().my_warnning("支付失败", 0, th);
  252 + }
  253 + }
  254 + })
  255 + }else{
  256 + t_pay.pay(req, th.success, function () {
  257 + getApp().my_warnning("支付失败", 0, th);
  258 + });
  259 + }
374 260 },
375 261 //返回会员页面
376 262 OpeningClose: function() {
377   - this.setData({
378   - j: false
379   - })
  263 + this.setData({open_yq:0});
  264 + },
  265 +
  266 + //返回会员中心
  267 + back_user:function () {
  268 + setTimeout(function () {
  269 + wx.reLaunch({url:"/pages/user/index/index"});
  270 + },1000)
  271 + },
  272 + //--支付成功,跳转到等级卡续费页面--
  273 + success:function () {
  274 + var th=this;
  275 + getApp().my_warnning("支付成功", 0, th);
  276 + setTimeout(function () {
  277 + var u_url = "/pages/user/cardinfo/cardinfo";
  278 + wx.reLaunch({url: u_url})
  279 + },1500)
  280 + },
  281 +
  282 + //--绑定邀请码的输入--
  283 + b_input:function (e) {
  284 + var value=e.detail.value;
  285 + var name=e.currentTarget.dataset.name;
  286 + var ob={};
  287 + ob[name]=value
  288 + this.setData(ob);
380 289 }
381 290  
382 291 })
383 292 \ No newline at end of file
... ...
pages/user/plus/plus.json
1 1 {
2 2 "usingComponents": {
3 3 "pop_txt": "/components/userqy_pop_up/userqy_pop_up",
4   - "goods_recommend": "/components/goods_list/goods_list"
  4 + "goods_recommend": "/components/goods_list/goods_list",
  5 + "warn": "/components/long_warn/long_warn"
5 6 },
6   - "navigationBarTitleText": "我的会员"
  7 + "navigationBarTitleText": "购买plus会员"
7 8 }
8 9 \ No newline at end of file
... ...
pages/user/plus/plus.wxml
  1 +<block wx:if="{{is_show && (fir_leader?is_fengxiang:1)}}">
1 2 <!-- 我的会员背景图片 -->
  3 +<import src="../../../utils/wxParse/wxParse.wxml"></import>
2 4 <view>
3 5 <image class="Member_bk" src="{{url}}/miniapp/images/plus/page_bk.png"></image>
4 6 </view>
5   -
6 7 <view class="plus">
7 8 <!-- 开通会员模块 -->
8 9 <view class="Opening_plus">
... ... @@ -10,89 +11,32 @@
10 11 <image src="{{url}}/miniapp/images/plus/card_bk.png"></image>
11 12 </view>
12 13 <view class="swiper">
13   - <block wx:if="{{j}}">
14 14 <!-- 未开通会员swiper-item -->
15 15 <swiper current="{{currentId}}" current-item-id="{{currentId}}" next-margin="55rpx" previous-margin="55rpx" bindchange="swiperChange">
16   -
17   - <swiper-item class="flex" item-id="{{index}}" data-item-id="{{index}}" wx:for="{{plusCard}}">
  16 + <swiper-item class="flex" item-id="{{index}}" data-item-id="{{index}}" wx:for="{{is_plusCard}}">
18 17 <view class="Membership {{currentId==index?'enlarge':''}}" style=" background-image: url({{item.CardImg}});color:{{item.CardColor}}">
19   -
20 18 <view class="flex-space-between Membership_go">
21 19 <view>
22 20 <view class="fs32">{{item.CardName}}</view>
23   - <view class="fs24 Membership_remarks">开通会员年卡仅199元</view>
  21 + <view class="fs24 Membership_remarks">开通会员年卡仅{{item.CardFee}}元</view>
24 22 </view>
25   - <view class="Opening fs24 xc-black" bindtap="Opening">立即开通
  23 + <view class="Opening fs24 xc-black" data-ind="{{index}}" style="background:{{item.CardColor}}" bindtap="Opening">立即开通
26 24 </view>
27 25  
28 26 </view>
29 27  
30 28 <view class="flex-vertical-between consumption">
31 29  
32   - <view class="flex-vertical fs22">
33   - <image class="Member" src="{{url}}/miniapp/images/plus/privilege_o.png"></image>
34   - <view>根据大家购买数据,您成为超级会员预计可省¥2899元
  30 + <view class="flex-vertical fs22" style="overflow:hidden">
  31 + <!-- <image class="Member" src="{{url}}/miniapp/images/plus/privilege_o.png" style="filter:drop-shadow( 20rpx 0 0px {{item.CardColor}});"></image> -->
  32 + <view class="Member"style="background-image:url('{{url}}/miniapp/images/plus/privilege_o.png');filter: drop-shadow( 40rpx 0rpx 0rpx {{item.CardColor}});"></view>
  33 + <view>根据大家购买数据,您成为超级会员预计可省¥{{item.free}}元
35 34 </view>
36 35 </view>
37 36 </view>
38 37 </view>
39 38 </swiper-item>
40 39 </swiper>
41   - </block>
42   - <block wx:else>
43   - <!-- 已开通 -->
44   -
45   -
46   -
47   -
48   - <view class="MemberPlus" style=" background-image: url({{url}}/miniapp/images/plus/card_one.jpg);">
49   -
50   - <view class="flex-space-between">
51   - <view>
52   - <view class="fs36" style="font-weight:bold">PLUSI会员</view>
53   - <view class="fs22">开通会员年卡仅199元</view>
54   - </view>
55   - <view class="renew fs28">立即续费
56   - </view>
57   -
58   - </view>
59   -
60   - <view class="flex-vertical-between xs fs24">
61   -
62   - <view class="flex">
63   - <image class="privilege" src="{{url}}/miniapp/images/plus/privilege_o.png"></image>
64   - <view>正在享受PLUSI会员特权
65   - </view>
66   - </view>
67   - <view class="flex-vertical" bindtap="saveImageToPhotosAlbum">
68   - <view>邀请新朋友</view>
69   - <image class="share" src="{{url}}/miniapp/images/plus/Forward.png"></image>
70   - </view>
71   - </view>
72   -
73   - </view>
74   -
75   -
76   - </block>
77   - <view wx:if="{{j==false}}" class="flex-vertical-between Invitation fs30">
78   -
79   - <view class="flex">
80   - 已邀请
81   - <view class="Invitation_count">3人</view>
82   - 可提现
83   - <view class="Invitation_my">66元</view>
84   - </view>
85   -
86   - <view class="flex">
87   - <view class="Detailed flex-center">
88   - <navigator url="/pages/user/Detailed/Detailed">明细</navigator>
89   - </view>
90   - <view class="Invitation_Cash">立即提现</view>
91   -
92   - </view>
93   -
94   - </view>
95   -
96 40 </view>
97 41  
98 42  
... ... @@ -123,24 +67,10 @@
123 67 </view>
124 68  
125 69 <!-- 会员权益内容 -->
126   - <view class="Courtesy_comment fs24">
127   -
128   - <view class="flex">
129   - <view>1、</view>
130   - <view>可以领取880元黑卡专享礼包</view>
131   - </view>
132   - <view class="flex-center">
133   - <image class="t-c Equity_image" src="../../../images/plus/purchase_Bk.png"></image>
134   - </view>
135   - <view class="flex">
136   - <view>2、</view>
137   - <view>可以领取880元黑卡专享礼包</view>
138   - </view>
139   -
140   - <view class="flex">
141   - <view>3、</view>
142   - <view>可以领取880元黑卡专享礼包</view>
143   - </view>
  70 + <view class="Courtesy_comment " wx:if="{{is_card_rule!=null&&is_card_rule!=''}}">
  71 + <view class="wxParse">
  72 + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template>
  73 + </view>
144 74 </view>
145 75 </view>
146 76  
... ... @@ -152,9 +82,7 @@
152 82 <!-- 中文名标题 -->
153 83 <view class="China flex-level">
154 84 <view class="line flex-vertical">
155   - <view class="one"></view>
156   - <view class="two"></view>
157   - <view class="three"></view>
  85 + <view class="one"></view><view class="two"></view><view class="three"></view>
158 86 </view>
159 87  
160 88 <view class="Recommend flex-level" bindtap="requestList">好物推荐</view>
... ... @@ -181,61 +109,48 @@
181 109 </view>
182 110  
183 111 </view>
  112 +</block>
184 113  
185 114 <!-- 开通会员弹窗 -->
186   -<view wx:if="{{false}}" class="Disgraceful flex-center">
  115 +<view wx:if="{{open_yq}}" class="Disgraceful flex-center">
187 116 <!-- 蒙尘 -->
188 117 <view bindtap="OpeningClose"></view>
189 118  
190 119 <!-- 弹框 -->
191 120 <view class="Member_purchase">
192   - <view class="rel purchase_Bk" style="background-image: url({{url}}/miniapp/images/plus/card_one.jpg);">
193   - <image class="abs write" src="../../../images/plus/write.png"></image>
  121 + <view class="rel purchase_Bk" style="background-image: url({{url}}/miniapp/images/plus/purchase_Bk.png);">
  122 + <image class="abs write" src="{{url}}/miniapp/images/plus/write.png"></image>
194 123 </view>
195 124 <view class="fs26 inf_com">
196 125 <view class="fs36 flex-level perfect">请完善下面信息</view>
197 126 <view class="fillin">
198 127 <!-- 输入推荐人手机号 -->
199   - <view class="flex ai_and Enter_phone">
200   - <image class="phone_image" src="../../../images/plus/Invitation_code.png"></image>
  128 + <view class="flex ai_and Enter_phone" wx:if="{{isyaoqingma}}" >
  129 + <image class="phone_image" src="{{url}}/miniapp/images/plus/Invitation_code.png"></image>
201 130 <view class="phone">
202   - <input placeholder="请输入邀请码(推荐人手机号)" type="number" maxlength="30" />
  131 + <input bindinput="b_input" data-name="inp_recommon" class="fs30" placeholder="请输入邀请码(推荐人手机号)" type="number" maxlength="20" />
203 132 </view>
204 133 </view>
205   -
206 134 <!-- 输入营业员 -->
207   - <view class="flex ai_and enter_SalesClerk">
208   - <image class="SalesClerk_image" src="../../../images/plus/Sales_Clerk.png"></image>
  135 + <view class="flex ai_and enter_SalesClerk" wx:if="{{is_salesman}}">
  136 + <image class="SalesClerk_image" src="{{url}}/miniapp/images/plus/Sales_Clerk.png"></image>
209 137 <view class="SalesClerk">
210   - <input placeholder="请输入营业员" maxlength="30" />
  138 + <input bindinput="b_input" class="fs30" data-name="inp_serviceman" placeholder="请输入营业员" maxlength="30" />
211 139 </view>
212 140 </view>
213 141 <!-- 确认购买 -->
214   - <view class="flex-center">
215   - <view class="flex-center purchase" style="background-image:url({{url}}/miniapp/images/plus/card_one.jpg);">
  142 + <view class="flex-center" bindtap="buy_card">
  143 + <view class="flex-center purchase"
  144 + style="background-image:url({{url}}/miniapp/images/plus/purchase_Bk.png);">
216 145 确认购买
217 146 </view>
218 147 </view>
219 148 </view>
220 149 </view>
221 150 <view class="flex-level">
222   - <image class="purchaseClose" bindtap="OpeningClose" src="../../../images/plus/Close.png"></image>
  151 + <image class="purchaseClose" bindtap="OpeningClose" src="{{url}}/miniapp/images/plus/Close.png"></image>
223 152 </view>
224 153 </view>
225 154  
226 155 </view>
227   -
228   -<!-- 画布 -->
229   -
230   -<canvas canvas-id='myCanvas' style="width:750rpx;height:1330rpx;"></canvas>
231   -<!-- < 分享图片 -->
232   -<!-- <view class="mc" wx:if="{{isshare}}" catchtap="isshare">
233   - <!-- 蒙尘 -->
234   - <!-- <view>
235   - <image src="{{imagePath}}"></image>
236   - </view>
237   - <view class="flex-center Close">
238   - <image src="../../../images/plus/Close.png" bindtap="isshare"></image>
239   - </view>
240   -</view> --> -->
241 156 <warn id="warn"></warn>
242 157 \ No newline at end of file
... ...
pages/user/plus/plus.wxss
  1 +@import "../../../utils/wxParse/wxParse.wxss";
1 2 page {
2 3 width: 100%;
3 4 height: 100%;
... ... @@ -161,6 +162,10 @@ swiper {
161 162 width: 30rpx;
162 163 height: 30rpx;
163 164 margin-right: 5rpx;
  165 + background-size: 100% 100%;
  166 +position: relative;
  167 +left: -40rpx;
  168 +
164 169 }
165 170  
166 171 .Membership .Opening {
... ... @@ -171,6 +176,7 @@ swiper {
171 176 line-height: 45rpx;
172 177 text-align: center;
173 178 margin-top: 2rpx;
  179 + color: #666
174 180 }
175 181  
176 182 .Invitation {
... ... @@ -262,11 +268,10 @@ swiper {
262 268 right: 0;
263 269 bottom: 0;
264 270 z-index: 11;
265   - background: rgba(0, 0, 0, 0.4);
  271 + background: rgba(0, 0, 0, 0.6);
266 272 width: 100%;
267 273 height: 100%;
268 274 }
269   -
270 275 .ddd {
271 276 border-radius: 20rpx;
272 277 }
... ... @@ -340,6 +345,7 @@ swiper {
340 345 border-radius: 25rpx;
341 346 color: rgb(255, 255, 255);
342 347 margin: 55rpx 0rpx;
  348 + background-position: center;background-repeat: no-repeat;background-size: cover
343 349 }
344 350  
345 351 .purchaseClose {
... ... @@ -350,6 +356,7 @@ swiper {
350 356 }
351 357  
352 358 input {
  359 +
353 360 overflow: visible;
354 361 width: 360rpx;
355 362 }
... ...
utils/pay2.js 0 → 100644
  1 +var t = getApp(), n = t.request;
  2 +
  3 +module.exports = {
  4 + url: "/api/weshop/plus/create/plus/order",
  5 + pay: function(dd, succ,fail) {
  6 + var i = this;
  7 + n.post(this.url, {
  8 + data: dd,
  9 + success: function(t) {
  10 + if(t.data.code==0){
  11 + i.weixinPay(t.data.data, succ,fail);
  12 + }else{
  13 + "function" == typeof fail && fail();
  14 + }
  15 + return false;
  16 + },
  17 + fail: function() {
  18 + "function" == typeof fail && fail();
  19 + },
  20 + failStatus: function() {
  21 + "function" == typeof fail && fail();
  22 + }
  23 + });
  24 + },
  25 + weixinPay: function(n, succ,fail) {
  26 + wx.requestPayment({
  27 + timeStamp: String(n.timeStamp),
  28 + nonceStr: n.nonceStr,
  29 + package: n.packageValue,
  30 + signType: n.signType,
  31 + paySign: n.paySign,
  32 + success: function(n) {
  33 + "function" == typeof succ && succ();
  34 + },
  35 + fail: function(n) {
  36 + "function" == typeof fail && fail();
  37 + }
  38 + });
  39 + }
  40 +};
0 41 \ No newline at end of file
... ...