江西小程序管理端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
3.6 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="box">
  3. <view class="item">
  4. <view class="lab">我的场地</view>
  5. <view class="val" style="display: flex;" @click="showSite=true">
  6. <mySelect :value="form.siteName" placeholder="请选择您的场地"/>
  7. <u-icon name="arrow-down" :size="12" :color="'#ADADAD'" style="margin-left: 12rpx;"></u-icon>
  8. </view>
  9. </view>
  10. <view class="item">
  11. <view class="lab">科目类型</view>
  12. <view class="val">
  13. <myRadio :radioData="radioData1" :value="form.subject" @changeRadio="(val)=>{form.subject=val}"/>
  14. </view>
  15. </view>
  16. <view class="item">
  17. <view class="lab">我的教练车</view>
  18. <view class="val">
  19. <myRadio :radioData="radioData2" :value="form.carNumber" @changeRadio="(val)=>{form.carNumber=val}"/>
  20. </view>
  21. </view>
  22. <view class="item">
  23. <view class="lab">可约人数</view>
  24. <view class="val">
  25. <myRadio :radioData="radioData3" :value="form.appointmentSumCount" @changeRadio="(val)=>{form.appointmentSumCount=val}"/>
  26. </view>
  27. </view>
  28. <view class="item">
  29. <view class="lab">开放范围</view>
  30. <view class="val">
  31. <myRadio :radioData="radioData4" :value="form.openRange" @changeRadio="(val)=>{form.openRange=val}"/>
  32. </view>
  33. </view>
  34. <view class="btn_row">
  35. <view class="btnBorder btn" @click="confirmPopup(0)">取消</view>
  36. <view class="btnBg btn" @click="confirmPopup(1)">确认</view>
  37. </view>
  38. <u-picker :show="showSite" :columns="siteColumns" keyName="name" @confirm="changeSite" @cancel="showSite=false" ></u-picker>
  39. </view>
  40. </template>
  41. <script>
  42. import { trainingSiteList } from '@/config/api.js'
  43. export default {
  44. data() {
  45. return {
  46. showSite: false,
  47. siteColumns: [],
  48. // scheduleClassCreateByTime
  49. radioData1: [
  50. {name: '不限', id: 0},
  51. {name: '科目二', id: 2},
  52. {name: '科目三', id: 3},
  53. ],
  54. // 0:不限;2:科目二;3:科目三
  55. radioData2: [
  56. {name: '浙A66666学', id: '浙A66666学'},
  57. {name: '浙A66667学', id: '浙A66667学'},
  58. ],
  59. radioData3: [
  60. {name: '1人', id: 1},
  61. {name: '2人', id: 2},
  62. {name: '3人', id: 3},
  63. {name: '4人', id: 4},
  64. ],
  65. radioData4: [
  66. {name: '我的学员', id: 0},
  67. {name: '本校学员', id: 1}
  68. ],//开放范围:0:自己的学员;1:绑定的驾校的学员
  69. form: {
  70. siteName: '',
  71. openRange: 0,
  72. appointmentSumCount: 1,
  73. carNumber: '浙A66666学',
  74. subject: 0
  75. }
  76. }
  77. },
  78. created() {
  79. this.trainingSiteListFn()
  80. },
  81. methods: {
  82. confirmPopup(val) {
  83. if(val==1&&!this.form.siteName) return this.$u.toast('请选择场地')
  84. this.$emit('confirmClass', val, this.form)
  85. },
  86. // 选择训练场地
  87. changeSite(val) {
  88. let item = val.value[0]
  89. this.form.address = item.address
  90. this.form.seq = item.seq
  91. this.form.area = item.area
  92. this.form.siteName = item.name
  93. this.form.siteId = item.id
  94. this.showSite = false
  95. },
  96. // 获取训练场地
  97. async trainingSiteListFn() {
  98. let obj = {
  99. pageNo: 1,
  100. pageSize: 100,
  101. schoolId: this.vuex_userInfo.user.schoolId
  102. }
  103. const {data: res} = await trainingSiteList(obj)
  104. this.siteColumns = [ res ]
  105. console.log(res)
  106. },
  107. changeRadio(e,val) {
  108. console.log(e)
  109. console.log(val)
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. .box {
  116. padding: 28rpx;
  117. width: 638rpx;
  118. .item {
  119. .lab {
  120. font-size: 30rpx;
  121. margin-bottom: 38rpx;
  122. }
  123. .val {
  124. margin-bottom: 56rpx;
  125. }
  126. }
  127. .btn_row {
  128. display: flex;
  129. justify-content: space-between;
  130. padding: 0 30rpx;
  131. .btnBorder {
  132. }
  133. .btn {width: 47%;}
  134. .btnBg {
  135. }
  136. }
  137. }
  138. </style>