作者 朱振飞

优化保单新增及修改部分

... ... @@ -4,7 +4,7 @@ App({
post: function(url, data) {
wx.showNavigationBarLoading()
wx.showLoading({
title: '',
title: '加载中',
})
var promise = new Promise((resolve, reject) => {
let that = this;
... ... @@ -19,12 +19,10 @@ App({
},
success: function(res) {
resolve(res)
setTimeout(function() {
wx.hideLoading()
}, 600)
wx.hideLoading()
wx.hideNavigationBarLoading()
},
error: function(e) {
fail: function(e) {
reject('');
wx.hideLoading()
wx.hideNavigationBarLoading()
... ... @@ -36,7 +34,6 @@ App({
}
})
});
wx.hideLoading()
return promise;
console.log(promise)
},
... ...
... ... @@ -7,9 +7,8 @@ Page({
*/
data: {
currentTab: 2,
Status: '',
KeyWord: '',
list: '',
Status:'',
KeyWord:'',
mainid: '',
vip_state: false
},
... ... @@ -41,56 +40,21 @@ Page({
let url = 'counselor/familylist';
let param = {
UserId: app.globalData.UserId,
Status: that.data.currentTab,
Status: this.data.currentTab,
KeyWord: that.data.KeyWord
}
console.log(param)
app.post(url, param).then((res) => {
console.log(res)
if (res.data.code == 200) {
let data = res.data;
console.log(data.code)
console.log(res.data.data.list)
if (data.code == 200) {
console.log(1)
console.log(data.data.list)
that.setData({
list: res.data.data.list,
// cid: res.data.data.list[0].users[0].cid,
KeyWord: '',
// vip_state: true
list: data.data.list
})
// if (res.data.data.type == '-13') {
// wx.showToast({
// title: '会员到期,请充值',
// icon: 'none'
// }, 2000)
// that.setData({
// vip_state: false
// })
// } else if (res.data.data.type == '-12') {
// wx.showToast({
// title: '您已经被禁用,请联系管理员',
// icon: 'none'
// }, 2000)
// that.setData({
// vip_state: false
// })
// } else if (res.data.data.type == '-11') {
// wx.showToast({
// title: '您的权限不足',
// icon: 'none'
// }, 2000)
// that.setData({
// vip_state: false
// })
// } else if (res.data.data.type == '1') {
// that.setData({
// list: res.data.data.list,
// // cid: res.data.data.list[0].users[0].cid,
// KeyWord: '',
// // vip_state: true
// })
// if (res.data.data.list[0].users[0].cid != '') {
// that.setData({
// cid: res.data.data.list[0].users[0].cid,
// })
// }
// }
}
}).catch((errMsg) => {
// console.log(errMsg)
... ... @@ -106,7 +70,6 @@ Page({
UserId: app.globalData.UserId,
}
app.post(url, param).then((res) => {
console.log(res, res.data.data.type)
if (res.data.code == 200) {
if (res.data.data.type == 5) {
wx.showToast({
... ... @@ -126,15 +89,8 @@ Page({
})
} else{
that.setData({
list: res.data.data.list,
KeyWord: '',
vip_state: true
})
if (res.data.data.list[0].users[0].cid != '') {
that.setData({
cid: res.data.data.list[0].users[0].cid,
})
}
}
}
}).catch((errMsg) => {
... ... @@ -183,6 +139,7 @@ Page({
wx.navigateTo({
url: '../addNewFamily/addNewFamily?flag=' + flag,
})
wx.setStorageSync('familyid', '')
},
//管理成员
... ... @@ -191,14 +148,15 @@ Page({
wx.navigateTo({
url: '../addNewFamily/addNewFamily?familyid=' + familyid,
})
wx.setStorageSync('familyid', familyid)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getdata()
this.getInfo()
// this.getdata()
},
/**
... ...
... ... @@ -257,7 +257,7 @@ Page({
console.log(list.sex, list.sex == '')
if (list.name == "") {
warn = "请填写您的姓名";
} else if (list.sex !=0 && list.sex!=1) {
} else if (!list.sex) {
warn = "请填写您的性别";
} else if (list.family_role == '') {
warn = '请填写您的家庭角色'
... ... @@ -292,9 +292,13 @@ Page({
wx.showToast({
title: '录入成功',
})
wx.navigateTo({
url: '/pages/index/addNewFamily/addNewFamily?familyid=' + res.data.data.family_id,
})
wx.setStorageSync('familyid', res.data.data.family_id)
setTimeout(()=>{
wx.navigateBack()
},1500)
// wx.navigateTo({
// url: '/pages/index/addNewFamily/addNewFamily?familyid=' + res.data.data.family_id,
// })
}
}).catch((errMsg) => {
console.log(errMsg)
... ... @@ -360,7 +364,6 @@ Page({
onLoad: function(options) {
this.labelInfo()
this.setData({
DefId: options.DefId,
familyid: options.familyid
})
if (options.DefId == undefined) {
... ...
... ... @@ -40,7 +40,7 @@
<view class='item_list'>
<view class='list_title'>手机号 </view>
<view class='list_input'>
<input type='text' placeholder='请输入手机号' value='{{list.mobile}}' bindinput='setMobile'></input>
<input type='number' placeholder='请输入手机号' value='{{list.mobile}}' bindinput='setMobile'></input>
</view>
</view>
... ... @@ -101,7 +101,7 @@
<!-- 上传图片 -->
<view class='upload_box'>
<view class='popup_img' wx:if='{{hasimg}}' bindtap='chooseImg'>
<image src='{{list.picurl}}' bindtap='viewImg'></image>
<image src='{{list.picurl}}' bindtap='viewImg' mode='WidthFix'></image>
</view>
<view bindtap='chooseImg' wx:else>
<view class='iconfont icon-add'></view>
... ... @@ -128,7 +128,6 @@
</view>
</view>
</view>
<!-- 底部按钮 -->
<view class='null_box'></view>
<view class='bottom_box'>
... ...
... ... @@ -227,3 +227,6 @@ page {
color: #fff;
background: rgba(2, 134, 255, 1);
}
.popup_img image{
width: 100%
}
... ...
// pages/addListDetail/addListDetail.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
... ... @@ -255,7 +254,6 @@ Page({
if (projectlist[index].choose_status) {
projectlist[index].num = e.detail.value
}
console.log(main_risk)
this.setData({
projectlist: projectlist
})
... ... @@ -837,11 +835,11 @@ Page({
},
//家庭成员
familyMember() {
familyMember(id) {
var FamilyId = this.data.FamilyId
let url = 'counselor/familyname'
let params = {
FamilyId: FamilyId,
FamilyId: FamilyId||id,
}
app.post(url, params).then((res) => {
// console.log(res)
... ... @@ -1150,10 +1148,10 @@ Page({
//获取编辑保单接口
getlistVerify() {
getlistVerify(id) {
let url = 'counselor/infordef'
let params = {
InfoId: this.data.inforid,
InfoId: this.data.inforid||id,
}
app.post(url, params).then((res) => {
if (res.data.code == 200) {
... ... @@ -1228,24 +1226,37 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.ensureProjectList()
this.setData({
def_id: options.def_id,
let that = this;
// this.setData({
// def_id: options.def_id,
// inforid: options.inforid,
// FamilyId: options.FamilyId,
// recognizee_name: options.name
// })
// if (options.inforid == undefined) {
// this.setData({
// inforid: 0
// })
// }
options.inforid ? (that.getlistVerify(options.inforid),that.setData({
inforid: options.inforid,
FamilyId: options.FamilyId,
recognizee_name: options.name
})
if (options.inforid == undefined) {
this.setData({
inforid: 0
})
}
if (options.FamilyId != '') {
this.familyMember()
}
if (options.inforid != undefined) {
this.getlistVerify()
}
edit_state: true
})): ""
options.def_id ? that.setData({
def_id: options.def_id,
}) : ""
options.FamilyId ? (that.familyMember(options.FamilyId),that.setData({
FamilyId: options.FamilyId
})):'';
// if (options.FamilyId != '') {
// this.familyMember()
// }
// if (options.inforid != undefined) {
// this.getlistVerify()
// }
if (wx.getStorageSync('storge_state') && options.inforid == undefined) {
this.getStorage()
... ...
... ... @@ -54,9 +54,9 @@
<view class='list_title'>被保险人</view>
<view class='list_input'>
<!-- bindchange='recognizeeSelect' -->
<view class='picker' range='{{recognizee}}' value='{{recognizeeindex}}'>
<picker class='picker' range='{{recognizee}}' value='{{recognizeeindex}}' bindchange='recognizeeSelect'>
<input placeholder='请选择' value='{{recognizee_name}}' disabled='true'></input>
</view>
</picker>
</view>
</view>
<view>
... ...
... ... @@ -54,7 +54,7 @@ Page({
let that = this;
let url = 'counselor/family';
app.post(url, {
FamilyId: this.data.familyid
FamilyId: this.data.familyid || wx.getStorageSync('familyid')
}).then((res) => {
console.log(res)
if (res.data.code == 200) {
... ... @@ -175,13 +175,12 @@ Page({
onLoad: function(options) {
console.log(options.familyid)
let that = this;
that.setData({
flag: options.flag,
options.flag ? that.setData({
flag: options.flag
}) : ""
options.familyid ? (that.setData({
familyid: options.familyid
})
if (options.familyid != '') {
that.getdata()
}
}) && that.getdata() && wx.setStorageSync('familyid', options.familyid)):""
},
/**
... ... @@ -195,9 +194,9 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
if (this.data.familyid != '') {
this.getdata()
}
let familyid = wx.getStorageSync('familyid');
console.log(familyid)
familyid ? this.getdata():console.log(2)
},
/**
... ...
... ... @@ -22,11 +22,16 @@
</view>
</block>
<block wx:else>
<view class='add_btn_box'>
<view class='add_btn' bindtap='addPerson' wx:if="{{user_list.length<1}}">
<view class='iconfont icon-tianjia '></view>
<view>添加成员</view>
</view>
<view class='add_btn_box' wx:else>
<view class='' bindtap='addPerson'>
<view class='iconfont icon-tianjia '></view>
<view>添加成员</view>
</view>
<view class='' bindtap='setDel' wx:if='{{del_icon}}'>
<view class='iconfont icon-bianji '></view>
<view>删除</view>
... ...
... ... @@ -170,15 +170,13 @@ Page({
})
} else {
that.setData({
list: res.data.data.list,
KeyWord: '',
vip_state: true
})
if (res.data.data.list[0].users[0].cid != '') {
that.setData({
cid: res.data.data.list[0].users[0].cid,
})
}
// if (res.data.data.list[0].users[0].cid != '') {
// that.setData({
// cid: res.data.data.list[0].users[0].cid,
// })
// }
}
}
}).catch((errMsg) => {
... ...
... ... @@ -376,10 +376,10 @@ Page({
onLoad: function(options) {
this.getcompany();
this.getjobTitle();
this.setData({
options.sharetext ? this.setData({
sharetext: options.sharetext,
})
}):''
if (options.sharetext != undefined) {
this.signType()
... ...
... ... @@ -38,7 +38,7 @@
</view>
<view class='item_list'>
<view class='list_title'>职业名称</view>
<view class='list_input' bindtap='chargePicker'>
<view class='list_input'>
<picker class='list_picker' value='{{titleindex}}' range='{{jobTitle_array}}' bindchange="jobTitle">
<input placeholder='请选择当前职位' value='{{jobTitle_array[titleindex]}}' disabled='true' placeholder-class='pl_style'></input>
<view class='iconfont icon-xiala'></view>
... ...
... ... @@ -35,10 +35,10 @@ Page({
app.globalData.UserStatus = res.data.data.UserStatus; //用户状态(1初次登录,2多次登录)"
app.globalData.UserType = res.data.data.UserType; //用户类型(2为普通会员,3为顾问,4为推广)
app.globalData.checkstatus = res.data.data.checkstatus; //分享参数(0无,1保单,2注册,3文章)
that.setData({
res.data.data.PublishId ? that.setData({
PublishId: res.data.data.PublishId
})
console.log(that.data.PublishId)
}):''
if (res.data.data.UserType == 4) {
app.globalData.temp_UserType = 3
}
... ...