Przeglądaj źródła

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

yuantianjiao 6 lat temu
rodzic
commit
03a1109c0e

+ 4
- 0
src/pages/user/bindMobile/bindMobile.vue Wyświetl plik

@@ -155,6 +155,7 @@ export default {
155 155
       }, 1000)
156 156
     },
157 157
     submit () {
158
+      var _that = this
158 159
       if (!this.postData.captcha) {
159 160
         this.$toast('请先获取验证码')
160 161
         return
@@ -169,6 +170,9 @@ export default {
169 170
       }
170 171
       this.submitData(this.postData).then((res) => {
171 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 Wyświetl plik

@@ -17,13 +17,14 @@
17 17
           </div>
18 18
           <h5>结识更多朋友</h5>
19 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 22
                 <courseItem :data="item"></courseItem>
23 23
               </router-link>
24 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 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 28
           <div style="width:100%;height:.1rem;background:#f8f8f8;margin:0 auto;"></div>
28 29
           <h5>资讯</h5>
29 30
           <div class="newsList flex-h">
@@ -50,8 +51,9 @@ export default {
50 51
   name: '',
51 52
   data () {
52 53
     return {
54
+      fiveANoData: false,
53 55
       active: {
54
-        index: 1,
56
+        index: 0,
55 57
         locationid: ''
56 58
       },
57 59
       swiperOption: {
@@ -65,63 +67,8 @@ export default {
65 67
         LocationId: "selected",
66 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 74
   computed: {
@@ -129,7 +76,8 @@ export default {
129 76
       orgid: x => x.app.orgId,
130 77
       navList: x => x.fiveA.nav,
131 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 82
     MySwiper () {
135 83
       return this.$refs.mySwiper.swiper
@@ -147,22 +95,65 @@ export default {
147 95
   created () {
148 96
     this.getNav({ orgid: this.orgid, issys: '0' }).then(() => {
149 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 114
       this.getFiveAInfo({ orgid: this.orgid, locationid: this.active.locationid }).then(() => {
152 115
         this.newsList = this.cms
153 116
       })
154 117
     })
155 118
   },
156 119
   methods: {
157
-    ...mapFiveAActions(['getNav']),
158
-    ...mapFiveAActions(['getFiveAInfo']),
120
+    ...mapFiveAActions([
121
+      'getNav',
122
+      'getFiveAInfo',
123
+      'getFiveAList',
124
+    ]),
159 125
     changeLocation (item, index) {
160 126
       this.active.index = index
161 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 138
       this.getFiveAInfo({ orgid: this.orgid, locationid: this.active.locationid }).then(() => {
163 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 157
     jump (item) {
167 158
       console.log(item)
168 159
       item.ForwardType = item.ForwardType || ''
@@ -180,5 +171,5 @@ export default {
180 171
 
181 172
 <!-- Add "scoped" attribute to limit CSS to this component only -->
182 173
 <style lang="scss" scoped>
183
-@import "page.scss";
174
+@import 'page.scss';
184 175
 </style>

+ 8
- 7
src/pages/user/mainPage/indexPage/index.vue Wyświetl plik

@@ -83,7 +83,6 @@ export default {
83 83
       locationId: '',
84 84
       swiperOption: {
85 85
         observer: true,
86
-        loop: true,
87 86
         autoplay: {
88 87
           disableOnInteraction: false,
89 88
         }
@@ -126,11 +125,13 @@ export default {
126 125
       this.locationId = 'index'
127 126
       this.getIndexInfo({ orgid: this.orgid, locationid: this.locationId }).then(() => {
128 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,5 +158,5 @@ export default {
157 158
 
158 159
 <!-- Add "scoped" attribute to limit CSS to this component only -->
159 160
 <style lang="scss" scoped>
160
-@import "page.scss";
161
+@import 'page.scss';
161 162
 </style>

+ 4
- 1
src/pages/user/router.js Wyświetl plik

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

+ 23
- 7
src/store/fiveA/fiveA.js Wyświetl plik

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

+ 2
- 2
src/store/userCenter/userCenter.js Wyświetl plik

@@ -93,10 +93,10 @@ export default {
93 93
       state.courseLocationList = data
94 94
     },
95 95
     setCourseOrder (state, { res, page }) { // 设置我的课程订单信息
96
-      if (page === 1) {
96
+      if (page <= 1) {
97 97
         state.courseOrderList = res
98 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 Wyświetl plik

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