123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <template>
- <view>
- <my-requiredetail :item="item" :location="location" :marker="marker" :timeAM="timeAM" :timePM="timePM" :timeEvening="timeEvening" :isShowPrivate="isShowPrivate" buttonMessage="以此为模板新发布" @publishButton="publishButton"></my-requiredetail>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- isShowPrivate: true,
- item: {},
- courseWeekday: [],
- location: [],
- marker: [{
- id: 1,
- joinCluster:true,
- latitude: 0,
- longitude: 0,
- width: 40,
- height: 40,
- iconPath: '/static/location.png',
- }],
- // 上课时间
- // 上午
- timeAM: [{
- value: 'A1',
- name: '1',
- checked: false
- },
- {
- name: '2',
- value: 'A2',
- checked: false
- },
- {
- name: '3',
- value: 'A3',
- checked: false
- },
- {
- name: '4',
- value: 'A4',
- checked: false
- },
- {
- name: '5',
- value: 'A5',
- checked: false
- },
- {
- name: '6',
- value: 'A6',
- checked: false
- },
- {
- name: '7',
- value: 'A7',
- checked: false
- }
- ],
- // 下午
- timePM: [{
- value: 'P1',
- name: '1',
- checked: false
- },
- {
- name: '2',
- value: 'P2',
- checked: false
- },
- {
- name: '3',
- value: 'P3',
- checked: false
- },
- {
- name: '4',
- value: 'P4',
- checked: false
- },
- {
- name: '5',
- value: 'P5',
- checked: false
- },
- {
- name: '6',
- value: 'P6',
- checked: false
- },
- {
- name: '7',
- value: 'P7',
- checked: false
- }
- ],
- // 晚上
- timeEvening: [{
- name: '1',
- value: 'E1',
- checked: false
- },
- {
- name: '2',
- value: 'E2',
- checked: false
- },
- {
- name: '3',
- value: 'E3',
- checked: false
- },
- {
- name: '4',
- value: 'E4',
- checked: false
- },
- {
- name: '5',
- value: 'E5',
- checked: false
- },
- {
- name: '6',
- value: 'E6',
- checked: false
- },
- {
- name: '7',
- value: 'E7',
- checked: false
- }
- ],
- };
- },
- onLoad(option) {
- this.item = JSON.parse(decodeURIComponent(option.item))
- this.location = this.item.locationAl.split(",")
- this.marker[0].latitude = Number(this.location[0])
- this.marker[0].longitude = Number(this.location[1])
- this.courseWeekday = this.item.courseWeekday.split(",")
- // console.log("选中的日期:" + this.courseWeekday)
- for (let i = 0; i < this.courseWeekday.length; i++) {
- for (let x = 0; x < this.timeAM.length; x++) {
- if (this.courseWeekday[i] == this.timeAM[x].value) {
- this.timeAM[x].checked = true
- }
- }
-
- for (let y = 0; y < this.timePM.length; y++) {
- if (this.courseWeekday[i] == this.timePM[y].value) {
- // console.log(this.timePM[y].value)
- this.timePM[y].checked = true
- }
- }
-
- for (let z = 0; z < this.timeEvening.length; z++) {
- if (this.courseWeekday[i] == this.timeEvening[z].value) {
- this.timeEvening[z].checked = true
- }
- }
- }
- },
- methods: {
- publishButton() {
- uni.navigateTo({
- url:'/subpkg/add_stu_require/add_stu_require?item='+encodeURIComponent(JSON.stringify(this.item))
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .contain {
- background-color: #FFF2CC;
- border-radius: 10%;
-
- .contain-item {
- margin-bottom: 20rpx;
- }
-
- .contain-text {
- font-weight: 700;
- color: #bbb;
- }
-
- .map {
- width: 100%;
- }
- }
- .tr-container{
- display: flex;
- position: relative;
- width: 96%;
- flex-direction: column;
- font-size: 26rpx;
- /* border: 1rpx solid gray; */
- margin: -10px 20rpx;
- margin-bottom: 20px;
- }
-
- .tr_1 {
- display: flex;
- position: relative;
- height: 80rpx;
- line-height: 80rpx;
- }
- .tr_2{
- display: block;
- height: 80rpx;
- line-height: 80rpx;
- }
-
- .th_0,
- .th_1,
- .th_2,
- .th2_0,
- .th2_1,
- .th2_2{
- width: 12%;
- height: 80rpx;
- line-height: 80rpx;
- border-right: 1rpx solid gray;
- border-bottom: 1rpx solid gray;
- text-align: center;
- }
-
- .th_0,
- .th_1,
- .th_2{
- border-top: 1rpx solid gray;
- }
-
- .th_0,
- .th2_0{
- border-left: 1rpx solid gray;
- }
-
- .th2_0{
- float: left;
- width: 12%;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- /* background-color: greenyellow; */
- }
-
- .publish-button {
- background-color: #E2F0D9;
- width: 90%;
- border-radius: 25%;
- }
- </style>
|