stu_require_detail.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <view>
  3. <my-requiredetail :item="item" :location="location" :marker="marker" :timeAM="timeAM" :timePM="timePM" :timeEvening="timeEvening" :isShowPrivate="isShowPrivate" buttonMessage="以此为模板新发布" @publishButton="publishButton"></my-requiredetail>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. isShowPrivate: true,
  11. item: {},
  12. courseWeekday: [],
  13. location: [],
  14. marker: [{
  15. id: 1,
  16. joinCluster:true,
  17. latitude: 0,
  18. longitude: 0,
  19. width: 40,
  20. height: 40,
  21. iconPath: '/static/location.png',
  22. }],
  23. // 上课时间
  24. // 上午
  25. timeAM: [{
  26. value: 'A1',
  27. name: '1',
  28. checked: false
  29. },
  30. {
  31. name: '2',
  32. value: 'A2',
  33. checked: false
  34. },
  35. {
  36. name: '3',
  37. value: 'A3',
  38. checked: false
  39. },
  40. {
  41. name: '4',
  42. value: 'A4',
  43. checked: false
  44. },
  45. {
  46. name: '5',
  47. value: 'A5',
  48. checked: false
  49. },
  50. {
  51. name: '6',
  52. value: 'A6',
  53. checked: false
  54. },
  55. {
  56. name: '7',
  57. value: 'A7',
  58. checked: false
  59. }
  60. ],
  61. // 下午
  62. timePM: [{
  63. value: 'P1',
  64. name: '1',
  65. checked: false
  66. },
  67. {
  68. name: '2',
  69. value: 'P2',
  70. checked: false
  71. },
  72. {
  73. name: '3',
  74. value: 'P3',
  75. checked: false
  76. },
  77. {
  78. name: '4',
  79. value: 'P4',
  80. checked: false
  81. },
  82. {
  83. name: '5',
  84. value: 'P5',
  85. checked: false
  86. },
  87. {
  88. name: '6',
  89. value: 'P6',
  90. checked: false
  91. },
  92. {
  93. name: '7',
  94. value: 'P7',
  95. checked: false
  96. }
  97. ],
  98. // 晚上
  99. timeEvening: [{
  100. name: '1',
  101. value: 'E1',
  102. checked: false
  103. },
  104. {
  105. name: '2',
  106. value: 'E2',
  107. checked: false
  108. },
  109. {
  110. name: '3',
  111. value: 'E3',
  112. checked: false
  113. },
  114. {
  115. name: '4',
  116. value: 'E4',
  117. checked: false
  118. },
  119. {
  120. name: '5',
  121. value: 'E5',
  122. checked: false
  123. },
  124. {
  125. name: '6',
  126. value: 'E6',
  127. checked: false
  128. },
  129. {
  130. name: '7',
  131. value: 'E7',
  132. checked: false
  133. }
  134. ],
  135. };
  136. },
  137. onLoad(option) {
  138. this.item = JSON.parse(decodeURIComponent(option.item))
  139. this.location = this.item.locationAl.split(",")
  140. this.marker[0].latitude = Number(this.location[0])
  141. this.marker[0].longitude = Number(this.location[1])
  142. this.courseWeekday = this.item.courseWeekday.split(",")
  143. // console.log("选中的日期:" + this.courseWeekday)
  144. for (let i = 0; i < this.courseWeekday.length; i++) {
  145. for (let x = 0; x < this.timeAM.length; x++) {
  146. if (this.courseWeekday[i] == this.timeAM[x].value) {
  147. this.timeAM[x].checked = true
  148. }
  149. }
  150. for (let y = 0; y < this.timePM.length; y++) {
  151. if (this.courseWeekday[i] == this.timePM[y].value) {
  152. // console.log(this.timePM[y].value)
  153. this.timePM[y].checked = true
  154. }
  155. }
  156. for (let z = 0; z < this.timeEvening.length; z++) {
  157. if (this.courseWeekday[i] == this.timeEvening[z].value) {
  158. this.timeEvening[z].checked = true
  159. }
  160. }
  161. }
  162. },
  163. methods: {
  164. publishButton() {
  165. uni.navigateTo({
  166. url:'/subpkg/add_stu_require/add_stu_require?item='+encodeURIComponent(JSON.stringify(this.item))
  167. })
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss" scoped>
  173. .contain {
  174. background-color: #FFF2CC;
  175. border-radius: 10%;
  176. .contain-item {
  177. margin-bottom: 20rpx;
  178. }
  179. .contain-text {
  180. font-weight: 700;
  181. color: #bbb;
  182. }
  183. .map {
  184. width: 100%;
  185. }
  186. }
  187. .tr-container{
  188. display: flex;
  189. position: relative;
  190. width: 96%;
  191. flex-direction: column;
  192. font-size: 26rpx;
  193. /* border: 1rpx solid gray; */
  194. margin: -10px 20rpx;
  195. margin-bottom: 20px;
  196. }
  197. .tr_1 {
  198. display: flex;
  199. position: relative;
  200. height: 80rpx;
  201. line-height: 80rpx;
  202. }
  203. .tr_2{
  204. display: block;
  205. height: 80rpx;
  206. line-height: 80rpx;
  207. }
  208. .th_0,
  209. .th_1,
  210. .th_2,
  211. .th2_0,
  212. .th2_1,
  213. .th2_2{
  214. width: 12%;
  215. height: 80rpx;
  216. line-height: 80rpx;
  217. border-right: 1rpx solid gray;
  218. border-bottom: 1rpx solid gray;
  219. text-align: center;
  220. }
  221. .th_0,
  222. .th_1,
  223. .th_2{
  224. border-top: 1rpx solid gray;
  225. }
  226. .th_0,
  227. .th2_0{
  228. border-left: 1rpx solid gray;
  229. }
  230. .th2_0{
  231. float: left;
  232. width: 12%;
  233. height: 80rpx;
  234. line-height: 80rpx;
  235. text-align: center;
  236. /* background-color: greenyellow; */
  237. }
  238. .publish-button {
  239. background-color: #E2F0D9;
  240. width: 90%;
  241. border-radius: 25%;
  242. }
  243. </style>