From 32d41c0b79ef3b9255049d61ece2426425c366ed Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Sun, 17 Dec 2023 22:56:12 +0800 Subject: [PATCH] 会员中心自定义模板的优化 --- components/diy_user_info/diy_user_info.js | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- components/diy_user_info/diy_user_info.wxml | 49 ++++++++++++++++++++++++++++++++++++------------- components/diy_user_info/diy_user_info.wxss | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- components/diy_user_info/style1.wxml | 69 ++++++++++++++++++++++++++++++++++++++++----------------------------- components/diy_user_my_rights/diy_user_my_rights.js | 31 +++++++++++++++++++++++++++---- components/diy_user_my_rights/diy_user_my_rights.wxml | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- components/diy_user_my_rights/diy_user_my_rights.wxss | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- components/diy_user_tools_services/diy_user_tools_services.js | 225 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- components/diy_user_tools_services/diy_user_tools_services.wxml | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- components/diy_user_tools_services/diy_user_tools_services.wxss | 42 ++++++++++++++++++++++++++++++++++++++++-- packageG/pages/user_template/index.js | 390 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------- packageG/pages/user_template/index.json | 3 ++- packageG/pages/user_template/index.wxml | 9 ++++++--- pages/user/index/index.js | 3 +++ 14 files changed, 1207 insertions(+), 83 deletions(-) diff --git a/components/diy_user_info/diy_user_info.js b/components/diy_user_info/diy_user_info.js index 87e7ff8..b2f952e 100644 --- a/components/diy_user_info/diy_user_info.js +++ b/components/diy_user_info/diy_user_info.js @@ -1,32 +1,169 @@ +const rq = require("../../utils/request.js"); +const ut = require("../../utils/util.js"); +const {qrcode} = require("../../utils/index.js"); var s = getApp().globalData.setting; +var r=s; Component({ properties: { object: { type: Object, value: null }, - is_temp:{ - type:Number, - value:0 - } + qy_data:{ + type: Object, + value: null + }, + pulscardname:{ + type:String, + value:"--" + }, + rfmName:{ + type:String, + value:"--" + }, // 这里定义了innerText属性,属性值可以在组件使用时指定 }, data: { // 这里是一些组件内部数据 iurl: s.imghost, defaultAvatar: s.imghost + "/miniapp/images/no-head.jpg", - userInfo:null + userInfo:null, + + sys_switch:null, + tc_hide:true, //会员卡的弹出层隐藏 }, ready: function() { - if(this.properties.is_temp==1){ + var th=this; + + if(getApp().globalData.userInfo){ + this.setData({userInfo:getApp().globalData.userInfo}); + } + + /*-------系统是否开通等级卡,会员是等级卡-----*/ + getApp().getConfig2(function (e) { + var t_swi = e.switch_list; + if (t_swi) t_swi = JSON.parse(t_swi) + if (t_swi) { + th.setData({sys_switch: t_swi}); + } + }) - }else{ + }, - } + pageLifetimes: { + //要处理一下,游客登录后的界面的变化,主要还该是改变会员 + show: function () { + if(!this.data.userInfo && getApp().globalData.userInfo){ + this.setData({userInfo:getApp().globalData.userInfo}); + } + } }, + methods: { + //登陆会员 + login_user(){ + getApp().goto('/packageE/pages/togoin/togoin'); + }, + //------卡片的显示和关闭-------- + show_tc: function () { + var that=this; + if (!this.data.userInfo) return false; + var getnowtime; + getApp().request.get("/api/weshop/users/getServerTime", { + success: function (res) { + if (res.data.code == 0) + { + getnowtime=res.data.data; + if (!getnowtime) + { + ut.m_toast("获取服务时间失败"); + return; + } + //base64_encode($user.mobile.'|'.date('Y-m-d H:i:s') + var val = that.data.userInfo.mobile + "|" +getnowtime+"|"+that.data.getusercode_vailtime; + val = "^" + ut.base64_encode(val); + + qrcode('qrcode', val, 480, 480, that); + that.setData({ + tc_hide: false, + }); + } + } + }) + }, + //隐藏会员卡 + hide_tc: function () { + this.setData({ + tc_hide: true, + }); + }, + + //--跳转到预存款页面-- + deposit: function () { + if (!this.data.userInfo) + { + this.login_user(); + return false; + } + wx.navigateTo({ + url: '/packageD/pages/user/deposit/deposit', + }) + }, + //--跳转到余额页面-- + balance: function () { + if (!this.data.userInfo) + { + this.login_user(); + return false; + }; + wx.navigateTo({ + url: '/packageD/pages/user/member/menber', + }) + }, + //--跳转到优惠券-- + coupon: function () { + var th = this; + if (!this.data.userInfo) + { + this.login_user(); + return false; + }; + // th.sendsm(); + wx.navigateTo({ + url: '/packageD/pages/user/coupons/coupons', + }) + }, + //--跳转到积分-- + integral: function () { + if (!this.data.userInfo) + { + this.login_user(); + return false; + } + wx.navigateTo({ + url: '/packageD/pages/user/integral/integral', + }) + }, + + jump: function () { + let isRfm = wx.getStorageSync('isRfm') + //升级为RFM就不跳转成长值详情 + if (!isRfm) { + getApp().goto("/packageE/pages/user/grow_value/grow_value") + } + }, + + //跳转到链接 + goto: function (e) { + console.log(e); + console.log('跳转'); + var url = e.currentTarget.dataset.url; + wx.navigateTo({ url: url }) + + }, + } }) \ No newline at end of file diff --git a/components/diy_user_info/diy_user_info.wxml b/components/diy_user_info/diy_user_info.wxml index 16149ef..2745e22 100644 --- a/components/diy_user_info/diy_user_info.wxml +++ b/components/diy_user_info/diy_user_info.wxml @@ -1,24 +1,21 @@ - - + - + + s + + - - - - + + + + - - - - - @@ -45,4 +42,30 @@ - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/components/diy_user_info/diy_user_info.wxss b/components/diy_user_info/diy_user_info.wxss index afd510b..e208501 100644 --- a/components/diy_user_info/diy_user_info.wxss +++ b/components/diy_user_info/diy_user_info.wxss @@ -37,7 +37,7 @@ /*-- 头部 --*/ .xc-user .xc-head { - height: 335rpx; + height: 370rpx; } .xc-background { @@ -122,3 +122,99 @@ line-height: 46rpx; margin-left: 10rpx; } + + +.xc-qrcode-frame { + /* border-radius: 10rpx; + border: 5rpx solid #fe9db5; + background: #fe9db5; + width: 70rpx; + height: 70rpx; */ + top: 70rpx; + right: 64rpx; +} + +.xc-qrcode { + border-radius: 10rpx; + border: 5rpx solid #fe9db5; + background: #fe9db5; + width: 70rpx; + height: 70rpx; +} + +/*---弹出层---*/ +.modal-box { + position: fixed; + width: 100%; + height: 100%; + top: 0px; + background: rgba(0, 0, 0, 0.4); + overflow: hidden; +} + +.modal-body { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: auto; + z-index: 100; + background: #fff; + /* margin-left: 73rpx; */ + width: 600rpx; + height: 860rpx; + border-radius: 8px; + text-align: center; +} + +.modal-content { + width: 480rpx; + margin: 0 auto; + margin-top: 60rpx; + overflow: hidden; +} + +.modal-content .hd_img { + width: 170rpx; + height: 170rpx; + border-radius: 5px; +} + +.ctent_txt { + margin-left: 30rpx; + text-align: left; +} + +.txt1 { + font-size: 34rpx; + font-weight: bold; +} + +.txt2 { + font-size: 30rpx; + color: #999; + margin-top: 20rpx; +} + +.arrow-right { + width: 20rpx; + height: 40rpx; + position: relative; + top: 13rpx; + margin-left: 20rpx; +} + +.m_ta { + margin-top: 50rpx; +} + +.g_img { + width: 480rpx; + height: 480rpx; +} + +.s_sao { + font-size: 27rpx; + margin-top: 25rpx; +} diff --git a/components/diy_user_info/style1.wxml b/components/diy_user_info/style1.wxml index b142546..70b7f19 100644 --- a/components/diy_user_info/style1.wxml +++ b/components/diy_user_info/style1.wxml @@ -6,7 +6,7 @@ - + {{pulscardname}} @@ -14,18 +14,19 @@ - + {{userInfo.nickname}} - - {{GradeName}} + + + {{qy_data.GradeName}} - - + + {{" "}} {{rfmName}} - {{cz_val}} / {{need_money}} + {{qy_data.cz_val}} / {{qy_data.need_money}} {{" "}} @@ -37,16 +38,16 @@ - - - 请点击注册 + + + 请点击注册 - - - 会员卡 + + + 会员卡 - + @@ -19,11 +21,12 @@ - + - + diff --git a/pages/user/index/index.js b/pages/user/index/index.js index 7f7c037..b236802 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -475,6 +475,9 @@ Page({ //th.setData({ qy_list: arr, need_money: need_money}); obj.qy_list = arr; th.setData(obj); + obj.is_init=1; + obj.old_qy_list = arr_data; + th.setData({qy_data:obj}) } }) } -- libgit2 0.21.4