feat(广告): 添加首页广告弹窗组件并更新版本号
- 新增common-advertisement组件用于展示首页广告弹窗 - 在首页添加广告组件调用逻辑 - 更新manifest.json中的版本号至1.0.47 - 临时修改开发环境baseUrl配置
This commit is contained in:
@@ -118,6 +118,11 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<common-advertisement
|
||||
ref="commonAdvertisement"
|
||||
:list="advertisementList"
|
||||
></common-advertisement>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -151,6 +156,7 @@ export default {
|
||||
studyList: [], //正在学习
|
||||
flashSaleList: [], //欢迎试听
|
||||
subList: [],
|
||||
advertisementList: [],
|
||||
cateIndex: 0 //分类默认选中第一个
|
||||
}
|
||||
},
|
||||
@@ -160,6 +166,9 @@ export default {
|
||||
this.isShowTaihu=false
|
||||
}
|
||||
this.getCateList();
|
||||
this.$nextTick(() => {
|
||||
this.getAdvertisement();
|
||||
});
|
||||
},
|
||||
onShow() {
|
||||
|
||||
@@ -172,6 +181,27 @@ export default {
|
||||
this.getMarketCourseList();
|
||||
},
|
||||
methods: {
|
||||
async getAdvertisement() {
|
||||
await $http
|
||||
.request({
|
||||
url: "common/mainAd/getMainAd",
|
||||
method: "POST",
|
||||
data: {
|
||||
type: 3,
|
||||
},
|
||||
header: {
|
||||
//默认 无 说明:请求头
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (res.code == 0 && res.list && res.list.length > 0) {
|
||||
this.advertisementList = res.list;
|
||||
|
||||
this.$refs.commonAdvertisement.open();
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取列表数据
|
||||
getCateList(){
|
||||
uni.showLoading({
|
||||
|
||||
Reference in New Issue
Block a user