From 85e8740f1b41d8fd7da753ee4868cf2dc98d0243 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Mon, 24 Oct 2022 09:16:05 +0800 Subject: [PATCH] 1、 微信小程序OA处理 2、 微信小程序超包处理 --- app.json | 5 +++-- components/diy_goodsGroup/diy_goodsGroup.js | 42 +----------------------------------------- components/goods_list/goods_list.js | 35 +---------------------------------- components/serviceCard_list/serviceCard_list.js | 41 ----------------------------------------- components/serviceCard_list/serviceCard_list.wxml | 89 +---------------------------------------------------------------------------------------- packageA/pages/distribution/goods/goods.wxml | 2 +- packageA/pages/distribution/shop/shop.wxml | 2 +- packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js | 2 +- packageC/pages/presell/goodsInfo/goodsInfo.js | 2 +- packageC/pages/presell/pregoodsInfo/goodsInfo.js | 2 +- packageE/pages/user/cardinfo/cardinfo.js | 881 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageE/pages/user/cardinfo/cardinfo.json | 10 ++++++++++ packageE/pages/user/cardinfo/cardinfo.wxml | 186 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ packageE/pages/user/cardinfo/cardinfo.wxss | 241 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/distribution/distribution.wxml | 2 +- pages/goods/categoryList/categoryList.js | 31 +++++-------------------------- pages/goods/categoryList/categoryList.wxml | 6 +++++- pages/goods/goodsInfo/buy_com_pop.wxml | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/goods/goodsInfo/buy_flash_normal.wxml | 147 +++++++-------------------------------------------------------------------------------------------------------------------------------------------- pages/goods/goodsInfo/buy_integral_normal.wxml | 171 ++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages/goods/goodsInfo/goodsInfo.js | 40 ++++++---------------------------------- pages/goods/goodsList/goodsList.wxml | 2 +- pages/goods/search/search.js | 29 +---------------------------- pages/goods/search/search.wxml | 2 +- pages/user/cardinfo/cardinfo.js | 881 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages/user/cardinfo/cardinfo.json | 10 ---------- pages/user/cardinfo/cardinfo.wxml | 186 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ pages/user/cardinfo/cardinfo.wxss | 241 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- pages/user/index/index.wxml | 2 +- pages/user/plus/plus.js | 4 ++-- utils/util.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ 31 files changed, 1570 insertions(+), 1927 deletions(-) create mode 100644 packageE/pages/user/cardinfo/cardinfo.js create mode 100644 packageE/pages/user/cardinfo/cardinfo.json create mode 100644 packageE/pages/user/cardinfo/cardinfo.wxml create mode 100644 packageE/pages/user/cardinfo/cardinfo.wxss create mode 100644 pages/goods/goodsInfo/buy_com_pop.wxml delete mode 100644 pages/user/cardinfo/cardinfo.js delete mode 100644 pages/user/cardinfo/cardinfo.json delete mode 100644 pages/user/cardinfo/cardinfo.wxml delete mode 100644 pages/user/cardinfo/cardinfo.wxss diff --git a/app.json b/app.json index 7b545a5..6396a49 100644 --- a/app.json +++ b/app.json @@ -37,7 +37,7 @@ "pages/user/grow_value/grow_value", "pages/payment/pay_success/pay_success", "pages/user/plus/plus", - "pages/user/cardinfo/cardinfo", + "pages/user/my_service/appment_main", "pages/user/my_service/i_service", "pages/user/my_service/cosmetology_list", @@ -209,7 +209,8 @@ "pages": [ "pages/togoin/togoin", "pages/user/Detailed/Detailed", - "pages/user/user_fw/user_fw" + "pages/user/user_fw/user_fw", + "pages/user/cardinfo/cardinfo" ] } diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index b22f7d4..5334302 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -320,50 +320,10 @@ Component({ getApp().getConfig2(function (e) { var swithc_list = e.switch_list; var sw_arr = JSON.parse(swithc_list); - if(sw_arr.is_retail_price){ th.setData({is_retail_price:1}); } - - - //---如果后台又开等级卡的开关--- - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { - th.setData({ - rank_switch: true - }); - //---回调卡的列表--- - th.getPlusCardType(function (ob) { - th.setData({ - card_list: ob.card_list - }); - var ti = setInterval(function () { - var user = getApp().globalData.userInfo; - if (!user) return false; - clearInterval(ti); - - if (user.card_field && user['card_expiredate']) { - var str = user['card_expiredate'].replace(/-/g, '/'); - var end = new Date(str); - end = Date.parse(end) / 1000; - var now = ut.gettimestamp(); - - //--- 判断是等级会员,且在有效期范围内 --- - if (user.card_field && now < end) { - var card_name = ob.name_map.get(user.card_field); - if (card_name && card_name.length > 4) card_name = card_name.substring(0, 4); - th.setData({ - card_field: user.card_field, - card_name: card_name, - card_list: ob.card_list - }); - } - - } - - }, 500) - }) - - } + ut.get_plus_name_price(sw_arr,th); }) } }) diff --git a/components/goods_list/goods_list.js b/components/goods_list/goods_list.js index 52027ee..24d651f 100644 --- a/components/goods_list/goods_list.js +++ b/components/goods_list/goods_list.js @@ -63,40 +63,7 @@ Component({ getApp().getConfig2(function (e) { var swithc_list = e.switch_list; var sw_arr = JSON.parse(swithc_list); - //---如果后台有开等级卡的开关--- - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { - th.setData({ - rank_switch: true - }); - //---回调卡的列表--- - th.getPlusCardType(function (ob) { - th.setData({ - card_list: ob.card_list - }); - var ti = setInterval(function () { - var user = getApp().globalData.userInfo; - if (!user) return false; - clearInterval(ti); - if (user.card_field && user['card_expiredate']) { - var str = user['card_expiredate'].replace(/-/g, '/'); - var end = new Date(str); - end = Date.parse(end) / 1000; - var now = ut.gettimestamp(); - //--- 判断是等级会员,且在有效期范围内 --- - if (user.card_field && now < end) { - var card_name = ob.name_map.get(user.card_field); - if (card_name && card_name.length > 4) card_name = card_name.substring(0, 8); - th.setData({ - card_field: user.card_field, - card_name: card_name, - card_list: ob.card_list - }); - } - } - }, 500) - }) - } - + ut.get_plus_name_price(sw_arr,th); }) } diff --git a/components/serviceCard_list/serviceCard_list.js b/components/serviceCard_list/serviceCard_list.js index 4098e2f..b4b3ff4 100644 --- a/components/serviceCard_list/serviceCard_list.js +++ b/components/serviceCard_list/serviceCard_list.js @@ -45,48 +45,7 @@ Component({ success: function (e) { if (e.data.code == 0 && e.data && e.data.data) { getApp().globalData.userInfo = e.data.data; - getApp().getConfig2(function (e) { - var swithc_list = e.switch_list; - var sw_arr = JSON.parse(swithc_list); - //---如果后台有开等级卡的开关--- - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { - th.setData({ - rank_switch: true - }); - //---回调卡的列表--- - th.getPlusCardType(function (ob) { - th.setData({ - card_list: ob.card_list - }); - var ti = setInterval(function () { - var user = getApp().globalData.userInfo; - if (!user) return false; - clearInterval(ti); - if (user.card_field && user['card_expiredate']) { - var str = user['card_expiredate'].replace(/-/g, '/'); - var end = new Date(str); - end = Date.parse(end) / 1000; - var now = ut.gettimestamp(); - //--- 判断是等级会员,且在有效期范围内 --- - if (user.card_field && now < end) { - var card_name = ob.name_map.get(user.card_field); - if (card_name && card_name.length > 4) card_name = card_name.substring(0, 8); - th.setData({ - card_field: user.card_field, - card_name: card_name, - card_list: ob.card_list - }); - } - } - }, 500) - }) - } - }) - } - - - } }) }, diff --git a/components/serviceCard_list/serviceCard_list.wxml b/components/serviceCard_list/serviceCard_list.wxml index 86919ed..ee7b346 100644 --- a/components/serviceCard_list/serviceCard_list.wxml +++ b/components/serviceCard_list/serviceCard_list.wxml @@ -37,95 +37,8 @@ - - - - - - - - - - - {{filter.toFix(item[card_field],2)}} - - - {{card_name}} - - - - - - - - {{item.market_price}} - - - - - - - - - {{filter.toFix(item.shop_price,2)}} - - - - - - - {{item.market_price}} - - - - - - - - - - - - {{filter.toFix(item.shop_price,2)}} - - - - - {{item.market_price}} - - - - - - - {{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}} - - - {{g_filter.get_card_price(item,card_list,1)}} - - - - - - - - - - {{filter.toFix(item.shop_price,2)}} - - - - - - - {{item.market_price}} - - - - - - + diff --git a/packageA/pages/distribution/goods/goods.wxml b/packageA/pages/distribution/goods/goods.wxml index ab59e8f..49b2c1a 100644 --- a/packageA/pages/distribution/goods/goods.wxml +++ b/packageA/pages/distribution/goods/goods.wxml @@ -83,7 +83,7 @@ {{item.goods_name}} - + {{item.prom_integral}}积分 + diff --git a/packageA/pages/distribution/shop/shop.wxml b/packageA/pages/distribution/shop/shop.wxml index 9ce235d..993b486 100644 --- a/packageA/pages/distribution/shop/shop.wxml +++ b/packageA/pages/distribution/shop/shop.wxml @@ -76,7 +76,7 @@ {{item.goods_name}} - + {{item.prom_integral}} diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index 65d3955..a80fb7a 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -6018,7 +6018,7 @@ Page({ }, go_card_info: function () { - getApp().goto("/pages/user/cardinfo/cardinfo"); + getApp().goto("/packageE/pages/user/cardinfo/cardinfo"); }, //-- 根据ID拿出门店 -- diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js index 4b2e251..0b018ba 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.js +++ b/packageC/pages/presell/goodsInfo/goodsInfo.js @@ -4531,7 +4531,7 @@ Page({ getApp().goto("/pages/user/plus/plus"); }, go_card_info: function () { - getApp().goto("/pages/user/cardinfo/cardinfo"); + getApp().goto("/packageE/pages/user/cardinfo/cardinfo"); }, //-- 根据ID拿出门店 -- get_pick_from_list(pid) { diff --git a/packageC/pages/presell/pregoodsInfo/goodsInfo.js b/packageC/pages/presell/pregoodsInfo/goodsInfo.js index 243429b..0ba4d9d 100644 --- a/packageC/pages/presell/pregoodsInfo/goodsInfo.js +++ b/packageC/pages/presell/pregoodsInfo/goodsInfo.js @@ -3694,7 +3694,7 @@ Page({ getApp().goto("/pages/user/plus/plus"); }, go_card_info: function () { - getApp().goto("/pages/user/cardinfo/cardinfo"); + getApp().goto("/packageE/pages/user/cardinfo/cardinfo"); }, //-- 根据ID拿出门店 -- get_pick_from_list(pid) { diff --git a/packageE/pages/user/cardinfo/cardinfo.js b/packageE/pages/user/cardinfo/cardinfo.js new file mode 100644 index 0000000..202e3a1 --- /dev/null +++ b/packageE/pages/user/cardinfo/cardinfo.js @@ -0,0 +1,881 @@ +var t = getApp(), + a = t.request, + o = t.globalData.setting, + os = o, + i = require("../../../../utils/util.js"), + ut = i, + s = require("../../../../utils/common.js"),t_pay = require("../../../../utils/pay2.js"), + w = require("../../../../utils/wxParse/wxParse.js"); +var regeneratorRuntime = require('../../../../utils/runtime.js'); +//wx.downloadFile把线上地址设为本地地址 +Page({ + + /** + * 页面的初始数据 + */ + data: { + 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"], + url: o.imghost, + screenWidth: 0, + screenheight: 0, + canvasHidden:1, + shareImgPath: null, + is_plusCard: "",//卡的列表 + imagePath: "", + user: null,//会员的数据 + is_card: 0,//用于判断是否是续费页和购买页面 0不是PLUS会员 + content: "",//等级卡规则 + is_card_rule: "",//等级卡规则判断用 + big_card: null,//最大的卡 + divide_into:"",//分佣 + is_loading:"",//判断分享只执行一次 + bas_ming:"",//分享的卡的图片 + head_pic:"",//会员头像 + img_money:"",//缓存VIP的图片 + img_Ancrown:"",//会员权益 + img_Identification:"",//缓存标识的图片 + img_square:"",//缓存方块的图片 + privilege_o:"",//卡的勋章图 + cardid: "",//会员卡的id + user_card: null,//会员买的卡 + free:null,//分佣的数据 + expiryDate:"",//卡到期时间 + is_guoqi:0, //卡是不是过期 + IsStopBuy:0, //卡是否停用 + yu_e_show:0,//装入余额的弹窗 + is_show_change_pop:0, + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ url: '/packageE/pages/togoin/togoin' }) + return false; + } + + var that = this,ee=this; + var th=this; + //-----------等级卡说明------------------- + getApp().request.promiseGet("/api/weshop/storeconfig/get/" + os.stoid, { + }).then(res => { + var is_cardrule = res.data.data.cardrules; + w.wxParse("content", "html", is_cardrule, ee, 6); + ee.setData({ + is_card_rule: is_cardrule + }); + }) + + //----------------------------获取最大的卡类----------------------- + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + o.stoid, { + }).then(res => { + var plusCard = res.data.data; + var big_cards = null,big_card=null; + if(!plusCard) return false; + + var new_card_arr=[]; + for (var i = 0; i < plusCard.length; i++) { + if (plusCard[i].CardImg == "") plusCard[i].CardImg = th.data.url + "/miniapp/images/plus/bg" + (i + 1) + ".jpg?v=1"; + //big_cards = Math.max(plusCard[i].CardFee) + //if (plusCard[i].CardFee == big_cards) { + // big_card = plusCard[i] + //} + if(!plusCard[i].IsStopBuy) { + new_card_arr.push(plusCard[i]); + } + } + + //对比函数 + var compare = function (obj1, obj2) { + var val1 = obj1.CardFee;var val2 = obj2.CardFee; + if (val1 > val2) { + return -1; + }else if (val1 < val2) { + return 1; + }else{ return 0; } + } + new_card_arr.sort(compare); + big_card= new_card_arr[0]; + ee.setData({ + is_plusCard: new_card_arr, + big_card: big_card, + }) + + //缓存分享卡的图片 + wx.getImageInfo({ + src: big_card.CardImg, + success: function (res) { + //回调写法 + var bas_ming = res.path; + ee.setData({ bas_ming: bas_ming }); + } + }) + + }) + + //获取用户设备信息,屏幕宽度 + wx.getSystemInfo({ + success: res => { + that.setData({ + screenWidth: res.screenWidth + }) + } + }) + + + + }, + + +//------------程序初始化入口 同步------------- + async init() { + var ee = this, th = ee; + + //-------------会员卡的获取------------- + await getApp().request.promiseGet("/api/weshop/plus/vip/mem/list", + { + data: { + storeId: os.stoid, + userId: getApp().globalData.user_id, + }, + }).then(res => { + + var GradeCardID = res.data.data[0].GradeCardID; + var expiryDate = res.data.data[0].ExpiryDate + console.log(GradeCardID, "卡的id", res.data.data[0]); + var now=ut.gettimestamp(); + var str = expiryDate.replace(/-/g, '/'); + var end = new Date(str); + end = Date.parse(end) / 1000; + var is_guoqi=0; + if(endparseFloat(cur_card.CardFee)){ + new_buy_list.push(item); + } + } + } + } + + if(new_buy_list.length>0){ + th.setData({buy_list:new_buy_list}); + } + } + + },1800) + + + }) + //-----------会员分佣------------------- + await getApp().request.promiseGet("/api/weshop/plus/vip/mem/freeze/money?userId=" + getApp().globalData.user_id + "&storeId=" + os.stoid, { + }).then(res => { + console.log("分佣的数据", res.data.data); + if (res.data.code==0){ + ee.setData({ free:res.data.data}); + }else{ + ee.setData({ free: 0 }); + } + }) + //-----------会员的卡类------------------- + await getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/get?storeId=" + os.stoid + "&CardId=" + ee.data.cardid, { + }).then(res => { + var user_card= res.data.data; + if (user_card.CardImg==""){ + var index =parseInt(user_card.CorrPrice.replace("Price","")); + user_card.CardImg = th.data.url + "/miniapp/images/plus/bg" + index + ".jpg?v=1"; + } + if (user_card.IsStopBuy==true){ + this.setData({IsStopBuy:1}) + } + + console.log(user_card,"会员的卡类"); + ee.setData({user_card: user_card}); + }) + + + + //-----------------获取会员信息------------------------------- + await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id,{ + + }).then(res => { + var user = res.data.data; + var url = ee.data.url; + console.log("是什么东西", url); + var img_money = url + "/miniapp/images/plus/share/money.png"; + var img_Ancrown = url + "/miniapp/images/plus/share/Ancrown.png"; + var img_Identification = url + "/miniapp/images/plus/share/Identification.png"; + var img_square = url + "/miniapp/images/plus/share/square.png"; + var privilege_o = url + "/miniapp/images/plus/share/privilege_o.png"; + console.log("图片转换",img_money); + var big_card = ee.data.big_card; + ee.setData({ + user: user, + img_money: img_money, + img_Ancrown: img_Ancrown , + img_Identification: img_Identification, + img_square, img_square , + privilege_o, privilege_o + + }); + + //缓存会员头像的图片 + wx.getImageInfo({ + src: user.head_pic, + success: function (res) { + //回调写法 + var user_head= res.path; + ee.setData({ head_pic: user_head }); + } + }) + }) + //--------------------缓存vip价格的图片--------------- + wx.getImageInfo({ + src:ee.data.img_money, + success: function (res) { + //回调写法 + var img_money = res.path; + ee.setData({ img_money: img_money}); + } + }) + //--------------------缓存权益的图片--------------- + wx.getImageInfo({ + src: ee.data.img_Ancrown, + success: function (res) { + //回调写法 + var img_Ancrown = res.path; + ee.setData({ img_Ancrown: img_Ancrown }); + } + }) + //--------------------缓存标识的图片--------------- + wx.getImageInfo({ + src: ee.data.img_Identification, + success: function (res) { + //回调写法 + var img_Identification = res.path; + ee.setData({ img_Identification: img_Identification }); + } + }) + + //--------------------卡的勋章--------------- + wx.getImageInfo({ + src: ee.data.privilege_o, + success: function (res) { + //回调写法 + var privilege_o = res.path; + ee.setData({ privilege_o: privilege_o }); + } + }) + + //--------------------方块图--------------- + wx.getImageInfo({ + src: ee.data.img_square, + success: function (res) { + //回调写法 + var img_square = res.path; + ee.setData({ img_square: img_square}); + } + }) + + }, + + + + + //-----打开分享图片---- + Share_pictures: function () { + + this.setData({ + canvasHidden: false + }) + this.saveImageToPhotosAlbum(); + }, + + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + saveImageToPhotosAlbum: function () { + if (this.data.imagePath != "") { + getApp().pre_img(this.data.imagePath); + return; + } + + //if(this.data.is_loading) return false ; + this.data.is_loading=1; + + wx.showLoading({ + title: '生成中...', + }) + + this.setData({ + canvasHidden: false + }) + + var th = this; + //设置画板显示,才能开始绘图 + var card_ming=th.data.bas_ming;//卡的图片 + var user = th.data.user;//会员资料; + var big_card= th.data.big_card;//获取最大的卡 + var user_head = th.data.head_pic;//会员头像 + var img_money = th.data.img_money;//缓存vip的价格 + var img_Ancrown = th.data.img_Ancrown;//会员权益的图片 + var img_Identification = th.data.img_Identification;//会员标识 + var privilege_o = th.data.privilege_o;//勋章图片 + var img_square=th.data.img_square; + var nickname = user.nickname; + var app = getApp(); + var unit = th.data.screenWidth / 750 * 1.35; + var scene = getApp().globalData.user_id; + console.log("用户头像", th.data.head_pic); + ///二微码 + + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + + os.stoid + "?sceneValue=" + scene + "&pageValue=pages/user/plus/plus"; + wx.getImageInfo({ + src: path3, + success: function (res) { + //回调写法 + th.get_head_temp(th.get_goods_temp, function () { + var vpath=res.path; + + console.log("生成二维码", path3); + //开启画布 + const ctx = wx.createCanvasContext('myCanvas'); + + + //先画背景 930 + ctx.drawImage("../../../images/share/mackground.png", 0, 0, 554 * unit, 899 * unit); + ctx.setFontSize(24 * unit); + ctx.setFillStyle("rgb(0,0,0)"); + // ctx.fillText(nickname, 152 * unit, 75 * unit, 200 * unit); + ctx.fillText(nickname, 152 * unit, 76 * unit); + + // var width = 24 * nickname.length * unit + 2 * unit; + var width = 24 * nickname.length * unit + 2 * unit; + console.log("强烈推荐的距离:", "nickname.length", nickname.length, "unit", unit, "width", width); + var tj_path = "../../../images/share/q_tj.png"; + // ctx.drawImage(tj_path, 255 * unit + width, 50 * unit, 90 * unit, 30 * unit); + ctx.drawImage(tj_path, 152 * unit + width, 54 * unit, 95 * unit, 30 * unit); + + ctx.setFontSize(18 * unit); + ctx.setLineJoin('round'); //交点设置成圆角 + ctx.setFillStyle("white"); + ctx.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit); + // ctx.fillText("强烈推荐", 265 * unit + width, 72 * unit); + + ctx.setStrokeStyle("rgb(255,255,255)"); + ctx.setLineDash([5 * unit, 5 * unit], 5 * unit); + ctx.beginPath(); + ctx.moveTo(0, 125 * unit); + ctx.lineTo(554 * unit, 125 * unit); + ctx.stroke(); + + var x = 55 * unit, + y = 165 * unit, + w = 444 * unit, + h = 220 * unit, + r = 14 * unit; + ctx.save(); + // 开始绘制 + ctx.beginPath(); + // 因为边缘描边存在锯齿,最好指定使用 transparent 填充 + // 这里是使用 fill 还是 stroke都可以,二选一即可 + ctx.setFillStyle('rgb(237,188,150)') + // ctx.setStrokeStyle('transparent') + // 左上角 + ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5) + + // border-top + ctx.moveTo(x + r, y) + ctx.lineTo(x + w - r, y) + ctx.lineTo(x + w, y + r) + // 右上角 + ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2) + + // border-right + ctx.lineTo(x + w, y + h - r) + ctx.lineTo(x + w - r, y + h) + // 右下角 + ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5) + + // border-bottom + ctx.lineTo(x + r, y + h) + ctx.lineTo(x, y + h - r) + // 左下角 + ctx.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI) + + // border-left + ctx.lineTo(x, y + r) + ctx.lineTo(x + r, y) + + // 这里是使用 fill 还是 stroke都可以,二选一即可,但是需要与上面对应 + ctx.fill() + + ctx.clip(); //画了圆 再剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 + ctx.drawImage(card_ming, x, y, 444 * unit, 220 * unit); // 推进去图片 + ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制 + + ctx.beginPath(); + // 卡图片 + // ctx.drawImage("../../../images/plus/share/one.jpg", 55 * unit, 165 * unit, 444 * unit, 220 * unit,); + ctx.setFontSize(26 * unit); + ctx.setFillStyle('rgb(218,194,169)'); + ctx.fillText(big_card.CardName, 80 * unit, 215 * unit); + ctx.setFontSize(18 * unit); + ctx.setFillStyle('rgb(218,194,169)'); + ctx.fillText("开通plus会员仅" + big_card.CardFee+"元", 80 * unit, 240 * unit); + + // zzctx.drawImage(privilege_o, 80 * unit, 343 * unit, 20 * unit, 20 * unit); + + ctx.setFontSize(14 * unit); + ctx.setFillStyle('rgb(218,194,169)'); + ctx.fillText("按去年用户消费计算,开卡后一年预计省¥3031",85 * unit, 360 * unit); + + ctx.rect(70 * unit, 425 * unit, 182 * unit, 1 * unit); + ctx.setFillStyle('rgb(218,194,169)'); + ctx.fill(); + + ctx.drawImage(img_square, 267 * unit, 420 * unit, 13 * unit, 13 * unit); + + ctx.beginPath(); + ctx.rect(295 * unit, 425 * unit, 182 * unit, 1 * unit); + ctx.setFillStyle('rgb(218,194,169)'); + ctx.fill(); + + ctx.drawImage(img_square, 80 * unit, 470 * unit, 10 * unit, 10 * unit); + ctx.setFontSize(24 * unit); + ctx.setFillStyle("rgb(198,165,126)"); + ctx.fillText("PLUS会员权益", 100 * unit, 475 * unit); + + ctx.setFontSize(20 * unit); + ctx.setFillStyle("rgb(198,165,126)"); + ctx.fillText("PLUS会员专属权益", 100 * unit, 505 * unit); + ctx.drawImage(img_Ancrown, 355 * unit, 440 * unit, 65 * unit, 65 * unit); + + ctx.rect(85 * unit, 530 * unit, 375 * unit, 1 * unit) + ctx.setFillStyle('rgb(218,194,169)') + ctx.fill(); + + ctx.drawImage(img_square, 80 * unit, 575 * unit, 10 * unit, 10 * unit); + ctx.setFontSize(24 * unit); + ctx.setFillStyle("rgb(198,165,126)"); + ctx.fillText("PLUS会员标识", 100 * unit, 580 * unit); + + ctx.setFontSize(20 * unit); + ctx.setFillStyle("rgb(198,165,126)"); + ctx.fillText("彰显尊贵身份的象征", 100 * unit, 610 * unit); + ctx.drawImage(img_Identification, 355 * unit, 548 * unit, 65 * unit, 65 * unit); + + ctx.rect(85 * unit, 635 * unit, 375 * unit, 1 * unit); + ctx.setFillStyle('rgb(218,194,169)'); + ctx.fill(); + + ctx.drawImage(img_square, 80 * unit, 695 * unit, 10 * unit, 10 * unit); + ctx.setFontSize(24 * unit); + ctx.setFillStyle("rgb(198,165,126)"); + ctx.fillText("PLUS会员价格", 100 * unit, 695 * unit); + + ctx.setFontSize(20 * unit); + ctx.setFillStyle("rgb(198,165,126)"); + ctx.fillText("享受专属会员超低价", 100 * unit, 725 * unit); + ctx.drawImage(img_money, 355 * unit, 660 * unit, 65 * unit, 65 * unit); + + ctx.rect(85 * unit, 750 * unit, 375 * unit, 1 * unit) + ctx.setFillStyle('rgb(218,194,169)') + ctx.fill(); + + ctx.drawImage(vpath, 100 * unit, 780 * unit, 110 * unit, 110 * unit); + + ctx.setFontSize(20 * unit); + ctx.setFillStyle("#000"); + ctx.fillText("解锁新权益 精彩享不停", 230 * unit, 825 * unit); + + ctx.setFontSize(20 * unit); + ctx.setFillStyle("#000"); + ctx.fillText("长按识别二维码,立即开通!", 230 * unit, 865 * unit); + + //---绘制圆形要放在最后---- + ctx.save(); + ctx.beginPath(); + var h_x = 60 * unit; + var h_y = 24 * unit; + var h_r = 40 * unit; + var cx = h_x + h_r; + var cy = h_y + h_r; + ctx.arc(cx, cy, h_r, 0, Math.PI * 2, false); + ctx.closePath(); + ctx.fill(); + ctx.clip(); + ctx.drawImage(th.data.head_pic, h_x, h_y, h_r * 2, h_r * 2); + ctx.restore(); + + var x = 345 * unit, + y = 190 * unit, + w = 105 * unit, + h = 30 * unit, + r = 14 * unit; + ctx.save(); + // 开始绘制 + ctx.beginPath(); + // 因为边缘描边存在锯齿,最好指定使用 transparent 填充 + // 这里是使用 fill 还是 stroke都可以,二选一即可 + ctx.setFillStyle('rgb(237,188,150)') + // ctx.setStrokeStyle('transparent') + // 左上角 + ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5) + + // border-top + ctx.moveTo(x + r, y) + ctx.lineTo(x + w - r, y) + ctx.lineTo(x + w, y + r) + // 右上角 + ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2) + + // border-right + ctx.lineTo(x + w, y + h - r) + ctx.lineTo(x + w - r, y + h) + // 右下角 + ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5) + + // border-bottom + ctx.lineTo(x + r, y + h) + ctx.lineTo(x, y + h - r) + // 左下角 + ctx.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI) + + // border-left + ctx.lineTo(x, y + r) + ctx.lineTo(x + r, y) + + // 这里是使用 fill 还是 stroke都可以,二选一即可,但是需要与上面对应 + ctx.fill() + + ctx.setFontSize(18 * unit); + ctx.setFillStyle("#000"); + ctx.fillText("立即开通", 362 * unit, 212 * unit); + + + //绘制图片 + ctx.draw(false, + function(){ + setTimeout(function(){ + wx.canvasToTempFilePath({ + x: 0, + y: 0, + width: 750, + height: 930, + destWidth: 1.2 * 750 * 750 / th.data.screenWidth, + destHeight: 1.2 * 1217 * 750 / th.data.screenWidth, + canvasId: 'myCanvas', + success: function (res) { + wx.hideLoading();//关闭生成中的方法 + th.data.is_loading = 0; + console.log("生成的海报"); + console.log(res.tempFilePath); + var tempFilePath = res.tempFilePath; + th.setData({ + imagePath: tempFilePath, + maskHidden: false, + canvasHidden: true + }); + getApp().pre_img(res.tempFilePath); + if (!res.tempFilePath) { + wx.showModal({ + title: '提示', + content: '图片绘制中,请稍后重试', + showCancel: false + }) + } + } + }) + },500) + + }) + + + }) + } + }) + + }, + + //--获取头像的本地缓存,回调写法-- + get_head_temp: function (tt, func) { + var ee = this; + console.log("获取头像", ee.data.head_pic); + if (ee.data.head_pic) { + tt(func); + return false; + } + //---获取分享图片的本地地址,头像和商品图片---- + var path2 = getApp().globalData.userInfo.head_pic; + if (path2 == "") { + ee.data.head_pic = "../../../images/share/hui_hear_pic.png"; + tt(func); + } else { + path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); + path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); + wx.getImageInfo({ + src: path2, + success: function (res) { + //res.path是网络图片的本地地址 + ee.data.head_pic= res.path; + tt(func);; + }, + fail: function (res) { + ee.data.head_pic= "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 + tt(func); + } + }); + } + }, + //--获取商品图片的本地缓存,回调写法-- + get_goods_temp: function (tt) { + var ee = this; + if (ee.data.head_pic) { + tt(); + return false; + } + //获取商品是分享图信息 + wx.getImageInfo({ + src: ee.data.head_pic, + success: function (res) { + //res.path是网络图片的本地地址 + ee.data.head_pic = res.path; + tt(); + }, + fail: function (res) { + ee.data.head_pic = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 + tt(); + } + }); + }, + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + //同步初始化 + this.init(); + + var goods_list = this.selectComponent("#goods_list"); //组件的id + goods_list.init(); + goods_list.get_list(); + + }, + + + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + var goods_list = this.selectComponent("#goods_list"); //组件的id + goods_list.get_list(); + + }, + + + //--转到用户余额-- + to_user_money:function(){ + //提现小于0的值也不提现 + if(!this.data.free.VIPRebate || parseFloat(this.data.free.VIPRebate)<=0){ + getApp().my_warnning("您目前没有可提现的金额",0,this); return false; + } + this.setData({yu_e_show:1}) + }, + close_yu_e:function(){ + this.setData({yu_e_show:0}) + }, + go_yu_e:function(){ + var th=this,free=th.data.free; + //提现小于0的值也不提现 + if(!th.data.free.VIPRebate || parseFloat(th.data.free.VIPRebate)<=0){ + getApp().my_warnning("您目前没有可提现的金额",0,th); return false; + } + wx.showModal({ + title: '提示', + content: '您确定要转入余额吗?', + success(res) { + if (res.confirm) { + getApp().request.post("/api/weshop/plus/withdrawal/referee/money",{ + data:{storeId:os.stoid,userId:getApp().globalData.user_id}, + success:function(res){ + if(res.data.code==0){ + getApp().my_warnning("转入成功",0,th); + free.VIPRebate=0; + th.setData({free:free}); + }else{ + getApp().my_warnning(res.data.msg ,0,th); + } + } + }) + } + } + }) + }, + + + //-----立即续费的功能------ + xufei:async function(){ + var th = this,is_card = 0,end_time=0; + await getApp().request.promiseGet("/store/storemoduleendtime/page?store_id="+os.stoid+"&type=3", + {1:1}).then(res => { + if (ut.ajax_ok(res)) { + end_time=res.data.data.pageData[0].end_time; + } + }) + + var now=ut.gettimestamp(); + if(end_time { + if (res.data.code == 0) is_card = 1; + else errmsg=res.data.msg; + }) + + if (is_card == 0){ + getApp().my_warnning(errmsg?errmsg:"请联系商家升级plus功能", 0, th); + return false; + } + + var item = th.data.user_card; + var req = {}; + req.cardId = item.CardId; + req.rechargeType = 4; + //如果不是你导购,也不是等级会员分享 + req.storeId = os.stoid; + req.userId = getApp().globalData.user_id; + t_pay.pay(req, th.success, function () { + getApp().my_warnning("支付失败", 0, th); + }); + + }, + + //--支付成功,跳转到等级卡续费页面-- + success:function (ind) { + if(ind==1){ + getApp().my_warnning("升级成功",0,this); + }else{ + getApp().my_warnning("支付成功",0,this); + } + this.init(); + }, + + + + + //------计算俩种卡的------ + change_card:async function (e) { + var th = this,card_id =e.currentTarget.dataset.cid ,end_time=0; + await getApp().request.promiseGet("/store/storemoduleendtime/page?store_id="+os.stoid+"&type=3", + {1:1}).then(res => { + if (ut.ajax_ok(res)) { + end_time=res.data.data.pageData[0].end_time; + } + }) + var now=ut.gettimestamp(); + if(end_time { + if (res.data.code == 0) { + my_con.open("\n 温馨提示,高于当前等级,是否立即升级!\n\n 升级价格:¥"+ res.data.data.payMoney.toFixed(2)+" \n 有效时间:"+time+"\n\n", "是", "否", th.sure_pay, null) + } + }) + } + + }, + + sure_pay:function () { + var th=this; + var req = {}; + req.cardId = th.data.s_card_id; + req.rechargeType = 5; + //如果不是你导购,也不是等级会员分享 + req.storeId = os.stoid; + req.oldCardId=th.data.user_card.CardId; + req.userId = getApp().globalData.user_id; + t_pay.pay(req, th.success, function () { + getApp().my_warnning("支付失败", 0, th); + }); + }, + //显示弹出框 + show_change:function () { this.setData({is_show_change_pop:1}); }, + //关闭弹出框 + close_card_change_pop:function () { this.setData({is_show_change_pop:0}); }, + + + /** + * 点击跳转 + */ + goto(e) { + let url = ''; + if(e.target.dataset.url) { + url = e.target.dataset.url; + } else { + url = e.currentTarget.dataset.url; + } + t.goto(url); + }, + + + + +}) \ No newline at end of file diff --git a/packageE/pages/user/cardinfo/cardinfo.json b/packageE/pages/user/cardinfo/cardinfo.json new file mode 100644 index 0000000..393a432 --- /dev/null +++ b/packageE/pages/user/cardinfo/cardinfo.json @@ -0,0 +1,10 @@ + { + "usingComponents": { + "pop_txt": "/components/userqy_pop_up/userqy_pop_up", + "goods_recommend": "/components/goods_list/goods_list", + "warn": "/components/long_warn/long_warn", + "nav_box": "/components/nav_box_card/nav_box", + "my_confirm": "/components/my_confirm/my_confirm" + }, + "navigationBarTitleText": "plus会员" +} \ No newline at end of file diff --git a/packageE/pages/user/cardinfo/cardinfo.wxml b/packageE/pages/user/cardinfo/cardinfo.wxml new file mode 100644 index 0000000..e54425a --- /dev/null +++ b/packageE/pages/user/cardinfo/cardinfo.wxml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + {{user_card.CardName}} + 会员将在{{filters.replace_time2(expiryDate)}}到期 + 会员已在{{filters.replace_time2(expiryDate)}}过期 + + + + 立即续费 + + + 卡类变更 + + + + 卡类升级 + + 购卡明细 + + + + + + + + + + 正在享受{{user_card.CardName}}会员特权 + 享受更低价格,请续费哦 + + + 邀请新朋友 + + + + + + + + + + + + 已邀请 + {{free==0?"0":free.RefereeNumber}}人 + 可提现 + {{free==0?"0":free.VIPRebate}}元 + + + + + 明细 + + 转到余额 + + + + + + + + + + + 开通PLUS会员尊享礼遇 + + PLUS会员尊享礼遇 + + + + + + PLUS会员可享以下特权 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 好物推荐 + + + + + + + + + + + + GOOD HOT THING + + + + + + + + + + + + + + + 确定把所有奖励金转入余额 + + 是的 + 再看看 + + + + + + + + + + + + + + + + + + + + + + + + + {{item.CardName}} + + + {{item.CardFee}} + 立即变更 + 立即升级 + + + + + + + \ No newline at end of file diff --git a/packageE/pages/user/cardinfo/cardinfo.wxss b/packageE/pages/user/cardinfo/cardinfo.wxss new file mode 100644 index 0000000..64ee734 --- /dev/null +++ b/packageE/pages/user/cardinfo/cardinfo.wxss @@ -0,0 +1,241 @@ + @import "../../../../utils/wxParse/wxParse.wxss"; + .Member_bk { + position:relative; + z-index: 0; + width: 100%; + height: 100%; +} +.box--box_main .box--dian wx-image { + margin: 0px 0 0 10rpx; + + margin-bottom: 10rpx; + +} +.MemberPlus { + width: 618rpx; + height: 285rpx; + /* border-radius: 18rpx; */ + box-shadow: 0rpx 0rpx 10rpx #888; + margin: 0rpx 35rpx; + color: #ffa786; + padding: 0rpx 31rpx; + padding-top: 40rpx; + background-size: 100%; + border-top-left-radius: 18rpx; + border-top-right-radius: 18rpx; + margin-top: 20rpx +} +.renew { + width: 190rpx; + height: 50rpx; + border-radius: 18rpx; + background-color: rgb(237, 189, 150); + text-align: center; + line-height: 50rpx; + color: #000; + margin-top: 7rpx; + +} +.xs { + position: absolute; bottom: 30rpx; width: 91%; +} +.MemberPlus .privilege { + width: 30rpx; + height: 30rpx; + margin-right: 7rpx; +} +.MemberPlus .share { + width: 30rpx; + height: 30rpx; + margin-left: 7rpx; +} +.Invitation { + padding: 0rpx 31rpx; + box-shadow: 0rpx 0rpx 10rpx #888; + height: 95rpx; + background-color: rgb(255, 255, 255); + z-index: 6; +} +.Invitation .Invitation_count, .Invitation_my { + color: rgb(237, 189, 153); +} +.Invitation .Detailed { + color: rgb(237, 189, 150); + text-decoration: underline; +} +.Invitation .Invitation_Cash { + width: 150rpx; + height: 45rpx; + line-height: 45rpx; + text-align: center; + border-radius: 25rpx; + margin-left: 30rpx; + background-color: rgb(237, 189, 150); + color: rgb(255, 255, 255); +} +.swiper, .Courtesy, .title { + position: relative; + z-index:-3; +} +.Courtesy_title { + color: rgb(173, 137, 79); + font-weight: bold; + margin-bottom: 10rpx; + letter-spacing: 2rpx; +} +.Courtesy_image { + width: 50rpx; + height: 25rpx; + margin-top: 8rpx; +} +.Courtesy_can { + margin: 0rpx 7rpx; + color: rgb(94, 93, 91); + font-weight: bold; +} + + +/* 热门好物 */ + +.title .China { + width: 100%; + margin-top: 60rpx; + margin-bottom: 10rpx; + line-height: 0rpx; +} + +.title .China .line view { + width: 2rpx; +} + +.title .China .line { + height: 40rpx; + color: rgb(51, 51, 51); +} + +.title .China .line view { + border-left: 3rpx solid #000; + margin-left: 5rpx; +} + +.title .China .line .one { + height: 23rpx; +} + +.title .China .line .two { + height: 15rpx; +} + +.title .China .line .three { + height: 18rpx; +} + +.title .China .Recommend { + margin: 0rpx 20rpx; + font-size: 28rpx; + line-height: 39rpx; + font-weight: bold; +} + +.title .english .silk { + width: 214rpx; + height: 2rpx; + background-color: #000; +} + +.title .english .esh { + margin: 0rpx 15rpx; +} +.Member { + width: 30rpx; + height: 30rpx; + margin-right: 5rpx; + background-size: 100% 100%; + background-blend-mode: lighten; + transform: translateX(-280%); + vertical-align: top; +} + +.h36{ height:36rpx; line-height: 36rpx;} +.h22{ height:22rpx; line-height: 22rpx;} + + + + +/* 弹窗样式 */ +.xc-pop-up{ + width: 100%; + height: 100%; + position:fixed; + z-index:5; + display:flex; +justify-content:center; +align-items:center; + +} +.xc-obscuration{ + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 11; + background: rgba(0,0,0,0.4); + width: 100%; + height: 100%; + +} + +.shut{ + display: block; + width: 54rpx; + height: 54rpx; + font-size: 50rpx; + line-height:47rpx; + border-radius: 50%; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + color: #fff; + text-align: center; + position: fixed; + margin-top: -23rpx; + z-index: 66666; + right: 60rpx; + background: #c8162c; +} +.xc-qr-frame{ + width:560rpx; + height: 280rpx; + background: #fff; + z-index: 55; + position: fixed; + top:40%; + padding-bottom:20rpx; + left:50%; + margin-left: -280rpx; border-radius:10rpx +} + +.ck_btn{width:44%;height:52rpx;line-height:60rpx;background:#f35e73;border-radius:10rpx;} + +.fs36{ + font-size: 36rpx; +} +.Opening_bk image { + position: absolute; + + width: 100%; + height: 320rpx; +} + +.content{ position: fixed; top: 0;left:0; width: 100%; height: 100%; z-index: 12; } +.content .card_list{ width: 700rpx; margin: 0 auto; background-color: #ffe88b; border-radius: 15rpx} +.content .card_list .hg{ width: 100%;height: 156rpx} + +.content .card_list .list{ max-height: 700rpx; padding: 0 25rpx; margin-bottom: 20rpx; overflow-y: auto} +.content .card_list .item{ margin-bottom: 10rpx; background: #fff; height: 150rpx; border-radius: 10rpx} +.content .card_list .item .hg_img{ width: 70rpx; height: 60rpx; margin-left: 40rpx; margin-right: 20rpx } +.content .card_list .item .price_show{ width: 200rpx; height: 110rpx; background: #ffd430; + border-top-left-radius: 55rpx; border-bottom-left-radius:55rpx; } + .content .card_list .list .card_name{ max-width: 230rpx} + + .price_show .thr{color: #999; text-decoration:line-through } \ No newline at end of file diff --git a/pages/distribution/distribution.wxml b/pages/distribution/distribution.wxml index 7a53c29..40918ad 100644 --- a/pages/distribution/distribution.wxml +++ b/pages/distribution/distribution.wxml @@ -95,7 +95,7 @@ 仅限PLUS卡({{item.conditonRemark}})的会员, - PLUS详情 + PLUS详情 立即升级 diff --git a/pages/goods/categoryList/categoryList.js b/pages/goods/categoryList/categoryList.js index ef03f5a..43e3a73 100644 --- a/pages/goods/categoryList/categoryList.js +++ b/pages/goods/categoryList/categoryList.js @@ -168,32 +168,6 @@ Page({ //计算等级价相关 var swithc_list = rs.switch_list; var sw_arr = JSON.parse(swithc_list); - //---如果后台又开等级卡的开关--- - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { - th.setData({ rank_switch: true }); - var user = getApp().globalData.userInfo; - var ti = setInterval(function () { - if (!user) return false; - clearInterval(ti); - //---回调卡的列表--- - th.getPlusCardType(function (ob) { - th.setData({ card_list: ob.card_list }); - if (user.card_field && user['card_expiredate']) { - var str = user['card_expiredate'].replace(/-/g, '/'); - var end = new Date(str); - end = Date.parse(end) / 1000; - var now = ut.gettimestamp(); - - //--- 判断是等级会员,且在有效期范围内 --- - if (user.card_field && now < end) { - var card_name = ob.name_map.get(user.card_field); - //if (card_name.length > 4) card_name = card_name.substring(0, 4); - th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list }); - } - } - }) - }, 500) - } if(sw_arr.is_retail_price){ th.setData({is_retail_price:1}); @@ -228,6 +202,11 @@ Page({ var data = e; var switch_list_data = data.switch_list; var switch_list = JSON.parse(switch_list_data); + + //---如果后台又开等级卡的开关--- + ut.get_plus_name_price(switch_list,that); + + var is_newsgoodstype = switch_list.is_newsgoodstype; if (is_newsgoodstype == undefined) { is_newsgoodstype = 0; diff --git a/pages/goods/categoryList/categoryList.wxml b/pages/goods/categoryList/categoryList.wxml index 393a75d..26132a3 100644 --- a/pages/goods/categoryList/categoryList.wxml +++ b/pages/goods/categoryList/categoryList.wxml @@ -584,7 +584,8 @@ {{item.goods_name}} - + + @@ -605,12 +606,14 @@ + + @@ -683,6 +686,7 @@ + {{item.shop_price}} {{item.market_price}} diff --git a/pages/goods/goodsInfo/buy_com_pop.wxml b/pages/goods/goodsInfo/buy_com_pop.wxml new file mode 100644 index 0000000..656509d --- /dev/null +++ b/pages/goods/goodsInfo/buy_com_pop.wxml @@ -0,0 +1,158 @@ + + + + {{sele_g.goods_name}} + + + + {{sele_g[card_field]}} + {{sele_g.shop_price}} + + + + 已售:{{sele_g.sales_sum}} + + + 可售:{{def_pick_store.CanOutQty}} + + 可售:0 + + + 可售:{{sele_g.store_count}} + + + + + + + + + + + {{def_pick_store.pickup_name}} + + 距离:{{def_pick_store.distance > 1000 ? filters.toFix(def_pick_store.distance / 1000, 2) + "km" : filters.toFix(def_pick_store.distance, 0) + "m"}} + + + + + + + + 选择门店 + + + + + (库存不足) + + (库存不足) + + (配送不匹配) + + (库存不足) + + + + + 地址:{{def_pick_store.fulladdress}} + + + + + + + + + + + 购买数量 + + - + + + + + + + + + + 再买{{hui_condition.need}} + ,免{{hui_condition.money}}元 + ,打{{hui_condition.sale}}折 + ,包邮 + ,送{{hui_condition.intValue}}积分 + ,送优惠券 + ,送赠品 + ,送礼包 + ,送专享礼包 + + + + + + + + 配送不匹配 + + + + + + + 库存不足 + + + + + + + 库存不足 + + + + + 库存不足 + + + + + 请先选择门店 + + + + + 库存不足 + + + + + 加入购物车 + + 立即购买 + + + + + + + + + + + diff --git a/pages/goods/goodsInfo/buy_flash_normal.wxml b/pages/goods/goodsInfo/buy_flash_normal.wxml index 86ddc6f..7a9229b 100644 --- a/pages/goods/goodsInfo/buy_flash_normal.wxml +++ b/pages/goods/goodsInfo/buy_flash_normal.wxml @@ -1,141 +1,8 @@ - - - - - - - {{sele_g.goods_name}} - - - - {{sele_g[card_field]}} - {{sele_g.shop_price}} - - - - 已售:{{sele_g.sales_sum}} - - 可售:{{def_pick_store.CanOutQty}} - 可售:0 - - 可售:{{sele_g.store_count}} - - - - - - - - - - {{def_pick_store.pickup_name}} - - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} - - - - - - - - 选择门店 - - - - - (库存不足) - - (库存不足) - - (配送不匹配) - (库存不足) - - - 地址:{{def_pick_store.fulladdress}} - - - - - - - - - - 购买数量 - - - - - + - - - - - - - - 再买{{hui_condition.need}} - ,免{{hui_condition.money}}元 - ,打{{hui_condition.sale}}折 - ,包邮 - ,送{{hui_condition.intValue}}积分 - ,送优惠券 - ,送赠品 - ,送礼包 - ,送专享礼包 - - - - - - - - - 配送不匹配 - - - - - 库存不足 - - - - - - 库存不足 - - - - 库存不足 - - - - 请先选择门店 - - - - 库存不足 - - - - 加入购物车 - 立即购买 - - - - - - - - - - - - - \ No newline at end of file + + + + + + + \ No newline at end of file diff --git a/pages/goods/goodsInfo/buy_integral_normal.wxml b/pages/goods/goodsInfo/buy_integral_normal.wxml index 6d0df3a..4b8ae7e 100644 --- a/pages/goods/goodsInfo/buy_integral_normal.wxml +++ b/pages/goods/goodsInfo/buy_integral_normal.wxml @@ -1,163 +1,8 @@ - - - - - - - - {{sele_g.goods_name}} - - - - {{sele_g[card_field]}} - {{sele_g.shop_price}} - - - - 已售:{{sele_g.sales_sum}} - - 可售:{{def_pick_store.CanOutQty}} - 可售:0 - - 可售:{{sele_g.store_count}} - - - - - - - - - - {{def_pick_store.pickup_name}} - - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} - - - - - - - - 选择门店 - - - - - (库存不足) - - (库存不足) - - (配送不匹配) - (库存不足) - - - 地址:{{def_pick_store.fulladdress}} - - - - - - - - - - 购买数量 - - - - - + - - - - - - - - 再买{{hui_condition.need}} - ,免{{hui_condition.money}}元 - ,打{{hui_condition.sale}}折 - ,包邮 - ,送{{hui_condition.intValue}}积分 - ,送优惠券 - ,送赠品 - ,送礼包 - ,送专享礼包 - - - - - - - - - - 配送不匹配 - - - - - 库存不足 - - - - - - 库存不足 - - - - 库存不足 - - - - 请先选择门店 - - - - - - 库存不足 - - - - 加入购物车 - 立即购买 - - - - - - - - 库存不足5 - - - - - 加入购物车 - 立即购买 - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + \ No newline at end of file diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 1d72595..520bc55 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -441,38 +441,7 @@ Page({ var swithc_list = e.switch_list; var sw_arr = JSON.parse(swithc_list); //---如果后台又开等级卡的开关--- - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { - th.setData({rank_switch: true}); - //---回调卡的列表--- - th.getPlusCardType(function (ob) { - th.setData({card_list: ob.card_list}); - var ti = setInterval(function () { - var user = getApp().globalData.userInfo; - if (!user) return false; - clearInterval(ti); - if (user.card_field && user['card_expiredate']) { - var str = user['card_expiredate'].replace(/-/g, '/'); - var end = new Date(str); - end = Date.parse(end) / 1000; - var now = ut.gettimestamp(); - //--- 判断是等级会员,且在有效期范围内 --- - if (user.card_field && now < end) { - var card_name = ob.name_map.get(user.card_field); - //if(card_name.length>6) card_name=card_name.substring(0,6); - - var is_near_date = 0; - if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天 - th.setData({ - card_field: user.card_field, - card_name: card_name, - card_list: ob.card_list, - is_near_date: is_near_date - }); - } - } - }, 500) - }) - } + ut.get_plus_name_price(sw_arr,th); }, 1); @@ -1427,6 +1396,8 @@ Page({ }; + + //-- 代发商品不参加优惠 -- if(th.data.sele_g.whsle_id && newd.prom_type==3){ newd.prom_type=0; @@ -1474,6 +1445,7 @@ Page({ newd.prom_type = 0; newd.prom_id = 0; + newd.is_pd_normal=1; //---如果是线下门店销售的时候--- if (th.data.sales_rules == 2) { @@ -2016,7 +1988,7 @@ Page({ getApp().goto(url); } else { //要判断积分购的普通购买有没有参加优惠活动 - if (e.is_integral_normal == 1) { + if (e.is_integral_normal == 1 || e.is_pd_normal == 1 ) { this.check_nor_promgood(e.goods_id, function (res) { if (res && res.cat_id) { e.prom_type = 3; @@ -6372,7 +6344,7 @@ Page({ getApp().goto("/pages/user/plus/plus"); }, go_card_info: function () { - getApp().goto("/pages/user/cardinfo/cardinfo"); + getApp().goto("/packageE/pages/user/cardinfo/cardinfo"); }, //-- 根据ID拿出门店 -- get_pick_from_list(pid) { diff --git a/pages/goods/goodsList/goodsList.wxml b/pages/goods/goodsList/goodsList.wxml index 986321c..01b2fc9 100644 --- a/pages/goods/goodsList/goodsList.wxml +++ b/pages/goods/goodsList/goodsList.wxml @@ -82,7 +82,7 @@ {{item.goods_name}} - + diff --git a/pages/goods/search/search.js b/pages/goods/search/search.js index 5436701..7102c02 100644 --- a/pages/goods/search/search.js +++ b/pages/goods/search/search.js @@ -99,38 +99,11 @@ Page({ var swithc_list = rs.switch_list; var sw_arr = JSON.parse(swithc_list); //---如果后台又开等级卡的开关--- - if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { - th.setData({ rank_switch: true }); - var user = getApp().globalData.userInfo; - var ti = setInterval(function () { - if (!user) return false; - clearInterval(ti); - //---回调卡的列表--- - th.getPlusCardType(function (ob) { - th.setData({ card_list: ob.card_list }); - if (user.card_field) { - var str = user['card_expiredate'].replace(/-/g, '/'); - var end = new Date(str); - end = Date.parse(end) / 1000; - var now = ut.gettimestamp(); - - //--- 判断是等级会员,且在有效期范围内 --- - if (user.card_field && now < end) { - var card_name = ob.name_map.get(user.card_field); - if (card_name && card_name.length > 7) card_name = card_name.substring(0, 8); - th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list }); - } - } - }) - }, 500) - } - + ut.get_plus_name_price(sw_arr,th); if(sw_arr.is_retail_price){ th.setData({is_retail_price:1}); } - - }) //e.init(this, "", "requestData"); var url = this.data.baseUrl; diff --git a/pages/goods/search/search.wxml b/pages/goods/search/search.wxml index c13292a..d70c051 100644 --- a/pages/goods/search/search.wxml +++ b/pages/goods/search/search.wxml @@ -87,7 +87,7 @@ {{item.goods_name}} - + {{item.prom_integral}}积分 diff --git a/pages/user/cardinfo/cardinfo.js b/pages/user/cardinfo/cardinfo.js deleted file mode 100644 index 2492876..0000000 --- a/pages/user/cardinfo/cardinfo.js +++ /dev/null @@ -1,881 +0,0 @@ -var t = getApp(), - a = t.request, - o = t.globalData.setting, - os = o, - i = require("../../../utils/util.js"), - ut = i, - s = require("../../../utils/common.js"),t_pay = require("../../../utils/pay2.js"), - w = require("../../../utils/wxParse/wxParse.js"); -var regeneratorRuntime = require('../../../utils/runtime.js'); -//wx.downloadFile把线上地址设为本地地址 -Page({ - - /** - * 页面的初始数据 - */ - data: { - 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"], - url: o.imghost, - screenWidth: 0, - screenheight: 0, - canvasHidden:1, - shareImgPath: null, - is_plusCard: "",//卡的列表 - imagePath: "", - user: null,//会员的数据 - is_card: 0,//用于判断是否是续费页和购买页面 0不是PLUS会员 - content: "",//等级卡规则 - is_card_rule: "",//等级卡规则判断用 - big_card: null,//最大的卡 - divide_into:"",//分佣 - is_loading:"",//判断分享只执行一次 - bas_ming:"",//分享的卡的图片 - head_pic:"",//会员头像 - img_money:"",//缓存VIP的图片 - img_Ancrown:"",//会员权益 - img_Identification:"",//缓存标识的图片 - img_square:"",//缓存方块的图片 - privilege_o:"",//卡的勋章图 - cardid: "",//会员卡的id - user_card: null,//会员买的卡 - free:null,//分佣的数据 - expiryDate:"",//卡到期时间 - is_guoqi:0, //卡是不是过期 - IsStopBuy:0, //卡是否停用 - yu_e_show:0,//装入余额的弹窗 - is_show_change_pop:0, - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - //--先判断会员状态-- - var user_info = getApp().globalData.userInfo; - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { - wx.navigateTo({ url: '/packageE/pages/togoin/togoin' }) - return false; - } - - var that = this,ee=this; - var th=this; - //-----------等级卡说明------------------- - getApp().request.promiseGet("/api/weshop/storeconfig/get/" + os.stoid, { - }).then(res => { - var is_cardrule = res.data.data.cardrules; - w.wxParse("content", "html", is_cardrule, ee, 6); - ee.setData({ - is_card_rule: is_cardrule - }); - }) - - //----------------------------获取最大的卡类----------------------- - getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + o.stoid, { - }).then(res => { - var plusCard = res.data.data; - var big_cards = null,big_card=null; - if(!plusCard) return false; - - var new_card_arr=[]; - for (var i = 0; i < plusCard.length; i++) { - if (plusCard[i].CardImg == "") plusCard[i].CardImg = th.data.url + "/miniapp/images/plus/bg" + (i + 1) + ".jpg?v=1"; - //big_cards = Math.max(plusCard[i].CardFee) - //if (plusCard[i].CardFee == big_cards) { - // big_card = plusCard[i] - //} - if(!plusCard[i].IsStopBuy) { - new_card_arr.push(plusCard[i]); - } - } - - //对比函数 - var compare = function (obj1, obj2) { - var val1 = obj1.CardFee;var val2 = obj2.CardFee; - if (val1 > val2) { - return -1; - }else if (val1 < val2) { - return 1; - }else{ return 0; } - } - new_card_arr.sort(compare); - big_card= new_card_arr[0]; - ee.setData({ - is_plusCard: new_card_arr, - big_card: big_card, - }) - - //缓存分享卡的图片 - wx.getImageInfo({ - src: big_card.CardImg, - success: function (res) { - //回调写法 - var bas_ming = res.path; - ee.setData({ bas_ming: bas_ming }); - } - }) - - }) - - //获取用户设备信息,屏幕宽度 - wx.getSystemInfo({ - success: res => { - that.setData({ - screenWidth: res.screenWidth - }) - } - }) - - - - }, - - -//------------程序初始化入口 同步------------- - async init() { - var ee = this, th = ee; - - //-------------会员卡的获取------------- - await getApp().request.promiseGet("/api/weshop/plus/vip/mem/list", - { - data: { - storeId: os.stoid, - userId: getApp().globalData.user_id, - }, - }).then(res => { - - var GradeCardID = res.data.data[0].GradeCardID; - var expiryDate = res.data.data[0].ExpiryDate - console.log(GradeCardID, "卡的id", res.data.data[0]); - var now=ut.gettimestamp(); - var str = expiryDate.replace(/-/g, '/'); - var end = new Date(str); - end = Date.parse(end) / 1000; - var is_guoqi=0; - if(endparseFloat(cur_card.CardFee)){ - new_buy_list.push(item); - } - } - } - } - - if(new_buy_list.length>0){ - th.setData({buy_list:new_buy_list}); - } - } - - },1800) - - - }) - //-----------会员分佣------------------- - await getApp().request.promiseGet("/api/weshop/plus/vip/mem/freeze/money?userId=" + getApp().globalData.user_id + "&storeId=" + os.stoid, { - }).then(res => { - console.log("分佣的数据", res.data.data); - if (res.data.code==0){ - ee.setData({ free:res.data.data}); - }else{ - ee.setData({ free: 0 }); - } - }) - //-----------会员的卡类------------------- - await getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/get?storeId=" + os.stoid + "&CardId=" + ee.data.cardid, { - }).then(res => { - var user_card= res.data.data; - if (user_card.CardImg==""){ - var index =parseInt(user_card.CorrPrice.replace("Price","")); - user_card.CardImg = th.data.url + "/miniapp/images/plus/bg" + index + ".jpg?v=1"; - } - if (user_card.IsStopBuy==true){ - this.setData({IsStopBuy:1}) - } - - console.log(user_card,"会员的卡类"); - ee.setData({user_card: user_card}); - }) - - - - //-----------------获取会员信息------------------------------- - await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id,{ - - }).then(res => { - var user = res.data.data; - var url = ee.data.url; - console.log("是什么东西", url); - var img_money = url + "/miniapp/images/plus/share/money.png"; - var img_Ancrown = url + "/miniapp/images/plus/share/Ancrown.png"; - var img_Identification = url + "/miniapp/images/plus/share/Identification.png"; - var img_square = url + "/miniapp/images/plus/share/square.png"; - var privilege_o = url + "/miniapp/images/plus/share/privilege_o.png"; - console.log("图片转换",img_money); - var big_card = ee.data.big_card; - ee.setData({ - user: user, - img_money: img_money, - img_Ancrown: img_Ancrown , - img_Identification: img_Identification, - img_square, img_square , - privilege_o, privilege_o - - }); - - //缓存会员头像的图片 - wx.getImageInfo({ - src: user.head_pic, - success: function (res) { - //回调写法 - var user_head= res.path; - ee.setData({ head_pic: user_head }); - } - }) - }) - //--------------------缓存vip价格的图片--------------- - wx.getImageInfo({ - src:ee.data.img_money, - success: function (res) { - //回调写法 - var img_money = res.path; - ee.setData({ img_money: img_money}); - } - }) - //--------------------缓存权益的图片--------------- - wx.getImageInfo({ - src: ee.data.img_Ancrown, - success: function (res) { - //回调写法 - var img_Ancrown = res.path; - ee.setData({ img_Ancrown: img_Ancrown }); - } - }) - //--------------------缓存标识的图片--------------- - wx.getImageInfo({ - src: ee.data.img_Identification, - success: function (res) { - //回调写法 - var img_Identification = res.path; - ee.setData({ img_Identification: img_Identification }); - } - }) - - //--------------------卡的勋章--------------- - wx.getImageInfo({ - src: ee.data.privilege_o, - success: function (res) { - //回调写法 - var privilege_o = res.path; - ee.setData({ privilege_o: privilege_o }); - } - }) - - //--------------------方块图--------------- - wx.getImageInfo({ - src: ee.data.img_square, - success: function (res) { - //回调写法 - var img_square = res.path; - ee.setData({ img_square: img_square}); - } - }) - - }, - - - - - //-----打开分享图片---- - Share_pictures: function () { - - this.setData({ - canvasHidden: false - }) - this.saveImageToPhotosAlbum(); - }, - - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - saveImageToPhotosAlbum: function () { - if (this.data.imagePath != "") { - getApp().pre_img(this.data.imagePath); - return; - } - - //if(this.data.is_loading) return false ; - this.data.is_loading=1; - - wx.showLoading({ - title: '生成中...', - }) - - this.setData({ - canvasHidden: false - }) - - var th = this; - //设置画板显示,才能开始绘图 - var card_ming=th.data.bas_ming;//卡的图片 - var user = th.data.user;//会员资料; - var big_card= th.data.big_card;//获取最大的卡 - var user_head = th.data.head_pic;//会员头像 - var img_money = th.data.img_money;//缓存vip的价格 - var img_Ancrown = th.data.img_Ancrown;//会员权益的图片 - var img_Identification = th.data.img_Identification;//会员标识 - var privilege_o = th.data.privilege_o;//勋章图片 - var img_square=th.data.img_square; - var nickname = user.nickname; - var app = getApp(); - var unit = th.data.screenWidth / 750 * 1.35; - var scene = getApp().globalData.user_id; - console.log("用户头像", th.data.head_pic); - ///二微码 - - var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + - os.stoid + "?sceneValue=" + scene + "&pageValue=pages/user/plus/plus"; - wx.getImageInfo({ - src: path3, - success: function (res) { - //回调写法 - th.get_head_temp(th.get_goods_temp, function () { - var vpath=res.path; - - console.log("生成二维码", path3); - //开启画布 - const ctx = wx.createCanvasContext('myCanvas'); - - - //先画背景 930 - ctx.drawImage("../../../images/share/mackground.png", 0, 0, 554 * unit, 899 * unit); - ctx.setFontSize(24 * unit); - ctx.setFillStyle("rgb(0,0,0)"); - // ctx.fillText(nickname, 152 * unit, 75 * unit, 200 * unit); - ctx.fillText(nickname, 152 * unit, 76 * unit); - - // var width = 24 * nickname.length * unit + 2 * unit; - var width = 24 * nickname.length * unit + 2 * unit; - console.log("强烈推荐的距离:", "nickname.length", nickname.length, "unit", unit, "width", width); - var tj_path = "../../../images/share/q_tj.png"; - // ctx.drawImage(tj_path, 255 * unit + width, 50 * unit, 90 * unit, 30 * unit); - ctx.drawImage(tj_path, 152 * unit + width, 54 * unit, 95 * unit, 30 * unit); - - ctx.setFontSize(18 * unit); - ctx.setLineJoin('round'); //交点设置成圆角 - ctx.setFillStyle("white"); - ctx.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit); - // ctx.fillText("强烈推荐", 265 * unit + width, 72 * unit); - - ctx.setStrokeStyle("rgb(255,255,255)"); - ctx.setLineDash([5 * unit, 5 * unit], 5 * unit); - ctx.beginPath(); - ctx.moveTo(0, 125 * unit); - ctx.lineTo(554 * unit, 125 * unit); - ctx.stroke(); - - var x = 55 * unit, - y = 165 * unit, - w = 444 * unit, - h = 220 * unit, - r = 14 * unit; - ctx.save(); - // 开始绘制 - ctx.beginPath(); - // 因为边缘描边存在锯齿,最好指定使用 transparent 填充 - // 这里是使用 fill 还是 stroke都可以,二选一即可 - ctx.setFillStyle('rgb(237,188,150)') - // ctx.setStrokeStyle('transparent') - // 左上角 - ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5) - - // border-top - ctx.moveTo(x + r, y) - ctx.lineTo(x + w - r, y) - ctx.lineTo(x + w, y + r) - // 右上角 - ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2) - - // border-right - ctx.lineTo(x + w, y + h - r) - ctx.lineTo(x + w - r, y + h) - // 右下角 - ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5) - - // border-bottom - ctx.lineTo(x + r, y + h) - ctx.lineTo(x, y + h - r) - // 左下角 - ctx.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI) - - // border-left - ctx.lineTo(x, y + r) - ctx.lineTo(x + r, y) - - // 这里是使用 fill 还是 stroke都可以,二选一即可,但是需要与上面对应 - ctx.fill() - - ctx.clip(); //画了圆 再剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 - ctx.drawImage(card_ming, x, y, 444 * unit, 220 * unit); // 推进去图片 - ctx.restore(); //恢复之前保存的绘图上下文 恢复之前保存的绘图上下午即状态 可以继续绘制 - - ctx.beginPath(); - // 卡图片 - // ctx.drawImage("../../../images/plus/share/one.jpg", 55 * unit, 165 * unit, 444 * unit, 220 * unit,); - ctx.setFontSize(26 * unit); - ctx.setFillStyle('rgb(218,194,169)'); - ctx.fillText(big_card.CardName, 80 * unit, 215 * unit); - ctx.setFontSize(18 * unit); - ctx.setFillStyle('rgb(218,194,169)'); - ctx.fillText("开通plus会员仅" + big_card.CardFee+"元", 80 * unit, 240 * unit); - - // zzctx.drawImage(privilege_o, 80 * unit, 343 * unit, 20 * unit, 20 * unit); - - ctx.setFontSize(14 * unit); - ctx.setFillStyle('rgb(218,194,169)'); - ctx.fillText("按去年用户消费计算,开卡后一年预计省¥3031",85 * unit, 360 * unit); - - ctx.rect(70 * unit, 425 * unit, 182 * unit, 1 * unit); - ctx.setFillStyle('rgb(218,194,169)'); - ctx.fill(); - - ctx.drawImage(img_square, 267 * unit, 420 * unit, 13 * unit, 13 * unit); - - ctx.beginPath(); - ctx.rect(295 * unit, 425 * unit, 182 * unit, 1 * unit); - ctx.setFillStyle('rgb(218,194,169)'); - ctx.fill(); - - ctx.drawImage(img_square, 80 * unit, 470 * unit, 10 * unit, 10 * unit); - ctx.setFontSize(24 * unit); - ctx.setFillStyle("rgb(198,165,126)"); - ctx.fillText("PLUS会员权益", 100 * unit, 475 * unit); - - ctx.setFontSize(20 * unit); - ctx.setFillStyle("rgb(198,165,126)"); - ctx.fillText("PLUS会员专属权益", 100 * unit, 505 * unit); - ctx.drawImage(img_Ancrown, 355 * unit, 440 * unit, 65 * unit, 65 * unit); - - ctx.rect(85 * unit, 530 * unit, 375 * unit, 1 * unit) - ctx.setFillStyle('rgb(218,194,169)') - ctx.fill(); - - ctx.drawImage(img_square, 80 * unit, 575 * unit, 10 * unit, 10 * unit); - ctx.setFontSize(24 * unit); - ctx.setFillStyle("rgb(198,165,126)"); - ctx.fillText("PLUS会员标识", 100 * unit, 580 * unit); - - ctx.setFontSize(20 * unit); - ctx.setFillStyle("rgb(198,165,126)"); - ctx.fillText("彰显尊贵身份的象征", 100 * unit, 610 * unit); - ctx.drawImage(img_Identification, 355 * unit, 548 * unit, 65 * unit, 65 * unit); - - ctx.rect(85 * unit, 635 * unit, 375 * unit, 1 * unit); - ctx.setFillStyle('rgb(218,194,169)'); - ctx.fill(); - - ctx.drawImage(img_square, 80 * unit, 695 * unit, 10 * unit, 10 * unit); - ctx.setFontSize(24 * unit); - ctx.setFillStyle("rgb(198,165,126)"); - ctx.fillText("PLUS会员价格", 100 * unit, 695 * unit); - - ctx.setFontSize(20 * unit); - ctx.setFillStyle("rgb(198,165,126)"); - ctx.fillText("享受专属会员超低价", 100 * unit, 725 * unit); - ctx.drawImage(img_money, 355 * unit, 660 * unit, 65 * unit, 65 * unit); - - ctx.rect(85 * unit, 750 * unit, 375 * unit, 1 * unit) - ctx.setFillStyle('rgb(218,194,169)') - ctx.fill(); - - ctx.drawImage(vpath, 100 * unit, 780 * unit, 110 * unit, 110 * unit); - - ctx.setFontSize(20 * unit); - ctx.setFillStyle("#000"); - ctx.fillText("解锁新权益 精彩享不停", 230 * unit, 825 * unit); - - ctx.setFontSize(20 * unit); - ctx.setFillStyle("#000"); - ctx.fillText("长按识别二维码,立即开通!", 230 * unit, 865 * unit); - - //---绘制圆形要放在最后---- - ctx.save(); - ctx.beginPath(); - var h_x = 60 * unit; - var h_y = 24 * unit; - var h_r = 40 * unit; - var cx = h_x + h_r; - var cy = h_y + h_r; - ctx.arc(cx, cy, h_r, 0, Math.PI * 2, false); - ctx.closePath(); - ctx.fill(); - ctx.clip(); - ctx.drawImage(th.data.head_pic, h_x, h_y, h_r * 2, h_r * 2); - ctx.restore(); - - var x = 345 * unit, - y = 190 * unit, - w = 105 * unit, - h = 30 * unit, - r = 14 * unit; - ctx.save(); - // 开始绘制 - ctx.beginPath(); - // 因为边缘描边存在锯齿,最好指定使用 transparent 填充 - // 这里是使用 fill 还是 stroke都可以,二选一即可 - ctx.setFillStyle('rgb(237,188,150)') - // ctx.setStrokeStyle('transparent') - // 左上角 - ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5) - - // border-top - ctx.moveTo(x + r, y) - ctx.lineTo(x + w - r, y) - ctx.lineTo(x + w, y + r) - // 右上角 - ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2) - - // border-right - ctx.lineTo(x + w, y + h - r) - ctx.lineTo(x + w - r, y + h) - // 右下角 - ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5) - - // border-bottom - ctx.lineTo(x + r, y + h) - ctx.lineTo(x, y + h - r) - // 左下角 - ctx.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI) - - // border-left - ctx.lineTo(x, y + r) - ctx.lineTo(x + r, y) - - // 这里是使用 fill 还是 stroke都可以,二选一即可,但是需要与上面对应 - ctx.fill() - - ctx.setFontSize(18 * unit); - ctx.setFillStyle("#000"); - ctx.fillText("立即开通", 362 * unit, 212 * unit); - - - //绘制图片 - ctx.draw(false, - function(){ - setTimeout(function(){ - wx.canvasToTempFilePath({ - x: 0, - y: 0, - width: 750, - height: 930, - destWidth: 1.2 * 750 * 750 / th.data.screenWidth, - destHeight: 1.2 * 1217 * 750 / th.data.screenWidth, - canvasId: 'myCanvas', - success: function (res) { - wx.hideLoading();//关闭生成中的方法 - th.data.is_loading = 0; - console.log("生成的海报"); - console.log(res.tempFilePath); - var tempFilePath = res.tempFilePath; - th.setData({ - imagePath: tempFilePath, - maskHidden: false, - canvasHidden: true - }); - getApp().pre_img(res.tempFilePath); - if (!res.tempFilePath) { - wx.showModal({ - title: '提示', - content: '图片绘制中,请稍后重试', - showCancel: false - }) - } - } - }) - },500) - - }) - - - }) - } - }) - - }, - - //--获取头像的本地缓存,回调写法-- - get_head_temp: function (tt, func) { - var ee = this; - console.log("获取头像", ee.data.head_pic); - if (ee.data.head_pic) { - tt(func); - return false; - } - //---获取分享图片的本地地址,头像和商品图片---- - var path2 = getApp().globalData.userInfo.head_pic; - if (path2 == "") { - ee.data.head_pic = "../../../images/share/hui_hear_pic.png"; - tt(func); - } else { - path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); - path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); - wx.getImageInfo({ - src: path2, - success: function (res) { - //res.path是网络图片的本地地址 - ee.data.head_pic= res.path; - tt(func);; - }, - fail: function (res) { - ee.data.head_pic= "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 - tt(func); - } - }); - } - }, - //--获取商品图片的本地缓存,回调写法-- - get_goods_temp: function (tt) { - var ee = this; - if (ee.data.head_pic) { - tt(); - return false; - } - //获取商品是分享图信息 - wx.getImageInfo({ - src: ee.data.head_pic, - success: function (res) { - //res.path是网络图片的本地地址 - ee.data.head_pic = res.path; - tt(); - }, - fail: function (res) { - ee.data.head_pic = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 - tt(); - } - }); - }, - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - //同步初始化 - this.init(); - - var goods_list = this.selectComponent("#goods_list"); //组件的id - goods_list.init(); - goods_list.get_list(); - - }, - - - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - var goods_list = this.selectComponent("#goods_list"); //组件的id - goods_list.get_list(); - - }, - - - //--转到用户余额-- - to_user_money:function(){ - //提现小于0的值也不提现 - if(!this.data.free.VIPRebate || parseFloat(this.data.free.VIPRebate)<=0){ - getApp().my_warnning("您目前没有可提现的金额",0,this); return false; - } - this.setData({yu_e_show:1}) - }, - close_yu_e:function(){ - this.setData({yu_e_show:0}) - }, - go_yu_e:function(){ - var th=this,free=th.data.free; - //提现小于0的值也不提现 - if(!th.data.free.VIPRebate || parseFloat(th.data.free.VIPRebate)<=0){ - getApp().my_warnning("您目前没有可提现的金额",0,th); return false; - } - wx.showModal({ - title: '提示', - content: '您确定要转入余额吗?', - success(res) { - if (res.confirm) { - getApp().request.post("/api/weshop/plus/withdrawal/referee/money",{ - data:{storeId:os.stoid,userId:getApp().globalData.user_id}, - success:function(res){ - if(res.data.code==0){ - getApp().my_warnning("转入成功",0,th); - free.VIPRebate=0; - th.setData({free:free}); - }else{ - getApp().my_warnning(res.data.msg ,0,th); - } - } - }) - } - } - }) - }, - - - //-----立即续费的功能------ - xufei:async function(){ - var th = this,is_card = 0,end_time=0; - await getApp().request.promiseGet("/store/storemoduleendtime/page?store_id="+os.stoid+"&type=3", - {1:1}).then(res => { - if (ut.ajax_ok(res)) { - end_time=res.data.data.pageData[0].end_time; - } - }) - - var now=ut.gettimestamp(); - if(end_time { - if (res.data.code == 0) is_card = 1; - else errmsg=res.data.msg; - }) - - if (is_card == 0){ - getApp().my_warnning(errmsg?errmsg:"请联系商家升级plus功能", 0, th); - return false; - } - - var item = th.data.user_card; - var req = {}; - req.cardId = item.CardId; - req.rechargeType = 4; - //如果不是你导购,也不是等级会员分享 - req.storeId = os.stoid; - req.userId = getApp().globalData.user_id; - t_pay.pay(req, th.success, function () { - getApp().my_warnning("支付失败", 0, th); - }); - - }, - - //--支付成功,跳转到等级卡续费页面-- - success:function (ind) { - if(ind==1){ - getApp().my_warnning("升级成功",0,this); - }else{ - getApp().my_warnning("支付成功",0,this); - } - this.init(); - }, - - - - - //------计算俩种卡的------ - change_card:async function (e) { - var th = this,card_id =e.currentTarget.dataset.cid ,end_time=0; - await getApp().request.promiseGet("/store/storemoduleendtime/page?store_id="+os.stoid+"&type=3", - {1:1}).then(res => { - if (ut.ajax_ok(res)) { - end_time=res.data.data.pageData[0].end_time; - } - }) - var now=ut.gettimestamp(); - if(end_time { - if (res.data.code == 0) { - my_con.open("\n 温馨提示,高于当前等级,是否立即升级!\n\n 升级价格:¥"+ res.data.data.payMoney.toFixed(2)+" \n 有效时间:"+time+"\n\n", "是", "否", th.sure_pay, null) - } - }) - } - - }, - - sure_pay:function () { - var th=this; - var req = {}; - req.cardId = th.data.s_card_id; - req.rechargeType = 5; - //如果不是你导购,也不是等级会员分享 - req.storeId = os.stoid; - req.oldCardId=th.data.user_card.CardId; - req.userId = getApp().globalData.user_id; - t_pay.pay(req, th.success, function () { - getApp().my_warnning("支付失败", 0, th); - }); - }, - //显示弹出框 - show_change:function () { this.setData({is_show_change_pop:1}); }, - //关闭弹出框 - close_card_change_pop:function () { this.setData({is_show_change_pop:0}); }, - - - /** - * 点击跳转 - */ - goto(e) { - let url = ''; - if(e.target.dataset.url) { - url = e.target.dataset.url; - } else { - url = e.currentTarget.dataset.url; - } - t.goto(url); - }, - - - - -}) \ No newline at end of file diff --git a/pages/user/cardinfo/cardinfo.json b/pages/user/cardinfo/cardinfo.json deleted file mode 100644 index 393a432..0000000 --- a/pages/user/cardinfo/cardinfo.json +++ /dev/null @@ -1,10 +0,0 @@ - { - "usingComponents": { - "pop_txt": "/components/userqy_pop_up/userqy_pop_up", - "goods_recommend": "/components/goods_list/goods_list", - "warn": "/components/long_warn/long_warn", - "nav_box": "/components/nav_box_card/nav_box", - "my_confirm": "/components/my_confirm/my_confirm" - }, - "navigationBarTitleText": "plus会员" -} \ No newline at end of file diff --git a/pages/user/cardinfo/cardinfo.wxml b/pages/user/cardinfo/cardinfo.wxml deleted file mode 100644 index e54425a..0000000 --- a/pages/user/cardinfo/cardinfo.wxml +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - {{user_card.CardName}} - 会员将在{{filters.replace_time2(expiryDate)}}到期 - 会员已在{{filters.replace_time2(expiryDate)}}过期 - - - - 立即续费 - - - 卡类变更 - - - - 卡类升级 - - 购卡明细 - - - - - - - - - - 正在享受{{user_card.CardName}}会员特权 - 享受更低价格,请续费哦 - - - 邀请新朋友 - - - - - - - - - - - - 已邀请 - {{free==0?"0":free.RefereeNumber}}人 - 可提现 - {{free==0?"0":free.VIPRebate}}元 - - - - - 明细 - - 转到余额 - - - - - - - - - - - 开通PLUS会员尊享礼遇 - - PLUS会员尊享礼遇 - - - - - - PLUS会员可享以下特权 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 好物推荐 - - - - - - - - - - - - GOOD HOT THING - - - - - - - - - - - - - - - 确定把所有奖励金转入余额 - - 是的 - 再看看 - - - - - - - - - - - - - - - - - - - - - - - - - {{item.CardName}} - - - {{item.CardFee}} - 立即变更 - 立即升级 - - - - - - - \ No newline at end of file diff --git a/pages/user/cardinfo/cardinfo.wxss b/pages/user/cardinfo/cardinfo.wxss deleted file mode 100644 index e4f3bac..0000000 --- a/pages/user/cardinfo/cardinfo.wxss +++ /dev/null @@ -1,241 +0,0 @@ - @import "../../../utils/wxParse/wxParse.wxss"; - .Member_bk { - position:relative; - z-index: 0; - width: 100%; - height: 100%; -} -.box--box_main .box--dian wx-image { - margin: 0px 0 0 10rpx; - - margin-bottom: 10rpx; - -} -.MemberPlus { - width: 618rpx; - height: 285rpx; - /* border-radius: 18rpx; */ - box-shadow: 0rpx 0rpx 10rpx #888; - margin: 0rpx 35rpx; - color: #ffa786; - padding: 0rpx 31rpx; - padding-top: 40rpx; - background-size: 100%; - border-top-left-radius: 18rpx; - border-top-right-radius: 18rpx; - margin-top: 20rpx -} -.renew { - width: 190rpx; - height: 50rpx; - border-radius: 18rpx; - background-color: rgb(237, 189, 150); - text-align: center; - line-height: 50rpx; - color: #000; - margin-top: 7rpx; - -} -.xs { - position: absolute; bottom: 30rpx; width: 91%; -} -.MemberPlus .privilege { - width: 30rpx; - height: 30rpx; - margin-right: 7rpx; -} -.MemberPlus .share { - width: 30rpx; - height: 30rpx; - margin-left: 7rpx; -} -.Invitation { - padding: 0rpx 31rpx; - box-shadow: 0rpx 0rpx 10rpx #888; - height: 95rpx; - background-color: rgb(255, 255, 255); - z-index: 6; -} -.Invitation .Invitation_count, .Invitation_my { - color: rgb(237, 189, 153); -} -.Invitation .Detailed { - color: rgb(237, 189, 150); - text-decoration: underline; -} -.Invitation .Invitation_Cash { - width: 150rpx; - height: 45rpx; - line-height: 45rpx; - text-align: center; - border-radius: 25rpx; - margin-left: 30rpx; - background-color: rgb(237, 189, 150); - color: rgb(255, 255, 255); -} -.swiper, .Courtesy, .title { - position: relative; - z-index:-3; -} -.Courtesy_title { - color: rgb(173, 137, 79); - font-weight: bold; - margin-bottom: 10rpx; - letter-spacing: 2rpx; -} -.Courtesy_image { - width: 50rpx; - height: 25rpx; - margin-top: 8rpx; -} -.Courtesy_can { - margin: 0rpx 7rpx; - color: rgb(94, 93, 91); - font-weight: bold; -} - - -/* 热门好物 */ - -.title .China { - width: 100%; - margin-top: 60rpx; - margin-bottom: 10rpx; - line-height: 0rpx; -} - -.title .China .line view { - width: 2rpx; -} - -.title .China .line { - height: 40rpx; - color: rgb(51, 51, 51); -} - -.title .China .line view { - border-left: 3rpx solid #000; - margin-left: 5rpx; -} - -.title .China .line .one { - height: 23rpx; -} - -.title .China .line .two { - height: 15rpx; -} - -.title .China .line .three { - height: 18rpx; -} - -.title .China .Recommend { - margin: 0rpx 20rpx; - font-size: 28rpx; - line-height: 39rpx; - font-weight: bold; -} - -.title .english .silk { - width: 214rpx; - height: 2rpx; - background-color: #000; -} - -.title .english .esh { - margin: 0rpx 15rpx; -} -.Member { - width: 30rpx; - height: 30rpx; - margin-right: 5rpx; - background-size: 100% 100%; - background-blend-mode: lighten; - transform: translateX(-280%); - vertical-align: top; -} - -.h36{ height:36rpx; line-height: 36rpx;} -.h22{ height:22rpx; line-height: 22rpx;} - - - - -/* 弹窗样式 */ -.xc-pop-up{ - width: 100%; - height: 100%; - position:fixed; - z-index:5; - display:flex; -justify-content:center; -align-items:center; - -} -.xc-obscuration{ - position: fixed; - left: 0; - top: 0; - right: 0; - bottom: 0; - z-index: 11; - background: rgba(0,0,0,0.4); - width: 100%; - height: 100%; - -} - -.shut{ - display: block; - width: 54rpx; - height: 54rpx; - font-size: 50rpx; - line-height:47rpx; - border-radius: 50%; - -moz-border-radius: 50%; - -webkit-border-radius: 50%; - color: #fff; - text-align: center; - position: fixed; - margin-top: -23rpx; - z-index: 66666; - right: 60rpx; - background: #c8162c; -} -.xc-qr-frame{ - width:560rpx; - height: 280rpx; - background: #fff; - z-index: 55; - position: fixed; - top:40%; - padding-bottom:20rpx; - left:50%; - margin-left: -280rpx; border-radius:10rpx -} - -.ck_btn{width:44%;height:52rpx;line-height:60rpx;background:#f35e73;border-radius:10rpx;} - -.fs36{ - font-size: 36rpx; -} -.Opening_bk image { - position: absolute; - - width: 100%; - height: 320rpx; -} - -.content{ position: fixed; top: 0;left:0; width: 100%; height: 100%; z-index: 12; } -.content .card_list{ width: 700rpx; margin: 0 auto; background-color: #ffe88b; border-radius: 15rpx} -.content .card_list .hg{ width: 100%;height: 156rpx} - -.content .card_list .list{ max-height: 700rpx; padding: 0 25rpx; margin-bottom: 20rpx; overflow-y: auto} -.content .card_list .item{ margin-bottom: 10rpx; background: #fff; height: 150rpx; border-radius: 10rpx} -.content .card_list .item .hg_img{ width: 70rpx; height: 60rpx; margin-left: 40rpx; margin-right: 20rpx } -.content .card_list .item .price_show{ width: 200rpx; height: 110rpx; background: #ffd430; - border-top-left-radius: 55rpx; border-bottom-left-radius:55rpx; } - .content .card_list .list .card_name{ max-width: 230rpx} - - .price_show .thr{color: #999; text-decoration:line-through } \ No newline at end of file diff --git a/pages/user/index/index.wxml b/pages/user/index/index.wxml index 700dfda..48d58c9 100644 --- a/pages/user/index/index.wxml +++ b/pages/user/index/index.wxml @@ -90,7 +90,7 @@ 加入plus会员预计可省3031元 - + 立即续费 diff --git a/pages/user/plus/plus.js b/pages/user/plus/plus.js index 373c8d2..715a9d3 100644 --- a/pages/user/plus/plus.js +++ b/pages/user/plus/plus.js @@ -174,7 +174,7 @@ Page({ success: function (e) { var userInfo = e.data.data; if (userInfo['card_field'] && !getApp().globalData.is_card_back) { - var u_url = "/pages/user/cardinfo/cardinfo"; + var u_url = "/packageE/pages/user/cardinfo/cardinfo"; wx.reLaunch({ url: u_url }) @@ -501,7 +501,7 @@ Page({ }); return false; } else { - var u_url = "/pages/user/cardinfo/cardinfo"; + var u_url = "/packageE/pages/user/cardinfo/cardinfo"; wx.reLaunch({ url: u_url }) diff --git a/utils/util.js b/utils/util.js index 10a0c82..ac6b76f 100644 --- a/utils/util.js +++ b/utils/util.js @@ -697,7 +697,52 @@ module.exports = { } }) }, + //检验等级价格 + get_plus_name_price:function(sw_arr,th){ + var that=this; + //---如果后台又开等级卡的开关--- + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { + th.setData({ + rank_switch: true + }); + //---回调卡的列表--- + th.getPlusCardType(function (ob) { + th.setData({ + card_list: ob.card_list + }); + var ti = setInterval(function () { + var user = getApp().globalData.userInfo; + if (!user) return false; + clearInterval(ti); + + if (user.card_field && user['card_expiredate']) { + var str = user['card_expiredate'].replace(/-/g, '/'); + var end = new Date(str); + end = Date.parse(end) / 1000; + var now = that.gettimestamp(); + + //--- 判断是等级会员,且在有效期范围内 --- + if (user.card_field && now < end) { + var card_name = ob.name_map.get(user.card_field); + if (card_name && card_name.length > 6) card_name = card_name.substring(0, 6); + var is_near_date = 0; + if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天 + + th.setData({ + card_field: user.card_field, + card_name: card_name, + card_list: ob.card_list, + is_near_date:is_near_date + }); + } + + } + + }, 500) + }) + } + }, unserialize: unserialize, _throttle:_throttle, -- libgit2 0.21.4