feat(广告): 添加首页广告弹窗组件并更新版本号
- 新增common-advertisement组件用于展示首页广告弹窗 - 在首页添加广告组件调用逻辑 - 更新manifest.json中的版本号至1.0.47 - 临时修改开发环境baseUrl配置
This commit is contained in:
@@ -2,8 +2,8 @@ let baseUrl = "";
|
|||||||
let socketUrl = "";
|
let socketUrl = "";
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// 开发环境
|
// 开发环境
|
||||||
// baseUrl = "http://192.168.110.100:9200/pb/"; // 张川川
|
baseUrl = "http://192.168.110.100:9200/pb/"; // 张川川
|
||||||
baseUrl = "https://api.nuttyreading.com/"; //线上正式
|
// baseUrl = "https://api.nuttyreading.com/"; //线上正式
|
||||||
} else if (process.env.NODE_ENV === 'production') {
|
} else if (process.env.NODE_ENV === 'production') {
|
||||||
// baseUrl = "http://192.168.110.100:9200/pb/"; // 张川川
|
// baseUrl = "http://192.168.110.100:9200/pb/"; // 张川川
|
||||||
baseUrl = "https://api.nuttyreading.com/"; //线上正式
|
baseUrl = "https://api.nuttyreading.com/"; //线上正式
|
||||||
|
|||||||
3
main.js
3
main.js
@@ -82,6 +82,9 @@ Vue.component('common-anchor-link', commonAnchorLink);
|
|||||||
import commonSelectVip from '@/pages/component/commonComponents/selectVip.vue'
|
import commonSelectVip from '@/pages/component/commonComponents/selectVip.vue'
|
||||||
Vue.component('common-select-vip', commonSelectVip);
|
Vue.component('common-select-vip', commonSelectVip);
|
||||||
|
|
||||||
|
import commonAdvertisement from '@/pages/component/commonComponents/advertisement.vue'
|
||||||
|
Vue.component('common-advertisement', commonAdvertisement);
|
||||||
|
|
||||||
|
|
||||||
App.mpType = 'app'
|
App.mpType = 'app'
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
"name" : "心灵空间",
|
"name" : "心灵空间",
|
||||||
"appid" : "__UNI__BBBDFD2",
|
"appid" : "__UNI__BBBDFD2",
|
||||||
"description" : "心灵空间",
|
"description" : "心灵空间",
|
||||||
"versionName" : "1.0.46",
|
"versionName" : "1.0.47",
|
||||||
"sassImplementationName" : "node-sass",
|
"sassImplementationName" : "node-sass",
|
||||||
"versionCode" : 1046,
|
"versionCode" : 1047,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
260
pages/component/commonComponents/advertisement.vue
Normal file
260
pages/component/commonComponents/advertisement.vue
Normal file
@@ -0,0 +1,260 @@
|
|||||||
|
<template>
|
||||||
|
<view
|
||||||
|
class="container commonPageBox commonDetailPage"
|
||||||
|
style="height: auto !important; padding-bottom: 0 !important"
|
||||||
|
>
|
||||||
|
<u-popup :show="show" v-if="show" mode="center" class="popup_box">
|
||||||
|
<div class="product_image" scroll-y="true" style="position: relative">
|
||||||
|
<swiper
|
||||||
|
:style="{ height: fullHeight }"
|
||||||
|
class="swiper-tall"
|
||||||
|
:indicator-dots="indicatorDots"
|
||||||
|
:autoplay="autoplay"
|
||||||
|
:previous-margin="previousMargin"
|
||||||
|
:next-margin="nextMargin"
|
||||||
|
:circular="circular"
|
||||||
|
@change="change"
|
||||||
|
:current="swiperCurrentIndex"
|
||||||
|
>
|
||||||
|
<swiper-item
|
||||||
|
class="swiper-container"
|
||||||
|
v-for="(img, index) in list"
|
||||||
|
:key="index"
|
||||||
|
:item-id="index"
|
||||||
|
:data-year="index"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
@click="gotoDetail(img)"
|
||||||
|
class="swiper-item"
|
||||||
|
:style="{
|
||||||
|
background: img ? 'url(' + img.icon + ') center no-repeat' : '',
|
||||||
|
backgroundSize: '100% 100%',
|
||||||
|
}"
|
||||||
|
:animation="animationData[index]"
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
<view
|
||||||
|
style="display: flex; align-items: center; justify-content: center"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
@click="close()"
|
||||||
|
style="
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: rgba(255, 255, 255, 0.8);
|
||||||
|
color: #333;
|
||||||
|
padding: 20rpx 10rpx;
|
||||||
|
width: 200rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
text-align: center;
|
||||||
|
letter-spacing: 0.5rpx;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
关闭
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</div>
|
||||||
|
</u-popup></view
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const stopPenetrate = () => {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
import { mapState } from "vuex";
|
||||||
|
export default {
|
||||||
|
props: ["list"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
screenHeight: 0,
|
||||||
|
animationData: {
|
||||||
|
0: {},
|
||||||
|
1: {},
|
||||||
|
2: {},
|
||||||
|
},
|
||||||
|
title: "0",
|
||||||
|
indicatorDots: false,
|
||||||
|
autoplay: false,
|
||||||
|
previousMargin: uni.upx2px(82) + "px",
|
||||||
|
nextMargin: uni.upx2px(82) + "px",
|
||||||
|
circular: true,
|
||||||
|
zoomParam: 1.1,
|
||||||
|
swiperCurrentIndex: 0,
|
||||||
|
data: [],
|
||||||
|
max: 0,
|
||||||
|
show: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.show = false;
|
||||||
|
},
|
||||||
|
onLoad() {},
|
||||||
|
onHide() {
|
||||||
|
// this.showSearchList = false
|
||||||
|
// this.searchList = []
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["userInfo"]),
|
||||||
|
|
||||||
|
fullHeight() {
|
||||||
|
const res = uni.getSystemInfoSync();
|
||||||
|
return (
|
||||||
|
res.windowHeight - uni.upx2px(60) - (res.statusBarHeight + 44) + "px"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
gotoDetail(v) {
|
||||||
|
console.log("v at line 58:", v);
|
||||||
|
if (v.relationId) {
|
||||||
|
if (v.type == 0) {
|
||||||
|
if (v.shopProduct) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/goods/index/index?navTitle=''&isMiaosha=0&title=''&id=${v.shopProduct.productId}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (v.type == 1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/mine/wallet/recharge/index`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (v.type == 2) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/mine/vip/index`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.show = false;
|
||||||
|
},
|
||||||
|
// 放大图片
|
||||||
|
previewImage(url) {
|
||||||
|
console.log(url);
|
||||||
|
uni.previewImage({
|
||||||
|
urls: [url],
|
||||||
|
longPressActions: {
|
||||||
|
itemList: ["很抱歉,暂不支持保存图片到本地"],
|
||||||
|
success: function (res) {
|
||||||
|
// console.log(res,'+++++')
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
change(e) {
|
||||||
|
this.swiperCurrentIndex = e.detail.current;
|
||||||
|
this.title = e.detail.currentItemId;
|
||||||
|
for (let key in this.animationData) {
|
||||||
|
if (e.detail.currentItemId == key) {
|
||||||
|
this.animation.scale(this.zoomParam).step();
|
||||||
|
this.animationData[key] = this.animation.export();
|
||||||
|
} else {
|
||||||
|
this.animation.scale(1.0).step();
|
||||||
|
this.animationData[key] = this.animation.export();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.show = false;
|
||||||
|
},
|
||||||
|
selectGoods(data) {
|
||||||
|
this.$emit("selectGoods", data);
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
this.animation = uni.createAnimation();
|
||||||
|
this.animation.scale(this.zoomParam).step();
|
||||||
|
this.animationData[0] = this.animation.export();
|
||||||
|
this.show = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
onHandleClickBuy() {
|
||||||
|
this.$emit("selectGoodsData", this.selectGoodsData);
|
||||||
|
this.$emit("onHandleClickBuy");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onBackPress() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.key.hideSoftKeybord();
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
|
||||||
|
components: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.goods_image {
|
||||||
|
width: 70vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup_box {
|
||||||
|
padding-top: 30rpx;
|
||||||
|
|
||||||
|
background-color: transparent;
|
||||||
|
|
||||||
|
.popup_content {
|
||||||
|
padding-bottom: 140rpx;
|
||||||
|
}
|
||||||
|
/deep/.list_item {
|
||||||
|
// border-bottom: none;
|
||||||
|
|
||||||
|
border: none !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product_image {
|
||||||
|
width: 100vw;
|
||||||
|
|
||||||
|
max-height: 90vh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/deep/.u-popup__content {
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
/deep/.u-popup__content__close {
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
.title_box {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding-left: 0;
|
||||||
|
.title_price {
|
||||||
|
color: #ef1224;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.swiper-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-item {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
height: 858upx;
|
||||||
|
width: 530upx;
|
||||||
|
line-height: 300upx;
|
||||||
|
text-align: center;
|
||||||
|
broder-radius: 6upx;
|
||||||
|
margin-bottom: 50upx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-tall {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper-title {
|
||||||
|
width: 750upx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -118,6 +118,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<common-advertisement
|
||||||
|
ref="commonAdvertisement"
|
||||||
|
:list="advertisementList"
|
||||||
|
></common-advertisement>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -151,6 +156,7 @@ export default {
|
|||||||
studyList: [], //正在学习
|
studyList: [], //正在学习
|
||||||
flashSaleList: [], //欢迎试听
|
flashSaleList: [], //欢迎试听
|
||||||
subList: [],
|
subList: [],
|
||||||
|
advertisementList: [],
|
||||||
cateIndex: 0 //分类默认选中第一个
|
cateIndex: 0 //分类默认选中第一个
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -160,6 +166,9 @@ export default {
|
|||||||
this.isShowTaihu=false
|
this.isShowTaihu=false
|
||||||
}
|
}
|
||||||
this.getCateList();
|
this.getCateList();
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.getAdvertisement();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
|
||||||
@@ -172,6 +181,27 @@ export default {
|
|||||||
this.getMarketCourseList();
|
this.getMarketCourseList();
|
||||||
},
|
},
|
||||||
methods: {
|
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(){
|
getCateList(){
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
|
|||||||
Reference in New Issue
Block a user