许静 5 anni fa
parent
commit
c1e4c81291

+ 10
- 0
src/config/api.js Vedi File

@@ -273,5 +273,15 @@ const apis = {
273 273
       url: `${commPrefix}/taPointsExchange/change`
274 274
     }
275 275
   },
276
+  carouselFigure:{ // 轮播图列表查询
277
+    list:{
278
+      method:'get',
279
+      url: `${commPrefix}/extendContent`
280
+    },
281
+    handle:{
282
+      method:'get',
283
+      url: `${commPrefix}/extendContent/:id `
284
+    },
285
+  },
276 286
 }
277 287
 export default apis

+ 1
- 0
src/store/index.js Vedi File

@@ -18,6 +18,7 @@ const store = new Vuex.Store({
18 18
     goods: require('./modules/goods').default,
19 19
     points: require('./modules/points').default,
20 20
     exchange: require('./modules/exchange').default,
21
+    carouselFigure: require('./modules/carouselFigure').default,
21 22
     news
22 23
 
23 24
   }

+ 73
- 0
src/store/modules/carouselFigure.js Vedi File

@@ -0,0 +1,73 @@
1
+import request from '../../utils/request'
2
+import apis from '../../config/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    carouselList: {},
8
+    // detail: {}
9
+  },
10
+  mutations: {
11
+    updateList (state, payload) {
12
+      state.carouselList = payload
13
+    },
14
+    // updateDetail (state, payload) {
15
+    //   state.detail = payload
16
+    // }
17
+  },
18
+  actions: {
19
+    // setDetailNull ({ commit }) {
20
+    //   commit('updateDetail', {})
21
+    // },
22
+    getExtendContent ({ commit }, payload) {
23
+      return new Promise((resolve, reject) => {
24
+        request({
25
+          ...apis.carouselFigure.list,
26
+          params: payload,
27
+        }).then((data) => {
28
+          commit('updateList', data)
29
+          resolve(data)
30
+        }).catch((err) => {
31
+          const message = err.message || err.msg
32
+          if (typeof message === 'string') {
33
+            reject(message)
34
+          }
35
+        })
36
+      })
37
+    },
38
+    handleExtendContent ({ commit }, payload) {
39
+      return new Promise((resolve, reject) => {
40
+        request({
41
+          ...apis.carouselFigure.handle,
42
+          urlData: { id: payload.contentId },
43
+          params: payload,
44
+        }).then((data) => {
45
+          commit('updateList', data)
46
+          resolve(data)
47
+        }).catch((err) => {
48
+          const message = err.message || err.msg
49
+          if (typeof message === 'string') {
50
+            reject(message)
51
+          }
52
+        })
53
+      })
54
+    },
55
+    // getGoodsDetail ({ commit }, payload) {
56
+    //   return new Promise((resolve, reject) => {
57
+    //     request({
58
+    //       ...apis.goods.detail,
59
+    //       urlData: payload,
60
+    //     }).then((data) => {
61
+    //       commit('updateDetail', data)
62
+    //       resolve(data)
63
+    //     }).catch((err) => {
64
+    //       const message = err.message || err.msg
65
+
66
+    //       if (typeof message === 'string') {
67
+    //         reject(message)
68
+    //       }
69
+    //     })
70
+    //   })
71
+    // },
72
+  }
73
+}

+ 90
- 99
src/views/carouselFigure/list.vue Vedi File

@@ -8,9 +8,7 @@
8 8
       </div>
9 9
       <div class="moreFilter"></div>
10 10
     </div>
11
-    <el-table
12
-      :data="dynamics.list || []"
13
-      >
11
+    <el-table :data="carouselList.records || []">
14 12
       <el-table-column
15 13
         type="index">
16 14
         <template slot-scope="scope">
@@ -21,21 +19,24 @@
21 19
         label="主图">
22 20
         <template slot-scope="scope">
23 21
           <div class="header">
24
-            <img :src="scope.row.imgUrl" alt="" />
22
+            <img :src="scope.row.image" alt="" />
25 23
           </div>
26 24
         </template>
27 25
       </el-table-column>
28 26
       <el-table-column
29
-        prop="title"
27
+        prop="showType"
30 28
         label="类型">
31 29
       </el-table-column>
32 30
       <el-table-column
33
-        prop="desc"
31
+        prop="showPosition"
34 32
         label="发布位置">
35 33
       </el-table-column>
36 34
       <el-table-column
37
-        prop="createDate"
38
-        label="发布时间">
35
+        label="发布时间"
36
+        width="180">
37
+        <template slot-scope="scope">
38
+          <span>{{FormatDate(scope.row.createDate)}}</span>
39
+        </template>
39 40
       </el-table-column>
40 41
       <el-table-column
41 42
         label="状态"
@@ -51,8 +52,7 @@
51 52
         <template slot-scope="scope">
52 53
           <el-button type="text" @click="handleEdit(scope.row)" v-if="scope.row.status === 0" size="small">编辑</el-button>
53 54
           <el-button type="text" @click="handlePulic(scope.row)" size="small" v-if="scope.row.status === 0">启用</el-button>
54
-          <el-button type="text" @click="handleUnPulic(scope.row)" size="small" v-if="scope.row.status === 1">禁用</el-button>
55
-
55
+          <el-button type="text" @click="Prohibit(scope.row)" size="small" v-if="scope.row.status === 1">禁用</el-button>
56 56
         </template>
57 57
       </el-table-column>
58 58
     </el-table>
@@ -62,7 +62,7 @@
62 62
       layout="prev, pager, next"
63 63
       :current-page.sync="currentPage"
64 64
       :pageSize="pageSize"
65
-      :total="dynamics.total || 0"
65
+      :total="carouselList.total || 0"
66 66
       @current-change="getList"
67 67
     >
68 68
     </el-pagination>
@@ -70,151 +70,142 @@
70 70
 </template>
71 71
 
72 72
 <script>
73
-import { createNamespacedHelpers } from 'vuex';
73
+import { createNamespacedHelpers } from "vuex";
74
+import dayjs from 'dayjs'
74 75
 
75
-const {mapState: mapDynamicState, mapActions: mapDynamicActions} = createNamespacedHelpers('dynamic')
76
-const {mapState: mapBuildingState, mapActions: mapBuildingActions} = createNamespacedHelpers('building')
76
+const {
77
+  mapState: mapCarouselFigureState,
78
+  mapActions: mapCarouselFigureActions
79
+} = createNamespacedHelpers("carouselFigure");
80
+
81
+const {
82
+  mapState: mapBuildingState,
83
+  mapActions: mapBuildingActions
84
+} = createNamespacedHelpers("building");
77 85
 
78 86
 export default {
79 87
   data() {
80 88
     return {
81 89
       pageSize: 20,
82 90
       currentPage: 1,
83
-      name: '',
84
-      buildingId: '',
85
-    }
91
+      name: "",
92
+      buildingId: ""
93
+    };
86 94
   },
87 95
   computed: {
88
-    ...mapDynamicState({
89
-      dynamics: x => x.dynamics
96
+    ...mapCarouselFigureState({
97
+      carouselList: x => x.carouselList
90 98
     }),
91 99
     ...mapBuildingState({
92 100
       buildings: x => x.buildings
93 101
     })
94 102
   },
95 103
   methods: {
96
-    ...mapDynamicActions([
97
-      'getDynamics',
98
-      'setDetailNull',
99
-      'deleteDynamics',
100
-      'publicDynamic',
101
-      'cancelDynamic'
102
-    ]),
103
-    ...mapBuildingActions([
104
-      'getBuildings',
105
-    ]),
106
-    GetIndex (inx) {
107
-      return (this.currentPage - 1) * this.pageSize + inx + 1
104
+    ...mapCarouselFigureActions(["getExtendContent","handleExtendContent"]),
105
+    ...mapBuildingActions(["getBuildings"]),
106
+    GetIndex(inx) {
107
+      return (this.currentPage - 1) * this.pageSize + inx + 1;
108 108
     },
109
-    FormatDate (date) {
110
-      if (date) {
111
-        return dayjs(date).formate('yyyy-MM-DD HH:mm:ss')
112
-      } else {
113
-        return ''
114
-      }
109
+    FormatDate(date) {
110
+      if (!date || date.indexOf('0001-') > -1) return ''
111
+
112
+      return dayjs(date).format('YYYY-MM-DD HH:mm:ss')
115 113
     },
116
-    getList () {
117
-      this.getDynamics({
114
+
115
+    getList() {
116
+      this.getExtendContent({
118 117
         pageNum: this.currentPage,
119
-        pageSize: this.pageSize,
120
-        name: this.name,
121
-        buildingId: this.buildingId
122
-      })
118
+        pageSize: this.pageSize
119
+      });
123 120
     },
124
-    getBuildingName (id) {
125
-      return ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {}).buildingName || ''
121
+    getBuildingName(id) {
122
+      return (
123
+        ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {})
124
+          .buildingName || ""
125
+      );
126 126
     },
127
-    search () {
128
-      this.currentPage = 1
129
-      this.getList()
127
+    search() {
128
+      this.currentPage = 1;
129
+      this.getList();
130 130
     },
131
-    handleEdit (row) {
132
-      this.setDetailNull()
133
-      this.$router.push({name: 'editCarousel', query: {id: row.dynamicId}})
131
+    handleEdit(row) {
132
+      this.$router.push({ name: "editCarousel", query: { id: row.dynamicId } });
134 133
     },
135
-    handlePulic (row) {
136
-      this.$confirm('确认发布此数据?', '提示', {
137
-        confirmButtonText: '确定',
138
-        cancelButtonText: '取消',
139
-        type: 'warning'
140
-      }).then(() => {
141
-        this.publicDynamic({
142
-          id: row.dynamicId
143
-        }).then(() => {
144
-          this.getList()
145
-        })
146
-      })
134
+    handlePulic(row) {
135
+      this.$confirm("确认发布此数据?", "提示", {
136
+        confirmButtonText: "确定",
137
+        cancelButtonText: "取消",
138
+        type: "warning"
139
+      }).then(() => {});
147 140
     },
148
-    handleUnPulic (row) {
149
-      this.$confirm('确认取消发布此数据?', '提示', {
150
-        confirmButtonText: '确定',
151
-        cancelButtonText: '取消',
152
-        type: 'warning'
141
+    Prohibit(row) {
142
+      this.$confirm("确认停用此轮播图?", "提示", {
143
+        confirmButtonText: "确定",
144
+        cancelButtonText: "取消",
145
+        type: "warning"
153 146
       }).then(() => {
154
-        this.cancelDynamic({
155
-          id: row.dynamicId}).then(() => {
156
-          this.getList()
147
+        this.handleExtendContent(row.contentId)
148
+        .then(res => {
149
+          
150
+        
157 151
         })
158
-      })
152
+        .catch(err => {
153
+         
154
+        });
155
+      });
159 156
     },
160
-    handleDel (row) {
161
-      this.$confirm('确认删除此数据?', '提示', {
162
-        confirmButtonText: '确定',
163
-        cancelButtonText: '取消',
164
-        type: 'warning'
157
+    handleDel(row) {
158
+      this.$confirm("确认删除此数据?", "提示", {
159
+        confirmButtonText: "确定",
160
+        cancelButtonText: "取消",
161
+        type: "warning"
165 162
       }).then(() => {
166 163
         if (row.status === 1) {
167
-          this.$message.error('当前活动处于发布状态,不允许删除!')
168
-          return false
164
+          this.$message.error("当前活动处于发布状态,不允许删除!");
165
+          return false;
169 166
         }
170
-        this.deleteDynamics({
171
-          id: row.dynamicId
172
-        }).then(() => {
173
-          this.getList()
174
-        })
175
-      })
167
+      });
176 168
     },
177
-    addDynamic () {
178
-      this.setDetailNull()
179
-      this.$router.push({name: 'editCarousel'})
169
+    addDynamic() {
170
+      this.$router.push({ name: "editCarousel" });
180 171
     }
181 172
   },
182
-  created () {
173
+  created() {
183 174
     this.getBuildings({
184 175
       pageNum: 1,
185
-      pageSize: 100,
176
+      pageSize: 100
186 177
     }).then(() => {
187
-      this.getList()
188
-    })
178
+      this.getList();
179
+    });
189 180
   }
190
-}
181
+};
191 182
 </script>
192 183
 
193 184
 <style lang="scss" scoped>
194
-.header{
185
+.header {
195 186
   width: 50px;
196 187
   height: 50px;
197
-  img{
188
+  img {
198 189
     width: 100%;
199 190
     height: 100%;
200 191
   }
201 192
 }
202 193
 
203
-.system-table-search{
194
+.system-table-search {
204 195
   width: calc(100% - 40px);
205 196
   margin: 20px auto 0;
206 197
 }
207 198
 
208
-.system-table-search li{
199
+.system-table-search li {
209 200
   margin-right: 20px;
210 201
 }
211 202
 
212
-.system-table-search ul{
203
+.system-table-search ul {
213 204
   font-size: 0;
214 205
   white-space: nowrap;
215 206
 }
216 207
 
217
-.system-table-search ul>li{
208
+.system-table-search ul > li {
218 209
   display: inline-block;
219 210
 }
220 211
 

+ 1
- 1
src/views/consultant/list.vue Vedi File

@@ -108,7 +108,7 @@ export default {
108 108
         });
109 109
     },
110 110
     addDynamic() {
111
-      this.$router.push({ name: "consultant.list" });
111
+      this.$router.push({ name: "consultant.edit" });
112 112
     },
113 113
     toDetail(row) {
114 114
       this.$router.push({

+ 1
- 1
src/views/index.js Vedi File

@@ -33,7 +33,7 @@ const pages = [
33 33
         name: 'consultant.edit',
34 34
         component: () => import('./consultant/edit.vue'),
35 35
         meta: {
36
-          menuShow: true,
36
+          menuShow: false,
37 37
           title: '置业管理',
38 38
         },
39 39
       },

+ 3
- 3
src/views/news/type/index.vue Vedi File

@@ -90,13 +90,13 @@
90 90
             },
91 91
             handleSizeChange(val) {
92 92
                 console.log(`每页 ${val} 条`);
93
-                this.form.pageSize = val
94
-                this.form.pageNum = 1
93
+                this.pageSize = val
94
+                this.pageNum = 1
95 95
                 this.getList()
96 96
             },
97 97
             handleCurrentChange(val) {
98 98
                 console.log(`当前页: ${val}`);
99
-                this.form.pageNum = val
99
+                this.pageNum = val
100 100
                 this.getList()
101 101
             },
102 102
             getList() {

+ 2
- 1
vue.config.js Vedi File

@@ -4,7 +4,8 @@ module.exports = {
4 4
     port: 8080,
5 5
     proxy: {
6 6
       '/api': {
7
-        target: 'http://192.168.0.11:8080',
7
+        // target: 'http://192.168.0.11:8080',
8
+        target: 'http://192.168.0.131:8080',
8 9
         changeOrigin: true,
9 10
         // pathRewrite: {
10 11
         //   '^/api': '/'