diff --git a/pages/family/family.js b/pages/family/family.js
index f11e2cc..9a6d0d5 100644
--- a/pages/family/family.js
+++ b/pages/family/family.js
@@ -10,6 +10,7 @@ Page({
*/
data: {
"sexArr":["男","女"],
+ "sexShow":false,
"sex": "0",
"name": "",
"link": "",
@@ -17,14 +18,25 @@ Page({
"ownerId": "",
"userId": "",
"ownerTypeCd": "1002",
+ "idCard":"",
"age": "",
- "memberId": ""
+ "memberId": "-1",
+ "communityId":"",
+ "remark":''
},
/**
* 生命周期函数--监听页面加载
*/
- onLoad: function(options) {},
+ onLoad: function(options) {
+ let _that = this;
+ context.getOwner(function(_owner){
+ _that.setData({
+ ownerId: _owner.memberId,
+ communityId: _owner.communityId
+ });
+ });
+ },
/**
* 生命周期函数--监听页面初次渲染完成
@@ -60,34 +72,17 @@ Page({
onPullDownRefresh: function() {
},
-
-
- bindSexChange: function(e) {
- this.setData({
- sex: e.detail.value
- })
+ bindInput: function (e) {
+ console.log('数据监听', e);
+ let _that = this;
+ let dataset = e.currentTarget.dataset;
+ let value = e.detail;
+ let name = dataset.name;
+ _that.data[name] = value;
+ console.log(this.data);
},
- bindOwnerId: function(e) {
- this.setData({
- ownerId: e.detail.value
- })
- },
- bindName: function(e) {
- this.setData({
- name: e.detail.value
- })
- },
- bindAge: function(e) {
- this.setData({
- age: e.detail.value
- })
- },
- bindRemark: function(e) {
- this.setData({
- remark: e.detail.value
- })
- },
- submitRepair: function(e) {
+ submitOwnerMember: function(e) {
+ console.log('请求信息',e);
let obj = {
"sex": this.data.sex,
"name": this.data.name,
@@ -97,7 +92,9 @@ Page({
"userId": this.data.userId,
"ownerTypeCd": this.data.ownerTypeCd,
"age": this.data.age,
- "memberId": this.data.memberId
+ "memberId": this.data.memberId,
+ "communityId":this.data.communityId,
+ "idCard":this.data.idCard
}
let msg = "";
if (obj.ownerId == "") {
@@ -108,6 +105,8 @@ Page({
msg = "请填写性别";
} else if (obj.age == "") {
msg = "请填写年龄";
+ } else if(obj.idCard == ""){
+ msg = "请填写身份证";
}
if (msg != "") {
wx.showToast({
@@ -116,28 +115,60 @@ Page({
duration: 2000
})
} else {
+ wx.showLoading({
+ title: '提交中',
+ });
console.log("提交数据", obj);
wx.request({
- url: constant.url.saveOwner, // http://hc.demo.winqi.cn:8012/appApi/ownerRepair.saveOwnerRepair
+ url: constant.url.saveOwner,
header: context.getHeaders(),
method: "POST",
- data: {
- "sex": "1",
- "name": "1",
- "link": "1",
- "remark": "1",
- "ownerId": "1",
- "userId": "1",
- "ownerTypeCd": "1002",
- "age": "11",
- "memberId": "1"
- },
+ data: obj,
// data:obj, //动态数据
success: function(res) {
console.log(res, 99999);
+
+ if (res.statusCode == 200) {
+ wx.hideLoading();
+ wx.navigateBack();
+ return;
+ }
+
+ wx.hideLoading();
+ wx.showToast({
+ title: res.data,
+ icon: 'none',
+ duration: 2000
+ });
+ },
+ fail: function (e) {
+ wx.hideLoading();
+ wx.showToast({
+ title: "服务器异常了",
+ icon: 'none',
+ duration: 2000
+ })
}
});
}
+ },
+
+ onConfirm: function (e) {
+ let _sex = e.detail.index;
+ this.setData({
+ sex:_sex,
+ sexShow: false
+ });
+ },
+ chooseSex: function (e) {
+ this.setData({
+ sexShow: true
+ });
+ },
+ onCancel: function (e) {
+ this.setData({
+ sexShow: false
+ });
}
})
\ No newline at end of file
diff --git a/pages/family/family.json b/pages/family/family.json
index 9e26dfe..2fed966 100644
--- a/pages/family/family.json
+++ b/pages/family/family.json
@@ -1 +1,4 @@
-{}
\ No newline at end of file
+{
+ "enablePullDownRefresh": true,
+ "navigationBarTitleText": "添加成员"
+}
\ No newline at end of file
diff --git a/pages/family/family.wxml b/pages/family/family.wxml
index 9a09579..9be7d62 100644
--- a/pages/family/family.wxml
+++ b/pages/family/family.wxml
@@ -1,99 +1,32 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 基本信息
+
+
+
+
+
+
+ 联系信息
+
+
+
+ 发送验证码
+
+
+
+
-
-
-
-
-
+
+
+
-
-
- {{sexArr[sex]}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ 提交
\ No newline at end of file
diff --git a/pages/family/family.wxss b/pages/family/family.wxss
index d8b27ce..d97de70 100644
--- a/pages/family/family.wxss
+++ b/pages/family/family.wxss
@@ -1,17 +1,11 @@
-.user-container {
- padding: 25rpx 10rpx;
- background-color: #F0F0F0;
- /*border: 1px solid black;*/
+.block__title {
+ margin: 0;
+ font-weight: 400;
+ font-size: 14px;
+ color: rgba(69,90,100,.6);
+ padding: 40rpx 30rpx 20rpx;
}
-.form{
- background-color: #fff;
- margin: 10rpx 7rpx;
-}
-.repair_textarea{
- width: 100%;
- height: 150rpx;
-}
-.repair_image{
- width: 150rpx;
- height: 150rpx;
+
+.button_up_blank{
+ height: 40rpx;
}
\ No newline at end of file
diff --git a/pages/familyList/familyList.js b/pages/familyList/familyList.js
index e9e21bb..59cd59d 100644
--- a/pages/familyList/familyList.js
+++ b/pages/familyList/familyList.js
@@ -4,43 +4,58 @@ const constant = context.constant;
Page({
data: {
- tableData: [],
+ owners: [],
page: 1,
totalPage: 0,
- loading: false
+ loading: false,
+ communityId:'',
+ ownerId:''
},
onLoad: function() {
let that = this;
- context.getOwner(function(_owner) {
- console.log(_owner.communityId,99999999);
+ },
+
+ onShow: function () {
+ let that = this;
+ context.getOwner(function (_owner) {
+ console.log(_owner.communityId, 99999999);
that.setData({
communityId: _owner.communityId,
ownerId: _owner.memberId
})
that.getTable(1);
- })
- },
-
- onShow: function () {
- let that = this;
+ });
},
getTable: function (page, override) {
let that = this;
this.setData({
loading: true
- })
- return this.request({
- "ownerId": that.data.communityId,
- "communityId": that.data.ownerId
- // "page": page,
- // "row": 10
- }).then(res => {
- that.setData({
- tableData: override ? res.data.ownerRepairs : this.data.tableData.concat(res.data.ownerRepairs),
- totalPage: res.data.records,
- page: page,
- loading: false
- })
+ });
+ let _paramIn = {
+ "communityId": that.data.communityId,
+ "ownerId": that.data.ownerId
+ };
+ context.request({
+ url: constant.url.queryOwnerMembers,
+ header: context.getHeaders(),
+ method: "GET",
+ data: _paramIn,
+ success: function (res) {
+ if (res.statusCode == 200) {
+ let _owners = res.data.owners;
+ that.setData({
+ owners : _owners,
+ loading: false
+ })
+ }
+ },
+ fail:function(e){
+ wx.showToast({
+ title: "服务器异常了",
+ icon: 'none',
+ duration: 2000
+ })
+ }
})
},
goAdd: function (e) {
@@ -69,21 +84,5 @@ Page({
if (!this.data.loading && this.data.page < this.data.totalPage) {
this.getTable(this.data.page + 1)
}
- },
- //封装请求
- request: function (data) {
- return new Promise((resolve, reject) => {
- wx.request({
- url: constant.url.queryOwnerMembers,
- header: context.getHeaders(),
- method: "POST",
- data: data,
- success: function (res) {
- if (res.statusCode == 200) {
- resolve(res);
- }
- }
- })
- })
- },
+ }
})
\ No newline at end of file
diff --git a/pages/familyList/familyList.json b/pages/familyList/familyList.json
index 331ad4f..0a621be 100644
--- a/pages/familyList/familyList.json
+++ b/pages/familyList/familyList.json
@@ -1,3 +1,4 @@
{
- "enablePullDownRefresh": true
+ "enablePullDownRefresh": true,
+ "navigationBarTitleText": "家庭成员"
}
\ No newline at end of file
diff --git a/pages/familyList/familyList.wxml b/pages/familyList/familyList.wxml
index a0e0230..3c42ac5 100644
--- a/pages/familyList/familyList.wxml
+++ b/pages/familyList/familyList.wxml
@@ -1,22 +1,35 @@
-
-
-
-
-
- {{item.repairName}}
- {{item.appointmentTime}}
-
-
-
- 性别: {{item.repairTypeName}}
- 年龄: {{item.stateName}}
- 电话: {{item.tel}}
+ 成员信息
+
+
+
+
+ 成员编号:
+ {{item.memberId}}
+
+
+ 身份证号:
+ {{item.idCard}}
+
+
+ 成员年龄:
+ {{item.age}}岁
+
+
+ 成员性别:
+ {{item.sex == 0? '男': '女'}}
+
-
-
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/familyList/familyList.wxss b/pages/familyList/familyList.wxss
index a151110..f6ad4cd 100644
--- a/pages/familyList/familyList.wxss
+++ b/pages/familyList/familyList.wxss
@@ -1,34 +1,40 @@
-.user-container {
- padding: 25rpx 10rpx;
- background-color: #F0F0F0;
+.ppfl_footer{
+ text-align: right;
+}
+.ppfl_footer .ppfl_footer_his{
+ margin-right: 20rpx;
+}
- /*border: 1px solid black;*/
+.ppfl_c{
+ padding: 0rpx 20rpx 20rpx 20rpx;
}
-.add_button{
+
+.block__title {
+ margin: 0;
+ font-weight: 400;
+ font-size: 14px;
+ color: rgba(69,90,100,.6);
+ padding: 40rpx 30rpx 20rpx;
}
-.notice {
- margin: 10rpx 7rpx;
- padding: 25rpx;
- background-color: #ffffff;
- border-radius: 7rpx;
- /* display: flex;
- justify-content: space-between;
- align-items: flex-end; */
+
+.ppfl_context{
+ padding: 20rpx 40rpx 40rpx 40rpx;
+ font-size: 28rpx;
+ color: #8a8a8a;
}
-.title {
- border-bottom: 1rpx solid #dedede;
- font-weight: 700;
- font-size: 34rpx;
- color: #5f5e5e;
- display: flex;
- justify-content: space-between;
+
+.ppfl_context .ppfl_context_row{
+ margin-top: 30rpx;
}
-.text{
- padding: 4rpx 0;
- font-size: 30rpx;
+
+
+.button_up_blank{
+ height: 40rpx;
}
-.main{
- display: flex;
- justify-content: space-between;
- align-items: flex-end;
+
+.block__bottom{
+ height: 160rpx;
}
+.van-submit-bar__tip{
+ background-color: #e8e8e8;
+}
\ No newline at end of file