123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292 |
- <template>
- <view class="pageDesin-box" v-if="temData.length">
- <!-- <view class="address-view" @click="openLocation" :style="{ backgroundColor: temData[0].modelData.topBgColor, color:temData[0].modelData.textColor }">
- <text class="ibonfont ibondingweiweizhi"></text>
- <text class="address-text">{{ location.address || '请手动定位' }}</text>
- <text class="ibonfont ibonjinru"></text>
- </view> -->
- <!-- <view style="position: relative;z-index: 2;"> -->
- <block v-for="(item, index) in temData" :key="index">
- <ImgSwiper v-if="item.comName === 'ImgSwiper'" :modelData="item.modelData" />
- <SearchC v-if="item.comName === 'SearchC'" :modelData="item.modelData" />
- <MagicImg v-if="item.comName === 'MagicImg'" :modelData="item.modelData" />
- <Notice v-if="item.comName === 'Notice'" :modelData="item.modelData" :noticeData="item.data" />
- <NavBar v-if="item.comName === 'NavBar'" :modelData="item.modelData" />
- <view class="flex" v-if="temData[index].comName === 'NavBar' && temData[index+1].comName !== 'NavBar'">
- <image src="http://up.liuniukj.com/16921750418414/3bef1eab4692142cfe373956646e6f70/yyzq.png" mode=""
- class="banner-ad"
- @click="navTo('/pagesT/unit/item')"></image>
- <image src="http://up.liuniukj.com/169217504184137/3bef1eab4692142cfe373956646e6f70/lqzx.png" mode=""
- class="banner-ad"
- @click="navTo('/pagesT/user/GetCoupon')"></image>
- </view>
- <AdvGroup v-if="item.comName === 'AdvGroup'" :modelData="item.modelData" />
- <GoodsGroup v-if="item.comName === 'GoodsGroup'" :modelData="item.modelData" :goodsList="item.data"
- :showGoodsPrice="showGoodsPrice" :selAddress="selAddressD" />
- <LimitedSeckill v-if="item.comName === 'LimitedSeckill'" :modelData="item.modelData" :goodsList="item.data"
- :showGoodsPrice="showGoodsPrice" :selAddress="selAddressD" />
- <CouponGroup v-if="item.comName === 'CouponGroup'" :modelData="item.modelData" :couponList="item.data" />
- <LineF v-if="item.comName === 'LineF'" :modelData="item.modelData" />
- <Blank v-if="item.comName === 'Blank'" :modelData="item.modelData" />
- <div v-if="item.comName === 'FloatBth'" class="float-bth" @click="btnEvent(item)" :style="{
- backgroundColor: item.modelData.btnStyle === 2 ? item.modelData.bgColor : 'transparent',
- borderColor: item.modelData.btnStyle === 2 ? item.modelData.bgColor : '#999999'
- }">
- <image :src="item.modelData.image" class="float-img" />
- </div>
- <!-- #ifdef MP-WEIXIN -->
- <button v-if="item.comName === 'wxService'" class="float-bth wxService" :style="{
- color: item.modelData.color
- }" open-type="contact">
- <text class="ibonfont ibonkefu"></text>
- </button>
- <!-- #endif -->
- </block>
- <!-- <view class="logo-view" v-if="$common.getEnToken() !== '8fa553d53f44e33123e4d0d51a0de634'">
- <image src="https://onlineimg.qianniao.vip/QNlogo-i-1.png" mode="aspectFit"></image>
- <view class="logo-tip">- 千鸟云商提供技术支持 -</view>
- </view> -->
- <!-- </view> -->
- </view>
- </template>
- <script>
- import SearchC from './components/Search.vue';
- import ImgSwiper from './components/Banner.vue';
- import MagicImg from './components/MagicImg.vue';
- import Notice from './components/Notice.vue';
- import NavBar from './components/NavBar.vue';
- import GoodsGroup from './components/GoodsGroup.vue';
- import LimitedSeckill from './components/LimitedSeckill.vue';
- import CouponGroup from './components/CouponGroup.vue';
- import LineF from './components/Line.vue';
- import Blank from './components/Blank.vue';
- import AdvGroup from './components/AdvGroup.vue';
- // import NavigationBar from './components/NavigationBar.vue';
- export default {
- name: 'PageDesign',
- components: {
- SearchC,
- ImgSwiper,
- MagicImg,
- Notice,
- NavBar,
- GoodsGroup,
- LimitedSeckill,
- CouponGroup,
- LineF,
- Blank,
- AdvGroup
- // NavigationBar
- },
- props: {
- showGoodsPrice: {
- type: [Number, String],
- default: ''
- },
- temData: {
- type: Array,
- default: () => {
- return [];
- }
- },
- pageBack: {
- type: Boolean,
- default: false
- },
- isBackIndex: {
- type: Boolean,
- default: false
- },
- amapPlugin: {
- type: [Object, Function],
- default: () => {
- return {};
- }
- },
- selAddress: {
- type: Object,
- default: () => {
- return {};
- }
- }
- },
- computed: {
- style() {
- const systemInfo = uni.getSystemInfoSync();
- return `padding-top:${systemInfo.statusBarHeight + 50}px`;
- },
- location() {
- return this.$store.state.locationObj;
- }
- },
- data() {
- return {
- selAddressD: {}
- };
- },
- watch: {
- selAddress(val) {
- this.selAddressD = val;
- }
- },
- created() {
- // console.log(this.$common.getEnToken())
- // this.getHome();
- },
- methods: {
- navTo(url) {
- // console.log(this.hasLogin)
- // return
- if (!this.$store.state.hasLogin) {
- // #ifdef APP-PLUS
- uni.reLaunch({
- url: '/pagesT/public/wxLogin'
- });
- // #endif
- // #ifdef MP-WEIXIN
- uni.reLaunch({
- url: '/pagesT/binding/bindInfo'
- });
- //#endif
- // #ifdef H5
- uni.navigateTo({
- url: '/pagesT/public/wxLogin?loginType=2'
- });
- // #endif
- } else {
- uni.navigateTo({
- url
- });
- }
- },
- backEvent() {
- if (this.isBackIndex) {
- this.goPage('/pages/index/index', 'switchTab');
- } else {
- uni.navigateBack();
- }
- },
- openLocation() {
- this.$emit('openLocation');
- },
- getHome() {
- this.$u.api.getHome().then(res => {
- uni.stopPullDownRefresh();
- this.temData = res.data;
- });
- },
- btnEvent(item) {
- if (item.modelData.btnType === 2) {
- uni.makePhoneCall({
- phoneNumber: item.modelData.phone
- });
- } else if (item.modelData.btnType === 1) {
- this.goPage(item.modelData.url, item.modelData.switchTab);
- } else {
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 300
- });
- }
- }
- }
- };
- </script>
- <style lang="scss">
- .pageDesin-box {
- // background-color: #f5f9fc;
- // padding-top: calc(44px + var(--status-bar-height));
- }
- .float-bth {
- position: fixed;
- bottom: 150upx;
- right: 20upx;
- width: 80upx;
- height: 80upx;
- text-align: center;
- cursor: pointer;
- border-radius: 100%;
- border: 1upx solid #999;
- box-shadow: 0 6upx 20upx #dcdcdc;
- z-index: 99;
- .float-img {
- width: 40upx;
- height: 40upx;
- display: inline-block;
- margin-top: 20upx;
- }
- }
- .wxService {
- padding: 0;
- background-color: #ffffff;
- border: 0 none;
- bottom: 250upx;
- line-height: 80upx;
- .ibonkefu {
- font-size: 46upx;
- }
- &::after {
- border: 0 none;
- }
- }
- .logo-view {
- text-align: center;
- padding: 10upx 0;
- image {
- width: 120upx;
- height: 20upx;
- opacity: 0.7;
- }
- .logo-tip {
- // padding-top: 4upx;
- font-size: 18upx;
- color: #999;
- }
- }
- .address-view {
- padding: 20upx;
- font-size: 26upx;
- // background-color: #ffffff;
- .address-text {
- display: inline-block;
- vertical-align: middle;
- font-weight: bold;
- }
- .ibonfont {
- margin-right: 10upx;
- // color: #999;
- vertical-align: middle;
- }
- .ibonjinru {
- // color: #333;
- font-weight: 300;
- font-size: 28upx;
- }
- }
- .banner-ad {
- width: 340rpx;
- height: 190rpx;
- display: block;
- margin: 20rpx auto;
- }
- .flex {
- display: flex;
- justify-content: space-between;
- }
- </style>
|