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
+
+
+
+
+
+
+
+
+
+
+
+
+ {{userInfo.nickname}}
+
+
+
+ {{userInfo.address}}
+
+
+
+
+
+
+ 前台收银扫此二维码,即可享受优惠!
+
+
+
\ 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 @@
-
-
- 请点击注册
+
+
+ 请点击注册
-
-
- 会员卡
+
+
+ 会员卡
@@ -61,22 +62,32 @@
-
- {{yuer?yuer:0}}
- 余额
-
-
-
- {{udata.Balance?udata.Balance:0}}
- 储值款
-
-
+
- {{udata.Integral?udata.Integral:0}}
- 积分
-
+
+
+
+ {{yuer?yuer:0}}
+ 余额
+
+
+
+ {{udata.Balance?udata.Balance:0}}
+ 储值款
+
+
+
+ {{udata.Integral?udata.Integral:0}}
+ 积分
+
+
+
+ {{udata.CashCount+byquan?udata.CashCount+byquan:0}}
+ 优惠券
+
+
+
- {{udata.CashCount+byquan?udata.CashCount+byquan:0}}
- 优惠券
-
+
+
\ No newline at end of file
diff --git a/components/diy_user_my_rights/diy_user_my_rights.js b/components/diy_user_my_rights/diy_user_my_rights.js
index e0c1a1f..fe61cc4 100644
--- a/components/diy_user_my_rights/diy_user_my_rights.js
+++ b/components/diy_user_my_rights/diy_user_my_rights.js
@@ -1,18 +1,41 @@
+var os = getApp().globalData.setting;
Component({
properties: {
object: {
type: Object,
value: null
},
- // 这里定义了innerText属性,属性值可以在组件使用时指定
+ qy_data:{
+ type: Object,
+ value: null
+ },
},
data: {
- // 这里是一些组件内部数据
- someData: {}
+ iurl:os.imghost,
+ qy_list:[]
},
methods: {
// 这里是一个自定义方法
customMethod() { }
- }
+ },
+ observers: {
+ // 监听 num1 和 num2 数据的变化
+ 'qy_data': function(obj){
+ console.log(1111);
+ console.log(obj);
+ if(obj){
+ //4个4个一组
+ let arr = new Array();
+ let ater=this.properties.object.show_num;
+ let arr_data= this.properties.qy_data.old_qy_list
+ for (let i = 0; i < arr_data.length; i += ater) {
+ arr.push(arr_data.slice(i, i + ater));
+ }
+ this.setData({qy_list:arr})
+ }
+
+ }
+ },
+
})
\ No newline at end of file
diff --git a/components/diy_user_my_rights/diy_user_my_rights.wxml b/components/diy_user_my_rights/diy_user_my_rights.wxml
index 92530a6..5bd2851 100644
--- a/components/diy_user_my_rights/diy_user_my_rights.wxml
+++ b/components/diy_user_my_rights/diy_user_my_rights.wxml
@@ -1 +1,51 @@
-
\ No newline at end of file
+
+
+
+
+
+
+ 我的权益
+
+
+
+ 更多
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.PrivilegeName}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 未找到数据
+
+
+
\ No newline at end of file
diff --git a/components/diy_user_my_rights/diy_user_my_rights.wxss b/components/diy_user_my_rights/diy_user_my_rights.wxss
index d7ef0d1..35a7b32 100644
--- a/components/diy_user_my_rights/diy_user_my_rights.wxss
+++ b/components/diy_user_my_rights/diy_user_my_rights.wxss
@@ -1,4 +1,84 @@
-.assist{
+@import '../../app.wxss';
+/* 我的权益 */
+.xc-my-equity-frame {
width: 100%;
- /*border:1px solid #00F;*/
-}
\ No newline at end of file
+ height: 248rpx;
+}
+
+.xc-equity-title {
+ width: 100%;
+ height: 79rpx;
+ border-bottom: 1rpx solid #f2f2f2;
+}
+
+.xc-title-frame {
+ width: 85%;
+ height: 100%;
+}
+
+.xc-title-img {
+ width: 50rpx;
+ height: 50rpx;
+ margin-left: 20rpx;s
+}
+
+.xc-title-content {
+ height: 100%;
+}
+
+.xc-more {
+ color: #878787;
+}
+
+.xc-more-frame {
+ width: 16.1%;
+ height: 100%;
+}
+
+
+.xc-more-click {
+ width: 15rpx;
+ height: 15rpx;
+ margin-left: 10rpx;
+ color: #898989;
+}
+
+.bg_right.bcolor,
+.bg_left.bcolor {
+ border-color: #333;
+}
+
+.bg_right.mt {
+ margin-top: -9rpx;
+}
+
+.bg_right.mt2 {
+ margin-top: -5rpx;
+}
+
+
+.xc-specific-more-frame {
+ width: 100%;
+ height: 169rpx;
+ padding-left: 43rpx;
+}
+
+.xc-specific-more-frame .xc-left {
+ width: 20rpx;
+ height: 20rpx;
+}
+
+.xc-specific-more-frame .xc-middle {
+ width: 100%;
+ margin-left: 2%;
+ height:100%;
+ align-items: center;
+}
+.xc-center-frame {
+ width: 20%;
+ margin-right: 5%;
+}
+.xc-center-img {
+ width: 60rpx;
+ height: 60rpx;
+}
diff --git a/components/diy_user_tools_services/diy_user_tools_services.js b/components/diy_user_tools_services/diy_user_tools_services.js
index e0c1a1f..1ae4cfc 100644
--- a/components/diy_user_tools_services/diy_user_tools_services.js
+++ b/components/diy_user_tools_services/diy_user_tools_services.js
@@ -1,18 +1,235 @@
+const ut = require("../../utils/util.js");
+var os = getApp().globalData.setting;
Component({
properties: {
object: {
type: Object,
value: null
},
+ f_user_tool: {
+ type: Object,
+ value: null
+ },
+ c_list: {
+ type: Object,
+ value: null
+ },
// 这里定义了innerText属性,属性值可以在组件使用时指定
+ //-- 是不是初始化了 --
+ is_dengji:{
+ type:Number,
+ value:0
+ },
+ //-- 是不是有助力活动 --
+ is_assistance:{
+ type:Number,
+ value:0
+ },
},
+
data: {
- // 这里是一些组件内部数据
- someData: {}
+ iurl:os.imghost,
+ sys_switch:null,
+ userInfo:null,
+ hiddenCS: true,
},
+
+ ready: function() {
+
+ 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});
+ }
+ })
+
+ let img_host=this.data.iurl;
+ if(this.properties.f_user_tool){
+ var f_user_tool=JSON.parse(JSON.stringify(this.properties.f_user_tool));
+ var list=this.properties.object.list;
+
+ if(list && list.length) {
+ //进行循环
+ for (let iu = 0; iu < list.length; iu++) {
+ let fd = f_user_tool.find(function (e) {
+ return e.id == list[iu].id;
+ })
+ if (fd) {
+ list[iu].icoimg = fd.icoimg;
+ list[iu].new_weappurl = fd.new_weappurl;
+ } else {
+ list.splice(iu, 1);
+ iu--;
+ }
+ }
+ }else{
+ list=[];
+ }
+ //-- 如果是有新的tool要添加进去 --
+ for (let ig = 0; ig {
+ self.setData({
+ hiddenCS: false,
+ });
+ });
+ }
+ }
+ },
+
+ //---------联系客服------------
+ contactService: function () {
+ getApp().com_call(this);
+ },
+
+ //关闭客服操作菜单
+ closeCS() {
+ this.setData({
+ hiddenCS: true,
+ });
+ },
+
+ //添加卡包
+ addcard: function () {
+ var res = this.data.add_card_data;
+ if (!res) return false;
+
+ var arr = new Array(6)
+ arr[0] = res.code;
+ arr[1] = res.timestamp;
+ arr[2] = res.jsapiTicket;
+ arr[3] = res.openid;
+ arr[4] = res.cardid;
+ arr[5] = res.nonceStr;
+ var c = arr.sort();
+ var newstr = "";
+ for (var i = 0; i < c.length; i++) {
+ newstr += c[i];
+ }
+
+ var sh1 = ut.sha1(newstr);
+ wx.addCard({
+ cardList: [
+ {
+ cardId: res.cardid,
+ cardExt: '{"code": "' + res.code + '", "openid": "' + res.openid + '","timestamp": "' + res.timestamp + '","nonce_str":"' + res.nonceStr + '","outer_str":"web", "signature":"' + sh1 + '"}'
+ }
+
+ ],
+ success: function (res) { },
+ cancel: function (res) { }
+ });
+ },
+
+ // 获取客服热线
+ getTel() {
+ var self = this;
+ return new Promise((resolve, reject) => {
+ var s = getApp();
+ s.getConfig(function (t) {
+ if (t.store_tel == undefined) {
+ getApp().request.get("/api/weshop/store/get/" + os.stoid, {
+ isShowLoading: 1,
+ data: {},
+ success: function (rs) {
+ getApp().globalData.config = rs.data.data;
+ if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) {
+ getApp().showWarning("商家未设置电话");
+ return false;
+ } else {
+ self.setData({
+ store_tel: rs.data.data.store_tel,
+ });
+ // s.confirmBox("客服热线:" + rs.data.data.store_tel);
+ };
+
+ }
+ })
+ } else {
+ self.setData({
+ store_tel: t.store_tel,
+ });
+ // s.confirmBox("客服热线:" + t.store_tel);
+ }
+ resolve();
+ });
+ });
+ },
+
+
+
}
})
\ No newline at end of file
diff --git a/components/diy_user_tools_services/diy_user_tools_services.wxml b/components/diy_user_tools_services/diy_user_tools_services.wxml
index 92530a6..468405d 100644
--- a/components/diy_user_tools_services/diy_user_tools_services.wxml
+++ b/components/diy_user_tools_services/diy_user_tools_services.wxml
@@ -1 +1,79 @@
-
\ No newline at end of file
+
+
+
+
+
+ 工具与服务
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PLUS会员
+
+
+
+
+
+ 助力活动
+
+
+
+
+
+ 我的权益
+
+
+
+
+
+ 套盒商品
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+ 联系客服
+
+
+
+
+
+
+ 收入卡包
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/diy_user_tools_services/diy_user_tools_services.wxss b/components/diy_user_tools_services/diy_user_tools_services.wxss
index d7ef0d1..6810495 100644
--- a/components/diy_user_tools_services/diy_user_tools_services.wxss
+++ b/components/diy_user_tools_services/diy_user_tools_services.wxss
@@ -1,4 +1,42 @@
-.assist{
+@import '../../app.wxss';
+.xc-center-img {
+ width: 60rpx;
+ height: 60rpx;
+}
+
+/* 工具与服务 */
+.xc-tool-service {
width: 100%;
- /*border:1px solid #00F;*/
+ border-bottom: 20rpx solid #f2f2f2;
+ padding-bottom: 30rpx;
+}
+
+.xc-tool-service .xc-tool-service-title {
+ width: 100%;
+ height: 90rpx;
+
+}
+
+
+.xc-tool-service-img {
+ width: 38rpx;
+ height: 38rpx;
+ margin-left: 30rpx;
+}
+
+.xc-tool-service-word {
+ margin-left: 10rpx;
+}
+
+.xc-project-frame {
+ width: 100%;
+}
+
+.xc-project-frame .item {
+ width: 25%;
+ margin-top: 30rpx;
+ display: inline-block;
+ line-height: 40rpx;
+ margin-left: 0 !important;
+ margin-right: 0 !important;
}
\ No newline at end of file
diff --git a/packageG/pages/user_template/index.js b/packageG/pages/user_template/index.js
index f30c7f7..e430aa7 100644
--- a/packageG/pages/user_template/index.js
+++ b/packageG/pages/user_template/index.js
@@ -5,24 +5,31 @@ var t = getApp(),
ut = require("../../../utils/util.js"),
com = require("../../../utils/common.js");
var regeneratorRuntime = require('../../../utils/runtime.js');
+const rq = require("../../../utils/request.js");
var appd = getApp().globalData;
Page({
data: {
url: os.imghost,
temp_id:0,
- goodsGroupArr:[]
+ goodsGroupArr:[],
+ pulscardname:'',
+ rfmName:'成长值',
+
+ byquan: 0,
+ yuer: 0,
+ udata:{},
+
+ is_assistance: 0, //助力活动
},
onLoad: function(e) {
var th = this;
this.data.temp_id=e.scene;
- if(!this.data.temp_id)
- this.data.temp_id=e.sence;
if(!this.data.temp_id) wx.showModal({ title:"未读取到模板ID" ,})
- var first_leader = e.first_leader;
- if (first_leader) {
+ var first_leader = e.first_leader;
+ if (first_leader) {
//-- user_id代过来免登录 --
getApp().globalData.first_leader = first_leader;
//调用接口判断是不是会员
@@ -32,20 +39,239 @@ Page({
getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
- }
+ }
+ if(!getApp().globalData.userInfo) {
+ getApp().goto('/packageE/pages/togoin/togoin');
+ }
-
},
async onShow() {
getApp().check_can_share();
- var th = this;
- await this.init_load();
- //如果是自定义模板
- if (this.data.isTemplate) {
-
- }
+ var th = this;
+
+ /*-------系统是否开通等级卡,会员是等级卡-----*/
+ 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});
+ var user_tool = [];
+ if (t_swi.usertool) user_tool = JSON.parse(t_swi.usertool);
+ th.setData({c_list: user_tool});
+
+ if (parseInt(t_swi.rank_switch) == 2) {
+ var userInfo = th.data.userInfo;
+ if (userInfo && userInfo.card_field != null && userInfo.card_field != undefined && userInfo.card_field != "") {
+ var now = ut.gettimestamp();
+ var str = userInfo.card_expiredate;
+ var end = new Date(str);
+ end = Date.parse(end) / 1000;
+ //---判断是不是有过期---
+ if (now < end) {
+ th.setData({
+ is_dengji: 1
+ })
+ } else {
+ th.setData({
+ is_dengji: 3
+ })
+ }
+ } else {
+ th.setData({
+ is_dengji: 2
+ })
+ }
+ }
+ }
+ })
+
+ //--初始化是否有打勾,--
+ getApp().request.get("/api/weshop/users/grade/vip/init/get", {
+ data: {
+ storeId: os.stoid
+ },
+ success: function (rs) {
+ if (rs.data.code == 0 && rs.data.data.isBool) {
+ th.setData({ is_init: 1 });
+ /*-----获取会员权益列表-----*/
+ rq.get("/api/weshop/users/grade/vipprivilegeinfo/page", {
+ isShowLoading: 0,
+ data: {
+ storeId: os.stoid,
+ pageSize: 100
+ },
+ success: async function (res) {
+
+ //判断有没有值,没有值返回
+ if (!ut.ajax_ok(res)) return false;
+
+ var arr_data = res.data.data.pageData;
+ var gid = null,
+ g_qy_list = null,
+ cz_vals = 0,
+ need_money = 0,
+ backClass = null,
+ GradeName = '';
+
+ var app_d=getApp().globalData;
+
+ //获取成长值
+ await getApp().request.promiseGet("/api/weshop/users/grade/aftervipinfo/get", {
+ data: {
+ storeId: os.stoid,
+ userId: app_d.user_id
+ }
+ }).then(res => {
+ if (res.data.code == 0 && res.data.data) {
+ gid = res.data.data.GradeId;
+ var cz_val = res.data.data.GradeSum;
+ cz_vals = parseInt(cz_val);
+ GradeName = res.data.data.GradeName;
+ }
+ //th.setData({ cz_val: cz_vals, GradeName: res.data.data.GradeName, is_init: is_init, gradeId: gid});
+ })
+ var obj = {
+ cz_val: cz_vals,
+ GradeName: GradeName,
+ gradeId: gid,
+ is_grad_get: 1
+ };
+
+ // 获取最大值
+ await getApp().request.promiseGet("/api/weshop/users/grade/vipgradeinfo/page", {
+ data: {
+ storeId: os.stoid
+ }
+ }).then(res => {
+ if (res.data.data)
+ backClass = res.data.data.pageData;
+ if (backClass) {
+ var full_cz_val = backClass[backClass.length - 1].BuyGradeSum;
+ obj.full_cz_val = full_cz_val
+ }
+ })
+
+ //--会员权益中心页的修改--
+ for (var i in backClass) {
+ var im = backClass[i];
+ if (cz_vals < im.BuyGradeSum && need_money == 0) {
+ need_money = im.BuyGradeSum;
+ obj.need_money = need_money;
+ }
+ }
+
+ //获取当前等级的特权
+ await getApp().request.promiseGet("/api/weshop/users/grade/privilegeform/list/page", {
+ data: {
+ storeId: os.stoid,
+ GradeId: gid,
+ userId: app_d.user_id,
+ pageSize: 100
+ }
+ }).then(res => {
+ if (res.data.data)
+ g_qy_list = res.data.data.pageData;
+ });
+
+ for (var i in arr_data) {
+ var item = arr_data[i];
+ var FromId = th.check_is_has_qy(item, g_qy_list);
+ arr_data[i].ishas = 0;
+ if (FromId) {
+ arr_data[i].ishas = 1;
+ arr_data[i].FromId = FromId;
+ }
+ }
+ arr_data.sort(function (a, b) {
+ return b.ishas - a.ishas
+ })
+
+ //4个4个一组
+ var arr = new Array();
+ for (var i = 0; i < arr_data.length; i += 4) {
+ arr.push(arr_data.slice(i, i + 4));
+ }
+ //th.setData({ qy_list: arr, need_money: need_money});
+ obj.qy_list = arr;
+ obj.old_qy_list = arr_data;
+ th.setData(obj);
+ obj.is_init=1;
+ th.setData({qy_data:obj})
+ }
+ })
+ }
+ }
+ })
+ this.puls_user();
+ this.getVison();
+
+ //-----获取线下会员的预存款和优惠券的数量-----
+ getApp().request.get("/api/weshop/users/getinfo/" + os.stoid + "/" +getApp().globalData.user_id, {
+ isShowLoading: 0,
+ success: function (su) {
+ if (su.data.code == 0 && su.data.data) {
+ var data = su.data.data;
+ if (!data) data = {};
+ data.cashcount = parseInt(data.cashcount);
+ th.setData({
+ udata: data,
+ });
+ }
+
+ }
+ })
+
+ //-----获取会员提现金额-----
+ getApp().request.get("/api/weshop/withdrawals/summoney", {
+ isShowLoading: 0,
+ data: {
+ user_id: getApp().globalData.user_id,
+ store_id: os.stoid,
+ status: 0
+ },
+ success: function (su) {
+ if (su.data.code == 0) {
+
+ let user=getApp().globalData.userInfo;
+ var yuer = parseFloat(user.user_money - user.frozen_money - su.data.data.summoney).toFixed(2);
+ th.setData({
+ txmon: su.data.data.summoney,
+ yuer: yuer
+ });
+ }
+ }
+ })
+
+ /*-----获取会员包邮券的数量-----*/
+ getApp().request.get("/api/weshop/userfeemail/page", {
+ isShowLoading: 0,
+ data: {
+ user_id:getApp().globalData.user_id,
+ store_id: os.stoid,
+ pageSize: 1,
+ isuse: 0
+ },
+ success: function (su) {
+ if (su.data.code == 0) {
+ th.setData({
+ byquan: parseInt(su.data.data.total)
+ });
+ }
+ }
+ });
+
+ //判断一下是不是助力活动
+ this.is_assistance();
+ //获取工具
+ await this.init_user_tool();
+
+
+ //获取自定义模板
+ await this.init_load();
+
+
},
//获取商品模块实例
@@ -190,6 +416,144 @@ Page({
this[item].automore()
})
}
+
+ var e = getApp().globalData.userInfo;
+ if (e != undefined && e != null && e.mobile) {
+ var goods_list = this.selectComponent("#goods_recommend"); //组件的id
+ goods_list.init();
+ setTimeout(function () {
+ goods_list.get_list();
+ }, 300)
+ }
+
+ },
+
+ //-----Plus会员获取-----------
+ puls_user: function() {
+ var th = this;
+ getApp().request.get("/api/weshop/plus/vip/mem/list", {
+ data: {
+ storeId: os.stoid,
+ userId: getApp().globalData.user_id,
+ },
+ success: function(su) {
+ if (su.data.code == 0) {
+ var cardname = su.data.data[0].MemCardName;
+ th.setData({
+ pulscardname: cardname
+ });
+ }
+ }
+ });
+ },
+
+ //判断会员是后有改服务项目
+ check_is_has_qy: function (item, g_qy_list) {
+ if (!g_qy_list) return false;
+
+ for (var i in g_qy_list) {
+ var iter = g_qy_list[i];
+ if (iter.FormId == item.Id) return g_qy_list[i].FormId;
+ }
+ return false;
+ },
+
+ //获取会员权益等级是否升级
+ getVison(){
+ let isRfm = wx.getStorageSync('isRfm')
+ if (isRfm) {
+ this.setData({
+ rfmName:'综合分'
+ })
+ }else{
+ rq.get(`/api/weshop/users/grade/vip/getSysPara?storeId=${os.stoid}&classInfo=IsUpRMF`, {
+ success: (res)=>{
+ console.log('会员权益等级升级查询-------');
+ console.log(res);
+ if (res.data.code == 0 && res.data.data && res.data.data.IsBool){
+ this.setData({
+ rfmName:'综合分'
+ })
+ wx.setStorageSync('isRfm', true)
+ }
+ }
+ })
+ }
+ },
+
+
+ //-- 初始话按钮图标,服务与工具的优化 ---
+ init_user_tool: async function () {
+ var d_list = null;
+ //读取user_tool按钮图标
+ await getApp().promiseGet("/api/weshop/userTool/page?pageSize=100&store_id=" + os.stoid, {
+ }).then(res => {
+ if (ut.ajax_ok(res)) {
+ d_list = res.data.data.pageData;
+ }
+ })
+
+ if (!d_list) return false;
+ //过滤掉分销关闭的
+ let distribut_end_time = await getApp().user_tools_endTime(2);//过滤掉分销到期的
+ await getApp().promiseGet("/api/weshop/storeDistribut/get/" + os.stoid, {}).then(rs => {
+ if (rs.data.code == 0 || !rs.data.data) {
+ var is_ok=1;
+
+ if(!distribut_end_time){
+ is_ok=0;
+ }
+ else if(!rs.data.data){
+ is_ok=0;
+ }else{
+ var dis=rs.data.data;
+ if(!dis || dis.switch == 0){
+ is_ok=0;
+ }
+ }
+
+ for (var i in d_list) {
+ if (d_list[i].name == '我的分销' && !is_ok) {
+ d_list.splice(i, 1);
+ }
+ }
+ }
+ })
+
+ //判断有没有开AI测肤
+ await getApp().promiseGet("/api/weshop/wx/weappSkin/get/" + os.stoid, {}).then(rs => {
+ if (rs.data.code != 0 || !rs.data.data) {
+ for (var i in d_list) {
+ if (d_list[i].name == 'AI测肤') {
+ d_list.splice(i, 1);
+ }
+ }
+ }
+ })
+ this.setData({ user_tool: d_list });
+ },
+
+ // 判断助力活动是不是存在
+ is_assistance: function () {
+ var th = this, r = Math.random() * 100;
+ getApp().promiseGet("/api/weshop/marketing/help/act/judge", {
+ data: {
+ storeId: os.stoid,
+ userId: getApp().globalData.user_id,
+ r: r,
+ }
+ }).then(res=>{
+ var code = res.data.code;
+ if (code == 0) {
+ th.setData({
+ is_assistance: 1
+ });
+ } else {
+ th.setData({
+ is_assistance: 0
+ });
+ }
+ })
},
diff --git a/packageG/pages/user_template/index.json b/packageG/pages/user_template/index.json
index f0cc58d..d2ea6ef 100644
--- a/packageG/pages/user_template/index.json
+++ b/packageG/pages/user_template/index.json
@@ -7,7 +7,8 @@
"diy_user_info":"/components/diy_user_info/diy_user_info",
"diy_user_order":"/components/diy_user_order/diy_user_order",
"diy_user_my_rights":"/components/diy_user_my_rights/diy_user_my_rights",
- "diy_user_tools_services":"/components/diy_user_tools_services/diy_user_tools_services"
+ "diy_user_tools_services":"/components/diy_user_tools_services/diy_user_tools_services",
+ "diy_user_my_rights": "/components/diy_user_my_rights/diy_user_my_rights"
},
"enablePullDownRefresh": false,
"onReachBottomDistance":300
diff --git a/packageG/pages/user_template/index.wxml b/packageG/pages/user_template/index.wxml
index 16cfded..a71108e 100644
--- a/packageG/pages/user_template/index.wxml
+++ b/packageG/pages/user_template/index.wxml
@@ -11,7 +11,9 @@
-
+
@@ -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})
}
})
}