diff --git a/pages/user/userinfo/userinfo.js b/pages/user/userinfo/userinfo.js
index afd74eb..ab79481 100644
--- a/pages/user/userinfo/userinfo.js
+++ b/pages/user/userinfo/userinfo.js
@@ -5,7 +5,7 @@ function e(e, a, r) {
configurable: !0,
writable: !0
}) : e[a] = r, e;
-}
+}
var a = getApp(),
r = a.globalData.setting,
@@ -50,6 +50,13 @@ Page({
isstcsp:1,//是否启动密码消费
isGender:1,//什么性别
iscalendar:1,//是否是农历
+ consumption:"",//消费密码
+ identity_card:"",//身份证值
+ address:"",//地址
+ openid:"",//openid
+ pulscardname:"",//puls会员的卡
+ gradename:"",//会员权益的卡
+ isBool:"",
},
//是否启动密码消费
isstcsp:function(){
@@ -80,24 +87,21 @@ Page({
}
},
//性别
- isGender:function(){
+ isGender:function(e){
var th = this;
-
- var isGender = th.data.isGender;
- if (isGender == 2) {
+ var sex = e.currentTarget.dataset.sex;
+ console.log("点击选择性别",sex);
th.setData({
- isGender: 1
+ isGender:sex
})
- } else {
- th.setData({
- isGender: 2
- })
- }
+
+
},
//密码是否隐藏显示
ispwhid:function(){
var th = this;
var ispwhid = th.data.ispwhid;
+
if (ispwhid == 0) {
th.setData({
ispwhid: 1
@@ -139,7 +143,6 @@ Page({
var th = this;
var item = null;
var openindstore = th.data.open_ind_store;
-
if (th.data.choice_sort_store == 0) {
var index = th.data.fir_pick_index;
if (th.data.is_show_sto_cat == 1) {
@@ -156,6 +159,7 @@ Page({
console.log("选择门店刷新", "def_pick_store", item);
th.setData({
def_pick_store: item,
+ stoname: item.pickup_name,
sto_sele_name: item.pickup_name,
sto_sele_id: item.pickup_id,
sto_sele_distr: item.distr_type,
@@ -173,14 +177,12 @@ Page({
th.setData({
openSpecModal: !0,
openSpecModal_ind: openindstore,
-
openSpecModal_pt: 1
});
}
},
choose_for_store_fir: function(e) {
var index_c = e.currentTarget.dataset.ind;
-
this.setData({
fir_pick_index: index_c
})
@@ -202,13 +204,11 @@ Page({
if (th.data.is_gps == 0) {
getApp().confirmBox("请开启GPS定位", null, 10000, !1);
}
-
} else {
th.setData({
is_gps: "3"
});
}
-
th.data.is_get_local_ok = 1;
}
})
@@ -502,10 +502,57 @@ Page({
},
//------初始化加载----------
onLoad: function(t) {
- var th = this;
- th.setData({
- isGender:th.data.user.sex
- })//设置性别
+ this.puls_user();
+ this.equity_user();
+ this.initial_user();
+ },
+ //-----------会员是否初始化---------------------
+ initial_user: function () {
+
+ var th = this;
+ getApp().request.get("/api/weshop/users/grade/vip/init/get", {
+ data: {
+ storeId: r.stoid,
+ },
+ success: function (su) {
+ var isBool = su.data.data.isBool;
+ console.log("会员是否初始化", isBool);
+ th.setData({isBool:isBool});
+ }
+ });
+ },
+ //-----会员等级卡获取---------------
+ equity_user:function(){
+ var th = this;
+ getApp().request.get("/api/weshop/users/grade/aftervipinfo/get", {
+ data: {
+ storeId: r.stoid,
+ userId: getApp().globalData.user_id,
+ },
+ success: function (su) {
+ var gradename=su.data.data.GradeName;
+ th.setData({gradename: gradename});
+
+ }
+ });
+ },
+
+ //-----Plus会员获取-----------
+ puls_user:function(){
+ var th=this;
+ getApp().request.get("/api/weshop/plus/vip/mem/list", {
+ data: {
+ storeId: r.stoid,
+ userId: getApp().globalData.user_id, },
+ success: function (su) {
+
+ if (su.data.code == 0) {
+ var cardname=su.data.data[0].MemCardName;
+ console.log("卡的名字", cardname);
+ th.setData({pulscardname:cardname});
+ }
+ }
+ });
},
onShow: function() {
@@ -522,8 +569,7 @@ Page({
if (a.pickup_id!=null) {
req.get("/api/weshop/pickup/get/" + r.stoid + "/" + a.pickup_id, {
success: function(da) {
- console.log('getsto');
- console.log(da);
+
//设置门店
e.setData({
stoname: da.data.data.pickup_name
@@ -531,13 +577,18 @@ Page({
}
})
}
- var phone = "";
- phone+=a.mobile.substr(0, 3)+"****";
- phone += a.mobile.substr(7, 12);
+ // var phone = "";
+ // phone+=a.mobile.substr(0, 3)+"****";
+ // phone += a.mobile.substr(7, 12);
+
+
e.setData({
- phone:phone,
- user: a
+ phone: a.mobile,
+ user: a,
+ openid: a.openid,
+ consumption: a.paypwd,
});
+
e.setData({
isGender:e.data.user.sex
})
@@ -585,4 +636,118 @@ Page({
tc_hide: true,
});
},
+ //消费密码输入框失去焦点事件
+ lose_focus:function(e){
+ var th=this;
+ var val=e.detail.value;
+ console.log("是什么东西",val);
+ if (val.length > 6 || val!=""){
+
+ this.setData({ consumption: val });
+ }
+
+
+ },
+
+//地址
+ address:function(e){
+ var val = e.detail;
+ console.log("地址55555555", val.value);
+ this.setData({ address: val.value });
+ },
+
+ //身份证验证
+ identity_card:function(e){
+ var val = e.detail;
+
+ this.setData({ identity_card: val.value });
+
+ },
+ //用户名字
+ user_name:function(e){
+ var name = e.detail.value;
+ if (name !=""||name!=null){
+
+ this.setData({ user_name: name });
+
+ }
+
+ },
+
+ //点击确认修改信息
+ confirm_revision:function(){
+ var th=this;
+ var phone=th.data.phone;//手机号码
+ if (phone == "" || phone==null){
+ getApp().my_warnning("手机不能为空", 0, th);
+
+ return false;
+ }
+ var consumption = th.data.consumption;//消费密码
+ var isstcsp = th.data.isstcsp;
+ if(isstcsp==1){
+ if (consumption.length < 6 && consumption==""){
+ getApp().my_warnning("消费密码不能为空及小于6位数", 0, th);
+ return false;
+ }
+ }
+ var sex = th.data.isGender;//性别
+ console.log(sex,"性别");
+ if (sex!="1"&&sex!="2" ) {
+ getApp().my_warnning("请选择性别", 0, th);
+ return false;
+ }
+ var user_name = th.data.user.vipname;//用户姓名
+ if (user_name == ""&& user_name!= null) {
+ getApp().my_warnning("请输入名字", 0, th);
+ return false;
+ }
+ var identity_card = th.data.identity_card;//身份证
+ console.log("身份证",identity_card);
+
+ if (identity_card == "" && identity_card != null ) {
+ getApp().my_warnning("请输入身份证", 0, th);
+ return false;
+ } else if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(identity_card))){
+ getApp().my_warnning("身份证号码错误",0, th);
+ return false;
+ }
+ var address = th.data.address;//地址
+ console.log("地址1010101", address)
+ if (address == "" && address != null) {
+ getApp().my_warnning("请输入地址", 0, th);
+ return false;
+ }
+ //保存所属门店的id
+ var sto_sele_id=th.data.sto_sele_id;
+ console.log("请输入所属门店的id", sto_sele_id);
+ if (sto_sele_id == null && sto_sele_id==""){
+ getApp().my_warnning("请输入所属门店", 0, th);
+ }
+ console.log("要保存的数据", sex, consumption, identity_card, address, user_name);
+ var datas = {
+ mobile: phone,//手机号码
+ store_id: r.stoid,
+ user_id: getApp().globalData.user_id,
+ openid: th.data.openid,
+ paypwd: consumption,//消费密码
+ sex: sex,//性别
+ nickname:user_name,//昵称
+ idcard:identity_card,//身份证
+ address:address,
+ }
+ getApp().request.put("/api/weshop/users/update", {
+ data: datas,
+ success: function (res) {
+
+ if (res.data.code==0){
+ getApp().showWarning("修改成功");
+ }else{
+ getApp().showWarning("修改失败");
+ }
+
+ }
+ })
+ }
+
});
\ No newline at end of file
diff --git a/pages/user/userinfo/userinfo.json b/pages/user/userinfo/userinfo.json
index 2f245ea..9a57847 100644
--- a/pages/user/userinfo/userinfo.json
+++ b/pages/user/userinfo/userinfo.json
@@ -1,4 +1,7 @@
{
"navigationBarTitleText": "个人资料",
- "enablePullDownRefresh": false
+ "enablePullDownRefresh": false,
+ "usingComponents": {
+ "warn": "/components/long_warn/long_warn"
+ }
}
\ No newline at end of file
diff --git a/pages/user/userinfo/userinfo.wxml b/pages/user/userinfo/userinfo.wxml
index 8689b6b..f4e72c7 100644
--- a/pages/user/userinfo/userinfo.wxml
+++ b/pages/user/userinfo/userinfo.wxml
@@ -3,7 +3,7 @@
-
+
@@ -16,18 +16,22 @@
+
- 黑卡会员
+ {{gradename}}
+
+
- PULS会员
+ {{pulscardname}}
+
@@ -67,46 +71,37 @@
消费密码
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
性别
-
-
+
+
-
+
男
-
+
@@ -116,16 +111,14 @@
女
- 保密
+
出生日期
-
-
-
+
@@ -139,10 +132,15 @@
+
+
+
+
{{datet==""?user.birthday:datet}}
-
+
+
@@ -150,17 +148,18 @@
姓名
-
+
身份证
-
- {{user.idcard}}
-
-
+
+
+
+
+
更换手机
@@ -175,14 +174,16 @@
{{user.address}}
-
+
所属门店
- {{def_pick_store.pickup_name}}
+ {{stoname}}
+
+
∟
@@ -190,7 +191,7 @@
收货地址
- {{user.address_id}}
+
∟
@@ -202,7 +203,7 @@
-
+
确认修改
@@ -368,4 +369,5 @@
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/pages/user/userinfo/userinfo.wxss b/pages/user/userinfo/userinfo.wxss
index f87c6ff..9826737 100644
--- a/pages/user/userinfo/userinfo.wxss
+++ b/pages/user/userinfo/userinfo.wxss
@@ -2,7 +2,7 @@
padding-bottom:165rpx;
}
.user-container {
- font-size: 30rpx;
+ font-size: 30rpx;
}
input{
width: 450rpx;
@@ -32,11 +32,14 @@ input{
.AncrownMax {
background-color: rgb(57, 57, 57);
- width: 150rpx;
+
height: 36rpx;
border-radius: 20rpx;
margin-right: 20rpx;
line-height: 36rpx;
+ padding-right: 14rpx;
+padding-left: 10rpx;
+
}
.Nickname{
max-width:170rpx;
@@ -49,10 +52,12 @@ input{
.plusMax {
background-color: rgb(212, 58, 30);
- width: 150rpx;
height: 36rpx;
border-radius: 20rpx;
line-height: 36rpx;
+ padding-left: 10rpx;
+padding-right: 14rpx;
+
}
.fuls {
@@ -118,7 +123,8 @@ input{
}
.hion {
- width:85rpx;
+ width: 97%;
+text-align: right;
margin-top: 3rpx;
margin-right: 5rpx;
}