|
|
@@ -39,21 +39,21 @@
|
|
|
</div>
|
|
|
<!-- 专区-end -->
|
|
|
<!-- 活动 -->
|
|
|
- <view class="activity" v-if="homeImg.length">
|
|
|
+ <!-- <view class="activity" v-if="homeImg.length">
|
|
|
<image class="act_img act_one_img" :src="homeImg[0].image" @click="toActivePage(homeImg[0])" mode=""></image>
|
|
|
<view class="act_other">
|
|
|
<image class="act_img act_two_img" :src="homeImg[1].image" mode="" @click="toActivePage(homeImg[1])"></image>
|
|
|
<image class="act_img act_two_img" :src="homeImg[2].image" @click="toActivePage(homeImg[2])" mode=""></image>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<!-- 活动-end -->
|
|
|
</view>
|
|
|
- <view class="bou_head flex_r flex_ac flex_jc">
|
|
|
+ <!-- <view class="bou_head flex_r flex_ac flex_jc">
|
|
|
<image class="bou_img" src="/static/sgin/left.png" mode=""></image>
|
|
|
<view class="bou_title">今日推荐</view>
|
|
|
<image class="bou_img" src="/static/sgin/right.png" mode=""></image>
|
|
|
- </view>
|
|
|
- <view class="list_bar">
|
|
|
+ </view> -->
|
|
|
+ <!-- <view class="list_bar">
|
|
|
<view class="product-list">
|
|
|
<view class="product" v-for="(i, s) in productList" :key="s" @click="NavToGoodsDetail(i.id, i.type)">
|
|
|
<view class="image-view">
|
|
|
@@ -74,7 +74,6 @@
|
|
|
<text class="product-text">消费券抵</text>
|
|
|
<span class="corFE2C15">¥{{ Number(i.consume) }}</span>
|
|
|
</view>
|
|
|
- <!-- <view class="product-txt" v-if="i.type == 1">赠送{{ i.give_integral + "批发券" }}</view> -->
|
|
|
<view class="product-txt" v-if="[3].includes(i.type)">限时赠送<text class="corFE2C15">{{ i.teac }}</text>TeaC</view>
|
|
|
<view class="product-txt fenxiang" v-if="[3].includes(i.type)">
|
|
|
<text class="iconfont red"></text>
|
|
|
@@ -82,15 +81,25 @@
|
|
|
</view>
|
|
|
<view v-if="[4].includes(i.type)" class="flex_r flex_ac">
|
|
|
<view class="product-txt">赠<text class="corFE2C15">{{ i.teac }}</text>TeaC</view>
|
|
|
- <!-- <view class="product-txt fenxiang flex_r flex_ac" style="background-color: rgba(0, 0, 0, 0);">
|
|
|
- <text class="iconfont red"></text>
|
|
|
- <text class="red">{{ i.first_teac }}</text>
|
|
|
- </view> -->
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
+ <div class="list" v-if="list.length">
|
|
|
+ <div class="li_item" v-for="(i,s) in list" :key="s" @click="goMerchant(i)">
|
|
|
+ <div class="logo_img">
|
|
|
+ <img :src="i.logo" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="con_box">
|
|
|
+ <div class="p1 ellipsis"><span class="topicon" v-if="i.is_recom == 1">⭐️</span>{{ i.name }}</div>
|
|
|
+ <div class="p2">{{ i.address }}</div>
|
|
|
+ <div class="p3">{{ $h.Div(i.distance, 1000).toFixed(2) }} km</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <not-goods v-else textStr="暂无附近商家"></not-goods>
|
|
|
<view class="fz_w_text">让数字经济赋能美好生活!</view>
|
|
|
<!-- 城市选择 -->
|
|
|
<h-address @select="selectaddress" :visible.sync="showAddress" />
|
|
|
@@ -111,13 +120,15 @@
|
|
|
import swiperBanner from "@/components/swiperBanner/index.vue"; //轮播
|
|
|
import hAddress from "@/components/h-address/address.vue"; //城市选择
|
|
|
// import tabs from '@/static/js/tabs' //专区入口
|
|
|
+import notGoods from "@/components/not-goods/index.vue";
|
|
|
import { post } from "@/request/api.js";
|
|
|
import { formatBytes } from "@/utils/index";
|
|
|
export default {
|
|
|
name: "Appindex",
|
|
|
components: {
|
|
|
swiperBanner, //轮播
|
|
|
- hAddress
|
|
|
+ hAddress,
|
|
|
+ notGoods
|
|
|
// xhPrivacy,
|
|
|
},
|
|
|
data() {
|
|
|
@@ -134,22 +145,43 @@ export default {
|
|
|
totalBytesExpectedToWrite: "0B", // 预期需要下载的数据总长度
|
|
|
filePath:"",
|
|
|
percentVal:0,
|
|
|
- newAppInfo:{}
|
|
|
+ newAppInfo:{},
|
|
|
+ list: [],
|
|
|
+ Query: {
|
|
|
+ latitude: "",
|
|
|
+ longitude: "",
|
|
|
+ page: 1,
|
|
|
+ rows: 20,
|
|
|
+ city: "",
|
|
|
+ business: -1
|
|
|
+ },
|
|
|
+ pageData: {},
|
|
|
};
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
+ uni.setTabBarStyle({
|
|
|
+ color: '#999',
|
|
|
+ selectedColor: '#18bb88',
|
|
|
+ })
|
|
|
this.getToCity()
|
|
|
- this.loadData()
|
|
|
+ // this.loadData()
|
|
|
// uni.Luserfun()
|
|
|
// #ifdef APP-PLUS
|
|
|
this.getNewVersion()
|
|
|
// #endif
|
|
|
},
|
|
|
onShow() {
|
|
|
+ uni.setTabBarStyle({
|
|
|
+ color: '#999',
|
|
|
+ selectedColor: '#18bb88',
|
|
|
+ })
|
|
|
+ this.Query.page = 1
|
|
|
+ this.list = []
|
|
|
+ this.pageData = {}
|
|
|
this.getBanner(); //获取轮播图
|
|
|
this.getAnnounce(); //获取公告列表
|
|
|
- this.gethomeImg(); //活动列表
|
|
|
this.getTabs(); //获取专区
|
|
|
+ this.getList(); //商家列表
|
|
|
},
|
|
|
onHide() {},
|
|
|
methods: {
|
|
|
@@ -161,6 +193,24 @@ export default {
|
|
|
});
|
|
|
|
|
|
},
|
|
|
+ async getList(page) {
|
|
|
+ let { lat, lng } = await uni.Location();
|
|
|
+ this.Query.latitude = lat;
|
|
|
+ this.Query.longitude = lng;
|
|
|
+ if (page) {
|
|
|
+ this.list = []
|
|
|
+ this.Query.page = 1
|
|
|
+ }
|
|
|
+ post("v1/merchant/list", this.Query).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ let da = res.data.data
|
|
|
+ delete res.data.data
|
|
|
+ this.pageData = res.data
|
|
|
+ this.list = [...this.list, ...da]
|
|
|
+ this.Query.page++
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
getNewVersion(){
|
|
|
post("v1/getAppVersion").then((res) => {
|
|
|
if (res.code === 0) {
|
|
|
@@ -184,6 +234,10 @@ export default {
|
|
|
NavToGoodsDetail(id, type) {
|
|
|
this.goto("/pages/product/p_details", { id, type });
|
|
|
},
|
|
|
+ goMerchant(da) {
|
|
|
+ this.setLS("merchant", da)
|
|
|
+ this.goto("/pagesC/settledMerchant/merchant", { id: da.id })
|
|
|
+ },
|
|
|
// 获取轮播图
|
|
|
getBanner() {
|
|
|
post("v1/banner").then((res) => {
|
|
|
@@ -368,6 +422,9 @@ export default {
|
|
|
},
|
|
|
computed: {},
|
|
|
watch: {},
|
|
|
+ onReachBottom() {
|
|
|
+ if (this.Query.page < this.pageData.last_page) this.getList();
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped lang='scss'>
|
|
|
@@ -434,7 +491,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
.l_tabBar {
|
|
|
- margin: 32rpx 0;
|
|
|
+ margin: 32rpx 0 20rpx;
|
|
|
background-color: #fff;
|
|
|
padding: 10rpx 20rpx;
|
|
|
border-radius: 10rpx;
|
|
|
@@ -562,116 +619,68 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.product-list {
|
|
|
- width: 100%;
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- flex-direction: row;
|
|
|
- padding: 0 30rpx;
|
|
|
|
|
|
- .product {
|
|
|
- width: 48.5%;
|
|
|
+.progressBox{
|
|
|
+ padding: 40rpx;
|
|
|
+ border-radius: 4rpx;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.list {
|
|
|
+ padding: 0rpx 30rpx 30rpx;
|
|
|
+
|
|
|
+ .li_item {
|
|
|
margin-bottom: 20rpx;
|
|
|
- padding-bottom: 12rpx;
|
|
|
+ padding: 28rpx 32rpx;
|
|
|
+ background-color: #fff;
|
|
|
border-radius: 10rpx;
|
|
|
box-shadow: 4rpx 4rpx 8rpx 4rpx rgba(0, 0, 0, 0.12);
|
|
|
-
|
|
|
- &:nth-child(2n) {
|
|
|
- margin-left: 3%;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- .product-image {
|
|
|
- border-radius: 10rpx 10rpx 0 0;
|
|
|
- width: 100%;
|
|
|
- height: 42.3vw;
|
|
|
- object-fit: cover;
|
|
|
+ .li_title {
|
|
|
+ font-size: 36rpx;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
}
|
|
|
|
|
|
- .content-view {
|
|
|
- padding: 0 16rpx;
|
|
|
+ .logo_img,
|
|
|
+ .con_box {
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: top;
|
|
|
}
|
|
|
|
|
|
- .product-title {
|
|
|
- width: 100%;
|
|
|
- overflow: hidden;
|
|
|
- line-height: 1.5;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #121212;
|
|
|
+ .logo_img {
|
|
|
+ img {
|
|
|
+ height: 180rpx;
|
|
|
+ width: 180rpx;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- .product-price {
|
|
|
- color: #121212;
|
|
|
- font-size: 28rpx;
|
|
|
+ .con_box {
|
|
|
+ height: 180rpx;
|
|
|
+ width: calc(100% - 180rpx - 28rpx);
|
|
|
+ margin-left: 28rpx;
|
|
|
position: relative;
|
|
|
- }
|
|
|
-
|
|
|
- .product-price-original {
|
|
|
- color: #18bb88;
|
|
|
- font-size: 32rpx;
|
|
|
- font-weight: bold;
|
|
|
|
|
|
- &:before {
|
|
|
- content: "¥";
|
|
|
- font-size: 20rpx;
|
|
|
+ .p1 {
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 6rpx;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- .product-price-favour {
|
|
|
- color: #888888;
|
|
|
- text-decoration: line-through;
|
|
|
- margin-left: 20rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .product-tip {
|
|
|
- position: absolute;
|
|
|
- right: 20rpx;
|
|
|
- background-color: #ff3333;
|
|
|
- color: #ffffff;
|
|
|
- padding: 0 20rpx;
|
|
|
- border-radius: 10rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .product-unit {
|
|
|
- font-size: 24rpx;
|
|
|
- color: #18bb88;
|
|
|
- }
|
|
|
-
|
|
|
- .product-txt,
|
|
|
- .product-text {
|
|
|
- font-size: 22rpx;
|
|
|
- color: #787878;
|
|
|
|
|
|
- .iconfont {
|
|
|
- margin-right: 3rpx;
|
|
|
+ .p2 {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #999;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- .product-price-msg {
|
|
|
- font-size: 20rpx;
|
|
|
- color: #ff6d44;
|
|
|
- }
|
|
|
-
|
|
|
- .product-text {
|
|
|
- margin-left: 16rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .red {
|
|
|
- color: #FA2E18;
|
|
|
- }
|
|
|
|
|
|
- .fenxiang {
|
|
|
- font-size: 20rpx;
|
|
|
- background: rgba(250, 46, 24, 0.08);
|
|
|
- display: inline-block;
|
|
|
- border-radius: 6rpx;
|
|
|
- padding: 0 16rpx;
|
|
|
+ .p3 {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #666;
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-.progressBox{
|
|
|
- padding: 40rpx;
|
|
|
- border-radius: 4rpx;
|
|
|
- background-color: #fff;
|
|
|
-}
|
|
|
</style>
|