Pārlūkot izejas kodu

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/wechat into dev

yuantianjiao 6 gadus atpakaļ
vecāks
revīzija
03a1109c0e

+ 4
- 0
src/pages/user/bindMobile/bindMobile.vue Parādīt failu

155
       }, 1000)
155
       }, 1000)
156
     },
156
     },
157
     submit () {
157
     submit () {
158
+      var _that = this
158
       if (!this.postData.captcha) {
159
       if (!this.postData.captcha) {
159
         this.$toast('请先获取验证码')
160
         this.$toast('请先获取验证码')
160
         return
161
         return
169
       }
170
       }
170
       this.submitData(this.postData).then((res) => {
171
       this.submitData(this.postData).then((res) => {
171
         this.$toast(res)
172
         this.$toast(res)
173
+        setTimeout(function(){
174
+          _that.$router.push({name: 'userCenter'})
175
+        },300)
172
       })
176
       })
173
     }
177
     }
174
   }
178
   }

+ 57
- 66
src/pages/user/fiveA/index.vue Parādīt failu

17
           </div>
17
           </div>
18
           <h5>结识更多朋友</h5>
18
           <h5>结识更多朋友</h5>
19
           <div class="courseList flex-h">
19
           <div class="courseList flex-h">
20
-            <ul class="flex-item">
21
-              <router-link tag="li" :to="{name:'',query:{}}" v-for="(item,index) in courseList" :key="index">
20
+            <ul class="flex-item" v-if="!fiveANoData">
21
+              <router-link tag="li" v-for="(item,index) in courseList" :key="index" :to="{name:'majorProjectsDetail',query:{id: item.id}}">
22
                 <courseItem :data="item"></courseItem>
22
                 <courseItem :data="item"></courseItem>
23
               </router-link>
23
               </router-link>
24
             </ul>
24
             </ul>
25
+            <span v-if="fiveANoData" style="width:100%;line-height:.3rem;display:block;text-align:center;color:#ccc;margin-bottom:.1rem;">暂无数据</span>
25
           </div>
26
           </div>
26
-          <router-link :to="{name:'',query:{}}" class="more">查看更多</router-link>
27
+          <router-link :to="{name:'',query:{}}" class="more" v-if="!fiveANoData">查看更多</router-link>
27
           <div style="width:100%;height:.1rem;background:#f8f8f8;margin:0 auto;"></div>
28
           <div style="width:100%;height:.1rem;background:#f8f8f8;margin:0 auto;"></div>
28
           <h5>资讯</h5>
29
           <h5>资讯</h5>
29
           <div class="newsList flex-h">
30
           <div class="newsList flex-h">
50
   name: '',
51
   name: '',
51
   data () {
52
   data () {
52
     return {
53
     return {
54
+      fiveANoData: false,
53
       active: {
55
       active: {
54
-        index: 1,
56
+        index: 0,
55
         locationid: ''
57
         locationid: ''
56
       },
58
       },
57
       swiperOption: {
59
       swiperOption: {
65
         LocationId: "selected",
67
         LocationId: "selected",
66
         LocationName: "精选"
68
         LocationName: "精选"
67
       }],
69
       }],
68
-      courseList: [{ // 课程列表
69
-        id: '',
70
-        title: '课程名称',
71
-        img: '',
72
-        time: '2018.04.04 18:30-20:00',
73
-        address: '南京南',
74
-        tag: ['儿童教育', '小小外交官'],
75
-        courseType: '团体课',
76
-        defaultPrice: '168/节',
77
-        getWay: 'ticket'
78
-      }, {
79
-        id: '',
80
-        title: '课程名称',
81
-        img: '',
82
-        time: '2018.04.04 18:30-20:00',
83
-        address: '南京南',
84
-        tag: ['儿童教育', '小小外交官'],
85
-        courseType: '团体课',
86
-        defaultPrice: '168/节',
87
-        getWay: 'free'
88
-      }, {
89
-        id: '',
90
-        title: '课程名称',
91
-        img: '',
92
-        time: '2018.04.04 18:30-20:00',
93
-        address: '南京南',
94
-        tag: ['儿童教育', '小小外交官'],
95
-        courseType: '团体课',
96
-        defaultPrice: '168/节',
97
-        getWay: 'free'
98
-      }],
99
-      newsList: [{ // 资讯列表
100
-        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
101
-        time: '2018年5月25日',
102
-        img: '',
103
-        id: ''
104
-      }, {
105
-        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
106
-        time: '2018年5月25日',
107
-        img: '',
108
-        id: ''
109
-      }, {
110
-        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
111
-        time: '2018年5月25日',
112
-        img: '',
113
-        id: ''
114
-      }, {
115
-        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
116
-        time: '2018年5月25日',
117
-        img: '',
118
-        id: ''
119
-      }, {
120
-        title: '我是标题我是标题我是标题我是标题我是标题我是标题',
121
-        time: '2018年5月25日',
122
-        img: '',
123
-        id: ''
124
-      }]
70
+      courseList: [], // 课程列表
71
+      newsList: [], // 资讯列表
125
     }
72
     }
126
   },
73
   },
127
   computed: {
74
   computed: {
129
       orgid: x => x.app.orgId,
76
       orgid: x => x.app.orgId,
130
       navList: x => x.fiveA.nav,
77
       navList: x => x.fiveA.nav,
131
       banner: x => x.fiveA.banner,
78
       banner: x => x.fiveA.banner,
132
-      cms: x => x.fiveA.cms
79
+      cms: x => x.fiveA.cms,
80
+      fiveAList: x => x.fiveA.fiveAList,
133
     }),
81
     }),
134
     MySwiper () {
82
     MySwiper () {
135
       return this.$refs.mySwiper.swiper
83
       return this.$refs.mySwiper.swiper
147
   created () {
95
   created () {
148
     this.getNav({ orgid: this.orgid, issys: '0' }).then(() => {
96
     this.getNav({ orgid: this.orgid, issys: '0' }).then(() => {
149
       this.nav = this.nav.concat(this.navList)
97
       this.nav = this.nav.concat(this.navList)
150
-      this.active.locationid = this.nav[this.active.index].LocationId
98
+      for (var n = 0; n < this.nav.length; n++) {
99
+        if(this.nav[n].LocationId === this.$route.query.id){
100
+          this.active.index = n
101
+          this.active.locationid = this.nav[n].LocationId
102
+        }
103
+      }
104
+      this.getFiveAList({ locationid: this.active.locationid, orgid: this.orgid }).then((res) => {
105
+        // console.log(JSON.stringify(res))
106
+        this.courseList = []
107
+        if (res !== null) {
108
+          this.fiveANoData = false
109
+          this.returnCourseList(res)
110
+        } else {
111
+          this.fiveANoData = true
112
+        }
113
+      })
151
       this.getFiveAInfo({ orgid: this.orgid, locationid: this.active.locationid }).then(() => {
114
       this.getFiveAInfo({ orgid: this.orgid, locationid: this.active.locationid }).then(() => {
152
         this.newsList = this.cms
115
         this.newsList = this.cms
153
       })
116
       })
154
     })
117
     })
155
   },
118
   },
156
   methods: {
119
   methods: {
157
-    ...mapFiveAActions(['getNav']),
158
-    ...mapFiveAActions(['getFiveAInfo']),
120
+    ...mapFiveAActions([
121
+      'getNav',
122
+      'getFiveAInfo',
123
+      'getFiveAList',
124
+    ]),
159
     changeLocation (item, index) {
125
     changeLocation (item, index) {
160
       this.active.index = index
126
       this.active.index = index
161
       this.active.locationid = item.LocationId
127
       this.active.locationid = item.LocationId
128
+      this.getFiveAList({ locationid: this.active.locationid, orgid: this.orgid }).then((res) => {
129
+        // console.log(JSON.stringify(res))
130
+        this.courseList = []
131
+        if (res !== null) {
132
+          this.fiveANoData = false
133
+          this.returnCourseList(res)
134
+        } else {
135
+          this.fiveANoData = true
136
+        }
137
+      })
162
       this.getFiveAInfo({ orgid: this.orgid, locationid: this.active.locationid }).then(() => {
138
       this.getFiveAInfo({ orgid: this.orgid, locationid: this.active.locationid }).then(() => {
163
         this.newsList = this.cms
139
         this.newsList = this.cms
164
       })
140
       })
165
     },
141
     },
142
+    returnCourseList (arr) { // 转换课程列表格式
143
+      for (var n = 0; n < arr.length; n++) {
144
+        this.courseList.push({
145
+          id: arr[n].CourseId,
146
+          title: arr[n].CourseName,
147
+          img: arr[n].CourseImg,
148
+          time: this.toolClass.dateFormat(arr[n].BeginDate),
149
+          address: arr[n].CaseInfo.CaseAddress,
150
+          tag: arr[n].CourseTags || [],
151
+          courseType: '',
152
+          defaultPrice: arr[n].Price + '/节',
153
+          getWay: 'ticket'
154
+        })
155
+      }
156
+    },
166
     jump (item) {
157
     jump (item) {
167
       console.log(item)
158
       console.log(item)
168
       item.ForwardType = item.ForwardType || ''
159
       item.ForwardType = item.ForwardType || ''
180
 
171
 
181
 <!-- Add "scoped" attribute to limit CSS to this component only -->
172
 <!-- Add "scoped" attribute to limit CSS to this component only -->
182
 <style lang="scss" scoped>
173
 <style lang="scss" scoped>
183
-@import "page.scss";
174
+@import 'page.scss';
184
 </style>
175
 </style>

+ 8
- 7
src/pages/user/mainPage/indexPage/index.vue Parādīt failu

83
       locationId: '',
83
       locationId: '',
84
       swiperOption: {
84
       swiperOption: {
85
         observer: true,
85
         observer: true,
86
-        loop: true,
87
         autoplay: {
86
         autoplay: {
88
           disableOnInteraction: false,
87
           disableOnInteraction: false,
89
         }
88
         }
126
       this.locationId = 'index'
125
       this.locationId = 'index'
127
       this.getIndexInfo({ orgid: this.orgid, locationid: this.locationId }).then(() => {
126
       this.getIndexInfo({ orgid: this.orgid, locationid: this.locationId }).then(() => {
128
         this.newsList = this.cms
127
         this.newsList = this.cms
129
-        for (let i = 0; i < this.project.length; i++) {
130
-          if (this.project[i].CmsCaseImgs != null) {
131
-            for (let j = 0; j < this.project[i].CmsCaseImgs.length; j++) {
132
-              if (this.project[i].CmsCaseImgs[j].ImageType === 'cover') {
133
-                this.project[i].CaseImageUrl = this.project[i].CmsCaseImgs[j].CaseImageUrl
128
+        if (this.project !== undefined && this.project !== null) {
129
+          for (let i = 0; i < this.project.length; i++) {
130
+            if (this.project[i].CmsCaseImgs != null) {
131
+              for (let j = 0; j < this.project[i].CmsCaseImgs.length; j++) {
132
+                if (this.project[i].CmsCaseImgs[j].ImageType === 'cover') {
133
+                  this.project[i].CaseImageUrl = this.project[i].CmsCaseImgs[j].CaseImageUrl
134
+                }
134
               }
135
               }
135
             }
136
             }
136
           }
137
           }
157
 
158
 
158
 <!-- Add "scoped" attribute to limit CSS to this component only -->
159
 <!-- Add "scoped" attribute to limit CSS to this component only -->
159
 <style lang="scss" scoped>
160
 <style lang="scss" scoped>
160
-@import "page.scss";
161
+@import 'page.scss';
161
 </style>
162
 </style>

+ 4
- 1
src/pages/user/router.js Parādīt failu

124
 })
124
 })
125
 
125
 
126
 router.beforeEach((to, from, next) => {
126
 router.beforeEach((to, from, next) => {
127
-  
127
+  // console.log(to)
128
+  // if(){
129
+    
130
+  // }
128
   next()
131
   next()
129
 })
132
 })
130
 
133
 

+ 23
- 7
src/store/fiveA/fiveA.js Parādīt failu

20
 }
20
 }
21
 
21
 
22
 http.getBanner = (data) => {
22
 http.getBanner = (data) => {
23
-  console.log(data)
23
+  // console.log(data)
24
   return new Promise((resolve, reject) => {
24
   return new Promise((resolve, reject) => {
25
     Ajax(api.index.banner.url, {
25
     Ajax(api.index.banner.url, {
26
       method: api.index.banner.method,
26
       method: api.index.banner.method,
37
 }
37
 }
38
 
38
 
39
 http.getList = (data) => {
39
 http.getList = (data) => {
40
-  console.log(data)
40
+  // console.log(data)
41
   return new Promise((resolve, reject) => {
41
   return new Promise((resolve, reject) => {
42
     Ajax(api.index.list.url, {
42
     Ajax(api.index.list.url, {
43
       method: api.index.list.method
43
       method: api.index.list.method
50
 }
50
 }
51
 
51
 
52
 http.getCms = (data) => {
52
 http.getCms = (data) => {
53
-  console.log(data)
53
+  // console.log(data)
54
   return new Promise((resolve, reject) => {
54
   return new Promise((resolve, reject) => {
55
     Ajax(api.index.cms.url, {
55
     Ajax(api.index.cms.url, {
56
       method: api.index.cms.method,
56
       method: api.index.cms.method,
72
     nav: [],
72
     nav: [],
73
     banner: [],
73
     banner: [],
74
     list: [],
74
     list: [],
75
-    cms: []
75
+    cms: [],
76
+    fiveAList: [],
76
   },
77
   },
77
   mutations: {
78
   mutations: {
78
     setNav (state, data) {
79
     setNav (state, data) {
86
     },
87
     },
87
     setCms (state, data) {
88
     setCms (state, data) {
88
       state.cms = data
89
       state.cms = data
89
-    }
90
+    },
91
+    setFiveAList (state, data) {
92
+      state.fiveAList = data
93
+    },
90
   },
94
   },
91
   actions: {
95
   actions: {
96
+    getFiveAList (context, { ...payload }) { // 获取5A列表
97
+      return new Promise((resolve) => {
98
+        Ajax(api.index.getFiveAList.url, {
99
+          method: api.index.getFiveAList.method,
100
+          queryData: {
101
+            ...payload
102
+          },
103
+        }).then(res => {
104
+          context.commit('setFiveAList', res)
105
+          resolve(res)
106
+        })
107
+      })
108
+    },
92
     getNav (context, data) {
109
     getNav (context, data) {
93
       return new Promise((resolve) => {
110
       return new Promise((resolve) => {
94
         http.getNav(data).then((res) => {
111
         http.getNav(data).then((res) => {
96
           resolve(res)
113
           resolve(res)
97
         })
114
         })
98
       })
115
       })
99
-      
100
     },
116
     },
101
     getFiveAInfo (context, data) {
117
     getFiveAInfo (context, data) {
102
-      console.log(data)
118
+      // console.log(data)
103
       http.getBanner(data).then((res) => {
119
       http.getBanner(data).then((res) => {
104
         context.commit('setBanner', res)
120
         context.commit('setBanner', res)
105
       })
121
       })

+ 2
- 2
src/store/userCenter/userCenter.js Parādīt failu

93
       state.courseLocationList = data
93
       state.courseLocationList = data
94
     },
94
     },
95
     setCourseOrder (state, { res, page }) { // 设置我的课程订单信息
95
     setCourseOrder (state, { res, page }) { // 设置我的课程订单信息
96
-      if (page === 1) {
96
+      if (page <= 1) {
97
         state.courseOrderList = res
97
         state.courseOrderList = res
98
       } else {
98
       } else {
99
-        state.courseOrderList = { ...res, list: [...state.courseOrderList.list, res.list] }
99
+        state.courseOrderList = {...res, list: [...state.courseOrderList.list, ...res.list]}
100
       }
100
       }
101
     }
101
     }
102
   },
102
   },

+ 4
- 0
src/util/api.js Parādīt failu

25
     cms: { // 获取cms消息
25
     cms: { // 获取cms消息
26
       method: 'get',
26
       method: 'get',
27
       url: `${baseUrl}${guest}/cms/news`
27
       url: `${baseUrl}${guest}/cms/news`
28
+    },
29
+    getFiveAList: { // 获取5A列表
30
+      method: 'get',
31
+      url: `${baseUrl}${guest}/cms/course`
28
     }
32
     }
29
   },
33
   },
30
   caseForCoffee: {
34
   caseForCoffee: {