Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wandouchengzhang_coach
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
石盼盼
wandouchengzhang_coach
Commits
6e3c1bdf
Commit
6e3c1bdf
authored
Nov 26, 2020
by
吴颖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'修改意向区域选择'
parent
1fae4902
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
374 additions
and
380 deletions
+374
-380
teachingArea.js
pages/my/teachingArea/teachingArea.js
+179
-183
teachingArea.wxml
pages/my/teachingArea/teachingArea.wxml
+2
-4
info.wxml
pages/sign/info/info.wxml
+1
-7
personal.wxml
pages/tabbar/personal/personal.wxml
+1
-1
transalte.wxml
pages/transalte/transalte.wxml
+1
-1
project.config.json
project.config.json
+190
-184
No files found.
pages/my/teachingArea/teachingArea.js
View file @
6e3c1bdf
const
app
=
getApp
()
import
{
Base
}
from
'
../../../utils/base.js
'
;
import
{
Base
}
from
'
../../../utils/base.js
'
;
const
base
=
new
Base
()
Page
({
/**
* 页面的初始数据
*/
data
:
{
city
:
''
,
cityShow
:
false
,
cityList
:
[],
city_name
:
''
,
cityChecked
:
''
,
show
:
false
,
forIndex
:
3
,
areaNameList
:
[],
},
/**
* 页面的初始数据
*/
data
:
{
coach_id
:
''
,
currentArea
:
[],
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
this
.
getCitylist
()
this
.
getMyarea
()
},
showCitypop
(
e
)
{
this
.
setData
({
show
:
true
,
showIndex
:
e
.
currentTarget
.
dataset
.
index
})
},
onClose
()
{
this
.
setData
({
show
:
false
})
},
getMyarea
:
function
()
{
let
params
=
{
url
:
'
coach/myarea
'
,
data
:
{
coach_id
:
app
.
globalData
.
coach_id
,
},
callback
:
(
data
)
=>
{
console
.
log
(
data
)
this
.
setData
({
myarea
:
data
})
}
}
base
.
newRequest
(
params
)
},
getCitylist
:
function
()
{
let
params
=
{
url
:
'
coach/city
'
,
callback
:
(
data
)
=>
{
console
.
log
(
data
)
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
})
}
}
this
.
getArealist
(
this
.
data
.
region_id
)
}
}
base
.
newRequest
(
params
)
},
changeCity
:
function
(
e
)
{
this
.
setData
({
cityShow
:
true
})
},
closeCityShow
:
function
(
e
)
{
this
.
setData
({
cityShow
:
false
})
},
city
:
''
,
cityShow
:
false
,
cityList
:
[],
city_name
:
''
,
cityChecked
:
''
,
show
:
false
,
areaNameList
:
[],
},
chooseCity
(
e
)
{
console
.
log
(
e
.
currentTarget
.
dataset
.
item
)
let
city_name
=
e
.
currentTarget
.
dataset
.
item
.
city_name
;
let
city_id
=
e
.
currentTarget
.
dataset
.
item
.
id
;
let
region_id
=
e
.
currentTarget
.
dataset
.
item
.
region_id
;
if
(
e
.
currentTarget
.
dataset
.
item
.
city_name
!=
this
.
data
.
cityChecked
)
{
this
.
setData
({
cityChecked
:
city_name
,
cityChecked_id
:
city_id
,
region_id
:
region_id
})
this
.
getArealist
(
region_id
)
}
},
cityChangeComfirm
:
function
(
e
)
{
const
{
cityChecked
,
cityChecked_id
,
region_id
}
=
this
.
data
;
this
.
setData
({
city
:
cityChecked
,
city_id
:
cityChecked_id
,
cityShow
:
false
})
this
.
getArealist
(
region_id
)
},
getArealist
:
function
(
region_id
)
{
let
params
=
{
url
:
'
coach/area
'
,
data
:
{
region_id
:
region_id
},
callback
:
(
data
)
=>
{
console
.
log
(
data
)
var
areaNameList
=
[]
for
(
let
i
in
data
)
{
areaNameList
.
push
(
data
[
i
].
name
);
//属性
}
console
.
log
(
areaNameList
)
this
.
setData
({
areaNameList
:
areaNameList
,
areaList
:
data
})
}
}
base
.
newRequest
(
params
)
},
onConfirm
(
event
)
{
const
{
picker
,
value
,
index
}
=
event
.
detail
;
const
{
showIndex
,
areaList
}
=
this
.
data
;
let
area_id
;
for
(
let
i
=
0
;
i
<
areaList
.
length
;
i
++
){
if
(
areaList
[
i
].
name
==
value
){
area_id
=
areaList
[
i
].
id
;
}
}
if
(
showIndex
==
1
){
this
.
setData
({
first_area_name
:
value
,
first_area
:
area_id
})
}
else
if
(
showIndex
==
2
){
this
.
setData
({
second_area_name
:
value
,
second_area
:
area_id
})
}
else
if
(
showIndex
==
3
){
this
.
setData
({
third_area_name
:
value
,
third_area
:
area_id
})
}
console
.
log
(
area_id
)
this
.
setData
({
show
:
!
this
.
data
.
show
})
},
onCancel
()
{
this
.
setData
({
show
:
!
this
.
data
.
show
})
},
save
:
function
()
{
const
{
city_id
,
first_area
,
second_area
,
third_area
}
=
this
.
data
;
if
(
first_area
||
second_area
||
third_area
){
let
params
=
{
url
:
'
coach/save_area
'
,
data
:
{
// coach_id : 5,
coach_id
:
app
.
globalData
.
coach_id
,
city_id
,
first_area
,
second_area
,
third_area
},
type
:
'
POST
'
,
callback
:
(
data
)
=>
{
base
.
toast
(
'
保存区域成功
'
)
}
}
base
.
newRequest
(
params
)
}
else
{
base
.
toast
(
'
请至少选择一个意向区域
'
)
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
this
.
setData
({
coach_id
:
app
.
globalData
.
coach_id
})
this
.
getMyarea
()
this
.
getCitylist
()
},
getMyarea
:
function
()
{
let
params
=
{
url
:
'
coach/myarea
'
,
data
:
{
coach_id
:
this
.
data
.
coach_id
,
},
callback
:
(
data
)
=>
{
var
arr
=
[]
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
:
''
,
}
arr
.
push
(
option
)
}
this
.
setData
({
currentArea
:
arr
})
console
.
log
(
this
.
data
.
currentArea
)
}
}
base
.
newRequest
(
params
)
},
getCitylist
:
function
()
{
let
params
=
{
url
:
'
coach/city
'
,
callback
:
(
data
)
=>
{
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
})
}
}
this
.
getArealist
(
this
.
data
.
region_id
)
}
}
base
.
newRequest
(
params
)
},
getArealist
:
function
(
region_id
)
{
let
params
=
{
url
:
'
coach/area
'
,
data
:
{
region_id
:
region_id
},
callback
:
(
data
)
=>
{
var
areaNameList
=
[]
for
(
let
i
in
data
)
{
areaNameList
.
push
(
data
[
i
].
name
);
//属性
}
this
.
setData
({
areaNameList
:
areaNameList
,
areaList
:
data
})
}
}
base
.
newRequest
(
params
)
},
showCitypop
(
e
)
{
this
.
setData
({
show
:
true
,
showIndex
:
e
.
currentTarget
.
dataset
.
index
})
},
onClose
()
{
this
.
setData
({
show
:
false
})
},
changeCity
:
function
(
e
)
{
this
.
setData
({
cityShow
:
true
})
},
closeCityShow
:
function
(
e
)
{
this
.
setData
({
cityShow
:
false
})
},
chooseCity
(
e
)
{
let
city_name
=
e
.
currentTarget
.
dataset
.
item
.
city_name
;
let
city_id
=
e
.
currentTarget
.
dataset
.
item
.
id
;
let
region_id
=
e
.
currentTarget
.
dataset
.
item
.
region_id
;
if
(
e
.
currentTarget
.
dataset
.
item
.
city_name
!=
this
.
data
.
cityChecked
)
{
this
.
setData
({
cityChecked
:
city_name
,
cityChecked_id
:
city_id
,
region_id
:
region_id
})
this
.
getArealist
(
region_id
)
}
},
cityChangeComfirm
:
function
(
e
)
{
const
{
cityChecked
,
cityChecked_id
,
region_id
}
=
this
.
data
;
this
.
setData
({
city
:
cityChecked
,
city_id
:
cityChecked_id
,
cityShow
:
false
})
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
this
.
setData
({
currentArea
:
list
,
show
:
!
this
.
data
.
show
})
},
onCancel
()
{
this
.
setData
({
show
:
!
this
.
data
.
show
})
},
save
:
function
()
{
if
(
this
.
data
.
currentArea
[
0
].
id
||
this
.
data
.
currentArea
[
1
].
id
||
this
.
data
.
currentArea
[
2
].
id
)
{
let
params
=
{
url
:
'
coach/save_area
'
,
data
:
{
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
,
third_area
:
this
.
data
.
currentArea
[
2
].
id
},
type
:
'
POST
'
,
callback
:
(
data
)
=>
{
base
.
toast
(
'
保存区域成功
'
)
}
}
base
.
newRequest
(
params
)
}
else
{
base
.
toast
(
'
请至少选择一个意向区域
'
)
}
},
})
\ No newline at end of file
pages/my/teachingArea/teachingArea.wxml
View file @
6e3c1bdf
...
...
@@ -3,13 +3,11 @@
<view>已选城市:{{city}}</view>
</view>
<view class="select">选择意向区域</view>
<view class="item" wx:for="{{
forIndex
}}" wx:key="index">
<view class="item" wx:for="{{
currentArea
}}" wx:key="index">
<view class="every flex-h flex-vc">
<view class="one">意向区域{{index+1}}</view>
<view class="two" bindtap="showCitypop" data-index="{{index+1}}">
<text wx:if="{{index == 0}}">{{first_area_name}}</text>
<text wx:if="{{index == 1}}">{{second_area_name}}</text>
<text wx:if="{{index == 2}}">{{third_area_name}}</text>
<text>{{item.name}}</text>
<text class="iconfont icongengduo"></text>
</view>
</view>
...
...
pages/sign/info/info.wxml
View file @
6e3c1bdf
<view class="info">
<!-- <view class="onerow flex-h flex-vc flex-hb">
<text>手机号码</text>
<view>
<input type="number" max-length='11' value="{{telphone}}" bindinput="changeTel"/>
</view>
</view> -->
<view class="onerow flex-h flex-vc flex-hb">
<text>账户昵称</text>
<view>
...
...
@@ -14,7 +8,7 @@
<view class="onerow flex-h flex-vc flex-hb">
<text>账户头像</text>
<view class="flex-h" catchtap="changeImg">
<image src="{{headImg}}"></image>
<image src="{{headImg}}"
mode="aspectFill"
></image>
</view>
</view>
...
...
pages/tabbar/personal/personal.wxml
View file @
6e3c1bdf
...
...
@@ -35,7 +35,7 @@
</view>
<view class="every flex-h flex-vc flex-hb" catchtap="tcHold">
<view class="row title">
<image src="../../../images/my/per_icon_03.png"></image>
<image
mode="aspectFill"
src="../../../images/my/per_icon_03.png"></image>
<view>教学科目</view>
</view>
<view class="row">
...
...
pages/transalte/transalte.wxml
View file @
6e3c1bdf
<view class="box flex-v flex-hc flex-vc">
<image src="/images/course_login.png"></image>
<view>豌豆
成长
</view>
<view>豌豆
教练
</view>
</view>
\ No newline at end of file
project.config.json
View file @
6e3c1bdf
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment