Commit 3d27eabf authored by 石盼盼's avatar 石盼盼

意向区域bug跟联系客服修改

parent 0b436f5f
......@@ -30,7 +30,7 @@ Page({
})
this.getMyarea()
this.getCitylist()
},
getMyarea: function () {
let params = {
......@@ -40,15 +40,19 @@ Page({
},
callback: (data) => {
var arr = []
for(var i in data.area){
for (var i in data.area) {
let option = {
id: data.area[i] !=null && data.area[i].id ? data.area[i].id: '',
name: data.area[i] !=null && data.area[i].name ? data.area[i].name: '',
id: data.area[i] != null && data.area[i].id ? data.area[i].id : '',
name: data.area[i] != null && data.area[i].name ? data.area[i].name : '',
}
arr.push(option)
}
this.setData({
currentArea: arr
currentArea: arr,
cityChecked: data.city != null && data.city.city_name != '' ? data.city.city_name : '',
city: data.city != null && data.city.city_name != '' ? data.city.city_name : '',
region_id: data.city != null && data.city.region_id != '' ? data.city.region_id : '',
city_id: data.city != null && data.city.city_id != '' ? data.city.id : '',
})
console.log(this.data.currentArea)
}
......@@ -62,17 +66,20 @@ Page({
this.setData({
cityList: data
})
for (let i = 0; i < data.length; i++) {
if (data[i].is_default == 1) {
this.setData({
cityChecked: data[i].city_name,
city: data[i].city_name,
region_id: data[i].region_id,
city_id: data[i].id
})
if (this.data.city == '') {
for (let i = 0; i < data.length; i++) {
if (data[i].is_default == 1) {
this.setData({
cityChecked: data[i].city_name,
city: data[i].city_name,
region_id: data[i].region_id,
city_id: data[i].id
})
}
}
}
this.getArealist(this.data.region_id)
}
}
base.newRequest(params)
......@@ -107,8 +114,8 @@ Page({
show: false
})
},
changeCity: function (e) {
this.setData({
cityShow: true
......@@ -139,19 +146,26 @@ Page({
cityChecked_id,
region_id
} = this.data;
for(let i=0;i<this.data.currentArea.length;i++){
this.data.currentArea[i].id = ''
this.data.currentArea[i].name = ''
}
this.setData({
city: cityChecked,
city_id: cityChecked_id,
cityShow: false
cityShow: false,
currentArea : this.data.currentArea
})
this.getArealist(region_id)
},
onConfirm(event) {
let index = event.detail.index
let list = this.data.currentArea
list[this.data.showIndex-1].name = this.data.areaList[index].name
list[this.data.showIndex-1].id = this.data.areaList[index].id
list[this.data.showIndex - 1].name = this.data.areaList[index].name
list[this.data.showIndex - 1].id = this.data.areaList[index].id
this.setData({
currentArea: list,
show: !this.data.show
......@@ -167,7 +181,7 @@ Page({
let params = {
url: 'coach/save_area',
data: {
coach_id : this.data.coach_id,
coach_id: this.data.coach_id,
city_id: this.data.city_id,
first_area: this.data.currentArea[0].id,
second_area: this.data.currentArea[1].id,
......
......@@ -7,7 +7,7 @@
<view class="every flex-h flex-vc">
<view class="one">意向区域{{index+1}}</view>
<view class="two" bindtap="showCitypop" data-index="{{index+1}}">
<text>{{item.name}}</text>
<text>{{item.name ? item.name : '请选择意向区域'}}</text>
<text class="iconfont icongengduo"></text>
</view>
</view>
......
......@@ -39,13 +39,13 @@ Page({
})
}
},
getInfo () {
getInfo() {
let params = {
url: 'coach/info',
data: {
coach_id: this.data.coach_id
},
callback:(data)=>{
callback: (data) => {
this.setData({
userInfo: data,
userTel: data.wx_user.tel.substr(0, 3) + '****' + data.wx_user.tel.substring(7, 11)
......@@ -77,7 +77,7 @@ Page({
getSubjectlist: function () {
let params = {
url: 'coach/course',
data:{
data: {
coach_id: app.globalData.coach_id,
},
callback: (data) => {
......@@ -136,16 +136,16 @@ Page({
base.newRequest(params)
}
},
goCall: function (e) {
wx.showModal({
content: '确定要拨打电话吗?',
success(res) {
if (res.confirm) {
wx.makePhoneCall({
phoneNumber: '15630107218'
})
}
}
})
}
// goCall: function (e) {
// wx.showModal({
// content: '确定要拨打电话吗?',
// success(res) {
// if (res.confirm) {
// wx.makePhoneCall({
// phoneNumber: '15630107218'
// })
// }
// }
// })
// }
})
\ No newline at end of file
......@@ -46,13 +46,15 @@
</view>
<view class="centerNav">
<view class="every flex-h flex-vc flex-hb" catchtap="goCall">
<view class="row title">
<image src="/images/my/per_icon_04.png"></image>
<view>联系客服</view>
<button class="kf-btn" open-type="contact">
<view class="every flex-h flex-vc flex-hb">
<view class="row title">
<image src="/images/my/per_icon_04.png"></image>
<view>联系客服</view>
</view>
<text class="iconfont icongengduo"></text>
</view>
<text class="iconfont icongengduo"></text>
</view>
</button>
</view>
<van-popup show="{{ subjectShow }}" closeable round bind:close="tcHold">
......@@ -63,8 +65,7 @@
</view>
<view class="subject flex-h flex-hw flex-ha">
<block wx:for='{{subjectList}}' wx:key='index'>
<view class="{{item.isChecked ? 'active' : ''}}" catchtap="chooseOne" data-index='{{index}}'
data-item='{{item}}'>{{item.name}}</view>
<view class="{{item.isChecked ? 'active' : ''}}" catchtap="chooseOne" data-index='{{index}}' data-item='{{item}}'>{{item.name}}</view>
</block>
</view>
<view class="confirm" catchtap="confirm">确定</view>
......
......@@ -156,4 +156,12 @@ page {
margin: 30rpx auto 0;
}
.kf-btn{
background:#FFFFFF;
width:750rpx !important;
height:109rpx !important;
font-weight: normal !important;
color: #B3B3B3;
font-size: 30rpx;
padding: 0 58rpx 0 0 !important;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment