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

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

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