首页更新

This commit is contained in:
魏啾
2024-05-07 17:23:52 +08:00
parent 3b85017f91
commit a9832d38af
12 changed files with 707 additions and 286 deletions

View File

@@ -92,4 +92,13 @@ export default {
orderfindWiningUser(data) { //获取免单订单
return uni.api.get("/order/findWiningUser", data);
},
indexlist(data) { //商品列表(今日上新/热榜/咖啡饮品)
return uni.api.get("/distirict/productCate", data);
},
productproductInfo(data) { //商品详情
return uni.api.get("/product/productInfo", data);
},
distirictcomShopList(data) { //通用门店列表
return uni.api.get("/distirict/comShopList", data);
},
}

View File

@@ -70,7 +70,7 @@
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 999999;
z-index: 9999;
.active {
background: rgba(249, 249, 249, 1);

View File

@@ -60,6 +60,12 @@
"navigationStyle": "custom"
}
},
{
"path": "pages/product/generalstore",
"style": {
"navigationBarTitleText": "通用门店"
}
},
{
"path": "pages/login/login",
"style": {

View File

@@ -14,7 +14,7 @@
</view>
<view class="therecontent_box_itembox">
<view class="therecontent_box_itembox_item flex-between" v-for="(item,index) in todayList.todayList"
:key="index">
:key="index" @click="clickproduct(item)">
<image :src="item.image" mode="aspectFill"></image>
<view class="therecontent_box_itembox_itemview flex-colum-start">
<view class="therecontent_box_itembox_itemviewone">
@@ -50,7 +50,7 @@
</view>
<view class="therecontent_box_itembox">
<view class="therecontent_box_itembox_item flex-between" v-for="(item,index) in salesList.hotList"
:key="index">
:key="index" @click="clickproduct(item)">
<image :src="item.image" mode="aspectFill"></image>
<view class="therecontent_box_itembox_itemview flex-colum-start">
<view class="therecontent_box_itembox_itemviewone flex-start">
@@ -101,6 +101,9 @@
}
},
methods:{
clickproduct(item){
uni.pro.navigateTo('product/index',item)
},
jrtoday(e){
if(e == 0){
uni.pro.navigateTo('index/jtoday')

View File

@@ -1,9 +1,9 @@
<template>
<view class="content">
<!-- 占位符导航栏 -->
<navseat class="navbar" :opacity='opacitys' :title='titlename' :titleshow='false'></navseat>
<navseat class="navbar" :opacity='opacitys' :title='toplist.name' :titleshow='false'></navseat>
<view class="onecontent">
<image class="onecontentimage" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/bsb.png" mode=" "></image>
<image class="onecontentimage" :src="toplist.coverImg" mode=" "></image>
<view class="onecontentabsolute">
</view>
</view>
@@ -20,9 +20,9 @@
</view>
</view>
<view class="towcontentlistxitembt flex-start">
<view class="towcontentlistxitembtitem" :class="index==1?'towcontentlistxitembtitemaktev':''"
v-for="(item,index) in 3" :key="index">
2小时销量飙升榜
<view class="towcontentlistxitembtitem" :class="index==xitembtitemindex?'towcontentlistxitembtitemaktev':''"
v-for="(item,index) in xitembtitem" :key="index" @click="clickxitembtitemindex(index)">
{{item.name}}
</view>
</view>
@@ -30,28 +30,7 @@
<view v-if="isFixedTop" :style="{'height':windowHeight - seighT + 'px'}"></view>
<view class="towcontentboutton" :style="{'height':seighT + 'px'}">
<!-- <scroll-view :style="{'height':seighT + 'px'}" scroll-y @scrolltolower="loadMore"> -->
<view class="fivecontent_item" v-for="(item,index) in 20" :key="index">
<view class="fivecontent_item_nav flex-start">
<image src="@/static/avatar.png" mode="aspectFill"></image>
<view class="fivecontent_item_nav_left">
<view class="fivecontent_item_nav_lefttop flex-between">
<view>
{{item.shopName}}
</view>
<view>
龙首.{{item.distances}}m
</view>
</view>
<view class="flex-start">
<view class="fivecontent_item_nav_leftlang flex-start"
v-for="(s,index1) in item.shopTag" :key="index1">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png"
mode="aspectFill"></image>
<text>{{s}}</text>
</view>
</view>
</view>
</view>
<view class="fivecontent_item" v-for="(item,index) in list" :key="index" @click="clickproduct(item)">
<view class="fivecontent_item_box">
<view class="fivecontent_item_boxitem flex-between">
<image :src="item.image" mode=""></image>
@@ -60,11 +39,14 @@
<view>{{item.productName}}</view>
<text>已抢{{item.realSalesNumber}}</text>
</view>
<view class="fivecontent_item_boxitemlefttow flex-start"
v-for="(c,index2) in item.proTag" :key="index2">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png"
mode="aspectFill"></image>
<text>{{c}}</text>
<view class="flex-start flexstartboxfttow">
<view class="fivecontent_item_boxitemlefttow flex-start"
v-for="(c,index2) in item.proTag" :key="index2"
:style="{'background':c.backColor,'color':c.backColor}">
<image class="fivecontent_item_boxitemlefttowimage" v-if="c.shareImg"
:src="c.shareImg" mode="aspectFill"></image>
<text class="fivecontent_item_boxitemlefttowtext">{{c.name}}</text>
</view>
</view>
<view class="indexboxitemleftthere flex-colum-start">
<view class="indexboxitemleftthereabsolute">
@@ -83,11 +65,11 @@
<view class="indexboxitemleftthere_countdown flex-between">
<text class="indexboxitemleftthere_countdowntext">共省{{item.save}}</text>
<view class="indexboxitemleftthere_countdowntexts">
<!-- <uni-countdown @timeup="updateCity" :show-day="false"
:day="item.end_times.d" :hour="item.end_times.h"
:minute="item.end_times.m" :second="item.end_times.s"
:indexs='index' color="#FFFFFF" border-color="#00B26A"
splitorColor="#FFFFFF" :font-size="7"></uni-countdown> -->
<!-- <uni-countdown @timeup="updateCity" :show-day="false" :day="item.end_times.d"
:hour="item.end_times.h" :minute="item.end_times.m"
:second="item.end_times.s" :indexs='index' color="#FFFFFF"
border-color="#00B26A" splitorColor="#FFFFFF"
:font-size="7"></uni-countdown> -->
</view>
@@ -97,8 +79,7 @@
</view>
</view>
</view>
<u-loadmore height='40' :status="form.status" iconSize='24' fontSize='24' />
</view><u-loadmore height='40' :status="form.status" iconSize='24' fontSize='24' />
<!-- </scroll-view> -->
</view>
</view>
@@ -123,6 +104,8 @@
customheighttop: '', //top高度
isFixedTop: false,
Topdistance: 3000, //吸顶初始距离
list: [],
toplist: {},
listbox: [{
name: '全部'
},
@@ -133,6 +116,14 @@
name: '饮品小吃'
}
],
xitembtitemindex:0,
xitembtitem: [{
name: '2小时销量飙升榜'
},
{
name: '今日热榜'
}
],
form: {
address: '', //地址
type: '', //品类
@@ -157,6 +148,8 @@
}
},
onLoad() {
this.distiricttopCommon()
this.onLoadlist()
setTimeout(() => {
this.GetTop()
}, 1000)
@@ -167,6 +160,13 @@
},
},
methods: {
//飙升榜
clickxitembtitemindex(index){
this.xitembtitemindex = index
},
towcontentclick(index) {
this.towcontentclickindex = index
},
//G滚动底部
loadMore(e) {
console.log(e)
@@ -199,9 +199,75 @@
}
})
},
towcontentclick(index) {
this.towcontentclickindex = index
}
async distiricttopCommon() {
let res = await this.api.distiricttopCommon({
type: '', //团购卷品类Id/subShop-预约到店
orderBy: 2
})
console.log(res.data)
if (res.code == 0) {
this.toplist = res.data.carousel[0]
this.listbox = res.data.menu
}
},
clickproduct(item) {
uni.pro.navigateTo('product/index', item)
},
async onLoadlist() {
try {
this.form = {
address:uni.cache.get('getLocationstorage').address, //地址
lng: uni.cache.get('getLocationstorage').lng,
lat: uni.cache.get('getLocationstorage').lat,
type: '', //团购卷品类Id
distanceInKm: '', //默认10 以经纬度为中心 多大范围以内 单位km
orderBy: 2, //0.今日上新 1.离我最近 2.销量优先/热榜推荐 3.价格优先
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
}
let res = await this.api.indexlist(this.form)
var dates = new Date().getTime();
res.data.list.forEach((item, index) => {
var leftTime = item.endTime - dates; //计算两日期之间相差的毫秒数
if (leftTime >= 0) {
let d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
let h = Math.floor(leftTime / 1000 / 60 / 60 % 24);
let m = Math.floor(leftTime / 1000 / 60 % 60);
let s = Math.floor(leftTime / 1000 % 60);
item.end_times = {
d: d,
h: h,
m: m,
s: s
}
} else {
item.end_times = 0
}
})
console.log(res.data.list)
if (res.data.pages < this.form.page) {
this.form.status = 'nomore'
// if (res.data.pageNum == 1) {
// this.is_end = true
// }
return false;
} else {
this.form.status = 'loading';
this.form.page = ++this.form.page;
setTimeout(() => {
this.list = [...this.list, ...res.data.list];
this.form.status = 'loading';
if (res.data.pageNum == res.data.pages) {
this.form.status = 'nomore';
} else {
this.form.status = 'loading';
}
}, 500)
}
} catch (e) {}
},
}
};
</script>
@@ -216,6 +282,7 @@
width: 100%;
height: 492rpx;
position: relative;
.onecontentimage {
position: absolute;
width: 100%;
@@ -349,62 +416,13 @@
.fivecontent_item {
margin-top: 32rpx;
padding: 24rpx;
padding:32rpx 24rpx;
width: 100%;
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.fivecontent_item_nav {
image {
width: 60rpx;
height: 60rpx;
border-radius: 8rpx;
}
.fivecontent_item_nav_left {
flex: auto;
margin-left: 12rpx;
.fivecontent_item_nav_lefttop {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #666666;
}
.fivecontent_item_nav_leftlang {
margin-top: 8rpx;
width: max-content;
padding: 4rpx 10rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
text {
margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 16rpx;
color: #F9A511;
}
image {
width: 10.82rpx;
height: 14.06rpx;
}
}
.fivecontent_item_nav_leftlang:nth-child(2) {
margin-left: 12rpx;
background: #FEE9DF;
}
}
}
.fivecontent_item_box {
margin-top: 20rpx;
border-top: 2rpx solid #E5E5E5;
padding-top: 14rpx;
.fivecontent_item_boxitem {
image {
@@ -435,25 +453,34 @@
}
}
.fivecontent_item_boxitemlefttow {
margin-top: 8rpx;
width: max-content;
padding: 4rpx 10rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
text {
margin-left: 6rpx;
.flexstartboxfttow {
.fivecontent_item_boxitemlefttow {
margin-left: 16rpx;
margin-top: 8rpx;
width: max-content;
padding: 4rpx 10rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 16rpx;
color: #F9A511;
.fivecontent_item_boxitemlefttowtext {
margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 16rpx;
color: #F9A511;
}
.fivecontent_item_boxitemlefttowimage {
width: 10.82rpx;
height: 14.06rpx;
}
}
image {
width: 10.82rpx;
height: 14.06rpx;
.fivecontent_item_boxitemlefttow:nth-child(1) {
margin-left: 0;
background: #FFD6D7;
border-radius: 4rpx 4rpx 4rpx 4rpx;
}
}

View File

@@ -63,7 +63,8 @@
<view class="fivecontent" :style="{'height':seighT + 'px'}">
<!-- <scroll-view :style="{'height':seighT + 'px'}" scroll-y @scrolltolower="loadMore"
scroll-with-animation> -->
<view class="fivecontent_item" v-for="(item,index) in homelist" :key="index">
<view class="fivecontent_item" v-for="(item,index) in homelist" :key="index"
@click="fivecontentclick(item)">
<view class="fivecontent_item_nav flex-start">
<image :src="item.shopImage" mode="aspectFill"></image>
<view class="fivecontent_item_nav_left">
@@ -72,7 +73,7 @@
{{item.shopName}}
</view>
<view>
龙首.{{item.distances}}m
龙首.{{item.distances}}km
</view>
</view>
<view class="fivecontent_item_nav_lefttopstart flex-start">
@@ -288,6 +289,26 @@
},
},
async onLoad() {
uni.getLocation({
type: 'wgs84',
success: (res) => {
console.log(res, '获取距离')
// this.lng = res.longitude
// this.lat = res.latitude
// this.positionindex()
},
fail: (err) => {
// this.positionindex()
console.log(err, '获取错误')
}
});
// 测试
let datastorage = {
address: '西安市', //地址
lng: '108.949158',
lat: '34.301731',
}
uni.cache.set('getLocationstorage', datastorage);
setTimeout(() => {
this.GetTop()
}, 1000)
@@ -311,8 +332,11 @@
uindexlist() {
uni.pro.navigateTo('index/uindexlist')
},
fivecontentclick(item) {
uni.pro.navigateTo('product/index', item)
},
updateCity(data) {
this.list[data].end_times = 0;
thiss.list[data].end_times = 0;
this.$forceUpdate();
},
//获取元素距离顶部的距离
@@ -370,9 +394,9 @@
init_fn() {
this.homelist = []
this.form = {
address: '西安市', //地址
lng: '108.949158',
lat: '34.301731',
address:uni.cache.get('getLocationstorage').address, //地址
lng: uni.cache.get('getLocationstorage').lng,
lat: uni.cache.get('getLocationstorage').lat,
type: '', //品类
orderBy: 0, //1.理我最近 2.销量优先 3.价格优先
other: '', //附近1KM 1选中 0不选中
@@ -386,7 +410,7 @@
try {
let res = await this.api.home(this.form)
var dates = new Date().getTime();
res.data.forEach((item, index) => {
res.data.list.forEach((item, index) => {
var leftTime = item.endTime - dates; //计算两日期之间相差的毫秒数
if (leftTime >= 0) {
let d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
@@ -403,19 +427,22 @@
item.end_times = 0
}
})
if (res.data.length == 0) {
if (res.data.pages < this.form.page) {
this.form.status = 'nomore'
// if (res.data.pageNum == 1) {
// this.is_end = true
// }
return false;
} else {
this.form.status = 'loading';
this.form.page = ++this.form.page;
setTimeout(() => {
this.homelist = [...this.homelist, ...res.data];
if (res.data.length == 10) {
this.form.status = 'loading';
} else {
this.homelist = [...this.homelist, ...res.data.list];
this.form.status = 'loading';
if (res.data.pageNum == res.data.pages) {
this.form.status = 'nomore';
} else {
this.form.status = 'loading';
}
}, 500)
}

View File

@@ -1,9 +1,9 @@
<template>
<view class="content">
<!-- 占位符导航栏 -->
<navseat :opacity='opacity' :title='titlename' :titleshow='false'></navseat>
<navseat :opacity='opacity' :title='toplist.name' :titleshow='false'></navseat>
<view class="onecontent">
<image class="onecontentimage" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/nav.png" mode=""></image>
<image class="onecontentimage" :src="toplist.coverImg" mode=""></image>
<view class="onecontentabsolute">
<view class="onecontentabsoluteitem flex-between">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/l.png" mode=""></image>
@@ -15,24 +15,24 @@
</view>
</view>
<view class="towcontent">
<view class="fivecontent_item" v-for="(item,index) in 20" :key="index">
<view class="fivecontent_item" v-for="(item,index) in list" :key="index" @click="clickproduct(item)">
<view class="fivecontent_item_nav flex-start">
<image class="fivecontent_item_navimage" src="@/static/avatar.png" mode="aspectFill"></image>
<image class="fivecontent_item_navimage" :src="item.shopImage" mode="aspectFill"></image>
<view class="fivecontent_item_nav_left">
<view class="fivecontent_item_nav_lefttop flex-between">
<view>
{{item.shopName}}
</view>
<view>
龙首.{{item.distances}}m
龙首.{{item.distances}}km
</view>
</view>
<view class="flex-start">
<view class="fivecontent_item_nav_lefttopstart flex-start">
<view class="fivecontent_item_nav_leftlang flex-start" v-for="(s,index1) in item.shopTag"
:key="index1">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png"
:key="index1" :style="{'background':s.backColor,'color':s.backColor}">
<image class="fivecontent_item_nav_leftlangimage" v-if="s.shareImg" :src="s.shareImg"
mode="aspectFill"></image>
<text>{{s}}</text>
<text class="fivecontent_item_nav_leftlangtext">{{s.name}}</text>
</view>
</view>
</view>
@@ -45,11 +45,14 @@
<view>{{item.productName}}</view>
<text>已抢{{item.realSalesNumber}}</text>
</view>
<view class="fivecontent_item_boxitemlefttow flex-start" v-for="(c,index2) in item.proTag"
:key="index2">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png"
mode="aspectFill"></image>
<text>{{c}}</text>
<view class="flex-start flexstartboxfttow">
<view class="fivecontent_item_boxitemlefttow flex-start"
v-for="(c,index2) in item.proTag" :key="index2"
:style="{'background':c.backColor,'color':c.backColor}">
<image class="fivecontent_item_boxitemlefttowimage" v-if="c.shareImg"
:src="c.shareImg" mode="aspectFill"></image>
<text class="fivecontent_item_boxitemlefttowtext">{{c.name}}</text>
</view>
</view>
<view class="indexboxitemleftthere flex-colum-start">
<view class="indexboxitemleftthereabsolute">
@@ -100,10 +103,14 @@
return {
titlename: '今日上新',
opacity: false,
list: [],
toplist: {},
form: {
address: '', //地址
address: '西安市', //地址
lng: '108.949158',
lat: '34.301731',
type: '', //品类
orderBy: '', //1.理我最近 2.销量优先 3.价格优先
orderBy: 0, //1.理我最近 2.销量优先 3.价格优先
other: '', //附近1KM 1选中 0不选中
page: 1, //页数
size: 10, //页容量
@@ -118,6 +125,82 @@
this.opacity = true
}
},
onLoad(e) {
this.distiricttopCommon()
},
onShow() {
this.onLoadlist()
},
methods: {
async distiricttopCommon() {
let res = await this.api.distiricttopCommon({
type: '', //团购卷品类Id/subShop-预约到店
orderBy: 0
})
console.log(res.data)
if (res.code == 0) {
this.toplist = res.data.carousel[0]
}
},
clickproduct(item){
uni.pro.navigateTo('product/index',item)
},
async onLoadlist() {
try {
this.form = {
address: '西安市', //地址
lng: '108.949158',
lat: '34.301731',
type: '', //团购卷品类Id
distanceInKm: '', //默认10 以经纬度为中心 多大范围以内 单位km
orderBy: 0, //0.今日上新 1.离我最近 2.销量优先/热榜推荐 3.价格优先
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
}
let res = await this.api.indexlist(this.form)
var dates = new Date().getTime();
res.data.list.forEach((item, index) => {
var leftTime = item.endTime - dates; //计算两日期之间相差的毫秒数
if (leftTime >= 0) {
let d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
let h = Math.floor(leftTime / 1000 / 60 / 60 % 24);
let m = Math.floor(leftTime / 1000 / 60 % 60);
let s = Math.floor(leftTime / 1000 % 60);
item.end_times = {
d: d,
h: h,
m: m,
s: s
}
} else {
item.end_times = 0
}
})
console.log(res.data.list)
if (res.data.pages < this.form.page) {
this.form.status = 'nomore'
// if (res.data.pageNum == 1) {
// this.is_end = true
// }
return false;
} else {
this.form.status = 'loading';
this.form.page = ++this.form.page;
setTimeout(() => {
this.list = [...this.list, ...res.data.list];
this.form.status = 'loading';
if (res.data.pageNum == res.data.pages) {
this.form.status = 'nomore';
} else {
this.form.status = 'loading';
}
}, 500)
}
} catch (e) {}
},
}
};
</script>
@@ -131,8 +214,8 @@
width: 100%;
height: 492rpx;
position: relative;
.onecontentimage{
.onecontentimage {
position: absolute;
width: 100%;
height: 100%;
@@ -140,6 +223,7 @@
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/nav.png) no-repeat;
background-size: cover;
}
.onecontentabsolute {
position: absolute;
width: 100%;
@@ -215,33 +299,34 @@
color: #666666;
}
.flex-start {
.fivecontent_item_nav_lefttopstart {
margin-top: 8rpx;
.fivecontent_item_nav_leftlang {
margin-top: 8rpx;
margin-left: 12rpx;
width: max-content;
padding: 4rpx 10rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
text {
.fivecontent_item_nav_leftlangtext {
margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 16rpx;
color: #F9A511;
}
image {
.fivecontent_item_nav_leftlangimage {
width: 10.82rpx;
height: 14.06rpx;
}
}
.fivecontent_item_nav_leftlang:nth-child(2) {
margin-left: 12rpx;
background: #FEE9DF;
.fivecontent_item_nav_leftlang:nth-child(1) {
margin-left: 0;
}
}
}
}
@@ -278,26 +363,35 @@
color: #333333;
}
}
.fivecontent_item_boxitemlefttow {
margin-top: 8rpx;
width: max-content;
padding: 4rpx 10rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
text {
margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 16rpx;
color: #F9A511;
.flexstartboxfttow {
.fivecontent_item_boxitemlefttow {
margin-left: 16rpx;
margin-top: 8rpx;
width: max-content;
padding: 4rpx 10rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
.fivecontent_item_boxitemlefttowtext {
margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 16rpx;
color: #F9A511;
}
.fivecontent_item_boxitemlefttowimage {
width: 10.82rpx;
height: 14.06rpx;
}
}
image {
width: 10.82rpx;
height: 14.06rpx;
.fivecontent_item_boxitemlefttow:nth-child(1) {
margin-left: 0;
background: #FFD6D7;
border-radius: 4rpx 4rpx 4rpx 4rpx;
}
}

View File

@@ -8,7 +8,7 @@
</view>
</view>
<view class="towcontent">
<view class="fivecontent_item flex-between" v-for="(item,index) in list.list" :key="index">
<view class="fivecontent_item flex-between" v-for="(item,index) in list" :key="index">
<view class="fivecontent_itemone flex-start">
<image class="fivecontent_itemoneimage" :src="item.coverImg" mode=""></image>
<view class="fivecontent_itemonebox">
@@ -98,16 +98,15 @@
type: 'subShop', //团购卷品类Id/subShop-预约到店
orderBy: ''
})
console.log(res.data)
if (res.code == 0) {
if (res.code == 0) {
this.toplist = res.data.carousel[0]
}
},
async distirictsubShopList() {
let res = await this.api.distirictsubShopList({
address: '西安市', //地址
lng: '108.949158',
lat: '34.301731',
address:uni.cache.get('getLocationstorage').address, //地址
lng: uni.cache.get('getLocationstorage').lng,
lat: uni.cache.get('getLocationstorage').lat,
distanceInKm: '10', //默认10 以经纬度为中心 多大范围以内 单位km
isPage: '', //是否分页 1分页 0不分页
page: this.form.page, //页数
@@ -120,7 +119,7 @@
this.form.status = 'loading';
this.form.page = ++this.form.page;
setTimeout(() => {
this.list = [...this.list, ...res.data.list];
this.list = [...this.list,...res.data.list]
this.form.status = 'loading';
if (res.data.pageNum == res.data.pages) {
this.form.status = 'nomore';
@@ -129,7 +128,6 @@
}
}, 500)
}
this.list = res.data
}
}
};

View File

@@ -1,5 +1,15 @@
<template>
<view>
<view class="navtab flex-center">
<view class="navtabpost flex-center">
<view :class="navtabindex == 0 ? 'navtabone':'navtabtow'" @click="navtabclick(0)">
团购订单
</view>
<view :class="navtabindex == 1 ? 'navtabone':'navtabtow'" @click="navtabclick(1)">
到店订单
</view>
</view>
</view>
<u-sticky bgColor="#fff">
<view class="tab-wrap">
<view class="item" v-for="(item, index) in tabs" :key="index" @click="orderswitch(item,index)">
@@ -89,6 +99,7 @@
data() {
return {
active: 0,
navtabindex:0,
tabs: [{
name: '全部',
type: 1,
@@ -140,6 +151,10 @@
this.orderorderList()
},
methods: {
// 切换导航栏
navtabclick(i){
this.navtabindex = i
},
async loginwxuserInfo() {
let res = await this.api.loginwxuserInfo({
userId: uni.cache.get('userInfo').id
@@ -207,6 +222,43 @@
background: #f6f6f6;
}
.navtab {
width: 100%;
height: 56rpx;
background: #ffd158;
.navtabpost{
position: relative;
.navtabone {
margin-left:-10rpx;
width: 162rpx;
height: 56rpx;
background: #FFEAB1;
border-radius: 12rpx 12rpx 12rpx 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 28rpx;
color: #333333;
line-height: 56rpx;
text-align: center;
z-index: 10;
}
.navtabtow {
margin-left:-10rpx;
z-index: 9;
width: 166rpx;
height: 56rpx;
background: #FFFFFF;
border-radius: 12rpx 12rpx 12rpx 12rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #666666;
line-height: 56rpx;
text-align: center;
}
}
}
.tab-wrap {
display: flex;
position: relative;

View File

@@ -0,0 +1,137 @@
<template>
<view class="content">
<view class="contentitem" v-for="(item,index) in list" :key="index">
<view class="contentitemone flex-between">
<view class="contentitemone_o">
{{item.shopName}}{{(item.chainName)}}
</view>
<u-icon name="phone-fill" color="#333333" size="50" @click="clickphone(item.phone)"></u-icon>
</view>
<view class="contentitemtow">
营业时间{{item.businessTime}}
</view>
<view class="contentitemthere flex-start">
<view class="contentitemthere_o" v-if="index == 0">
最近
</view>
<image class="contentitemthere_image"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/product/d.png" mode="aspectFill"></image>
<view class="contentitemthere_t">
距您{{item.distances}}km<text v-if="item.address">,{{item.address}}</text>
</view>
<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
shopName: '',
list:[]
};
},
onLoad(e) {
this.shopName = e.name
this.distirictcomShopList()
},
onShow() {},
methods: {
//打电话
clickphone(e) {
uni.makePhoneCall({
phoneNumber: e
});
},
async distirictcomShopList() {
let res = await this.api.distirictcomShopList({
lng: uni.cache.get('getLocationstorage').lng,
lat: uni.cache.get('getLocationstorage').lat,
address: uni.cache.get('getLocationstorage').address,
distanceInKm: '',
page: 1,
size: 10,
shopName: this.shopName
})
if (res.code == 0) {
this.list = res.data
}
},
clickproduct(item) {
uni.pro.navigateTo('product/index', item)
},
}
};
</script>
<style scoped lang="scss">
page {
background: #fff;
}
.content {
padding: 0 24rpx;
.contentitem:nth-child(1) {
border-top: none;
}
.contentitem {
padding: 32rpx 0;
width: 100%;
border-top: 2rpx solid #E5E5E5;
.contentitemone {
.contentitemone_o {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 32rpx;
color: #333333;
}
}
.contentitemtow {
margin-top: 16rpx;
font-family: PingFang SC, PingFang SC;
font-weight: bold;
font-size: 24rpx;
color: #999999;
}
.contentitemthere {
margin-top: 16rpx;
.contentitemthere_o {
padding: 2rpx 12rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
font-size: 16rpx;
color: #FF9125;
}
.contentitemthere_image {
width: 24rpx;
height: 24rpx;
}
.contentitemthere_t {
margin-left: 8rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
text{
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
}
}
}
}
</style>

View File

@@ -5,8 +5,9 @@
<view class="onecontent">
<!-- 小内切圆 -->
<view class="after"></view>
<image class="onecontentimage" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/nav.png"
mode=""></image>
<!-- <image class="onecontentimage" :src="listdata.images"
mode=""></image> -->
<u-swiper class="onecontentimage" :list="listdata.images" height='490'></u-swiper>
</view>
<view class="towcontent">
<view class="onetowcontent flex-between">
@@ -15,30 +16,30 @@
到手
</view>
<view class="onetowcontent_onet">
12.00
{{listdata.salePrice}}
</view>
<view class="onetowcontent_oneth">
8
{{listdata.discount}}
</view>
<view class="onetowcontent_onefour">
15.00
{{listdata.originPrice}}
</view>
</view>
<view class="onetowcontent_tow flex-center">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/product/h.png" mode="aspectFill">
</image>
<text>已售620</text>
<text>已售{{listdata.realSalesNumber}}</text>
</view>
<view class="after"></view>
</view>
<view class="towtowcontent">
<view class="towtowcontent_one">
书亦烧仙草|青提烧仙草
{{listdata.shopName}}|{{listdata.productName}}
</view>
<view class="towtowcontent_tow flex-start">
<view class="flex-center">
<image class="towtowcontent_towimage" src="@/static/avatar.png" mode="aspectFill"></image>
<text class="towtowcontent_towtext">随时退</text>
<view class="flex-center" v-for="(item,index) in listdata.noticeTag" :key="index">
<image class="towtowcontent_towimage" :src="item.shareImg" mode="aspectFill"></image>
<text class="towtowcontent_towtext">{{item.name}}</text>
</view>
</view>
</view>
@@ -48,29 +49,29 @@
通用门店
</view>
<view class="onetherecontent_t flex-start">
<view class="">
15家店可用
<view class="" v-if="listdata.shopNum" @click="productgeneralstore(listdata.shopName)">
{{listdata.shopNum}}家店可用
</view>
<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
</view>
</view>
<view class="towtherecontent flex-between">
<view class="towtherecontent_o">
书亦烧仙草西安龙首门店
{{listdata.shopName || ''}}<text v-if="listdata.chainName">{{listdata.chainName}}门店</text>
</view>
<u-icon name="phone-fill" color="#333333" size="50"></u-icon>
<u-icon name="phone-fill" color="#333333" size="50" @click="clickphone(listdata.phone)"></u-icon>
</view>
<view class="theretherecontent">
营业时间周一至周日 10:00-21:00
营业时间{{listdata.businessTime}}
</view>
<view class="fourtherecontent flex-start">
<image class="fourtherecontentimage"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/product/d.png" mode="aspectFill"></image>
<view class="fourtherecontent_o">
30.0km
{{listdata.distances}}km
</view>
<view class="fourtherecontent_t">
龙首印象城向西20米
{{listdata.address}}
</view>
</view>
</view>
@@ -78,27 +79,30 @@
<view class="fourcontent_o">
套餐详情
</view>
<view class="fourcontent_t">
饮品
</view>
<view class="fourcontent_th flex-between">
<view class="fourcontent_th_one flex-start">
<view>
青提烧仙草
</view>
<view>
网友推荐TOP5
</view>
<view v-for="(item,index) in listdata.productList" :key="index">
<view class="fourcontent_t">
{{item.title}}
</view>
<view class="fourcontent_th_tow flex-start">
<view class="fourcontent_th_towo">
1
<view class="fourcontent_th flex-between" v-for="(item1,index1) in item.goods" :key="index1">
<view class="fourcontent_th_one flex-start">
<view>
{{item1.name}}
</view>
<view v-for="(item2,index2) in item1.proTag" :style="{'background':item.backColor,'color':item.fontColor}" :key="index2">
{{item2.name}}
</view>
</view>
<view class="fourcontent_th_towt">
12.00
<view class="fourcontent_th_tow flex-start">
<view class="fourcontent_th_towo">
{{item1.unitName}}
</view>
<view class="fourcontent_th_towt">
{{item1.lowPrice}}
</view>
</view>
</view>
</view>
</view>
<view class="fivecontent">
<view class="fivecontentone">
@@ -109,7 +113,7 @@
使用日期
</view>
<view class="fivecontenitemtow">
购买15天内有效
{{listdata.purchaseNotice.dateUsed || '无'}}
</view>
</view>
<view class="fivecontenitem">
@@ -117,7 +121,7 @@
可用时间
</view>
<view class="fivecontenitemtow">
全天可用
{{listdata.purchaseNotice.availableTime || '无'}}
</view>
</view>
<view class="fivecontenitem">
@@ -125,7 +129,7 @@
预约方式
</view>
<view class="fivecontenitemtow">
无需预约高峰期需等位
{{listdata.purchaseNotice.bookingType || '无'}}
</view>
</view>
<view class="fivecontenitem">
@@ -133,8 +137,7 @@
退款说明
</view>
<view class="fivecontenitemtow">
此为限时限量特惠产品请在规定期限内使用使用期限
内可申请全额退款逾期未使用自动全额退款
{{listdata.purchaseNotice.refundPolicy || '无'}}
</view>
</view>
<view class="fivecontenitem">
@@ -168,7 +171,7 @@
<u-icon name="arrow-right" color="#333333" size="28"></u-icon>
</view>
</view>
<view class="bottomcontent flex-between">
<!-- <view class="bottomcontent flex-between">
<view class="bottomcontent_texttop flex-start">
附近推荐
</view>
@@ -176,7 +179,7 @@
去首页
<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
</view>
</view>
</view> -->
<view class="fivecontentes">
<view class="fivecontent_item" v-for="(item,index) in homelist" :key="index">
<view class="fivecontent_item_nav flex-start">
@@ -191,11 +194,10 @@
</view>
</view>
<view class="fivecontent_item_nav_lefttopstart flex-start">
<view class="fivecontent_item_nav_leftlang flex-start"
v-for="(s,index1) in item.shopTag" :key="index1"
:style="{'background':s.backColor,'color':s.backColor}">
<image class="fivecontent_item_nav_leftlangimage" v-if="s.shareImg"
:src="s.shareImg" mode="aspectFill"></image>
<view class="fivecontent_item_nav_leftlang flex-start" v-for="(s,index1) in item.shopTag"
:key="index1" :style="{'background':s.backColor,'color':s.backColor}">
<image class="fivecontent_item_nav_leftlangimage" v-if="s.shareImg" :src="s.shareImg"
mode="aspectFill"></image>
<text class="fivecontent_item_nav_leftlangtext">{{s.name}}</text>
</view>
</view>
@@ -230,23 +232,23 @@
<view class="indexboxitemlefttheretexttow">
¥{{item.discount}}
</view>
</view>
<view class="indexboxitemleftthere_countdown flex-between">
<text class="indexboxitemleftthere_countdowntext">共省{{item.save}}</text>
<view class="indexboxitemleftthere_countdowntexts">
<uni-countdown @timeup="updateCity" :show-day="false"
:day="item.end_times.d" :hour="item.end_times.h"
:minute="item.end_times.m" :second="item.end_times.s"
:indexs='index' color="#FFFFFF" border-color="#00B26A"
splitorColor="#FFFFFF" :font-size="7"></uni-countdown>
<uni-countdown @timeup="updateCity" :show-day="false" :day="item.end_times.d"
:hour="item.end_times.h" :minute="item.end_times.m"
:second="item.end_times.s" :indexs='index' color="#FFFFFF"
border-color="#00B26A" splitorColor="#FFFFFF"
:font-size="7"></uni-countdown>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
@@ -264,8 +266,25 @@
团购价
</view>
<view class="classshowpopupitemtow">
指团购商品/服务的销售价格是用户最终决定是否购买商品/服务
的依据
{{listdata.purchaseNotice.groupPurInfo || '无'}}
</view>
<view class="classshowpopupitemone">
门市价/划线价
</view>
<view class="classshowpopupitemtow">
{{listdata.purchaseNotice.marketPriceInfo || '无'}}
</view>
<view class="classshowpopupitemone">
折扣
</view>
<view class="classshowpopupitemtow">
{{listdata.purchaseNotice.discountInfo || '无'}}
</view>
<view class="classshowpopupitemone">
平台温馨提示
</view>
<view class="classshowpopupitemtow">
{{listdata.purchaseNotice.platformTips || '无'}}
</view>
</view>
</view>
@@ -281,18 +300,18 @@
},
data() {
return {
titlename: '今日上新',
titlename: '详情',
opacity: false,
showpopup:false,
form: {
address: '', //地址
type: '', //品类
orderBy: '', //1.理我最近 2.销量优先 3.价格优先
other: '', //附近1KM 1选中 0不选中
page: 1, //页数
size: 10, //页容量
status: 'loadmore'
showpopup: true,
indexform: {},
listdata: {
},
list1: [
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
]
};
},
onPageScroll(e) {
@@ -302,6 +321,37 @@
this.opacity = true
}
},
onLoad(e) {
console.log(e)
this.indexform = e
this.onLoadInfo()
},
methods: {
//打电话
clickphone(e){
uni.makePhoneCall({
phoneNumber: e
});
},
// 通用门店
productgeneralstore(name){
uni.pro.navigateTo('product/generalstore',{
name
})
},
async onLoadInfo() { //详情接口
let res = await this.api.productproductInfo({
productId: this.indexform.id,
lng: uni.cache.get('getLocationstorage').lng,
lat: uni.cache.get('getLocationstorage').lat
})
try {
this.listdata = res.data
} catch (e) {
//TODO handle the exception
}
}
}
};
</script>
@@ -399,6 +449,7 @@
font-weight: 400;
font-size: 24rpx;
color: #FFFFFF;
text-decoration: line-through;
}
}
@@ -433,6 +484,9 @@
background: #FFFFFF;
.towtowcontent_one {
overflow:hidden; //超出的文本隐藏
text-overflow:ellipsis; //溢出用省略号显示
white-space:nowrap; //溢出不换行
padding-top: 32rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
@@ -491,6 +545,9 @@
margin-top: 32rpx;
.towtherecontent_o {
overflow:hidden; //超出的文本隐藏
text-overflow:ellipsis; //溢出用省略号显示
white-space:nowrap; //溢出不换行
width: 364rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
@@ -642,15 +699,18 @@
color: #333333;
}
}
.bottomcontent{
.bottomcontent {
padding: 0 28rpx;
.bottomcontent_texttop{
.bottomcontent_texttop {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
.bottomcontent_texttop::before{
.bottomcontent_texttop::before {
content: '';
display: inline-block;
width: 4rpx;
@@ -659,56 +719,58 @@
margin-right: 10rpx;
border-radius: 4rpx 4rpx 4rpx 4rpx;
}
.bottomcontent_textright{
.bottomcontent_textright {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
}
.fivecontentes {
padding: 0 28rpx;
overflow: auto;
.fivecontent_item:nth-child(1) {
margin-top: 0;
}
.fivecontent_item {
margin-top: 32rpx;
padding: 24rpx 32rpx;
width: 100%;
background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx;
.fivecontent_item_nav {
image {
width: 60rpx;
height: 60rpx;
border-radius: 8rpx;
}
.fivecontent_item_nav_left {
flex: auto;
margin-left: 12rpx;
.fivecontent_item_nav_lefttop {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #666666;
}
.fivecontent_item_nav_lefttopstart {
margin-top: 8rpx;
.fivecontent_item_nav_leftlang {
margin-left: 12rpx;
width: max-content;
padding: 4rpx 10rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
.fivecontent_item_nav_leftlangtext {
margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
@@ -716,47 +778,47 @@
font-size: 16rpx;
color: #F9A511;
}
.fivecontent_item_nav_leftlangimage {
width: 10.82rpx;
height: 14.06rpx;
}
}
.fivecontent_item_nav_leftlang:nth-child(1) {
margin-left: 0;
}
}
}
}
.fivecontent_item_box {
margin-top: 20rpx;
border-top: 2rpx solid #E5E5E5;
padding-top: 14rpx;
.fivecontent_item_boxitem {
image {
width: 192rpx;
height: 192rpx;
border-radius: 12rpx;
}
.fivecontent_item_boxitemleft {
margin-left: 24rpx;
flex: auto;
.fivecontent_item_boxitemleftone {
width: 100%;
text {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
view {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
@@ -764,7 +826,7 @@
color: #333333;
}
}
.flexstartboxfttow {
.fivecontent_item_boxitemlefttow {
margin-left: 16rpx;
@@ -773,7 +835,7 @@
padding: 4rpx 10rpx;
background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx;
.fivecontent_item_boxitemlefttowtext {
margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
@@ -781,21 +843,21 @@
font-size: 16rpx;
color: #F9A511;
}
.fivecontent_item_boxitemlefttowimage {
width: 10.82rpx;
height: 14.06rpx;
}
}
.fivecontent_item_boxitemlefttow:nth-child(1) {
margin-left: 0;
background: #FFD6D7;
border-radius: 4rpx 4rpx 4rpx 4rpx;
}
}
.indexboxitemleftthere {
position: relative;
margin-top: 30rpx;
@@ -804,7 +866,7 @@
height: 88rpx;
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/qinggou.png) no-repeat;
background-size: 100% 100%;
.indexboxitemleftthereabsolute {
position: absolute;
top: 14rpx;
@@ -814,7 +876,7 @@
font-size: 24rpx;
color: #FFFFFF;
}
.indexboxitemlefttheretext {
.indexboxitemlefttheretextone {
text {
@@ -822,17 +884,17 @@
font-weight: normal;
color: #FF5053;
}
text:nth-child(2) {
font-weight: bold;
font-size: 34rpx;
}
text:nth-child(1) {
font-size: 24rpx;
}
}
.indexboxitemlefttheretexttow {
margin-left: 12rpx;
font-size: 20rpx;
@@ -842,18 +904,18 @@
text-decoration: line-through;
}
}
.indexboxitemleftthere_countdown {
width: 100%;
padding-right: 7rpx;
.indexboxitemleftthere_countdowntext {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.indexboxitemleftthere_countdowntexts {
font-family: Roboto, Roboto;
font-weight: 400;
@@ -869,15 +931,17 @@
}
}
}
}
.classshowpopup{
.classshowpopup {
position: relative;
width: 100%;
background: #FFFFFF;
border-radius: 40rpx 40rpx 0rpx 0rpx;
padding: 48rpx 28rpx 28rpx 28rpx;
.classshowpopuptop{
.classshowpopuptop {
text-align: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 500;
@@ -885,20 +949,24 @@
color: #333333;
width: 100%;
}
.classshowpopupabsolute{
.classshowpopupabsolute {
position: absolute;
top: 55rpx;
right: 28rpx;
}
.classshowpopupitem{
.classshowpopupitem {
margin-top: 32rpx;
.classshowpopupitemone{
.classshowpopupitemone {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 32rpx;
color: #333333;
}
.classshowpopupitemtow{
.classshowpopupitemtow {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 24rpx;

View File

@@ -56,7 +56,7 @@
this.form.type = item.value
break;
case 'relative': //内部页面
uni.pro.navigateTo(relUrl)
uni.pro.navigateTo(item.absUrl)
break;
case 'absolute': //外链url
uni.navigateTo({