mirror of
https://gitee.com/java110/WechatOwnerService.git
synced 2026-02-26 16:19:45 +08:00
Merge branch 'master' of https://github.com/java110/WechatOwnerService
This commit is contained in:
commit
bf715dac13
@ -9,8 +9,9 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
"sexArr":["男","女"],
|
||||
"sex": "0",
|
||||
"columns":["男","女"],
|
||||
"sex": "",
|
||||
sexValue:"",
|
||||
"name": "",
|
||||
"link": "",
|
||||
"remark": "",
|
||||
@ -18,13 +19,26 @@ Page({
|
||||
"userId": "",
|
||||
"ownerTypeCd": "1002",
|
||||
"age": "",
|
||||
"memberId": ""
|
||||
"memberId": -1,
|
||||
communityId:"",
|
||||
idCard:"",
|
||||
sexShow: false
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {},
|
||||
onLoad: function(options) {
|
||||
let that = this;
|
||||
context.getOwner(function (_owner) {
|
||||
console.log(_owner);
|
||||
that.setData({
|
||||
ownerId: _owner.memberId,
|
||||
userId: _owner.memberId,
|
||||
communityId: _owner.communityId
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
@ -61,33 +75,39 @@ Page({
|
||||
|
||||
},
|
||||
|
||||
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;
|
||||
// _that.setData({
|
||||
// name: value
|
||||
// });
|
||||
console.log(this.data);
|
||||
},
|
||||
|
||||
bindSexChange: function(e) {
|
||||
onSexConfirm: function (e) {
|
||||
console.log("onConfirm", e);
|
||||
this.setData({
|
||||
sex: e.detail.value
|
||||
})
|
||||
sexValue: e.detail.value,
|
||||
sex: e.detail.index+'',
|
||||
sexShow: false
|
||||
});
|
||||
},
|
||||
bindOwnerId: function(e) {
|
||||
onSexCancel: function (e) {
|
||||
this.setData({
|
||||
ownerId: e.detail.value
|
||||
})
|
||||
sexShow: false
|
||||
});
|
||||
},
|
||||
bindName: function(e) {
|
||||
chooseSex: function (e) {
|
||||
this.setData({
|
||||
name: e.detail.value
|
||||
})
|
||||
sexShow: true
|
||||
});
|
||||
},
|
||||
bindAge: function(e) {
|
||||
this.setData({
|
||||
age: e.detail.value
|
||||
})
|
||||
},
|
||||
bindRemark: function(e) {
|
||||
this.setData({
|
||||
remark: e.detail.value
|
||||
})
|
||||
},
|
||||
submitRepair: function(e) {
|
||||
|
||||
submit: function(e) {
|
||||
let obj = {
|
||||
"sex": this.data.sex,
|
||||
"name": this.data.name,
|
||||
@ -97,17 +117,21 @@ 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 == "") {
|
||||
msg = "请填写业主";
|
||||
} else if (obj.name == "") {
|
||||
if (obj.name == "") {
|
||||
msg = "请填写姓名";
|
||||
} else if (obj.sex == "") {
|
||||
msg = "请填写性别";
|
||||
} else if (obj.idCard == "") {
|
||||
msg = "请填写身份证";
|
||||
} else if (obj.age == "") {
|
||||
msg = "请填写年龄";
|
||||
} else if (obj.link == "") {
|
||||
msg = "请填写电话";
|
||||
}
|
||||
if (msg != "") {
|
||||
wx.showToast({
|
||||
@ -121,20 +145,23 @@ Page({
|
||||
url: constant.url.saveOwner, // http://hc.demo.winqi.cn:8012/appApi/ownerRepair.saveOwnerRepair
|
||||
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: {
|
||||
// "sex": "1",
|
||||
// "name": "1",
|
||||
// "link": "1",
|
||||
// "remark": "1",
|
||||
// "ownerId": "1",
|
||||
// "userId": "1",
|
||||
// "ownerTypeCd": "1002",
|
||||
// "age": "11",
|
||||
// "memberId": "1"
|
||||
// },
|
||||
data:obj, //动态数据
|
||||
success: function(res) {
|
||||
console.log(res, 99999);
|
||||
if (res.statusCode == 200){
|
||||
wx.navigateBack()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,99 +1,18 @@
|
||||
<view class="page">
|
||||
<view class="weui-form">
|
||||
<view class="">
|
||||
<view class="weui-cells__group weui-cells__group_form">
|
||||
<view class="weui-cells weui-cells_after-title">
|
||||
|
||||
<view class="block__title">成员信息</view>
|
||||
<van-cell-group>
|
||||
<van-field value="{{ name }}" bindinput="bindInput" data-name="name" label="姓名" placeholder="请输入姓名" required />
|
||||
<van-field value="{{ sexValue }}" label="性别" placeholder="请选择性别" catchtap="chooseSex" required readonly icon="arrow" />
|
||||
<van-field value="{{ idCard }}" bindinput="bindInput" data-name="idCard" label="身份证" placeholder="请输入身份证" required />
|
||||
<van-field value="{{ age }}" bindinput="bindInput" data-name="age" type="number" label="年龄" placeholder="请输入年龄" required />
|
||||
<van-field value="{{ link }}" bindinput="bindInput" data-name="link" type="number" label="电话" placeholder="请输入电话" required />
|
||||
<van-field value="{{ remark }}" bindinput="bindInput" data-name="remark" label="备注" type="textarea" placeholder="请输入备注" autosize border="{{ false }}" />
|
||||
</van-cell-group>
|
||||
<view class="button_up_blank"></view>
|
||||
|
||||
<van-button type="primary" size="large" catchtap="submit">提交</van-button>
|
||||
|
||||
<view class="weui-cell">
|
||||
<view class="weui-cell__hd">
|
||||
<label class="weui-label">业
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text> 主
|
||||
</label>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
<input bindinput="bindOwnerId" class="weui-input" type="text" placeholder="请输入业主" value="{{ownerId}}" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="weui-cell">
|
||||
<view class="weui-cell__hd">
|
||||
<label class="weui-label">姓
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text> 名
|
||||
</label>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
<input bindinput="bindName" class="weui-input" type="text" placeholder="请输入姓名" value="{{name}}" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="weui-cell_select weui-cell ">
|
||||
<view class="weui-cell__hd ">
|
||||
<label class="weui-label" style="margin-left:64rpx">性
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text> 别</label>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
|
||||
<picker bindchange="bindSexChange" value="{{index}}" range="{{sexArr}}">
|
||||
<view class="weui-select" style="margin-left:-48rpx">
|
||||
{{sexArr[sex]}}
|
||||
</view>
|
||||
</picker>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="weui-cell">
|
||||
<view class="weui-cell__hd">
|
||||
<label class="weui-label">
|
||||
年
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text> 龄
|
||||
</label>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
<input bindinput="bindAge" class="weui-input" type="text" placeholder="请输入年龄" value="{{age}}" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="weui-cell">
|
||||
<view class="weui-cell__hd">
|
||||
<label class="weui-label">
|
||||
备<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text>
|
||||
<text decode="{{true}}"> </text> 注
|
||||
</label>
|
||||
</view>
|
||||
<view class="weui-cell__bd">
|
||||
<textarea bindblur="bindRemark" class="repair_textarea" value="{{remark}}" rows="3" placeholder="备注" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<button type="primary" catchtap="submitRepair">确认报修</button>
|
||||
</view>
|
||||
</view>
|
||||
<van-popup show="{{ sexShow }}" position="bottom" custom-style="height: 40%;">
|
||||
<van-picker show-toolbar title="" columns="{{ columns }}" bind:change="onChange" bind:cancel="onSexCancel" bind:confirm="onSexConfirm" />
|
||||
</van-popup>
|
||||
</view>
|
||||
@ -1,17 +1,28 @@
|
||||
.user-container {
|
||||
padding: 25rpx 10rpx;
|
||||
background-color: #F0F0F0;
|
||||
/*border: 1px solid black;*/
|
||||
@import '../../lib/common/index.wxss';
|
||||
|
||||
.block__title {
|
||||
margin: 0;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
color: rgba(69,90,100,.6);
|
||||
padding: 60rpx 30rpx 20rpx;
|
||||
}
|
||||
.form{
|
||||
background-color: #fff;
|
||||
margin: 10rpx 7rpx;
|
||||
|
||||
.button_up_blank{
|
||||
height: 40rpx;
|
||||
}
|
||||
.repair_textarea{
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
|
||||
.uploader-container{
|
||||
margin: 0 10px;
|
||||
}
|
||||
.repair_image{
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
}
|
||||
|
||||
.aku_photo_view{
|
||||
background-color: #FFF;
|
||||
padding: 40rpx 0 40rpx 40rpx;
|
||||
}
|
||||
|
||||
.aku_photo_view text{
|
||||
font-size: 30rpx;
|
||||
color: #8a8a8a
|
||||
}
|
||||
|
||||
|
||||
@ -7,45 +7,63 @@ Page({
|
||||
tableData: [],
|
||||
page: 1,
|
||||
totalPage: 0,
|
||||
loading: false
|
||||
loading: false,
|
||||
communityId: "",
|
||||
ownerId: ""
|
||||
},
|
||||
onLoad: function () {
|
||||
this.getTable(1);
|
||||
onLoad: function() {
|
||||
// let that = this;
|
||||
// context.getOwner(function(_owner) {
|
||||
// console.log(_owner);
|
||||
// that.setData({
|
||||
// communityId: _owner.communityId,
|
||||
// ownerId: _owner.memberId
|
||||
// })
|
||||
// that.getTable(1);
|
||||
// })
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
onShow: function() {
|
||||
let that = this;
|
||||
context.getOwner(function (_owner) {
|
||||
console.log(_owner);
|
||||
that.setData({
|
||||
communityId: _owner.communityId,
|
||||
ownerId: _owner.memberId
|
||||
})
|
||||
that.getTable(1);
|
||||
})
|
||||
},
|
||||
getTable: function (page, override) {
|
||||
getTable: function(page, override) {
|
||||
let that = this;
|
||||
this.setData({
|
||||
loading: true
|
||||
})
|
||||
return this.request({
|
||||
"ownerId": "772019122036600002",
|
||||
"communityId": "702019120393220007",
|
||||
"ownerId": that.communityId,
|
||||
"communityId": that.ownerId
|
||||
// "page": page,
|
||||
// "row": 10
|
||||
}).then(res => {
|
||||
that.setData({
|
||||
tableData: override ? res.data.ownerRepairs : this.data.tableData.concat(res.data.ownerRepairs),
|
||||
tableData: override ? res.data.owners : this.data.tableData.concat(res.data.owners),
|
||||
totalPage: res.data.records,
|
||||
page: page,
|
||||
loading: false
|
||||
})
|
||||
})
|
||||
},
|
||||
goAdd: function (e) {
|
||||
},
|
||||
goAdd: function(e) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/family/family"
|
||||
})
|
||||
},
|
||||
gotoDetail: function (e) {
|
||||
gotoDetail: function(e) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/repairList/detail/detail?item=" + JSON.stringify(e.currentTarget.dataset.item)
|
||||
})
|
||||
},
|
||||
onPullDownRefresh: function () {
|
||||
onPullDownRefresh: function() {
|
||||
// 上拉刷新
|
||||
if (!this.data.loading) {
|
||||
this.getTable(1, true).then(() => {
|
||||
@ -54,8 +72,8 @@ Page({
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom: function () {
|
||||
console.log(1, !this.data.loading,this.data.page < this.data.totalPage);
|
||||
onReachBottom: function() {
|
||||
console.log(1, !this.data.loading, this.data.page < this.data.totalPage);
|
||||
// 下拉触底,先判断是否有请求正在进行中
|
||||
// 以及检查当前请求页数是不是小于数据总页数,如符合条件,则发送请求
|
||||
if (!this.data.loading && this.data.page < this.data.totalPage) {
|
||||
@ -63,14 +81,14 @@ Page({
|
||||
}
|
||||
},
|
||||
//封装请求
|
||||
request: function (data) {
|
||||
request: function(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.request({
|
||||
url: constant.url.queryOwnerMembers,
|
||||
header: context.getHeaders(),
|
||||
method: "POST",
|
||||
method: "GET",
|
||||
data: data,
|
||||
success: function (res) {
|
||||
success: function(res) {
|
||||
if (res.statusCode == 200) {
|
||||
resolve(res);
|
||||
}
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
<view class="user-container">
|
||||
<view class="add_button">
|
||||
<button size="mini" type="primary" catchtap="goAdd" data-item="{{item}}">+ 添加</button>
|
||||
</view>
|
||||
|
||||
<view wx:for="{{tableData}}" wx:for-index="idx" wx:for-item="item" class="notice" data-item="{{item}}" bindtap="gotoDetail">
|
||||
<view class="title">
|
||||
<view>{{item.repairName}}</view>
|
||||
@ -19,4 +17,5 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<van-button class="add_button" type="primary" size="large" catchtap="goAdd">添加</van-button>
|
||||
@ -2,18 +2,17 @@
|
||||
padding: 25rpx 10rpx;
|
||||
background-color: #F0F0F0;
|
||||
|
||||
/*border: 1px solid black;*/
|
||||
}
|
||||
.add_button{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
.notice {
|
||||
margin: 10rpx 7rpx;
|
||||
padding: 25rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 7rpx;
|
||||
/* display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end; */
|
||||
}
|
||||
.title {
|
||||
border-bottom: 1rpx solid #dedede;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user