Commit bebc3109 authored by 石盼盼's avatar 石盼盼

Merge branch 'shipanpan' into 'master'

Shipanpan

See merge request !27
parents 6f020145 9decfc16
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</view> </view>
</view> </view>
<view class="status"> <view class="status">
<view class="evaluation" data-id="{{item.id}}" data-class_single_id="{{item.class_single_id}}" catchtap="goperformance" wx:if="{{item.is_leave == 0}}">运动评价</view> <view class="evaluation" data-id="{{item.child_id}}" data-class_single_id="{{item.class_single_id}}" catchtap="goperformance" wx:if="{{item.is_leave == 0}}">运动评价</view>
<view class="leave" wx:else>已请假</view> <view class="leave" wx:else>已请假</view>
<view class="unread" wx:if="{{ !item.class_moment }}"></view> <view class="unread" wx:if="{{ !item.class_moment }}"></view>
</view> </view>
......
...@@ -7,8 +7,14 @@ Page({ ...@@ -7,8 +7,14 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
city: '',
cityShow: false, cityShow: false,
cityList: [] cityList: [],
city_name: '',
cityChecked: '',
show: false,
forIndex: 3,
areaNameList: [],
}, },
/** /**
...@@ -17,14 +23,36 @@ Page({ ...@@ -17,14 +23,36 @@ Page({
onLoad: function (options) { onLoad: function (options) {
this.getCitylist() this.getCitylist()
}, },
getCitylist : function () { showCitypop(e) {
this.setData({
show: true,
showIndex: e.currentTarget.dataset.index
})
},
onClose() {
this.setData({
show: false
})
},
getCitylist: function () {
let params = { let params = {
url : 'coach/city', url: 'coach/city',
callback : (data) => { callback: (data) => {
console.log(data) console.log(data)
this.setData({ this.setData({
cityList : data 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) base.newRequest(params)
...@@ -39,87 +67,107 @@ Page({ ...@@ -39,87 +67,107 @@ Page({
cityShow: false cityShow: false
}) })
}, },
chooseCity(e) { chooseCity(e) {
let index = e.currentTarget.dataset.index console.log(e.currentTarget.dataset.item)
let list = this.data.cityList let city_name = e.currentTarget.dataset.item.city_name;
if (list[index].isChecked) { let city_id = e.currentTarget.dataset.item.id;
list[index].isChecked = false let region_id = e.currentTarget.dataset.item.region_id;
} else { if (e.currentTarget.dataset.item.city_name != this.data.cityChecked) {
list[index].isChecked = true 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({ this.setData({
cityList: list city: cityChecked,
city_id: cityChecked_id,
cityShow: false
}) })
// console.log(e.currentTarget.dataset.item) this.getArealist(region_id)
// if (e.currentTarget.dataset.item.city_name != this.data.cityChecked) {
// this.setData({
// cityList: list
// })
// }
}, },
cityChangeComfirm() { getArealist: function (region_id) {
for (var i = 0; i < this.data.cityList.length; i++) { let params = {
if (this.data.cityChecked == this.data.cityList[i].city_name) { url: 'coach/area',
app.globalData.city_id = this.data.cityList[i].id data: {
app.globalData.city_name = this.data.cityList[i].city_name 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({ this.setData({
cityShow: false third_area_name: value,
third_area: area_id
}) })
} }
// if (arr.length == 0) { console.log(area_id)
// base.toast('至少选择一个城市') this.setData({
// }else { show: !this.data.show
// console.log(arr) })
// }
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
}, },
onCancel() {
/** this.setData({
* 页面相关事件处理函数--监听用户下拉动作 show : !this.data.show
*/ })
onPullDownRefresh: function () {
}, },
save : function () {
/** const {city_id, first_area, second_area, third_area} = this.data;
* 页面上拉触底事件的处理函数 if(first_area || second_area || third_area){
*/ let params = {
onReachBottom: function () { url : 'coach/save_area',
data : {
coach_id: 5,
city_id,
first_area,
second_area,
third_area
},
type:'POST',
callback : (data) => {
base.toast('保存区域成功')
}
}
base.newRequest(params)
}else{
base.toast('请至少选择一个意向区域')
}
}, },
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
}) })
\ No newline at end of file
{ {
"usingComponents": {}, "usingComponents": {
"van-picker": "/components/vant/picker/index"
},
"navigationBarTitleText": "教学区域" "navigationBarTitleText": "教学区域"
} }
\ No newline at end of file
<view class="place flex-h flex-vc" catchtap="changeCity"> <view class="place flex-h flex-vc" catchtap="changeCity">
<image src="../../../images/location.png"></image> <image src="../../../images/location.png"></image>
<view>已选城市:石家庄</view> <view>已选城市:{{city}}</view>
</view> </view>
<view class="select">选择意向区域</view> <view class="select">选择意向区域</view>
<view class="every flex-h flex-vc flex-hb"> <view class="item" wx:for="{{forIndex}}" wx:key="index">
<view>意向区域1</view> <view class="every flex-h flex-vc flex-hb">
<view> <view>意向区域{{index+1}}</view>
<text>长安区</text> <view bindtap="showCitypop" data-index="{{index+1}}">
<text class="iconfont icongengduo"></text> <text wx:if="{{index == 0}}">{{first_area_name}}</text>
</view> <text wx:if="{{index == 1}}">{{second_area_name}}</text>
</view> <text wx:if="{{index == 2}}">{{third_area_name}}</text>
<view class="line"></view> <text class="iconfont icongengduo"></text>
</view>
<view class="every flex-h flex-vc flex-hb">
<view>意向区域2</view>
<view>
<text>高新区</text>
<text class="iconfont icongengduo"></text>
</view>
</view>
<view class="line"></view>
<view class="every flex-h flex-vc flex-hb">
<view>意向区域3</view>
<view>
<text>裕华区</text>
<text class="iconfont icongengduo"></text>
</view> </view>
<view class="line"></view>
</view> </view>
<view class="line"></view> <van-popup show="{{ show }}" position="bottom" custom-style="height: 50%;" bind:close="onClose">
<van-picker show-toolbar columns="{{ areaNameList }}" bind:confirm="onConfirm" bind:cancel="onCancel" />
</van-popup>
<view class="cityBox" wx:if="{{cityShow}}" catchtap="closeCityShow"> <view class="cityBox" wx:if="{{cityShow}}" catchtap="closeCityShow">
<view class="cityContent"> <view class="cityContent">
<view class="cityTitle"> <view class="cityTitle">
...@@ -37,13 +25,15 @@ ...@@ -37,13 +25,15 @@
<text class="iconfont iconguanbi1" catchtap="closeCityShow"></text> <text class="iconfont iconguanbi1" catchtap="closeCityShow"></text>
</view> </view>
<view class="cityCenter"> <view class="cityCenter">
<!-- <view class="cityCenter_title">已开通服务城市</view> -->
<view class="cityCenter_con flex-h flex-hw"> <view class="cityCenter_con flex-h flex-hw">
<block wx:for='{{cityList}}' wx:key='index'> <block wx:for='{{cityList}}' wx:key='index'>
<text class="{{item.isChecked ? 'city_active' : ''}}" catchtap="chooseCity" data-index='{{index}}'>{{item.city_name}}</text> <text class="{{cityChecked == item.city_name ? 'city_active': ''}}" catchtap="chooseCity" data-index='{{index}}' data-item='{{item}}'>{{item.city_name}}</text>
</block> </block>
</view> </view>
</view> </view>
<view class="cityConfirm" catchtap="cityChangeComfirm">确定</view> <view class="cityConfirm" catchtap="cityChangeComfirm">确定</view>
</view> </view>
</view>
<view class="button">
<view class="save" bindtap="save">保存</view>
</view> </view>
\ No newline at end of file
...@@ -105,4 +105,26 @@ line-height: 68rpx; ...@@ -105,4 +105,26 @@ line-height: 68rpx;
margin: 29rpx auto 0 auto; margin: 29rpx auto 0 auto;
font-size: 28rpx; font-size: 28rpx;
color: #1A1A1A; color: #1A1A1A;
}
/* 按钮样式 */
.button{
width: 750rpx;
height: 118rpx;
padding: 18rpx 68rpx 20rpx;
position: fixed;
bottom: 0;
background: #FFFFFF;
}
.button .save{
width: 620rpx;
height: 80rpx;
border:none;
background: linear-gradient(-70deg, #FFC600 0%, #FFD400 100%);
border-radius: 40rpx;
color: #000000;
font-size: 30rpx;
text-align: center;
line-height: 80rpx;
} }
\ No newline at end of file
...@@ -11,7 +11,7 @@ Page({ ...@@ -11,7 +11,7 @@ Page({
data: { data: {
showUserInfo: true, //用户信息是否显示 showUserInfo: true, //用户信息是否显示
noticeCount: 9, // 家长回复小红点 noticeCount: 9, // 家长回复小红点
show:false, show: false,
subjectShow: false, subjectShow: false,
subjectList:[], subjectList:[],
// subjectList:[ // subjectList:[
...@@ -56,7 +56,7 @@ Page({ ...@@ -56,7 +56,7 @@ Page({
}) })
} }
}, },
goLogin() { goLogin() {
wx.navigateTo({ // 登录 wx.navigateTo({ // 登录
url: '/pages/sign/login/login', url: '/pages/sign/login/login',
...@@ -67,25 +67,25 @@ Page({ ...@@ -67,25 +67,25 @@ Page({
url: '/pages/sign/info/info', url: '/pages/sign/info/info',
}) })
}, },
goparents:function(){ goparents: function () {
wx.navigateTo({ wx.navigateTo({
url: '../../my/parents/parents', url: '../../my/parents/parents',
}) })
}, },
goteachingArea:function(){ goteachingArea: function () {
wx.navigateTo({ wx.navigateTo({
url: '../../my/teachingArea/teachingArea', url: '../../my/teachingArea/teachingArea',
}) })
}, },
getSubjectlist : function (){ getSubjectlist: function () {
let params = { let params = {
url:'coach/course', url: 'coach/course',
callback : (data) => { callback: (data) => {
console.log(data) console.log(data)
this.setData({ this.setData({
subjectList : data subjectList: data
}) })
} }
} }
base.newRequest(params) base.newRequest(params)
...@@ -99,7 +99,7 @@ Page({ ...@@ -99,7 +99,7 @@ Page({
chooseOne(e) { chooseOne(e) {
let index = e.currentTarget.dataset.index let index = e.currentTarget.dataset.index
let list = this.data.subjectList let list = this.data.subjectList
if (list[index].isChecked){ if (list[index].isChecked) {
list[index].isChecked = false list[index].isChecked = false
} else { } else {
list[index].isChecked = true list[index].isChecked = true
...@@ -108,20 +108,38 @@ Page({ ...@@ -108,20 +108,38 @@ Page({
subjectList: list subjectList: list
}) })
}, },
confirm(){ confirm() {
var arr = [] var arr = []
for (var i=0; i<this.data.subjectList.length;i++) { var newArr = []
for (var i = 0; i < this.data.subjectList.length; i++) {
if (this.data.subjectList[i].isChecked == true) { if (this.data.subjectList[i].isChecked == true) {
arr.push(this.data.subjectList[i]) arr.push(this.data.subjectList[i])
newArr.push(this.data.subjectList[i].id)
} }
} }
console.log(arr)
console.log(newArr)
if (arr.length == 0) { if (arr.length == 0) {
base.toast('教学科目至少选择一项') base.toast('教学科目至少选择一项')
} else { } else {
console.log(arr) let params = {
url: 'coach/save_course',
data: {
coach_id: 4,
course_ids: JSON.stringify(newArr)
},
type : 'POST',
callback: (data) => {
base.toast('保存科目成功')
this.setData({
subjectShow : false
})
}
}
base.newRequest(params)
} }
}, },
goCall: function(e){ goCall: function (e) {
wx.showModal({ wx.showModal({
content: '确定要拨打电话吗?', content: '确定要拨打电话吗?',
success(res) { success(res) {
......
{ {
"description": "项目配置文件", "description": "项目配置文件",
"packOptions": { "packOptions": {
"ignore": [] "ignore": []
}, },
"setting": { "setting": {
"urlCheck": true, "urlCheck": false,
"es6": true, "es6": true,
"enhance": false, "enhance": false,
"postcss": true, "postcss": true,
"preloadBackgroundData": false, "preloadBackgroundData": false,
"minified": true, "minified": true,
"newFeature": false, "newFeature": false,
"coverView": true, "coverView": true,
"nodeModules": false, "nodeModules": false,
"autoAudits": false, "autoAudits": false,
"showShadowRootInWxmlPanel": true, "showShadowRootInWxmlPanel": true,
"scopeDataCheck": false, "scopeDataCheck": false,
"uglifyFileName": false, "uglifyFileName": false,
"checkInvalidKey": true, "checkInvalidKey": true,
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"useMultiFrameRuntime": false, "babelSetting": {
"useApiHook": true, "ignore": [],
"babelSetting": { "disablePlugins": [],
"ignore": [], "outputPath": ""
"disablePlugins": [], },
"outputPath": "" "useIsolateContext": true,
}, "useCompilerModule": false,
"enableEngineNative": false, "userConfirmedUseCompilerModuleSwitch": false,
"useIsolateContext": true, "useMultiFrameRuntime": false,
"useCompilerModule": false, "useApiHook": true,
"userConfirmedUseCompilerModuleSwitch": false, "enableEngineNative": false,
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
"minifyWXSS": true "minifyWXSS": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.14.0", "libVersion": "2.14.0",
"appid": "wx6e6eaca9cc1c406d", "appid": "wx6e6eaca9cc1c406d",
"projectname": "wandouchengzhang_coach", "projectname": "wandouchengzhang_coach",
"debugOptions": { "debugOptions": {
"hidedInDevtools": [] "hidedInDevtools": []
}, },
"scripts": {}, "scripts": {},
"isGameTourist": false, "isGameTourist": false,
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"condition": { "condition": {
"plugin": { "plugin": {
"list": [] "list": []
}, },
"game": { "game": {
"list": [] "list": []
}, },
"gamePlugin": { "gamePlugin": {
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"id": -1, "id": -1,
"name": "pages/tabbar/personal/personal", "name": "pages/tabbar/personal/personal",
"pathName": "pages/tabbar/personal/personal", "pathName": "pages/tabbar/personal/personal",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/tabbar/personal/personal", "name": "pages/tabbar/personal/personal",
"pathName": "pages/tabbar/personal/personal", "pathName": "pages/tabbar/personal/personal",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/my/parents/parents", "name": "pages/my/parents/parents",
"pathName": "pages/my/parents/parents", "pathName": "pages/my/parents/parents",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/tabbar/personal/personal", "name": "pages/tabbar/personal/personal",
"pathName": "pages/tabbar/personal/personal", "pathName": "pages/tabbar/personal/personal",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/my/teachingArea/teachingArea", "name": "pages/my/teachingArea/teachingArea",
"pathName": "pages/my/teachingArea/teachingArea", "pathName": "pages/my/teachingArea/teachingArea",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/index/classManagement/classManagement", "name": "pages/index/classManagement/classManagement",
"pathName": "pages/index/classManagement/classManagement", "pathName": "pages/index/classManagement/classManagement",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/index/courseInstant/courseInstant", "name": "pages/index/courseInstant/courseInstant",
"pathName": "pages/index/courseInstant/courseInstant", "pathName": "pages/index/courseInstant/courseInstant",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": 7, "id": 7,
"name": "pages/index/classDetail/classDetail", "name": "pages/index/classDetail/classDetail",
"pathName": "pages/index/classDetail/classDetail", "pathName": "pages/index/classDetail/classDetail",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/team/teamDetail/teamDetail", "name": "pages/team/teamDetail/teamDetail",
"pathName": "pages/team/teamDetail/teamDetail", "pathName": "pages/team/teamDetail/teamDetail",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/index/performance/performance", "name": "pages/index/performance/performance",
"pathName": "pages/index/performance/performance", "pathName": "pages/index/performance/performance",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/index/evaluation/evaluation", "name": "pages/index/evaluation/evaluation",
"pathName": "pages/index/evaluation/evaluation", "pathName": "pages/index/evaluation/evaluation",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "个人中心", "name": "个人中心",
"pathName": "pages/tabbar/personal/personal", "pathName": "pages/tabbar/personal/personal",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/tabbar/class/class", "name": "pages/tabbar/class/class",
"pathName": "pages/tabbar/class/class", "pathName": "pages/tabbar/class/class",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"id": -1, "id": -1,
"name": "pages/team/teamDetail/teamDetail", "name": "pages/team/teamDetail/teamDetail",
"pathName": "pages/team/teamDetail/teamDetail", "pathName": "pages/team/teamDetail/teamDetail",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"name": "财务", "name": "财务",
"pathName": "pages/tabbar/financial/financial", "pathName": "pages/tabbar/financial/financial",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"name": "课程管理详情页面", "name": "课程管理详情页面",
"pathName": "pages/index/classManagement/classManagement", "pathName": "pages/index/classManagement/classManagement",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"name": "申请成为教练", "name": "申请成为教练",
"pathName": "pages/sign/apply/apply", "pathName": "pages/sign/apply/apply",
"query": "", "query": "",
"scene": null "scene": null
}, },
{ {
"name": "课程瞬间上传", "name": "课程瞬间上传",
"pathName": "pages/index/courseInstant/courseInstant", "pathName": "pages/index/courseInstant/courseInstant",
"scene": null "scene": null
} }
] ]
} }
} }
} }
\ No newline at end of file
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