Skip to content

Commit 739e1b0

Browse files
committed
mp:同步 mp 公众号 SQL
1 parent b1663fe commit 739e1b0

File tree

4 files changed

+298
-298
lines changed

4 files changed

+298
-298
lines changed

src/views/mp/components/wx-location/main.vue

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@
1111
</template>
1212

1313
<script>
14-
export default {
15-
name: "wxLocation",
16-
props: {
17-
locationX: {
18-
required: true,
19-
type: Number
20-
},
21-
locationY: {
22-
required: true,
23-
type: Number
24-
},
25-
label: { // 地名
26-
required: true,
27-
type: String
28-
},
29-
qqMapKey: { // QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc
30-
required: false,
31-
type: String,
32-
default: 'TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E' // 需要自定义
33-
}
14+
export default {
15+
name: "wxLocation",
16+
props: {
17+
locationX: {
18+
required: true,
19+
type: Number
20+
},
21+
locationY: {
22+
required: true,
23+
type: Number
24+
},
25+
label: { // 地名
26+
required: true,
27+
type: String
28+
},
29+
qqMapKey: { // QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc
30+
required: false,
31+
type: String,
32+
default: 'TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E' // 需要自定义
3433
}
35-
};
34+
}
35+
};
3636
</script>

src/views/mp/components/wx-material-select/main.vue

Lines changed: 127 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -95,153 +95,153 @@
9595
</template>
9696

9797
<script>
98-
import WxNews from '@/views/mp/components/wx-news/main.vue';
99-
import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue';
100-
import WxVideoPlayer from '@/views/mp/components/wx-video-play/main.vue';
101-
import { getMaterialPage } from "@/api/mp/material";
102-
import { getFreePublishPage } from "@/api/mp/freePublish";
103-
import { getDraftPage } from "@/api/mp/draft";
98+
import WxNews from '@/views/mp/components/wx-news/main.vue';
99+
import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue';
100+
import WxVideoPlayer from '@/views/mp/components/wx-video-play/main.vue';
101+
import { getMaterialPage } from "@/api/mp/material";
102+
import { getFreePublishPage } from "@/api/mp/freePublish";
103+
import { getDraftPage } from "@/api/mp/draft";
104104
105-
export default {
106-
name: "wxMaterialSelect",
107-
components: {
108-
WxNews,
109-
WxVoicePlayer,
110-
WxVideoPlayer
105+
export default {
106+
name: "wxMaterialSelect",
107+
components: {
108+
WxNews,
109+
WxVoicePlayer,
110+
WxVideoPlayer
111+
},
112+
props: {
113+
objData: {
114+
type: Object, // type - 类型;accountId - 公众号账号编号
115+
required: true
111116
},
112-
props: {
113-
objData: {
114-
type: Object, // type - 类型;accountId - 公众号账号编号
115-
required: true
116-
},
117-
newsType:{ // 图文类型:1、已发布图文;2、草稿箱图文
118-
type: String,
119-
default: "1"
117+
newsType:{ // 图文类型:1、已发布图文;2、草稿箱图文
118+
type: String,
119+
default: "1"
120+
},
121+
},
122+
data() {
123+
return {
124+
// 遮罩层
125+
loading: false,
126+
// 总条数
127+
total: 0,
128+
// 数据列表
129+
list: [],
130+
// 查询参数
131+
queryParams: {
132+
pageNo: 1,
133+
pageSize: 10,
134+
accountId: this.objData.accountId,
120135
},
136+
}
137+
},
138+
created() {
139+
this.getPage()
140+
},
141+
methods:{
142+
selectMaterial(item) {
143+
this.$emit('selectMaterial', item)
121144
},
122-
data() {
123-
return {
124-
// 遮罩层
125-
loading: false,
126-
// 总条数
127-
total: 0,
128-
// 数据列表
129-
list: [],
130-
// 查询参数
131-
queryParams: {
132-
pageNo: 1,
133-
pageSize: 10,
134-
accountId: this.objData.accountId,
135-
},
145+
/** 搜索按钮操作 */
146+
handleQuery() {
147+
this.queryParams.pageNo = 1
148+
this.getPage()
149+
},
150+
getPage() {
151+
this.loading = true
152+
if (this.objData.type === 'news' && this.newsType === '1') { // 【图文】+ 【已发布】
153+
this.getFreePublishPage();
154+
} else if (this.objData.type === 'news' && this.newsType === '2') { // 【图文】+ 【草稿】
155+
this.getDraftPage();
156+
} else { // 【素材】
157+
this.getMaterialPage();
136158
}
137159
},
138-
created() {
139-
this.getPage()
160+
getMaterialPage() {
161+
getMaterialPage({
162+
...this.queryParams,
163+
type: this.objData.type
164+
}).then(response => {
165+
this.list = response.data.list
166+
this.total = response.data.total
167+
}).finally(() => {
168+
this.loading = false
169+
})
140170
},
141-
methods:{
142-
selectMaterial(item) {
143-
this.$emit('selectMaterial', item)
144-
},
145-
/** 搜索按钮操作 */
146-
handleQuery() {
147-
this.queryParams.pageNo = 1
148-
this.getPage()
149-
},
150-
getPage() {
151-
this.loading = true
152-
if (this.objData.type === 'news' && this.newsType === '1') { // 【图文】+ 【已发布】
153-
this.getFreePublishPage();
154-
} else if (this.objData.type === 'news' && this.newsType === '2') { // 【图文】+ 【草稿】
155-
this.getDraftPage();
156-
} else { // 【素材】
157-
this.getMaterialPage();
158-
}
159-
},
160-
getMaterialPage() {
161-
getMaterialPage({
162-
...this.queryParams,
163-
type: this.objData.type
164-
}).then(response => {
165-
this.list = response.data.list
166-
this.total = response.data.total
167-
}).finally(() => {
168-
this.loading = false
169-
})
170-
},
171-
getFreePublishPage() {
172-
getFreePublishPage(this.queryParams).then(response => {
173-
// 将 thumbUrl 转成 picUrl,保证 wx-news 组件可以预览封面
174-
response.data.list.forEach(item => {
175-
const newsItem = item.content.newsItem;
176-
newsItem.forEach(article => {
177-
article.picUrl = article.thumbUrl;
178-
})
171+
getFreePublishPage() {
172+
getFreePublishPage(this.queryParams).then(response => {
173+
// 将 thumbUrl 转成 picUrl,保证 wx-news 组件可以预览封面
174+
response.data.list.forEach(item => {
175+
const newsItem = item.content.newsItem;
176+
newsItem.forEach(article => {
177+
article.picUrl = article.thumbUrl;
179178
})
180-
this.list = response.data.list
181-
this.total = response.data.total
182-
}).finally(() => {
183-
this.loading = false
184179
})
185-
},
186-
getDraftPage() {
187-
getDraftPage((this.queryParams)).then(response => {
188-
// 将 thumbUrl 转成 picUrl,保证 wx-news 组件可以预览封面
189-
response.data.list.forEach(item => {
190-
const newsItem = item.content.newsItem;
191-
newsItem.forEach(article => {
192-
article.picUrl = article.thumbUrl;
193-
})
180+
this.list = response.data.list
181+
this.total = response.data.total
182+
}).finally(() => {
183+
this.loading = false
184+
})
185+
},
186+
getDraftPage() {
187+
getDraftPage((this.queryParams)).then(response => {
188+
// 将 thumbUrl 转成 picUrl,保证 wx-news 组件可以预览封面
189+
response.data.list.forEach(item => {
190+
const newsItem = item.content.newsItem;
191+
newsItem.forEach(article => {
192+
article.picUrl = article.thumbUrl;
194193
})
195-
this.list = response.data.list
196-
this.total = response.data.total
197-
}).finally(() => {
198-
this.loading = false
199194
})
200-
}
195+
this.list = response.data.list
196+
this.total = response.data.total
197+
}).finally(() => {
198+
this.loading = false
199+
})
201200
}
202-
};
201+
}
202+
};
203203
</script>
204204

205205
<style lang="scss" scoped>
206-
/*瀑布流样式*/
206+
/*瀑布流样式*/
207+
.waterfall {
208+
width: 100%;
209+
column-gap:10px;
210+
column-count: 5;
211+
margin: 0 auto;
212+
}
213+
.waterfall-item {
214+
padding: 10px;
215+
margin-bottom: 10px;
216+
break-inside: avoid;
217+
border: 1px solid #eaeaea;
218+
}
219+
.material-img {
220+
width: 100%;
221+
}
222+
p {
223+
line-height: 30px;
224+
}
225+
@media (min-width: 992px) and (max-width: 1300px) {
207226
.waterfall {
208-
width: 100%;
209-
column-gap:10px;
210-
column-count: 5;
211-
margin: 0 auto;
212-
}
213-
.waterfall-item {
214-
padding: 10px;
215-
margin-bottom: 10px;
216-
break-inside: avoid;
217-
border: 1px solid #eaeaea;
218-
}
219-
.material-img {
220-
width: 100%;
227+
column-count: 3;
221228
}
222229
p {
223-
line-height: 30px;
230+
color:red;
224231
}
225-
@media (min-width: 992px) and (max-width: 1300px) {
226-
.waterfall {
227-
column-count: 3;
228-
}
229-
p {
230-
color:red;
231-
}
232+
}
233+
@media (min-width: 768px) and (max-width: 991px) {
234+
.waterfall {
235+
column-count: 2;
232236
}
233-
@media (min-width: 768px) and (max-width: 991px) {
234-
.waterfall {
235-
column-count: 2;
236-
}
237-
p {
238-
color: orange;
239-
}
237+
p {
238+
color: orange;
240239
}
241-
@media (max-width: 767px) {
242-
.waterfall {
243-
column-count: 1;
244-
}
240+
}
241+
@media (max-width: 767px) {
242+
.waterfall {
243+
column-count: 1;
245244
}
246-
/*瀑布流样式*/
245+
}
246+
/*瀑布流样式*/
247247
</style>

0 commit comments

Comments
 (0)