Merge branch 'master' of https://git.dayouqiantu.cn/develop/yshop-uniapp into master
This commit is contained in:
@ -8,6 +8,14 @@ export function getHomeData() {
|
||||
return request.get("index", {}, { login: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getCanvas() {
|
||||
return request.get("/getCanvas?terminal=3", {}, { login: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* 文章 轮播列表
|
||||
* @returns {*}
|
||||
|
@ -2,55 +2,55 @@
|
||||
<view class="adv-box mx20 mb10">
|
||||
<!-- 模板1-->
|
||||
<view class="x-f" v-if="detail.style == 1">
|
||||
<image style="width:710rpx;height: 220rpx;" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<image style="width:710rpx;height: 220rpx;" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
</view>
|
||||
<!-- 模板2-->
|
||||
<view class="type1 x-f" v-if="detail.style == 2">
|
||||
<image class="type1-img" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<image class="type1-img" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"></image>
|
||||
<image class="type1-img" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<image class="type1-img" @tap="jump(detail.list[1].uniapp_url)" :src="detail.list[1].image" mode="aspectFill"></image>
|
||||
</view>
|
||||
<!-- 模板3-->
|
||||
<view class="type2 x-bc" v-if="detail.style == 3">
|
||||
<image class="type2-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<image class="type2-img1" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<view class="y-f type2-box">
|
||||
<image class="type2-img2" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill" style="border-bottom:1rpx solid #f6f6f6"></image>
|
||||
<image class="type2-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||
<image class="type2-img2" @tap="jump(detail.list[1].uniapp_url)" :src="detail.list[1].image" mode="aspectFill" style="border-bottom:1rpx solid #f6f6f6"></image>
|
||||
<image class="type2-img2" @tap="jump(detail.list[2].uniapp_url)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 模板4-->
|
||||
<view class="type3 x-bc" v-if="detail.style == 4">
|
||||
<view class="type3-box y-f">
|
||||
<image class="type3-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<image class="type3-img1" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"></image>
|
||||
<image class="type3-img1" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<image class="type3-img1" @tap="jump(detail.list[1].uniapp_url)" :src="detail.list[1].image" mode="aspectFill"></image>
|
||||
</view>
|
||||
<image class="type3-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||
<image class="type3-img2" @tap="jump(detail.list[2].uniapp_url)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||
</view>
|
||||
<!-- 模板5-->
|
||||
<view class="type4 y-f" v-if="detail.style == 5">
|
||||
<view class="type4-box x-f">
|
||||
<image class="type4-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<image class="type4-img1" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"></image>
|
||||
<image class="type4-img1" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<image class="type4-img1" @tap="jump(detail.list[1].uniapp_url)" :src="detail.list[1].image" mode="aspectFill"></image>
|
||||
</view>
|
||||
<image class="type4-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||
<image class="type4-img2" @tap="jump(detail.list[2].uniapp_url)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||
</view>
|
||||
<!-- 模板6-->
|
||||
<view class="type5 y-f" v-if="detail.style == 6">
|
||||
<image class="type5-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<image class="type5-img1" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<view class="type5-box x-bc">
|
||||
<image class="type5-img2" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill" style="border-bottom:1rpx solid #f6f6f6"></image>
|
||||
<image class="type5-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||
<image class="type5-img2" @tap="jump(detail.list[1].uniapp_url)" :src="detail.list[1].image" mode="aspectFill" style="border-bottom:1rpx solid #f6f6f6"></image>
|
||||
<image class="type5-img2" @tap="jump(detail.list[2].uniapp_url)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 模板7-->
|
||||
<view class="type6 y-f" v-if="detail.style == 7">
|
||||
<view class="x-f type6-box1">
|
||||
<image class="type6-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<image class="type6-img1" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"></image>
|
||||
<image class="type6-img1" @tap="jump(detail.list[0].uniapp_url)" :src="detail.list[0].image" mode="aspectFill"></image>
|
||||
<image class="type6-img1" @tap="jump(detail.list[1].uniapp_url)" :src="detail.list[1].image" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="x-f type6-box2">
|
||||
<image class="type6-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||
<image class="type6-img2" @tap="jump(detail.list[3].path)" :src="detail.list[3].image" mode="aspectFill"></image>
|
||||
<image class="type6-img2" @tap="jump(detail.list[4].path)" :src="detail.list[4].image" mode="aspectFill"></image>
|
||||
<image class="type6-img2" @tap="jump(detail.list[2].uniapp_url)" :src="detail.list[2].image" mode="aspectFill"></image>
|
||||
<image class="type6-img2" @tap="jump(detail.list[3].uniapp_url)" :src="detail.list[3].image" mode="aspectFill"></image>
|
||||
<image class="type6-img2" @tap="jump(detail.list[4].uniapp_url)" :src="detail.list[4].image" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -63,14 +63,16 @@ export default {
|
||||
return {};
|
||||
},
|
||||
props: {
|
||||
detail: {}
|
||||
detail: Object
|
||||
},
|
||||
computed: {},
|
||||
created() {},
|
||||
methods: {
|
||||
// 路由跳转
|
||||
jump(path) {
|
||||
this.$tools.routerTo(path);
|
||||
if (item.uniapp_url) {
|
||||
this.$yrouter.push(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -14,17 +14,17 @@
|
||||
>
|
||||
<view class="money">
|
||||
¥
|
||||
<text class="num">{{ item.coupon_price }}</text>
|
||||
<text class="num">{{ item.couponPrice }}</text>
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="condition line1">购物满{{ item.use_min_price }}元可用</view>
|
||||
<view class="condition line1">购物满{{ item.useMinPrice }}元可用</view>
|
||||
<view class="data acea-row row-between-wrapper">
|
||||
<view v-if="item.end_time === 0">不限时</view>
|
||||
<view v-else>{{ item.start_time }}-{{ item.end_time }}</view>
|
||||
<view v-else>{{ item.startTime }}-{{ item.endTime }}</view>
|
||||
<view
|
||||
class="bnt acea-row row-center-wrapper"
|
||||
:class="!item.is_use ? 'bg-color-red' : 'gray'"
|
||||
>{{ !item.is_use ? "立即领取" : "已领取" }}</view>
|
||||
:class="!item.isUse ? 'bg-color-red' : 'gray'"
|
||||
>{{ !item.isUse ? "立即领取" : "已领取" }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -2,7 +2,8 @@
|
||||
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api';
|
||||
// export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api';
|
||||
export const VUE_APP_API_URL = 'https://tapi.xinxintuan.co/api';
|
||||
export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||
// export const VUE_APP_API_URL = 'https://tapi.xinxintuan.co/api';
|
||||
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
||||
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';
|
||||
export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static';
|
||||
|
19
package-lock.json
generated
19
package-lock.json
generated
@ -287,6 +287,11 @@
|
||||
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz",
|
||||
"integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk="
|
||||
},
|
||||
"mutation-observer": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "http://192.168.1.56:8081/repository/npm-public/mutation-observer/-/mutation-observer-1.0.3.tgz",
|
||||
"integrity": "sha1-QukiKxAbyoLlup1aes9KFMDyY9A="
|
||||
},
|
||||
"normalize-url": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npm.taobao.org/normalize-url/download/normalize-url-4.5.0.tgz?cache=0&sync_timestamp=1596373090568&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnormalize-url%2Fdownload%2Fnormalize-url-4.5.0.tgz",
|
||||
@ -399,6 +404,11 @@
|
||||
"resolved": "https://registry.npm.taobao.org/to-readable-stream/download/to-readable-stream-1.0.0.tgz",
|
||||
"integrity": "sha1-zgqgwvPfat+FLvtASng+d8BHV3E="
|
||||
},
|
||||
"transitionEnd": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "http://192.168.1.56:8081/repository/npm-public/transitionEnd/-/transitionEnd-1.0.2.tgz",
|
||||
"integrity": "sha1-GRTbW0Wn79w0oBr2koWjppOHFjM="
|
||||
},
|
||||
"url-parse-lax": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npm.taobao.org/url-parse-lax/download/url-parse-lax-3.0.0.tgz",
|
||||
@ -407,6 +417,15 @@
|
||||
"prepend-http": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"vconsole": {
|
||||
"version": "3.4.0",
|
||||
"resolved": "http://192.168.1.56:8081/repository/npm-public/vconsole/-/vconsole-3.4.0.tgz",
|
||||
"integrity": "sha1-LPL/qobNerc2mXoitj0FYnxqtWc=",
|
||||
"requires": {
|
||||
"mutation-observer": "^1.0.3",
|
||||
"transitionEnd": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"vue": {
|
||||
"version": "2.6.12",
|
||||
"resolved": "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz",
|
||||
|
@ -1,34 +1,14 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<!-- 导航栏 -->
|
||||
<!-- <view class="head_box " :style="{ background: bgcolor }" :class="{ active: bgcolor }">-->
|
||||
<!-- <view class="cu-custom" :style="[{height:CustomBar+ 'px',}]">-->
|
||||
<!-- <view class="cu-bar fixed" :style="customStyle" :class="[bgcolor]">-->
|
||||
<!-- <view class="action">-->
|
||||
<!-- <text class="nav-title Shop-selector-rect">{{ 'yshop商城' }}</text>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="content" :style="[{top:StatusBar + 'px'}]">-->
|
||||
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
|
||||
<view
|
||||
class="head_box"
|
||||
:style="{ background: bgcolor }"
|
||||
:class="{ active: bgcolor }"
|
||||
>
|
||||
<view v-for="(item,index) in homeData" :key="index">
|
||||
<view class="head_box" v-if="item.type=='header'" :style="{ background: bgcolor }" :class="{ active: bgcolor }">
|
||||
<cu-custom :isBack="true" :bgColor="bgcolor">
|
||||
<block slot="backText">
|
||||
<text class="nav-title shopro-selector-rect">{{ "YSHOP商城" }}</text>
|
||||
<text class="nav-title shopro-selector-rect">{{ item.componentContent.title }}</text>
|
||||
</block>
|
||||
</cu-custom>
|
||||
</view>
|
||||
<view
|
||||
class="header header-search acea-row row-center-wrapper"
|
||||
:style="{ background: bgcolor }"
|
||||
>
|
||||
<view class="header header-search acea-row row-center-wrapper" v-if="item.type=='search'" :style="{ background: bgcolor }">
|
||||
<view @click="goGoodSearch()" class="search acea-row row-middle">
|
||||
<text class="iconfont icon-xiazai5"></text>
|
||||
搜索商品
|
||||
@ -37,54 +17,43 @@
|
||||
<image src="@/static/images/qr.png" />
|
||||
</view>
|
||||
</view>
|
||||
<Banner
|
||||
:detail="banner"
|
||||
v-if="banner.length > 0"
|
||||
@getbgcolor="getbgcolor"
|
||||
></Banner>
|
||||
<uni-notice-bar
|
||||
scrollable="true"
|
||||
@click="goRoll(singNew)"
|
||||
single="true"
|
||||
:speed="10"
|
||||
showIcon="true"
|
||||
:text="singNew.info"
|
||||
></uni-notice-bar>
|
||||
<Banner v-if="item.type=='banner'" :detail="item.componentContent.bannerData" @getbgcolor="getbgcolor"></Banner>
|
||||
<uni-notice-bar v-if="item.type=='noticeBar'" scrollable="true" @click="goRoll(item.componentContent.roll[0])" single="true" :speed="10"
|
||||
showIcon="true" :text="item.componentContent.roll[0].info"></uni-notice-bar>
|
||||
<view class="content_box home_content_box">
|
||||
<!-- 菜单 -->
|
||||
<Menu :list="menus"></Menu>
|
||||
<Menu :list="item.componentContent.menus" v-if="item.type=='menu'"></Menu>
|
||||
<!-- 滚动新闻 -->
|
||||
<!-- 广告 -->
|
||||
<Adv />
|
||||
<Adv v-if="item.type=='adv'" :detail="item.componentContent.detail" />
|
||||
<!-- 热门榜单 -->
|
||||
<HotCommodity :detail="likeInfo"></HotCommodity>
|
||||
<HotCommodity v-if="item.type=='hotCommodity'" :detail="likeInfo"></HotCommodity>
|
||||
<!-- 超值拼团 -->
|
||||
<Groupon :detail="combinationList" />
|
||||
<Groupon v-if="item.type=='groupon'" :detail="combinationList" />
|
||||
<!-- 首发新品->秒杀 -->
|
||||
<!-- <FirstNewProduct :detail="firstList"></FirstNewProduct> -->
|
||||
<FirstNewProduct v-if="item.type=='firstNewProduct'" :detail="firstList"></FirstNewProduct>
|
||||
<!-- 精品推荐 -->
|
||||
<!-- <ProductsRecommended :detail="bastList"></ProductsRecommended> -->
|
||||
<!-- 促销单品
|
||||
<PromoteProduct :detail="benefit"></PromoteProduct> -->
|
||||
<ProductsRecommended v-if="item.type=='productsRecommended'" :detail="bastList"></ProductsRecommended>
|
||||
<!-- 促销单品 -->
|
||||
<PromoteProduct v-if="item.type=='promoteProduct'" :detail="benefit"></PromoteProduct>
|
||||
<!-- 直播 -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<Live :detail="live"></Live>
|
||||
<Live v-if="item.type=='live'" :detail="live"></Live>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 为您推荐 -->
|
||||
<PromotionGood :benefit="benefit"></PromotionGood>
|
||||
<PromotionGood v-if="item.type=='promotionGood'" :benefit="benefit"></PromotionGood>
|
||||
</view>
|
||||
<Coupon-window
|
||||
:coupon-list="couponList"
|
||||
v-if="showCoupon"
|
||||
@checked="couponClose"
|
||||
@close="couponClose"
|
||||
>
|
||||
<Coupon-window :coupon-list="couponList" v-if="showCoupon" @checked="couponClose" @close="couponClose">
|
||||
</Coupon-window>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState, mapMutations, mapActions } from "vuex";
|
||||
import {
|
||||
mapState,
|
||||
mapMutations,
|
||||
mapActions
|
||||
} from "vuex";
|
||||
import GoodList from "@/components/GoodList";
|
||||
import PromotionGood from "@/components/PromotionGood";
|
||||
import CouponWindow from "@/components/CouponWindow";
|
||||
@ -99,9 +68,16 @@ import FirstNewProduct from "./components/FirstNewProduct";
|
||||
import ProductsRecommended from "./components/ProductsRecommended";
|
||||
import Live from "./components/Live";
|
||||
|
||||
import { getHomeData, getShare } from "@/api/public";
|
||||
import {
|
||||
getHomeData,
|
||||
getShare,
|
||||
getCanvas
|
||||
} from "@/api/public";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
import { isWeixin, handleUrlParam } from "@/utils/index";
|
||||
import {
|
||||
isWeixin,
|
||||
handleUrlParam
|
||||
} from "@/utils/index";
|
||||
|
||||
import {
|
||||
openShareAll,
|
||||
@ -130,6 +106,7 @@ export default {
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
homeData: [],
|
||||
CustomBar: this.CustomBar,
|
||||
StatusBar: this.StatusBar,
|
||||
formatMenus: [],
|
||||
@ -233,15 +210,16 @@ export default {
|
||||
onLoad: function() {
|
||||
this.getLocation();
|
||||
let that = this;
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
// uni.showLoading({
|
||||
// title: "加载中",
|
||||
// });
|
||||
getCanvas().then(res => {
|
||||
}).catch(error => {
|
||||
this.homeData = JSON.parse(error.data.json)
|
||||
})
|
||||
getHomeData().then((res) => {
|
||||
that.logoUrl = res.data.logoUrl;
|
||||
res.data.banner.map((item) => (item.bgcolor = item.color || ""));
|
||||
that.$set(that, "banner", res.data.banner);
|
||||
that.$set(that, "menus", res.data.menus);
|
||||
that.$set(that, "roll", res.data.roll);
|
||||
that.$set(that, "info", res.data.info);
|
||||
that.$set(that, "firstList", res.data.firstList);
|
||||
that.$set(that, "bastList", res.data.bastList);
|
||||
@ -460,8 +438,7 @@ export default {
|
||||
margin-top: -10rpx;
|
||||
}
|
||||
|
||||
.head_box {
|
||||
}
|
||||
.head_box {}
|
||||
|
||||
.nav-title {
|
||||
margin-left: 20rpx;
|
||||
|
Reference in New Issue
Block a user