首页更新

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) { //获取免单订单 orderfindWiningUser(data) { //获取免单订单
return uni.api.get("/order/findWiningUser", 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: -webkit-sticky;
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 999999; z-index: 9999;
.active { .active {
background: rgba(249, 249, 249, 1); background: rgba(249, 249, 249, 1);

View File

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

View File

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

View File

@@ -1,9 +1,9 @@
<template> <template>
<view class="content"> <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"> <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 class="onecontentabsolute">
</view> </view>
</view> </view>
@@ -20,9 +20,9 @@
</view> </view>
</view> </view>
<view class="towcontentlistxitembt flex-start"> <view class="towcontentlistxitembt flex-start">
<view class="towcontentlistxitembtitem" :class="index==1?'towcontentlistxitembtitemaktev':''" <view class="towcontentlistxitembtitem" :class="index==xitembtitemindex?'towcontentlistxitembtitemaktev':''"
v-for="(item,index) in 3" :key="index"> v-for="(item,index) in xitembtitem" :key="index" @click="clickxitembtitemindex(index)">
2小时销量飙升榜 {{item.name}}
</view> </view>
</view> </view>
@@ -30,28 +30,7 @@
<view v-if="isFixedTop" :style="{'height':windowHeight - seighT + 'px'}"></view> <view v-if="isFixedTop" :style="{'height':windowHeight - seighT + 'px'}"></view>
<view class="towcontentboutton" :style="{'height':seighT + 'px'}"> <view class="towcontentboutton" :style="{'height':seighT + 'px'}">
<!-- <scroll-view :style="{'height':seighT + 'px'}" scroll-y @scrolltolower="loadMore"> --> <!-- <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" v-for="(item,index) in list" :key="index" @click="clickproduct(item)">
<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_box"> <view class="fivecontent_item_box">
<view class="fivecontent_item_boxitem flex-between"> <view class="fivecontent_item_boxitem flex-between">
<image :src="item.image" mode=""></image> <image :src="item.image" mode=""></image>
@@ -60,11 +39,14 @@
<view>{{item.productName}}</view> <view>{{item.productName}}</view>
<text>已抢{{item.realSalesNumber}}</text> <text>已抢{{item.realSalesNumber}}</text>
</view> </view>
<view class="fivecontent_item_boxitemlefttow flex-start" <view class="flex-start flexstartboxfttow">
v-for="(c,index2) in item.proTag" :key="index2"> <view class="fivecontent_item_boxitemlefttow flex-start"
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png" v-for="(c,index2) in item.proTag" :key="index2"
mode="aspectFill"></image> :style="{'background':c.backColor,'color':c.backColor}">
<text>{{c}}</text> <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>
<view class="indexboxitemleftthere flex-colum-start"> <view class="indexboxitemleftthere flex-colum-start">
<view class="indexboxitemleftthereabsolute"> <view class="indexboxitemleftthereabsolute">
@@ -83,11 +65,11 @@
<view class="indexboxitemleftthere_countdown flex-between"> <view class="indexboxitemleftthere_countdown flex-between">
<text class="indexboxitemleftthere_countdowntext">共省{{item.save}}</text> <text class="indexboxitemleftthere_countdowntext">共省{{item.save}}</text>
<view class="indexboxitemleftthere_countdowntexts"> <view class="indexboxitemleftthere_countdowntexts">
<!-- <uni-countdown @timeup="updateCity" :show-day="false" <!-- <uni-countdown @timeup="updateCity" :show-day="false" :day="item.end_times.d"
:day="item.end_times.d" :hour="item.end_times.h" :hour="item.end_times.h" :minute="item.end_times.m"
:minute="item.end_times.m" :second="item.end_times.s" :second="item.end_times.s" :indexs='index' color="#FFFFFF"
:indexs='index' color="#FFFFFF" border-color="#00B26A" border-color="#00B26A" splitorColor="#FFFFFF"
splitorColor="#FFFFFF" :font-size="7"></uni-countdown> --> :font-size="7"></uni-countdown> -->
</view> </view>
@@ -97,8 +79,7 @@
</view> </view>
</view> </view>
</view> </view><u-loadmore height='40' :status="form.status" iconSize='24' fontSize='24' />
<u-loadmore height='40' :status="form.status" iconSize='24' fontSize='24' />
<!-- </scroll-view> --> <!-- </scroll-view> -->
</view> </view>
</view> </view>
@@ -123,6 +104,8 @@
customheighttop: '', //top高度 customheighttop: '', //top高度
isFixedTop: false, isFixedTop: false,
Topdistance: 3000, //吸顶初始距离 Topdistance: 3000, //吸顶初始距离
list: [],
toplist: {},
listbox: [{ listbox: [{
name: '全部' name: '全部'
}, },
@@ -133,6 +116,14 @@
name: '饮品小吃' name: '饮品小吃'
} }
], ],
xitembtitemindex:0,
xitembtitem: [{
name: '2小时销量飙升榜'
},
{
name: '今日热榜'
}
],
form: { form: {
address: '', //地址 address: '', //地址
type: '', //品类 type: '', //品类
@@ -157,6 +148,8 @@
} }
}, },
onLoad() { onLoad() {
this.distiricttopCommon()
this.onLoadlist()
setTimeout(() => { setTimeout(() => {
this.GetTop() this.GetTop()
}, 1000) }, 1000)
@@ -167,6 +160,13 @@
}, },
}, },
methods: { methods: {
//飙升榜
clickxitembtitemindex(index){
this.xitembtitemindex = index
},
towcontentclick(index) {
this.towcontentclickindex = index
},
//G滚动底部 //G滚动底部
loadMore(e) { loadMore(e) {
console.log(e) console.log(e)
@@ -199,9 +199,75 @@
} }
}) })
}, },
towcontentclick(index) { async distiricttopCommon() {
this.towcontentclickindex = index 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> </script>
@@ -216,6 +282,7 @@
width: 100%; width: 100%;
height: 492rpx; height: 492rpx;
position: relative; position: relative;
.onecontentimage { .onecontentimage {
position: absolute; position: absolute;
width: 100%; width: 100%;
@@ -349,62 +416,13 @@
.fivecontent_item { .fivecontent_item {
margin-top: 32rpx; margin-top: 32rpx;
padding: 24rpx; padding:32rpx 24rpx;
width: 100%; width: 100%;
background: #FFFFFF; background: #FFFFFF;
border-radius: 18rpx 18rpx 18rpx 18rpx; 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 { .fivecontent_item_box {
margin-top: 20rpx;
border-top: 2rpx solid #E5E5E5;
padding-top: 14rpx;
.fivecontent_item_boxitem { .fivecontent_item_boxitem {
image { 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 { .flexstartboxfttow {
margin-left: 6rpx; .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; .fivecontent_item_boxitemlefttowtext {
font-weight: 400; margin-left: 6rpx;
font-size: 16rpx; font-family: Source Han Sans CN, Source Han Sans CN;
color: #F9A511; font-weight: 400;
font-size: 16rpx;
color: #F9A511;
}
.fivecontent_item_boxitemlefttowimage {
width: 10.82rpx;
height: 14.06rpx;
}
} }
image { .fivecontent_item_boxitemlefttow:nth-child(1) {
width: 10.82rpx; margin-left: 0;
height: 14.06rpx; background: #FFD6D7;
border-radius: 4rpx 4rpx 4rpx 4rpx;
} }
} }

View File

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

View File

@@ -1,9 +1,9 @@
<template> <template>
<view class="content"> <view class="content">
<!-- 占位符导航栏 --> <!-- 占位符导航栏 -->
<navseat :opacity='opacity' :title='titlename' :titleshow='false'></navseat> <navseat :opacity='opacity' :title='toplist.name' :titleshow='false'></navseat>
<view class="onecontent"> <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="onecontentabsolute">
<view class="onecontentabsoluteitem flex-between"> <view class="onecontentabsoluteitem flex-between">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/l.png" mode=""></image> <image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/l.png" mode=""></image>
@@ -15,24 +15,24 @@
</view> </view>
</view> </view>
<view class="towcontent"> <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"> <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_left">
<view class="fivecontent_item_nav_lefttop flex-between"> <view class="fivecontent_item_nav_lefttop flex-between">
<view> <view>
{{item.shopName}} {{item.shopName}}
</view> </view>
<view> <view>
龙首.{{item.distances}}m 龙首.{{item.distances}}km
</view> </view>
</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" <view class="fivecontent_item_nav_leftlang flex-start" v-for="(s,index1) in item.shopTag"
:key="index1"> :key="index1" :style="{'background':s.backColor,'color':s.backColor}">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png" <image class="fivecontent_item_nav_leftlangimage" v-if="s.shareImg" :src="s.shareImg"
mode="aspectFill"></image> mode="aspectFill"></image>
<text>{{s}}</text> <text class="fivecontent_item_nav_leftlangtext">{{s.name}}</text>
</view> </view>
</view> </view>
</view> </view>
@@ -45,11 +45,14 @@
<view>{{item.productName}}</view> <view>{{item.productName}}</view>
<text>已抢{{item.realSalesNumber}}</text> <text>已抢{{item.realSalesNumber}}</text>
</view> </view>
<view class="fivecontent_item_boxitemlefttow flex-start" v-for="(c,index2) in item.proTag" <view class="flex-start flexstartboxfttow">
:key="index2"> <view class="fivecontent_item_boxitemlefttow flex-start"
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png" v-for="(c,index2) in item.proTag" :key="index2"
mode="aspectFill"></image> :style="{'background':c.backColor,'color':c.backColor}">
<text>{{c}}</text> <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>
<view class="indexboxitemleftthere flex-colum-start"> <view class="indexboxitemleftthere flex-colum-start">
<view class="indexboxitemleftthereabsolute"> <view class="indexboxitemleftthereabsolute">
@@ -100,10 +103,14 @@
return { return {
titlename: '今日上新', titlename: '今日上新',
opacity: false, opacity: false,
list: [],
toplist: {},
form: { form: {
address: '', //地址 address: '西安市', //地址
lng: '108.949158',
lat: '34.301731',
type: '', //品类 type: '', //品类
orderBy: '', //1.理我最近 2.销量优先 3.价格优先 orderBy: 0, //1.理我最近 2.销量优先 3.价格优先
other: '', //附近1KM 1选中 0不选中 other: '', //附近1KM 1选中 0不选中
page: 1, //页数 page: 1, //页数
size: 10, //页容量 size: 10, //页容量
@@ -118,6 +125,82 @@
this.opacity = true 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> </script>
@@ -131,8 +214,8 @@
width: 100%; width: 100%;
height: 492rpx; height: 492rpx;
position: relative; position: relative;
.onecontentimage{ .onecontentimage {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 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: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/nav.png) no-repeat;
background-size: cover; background-size: cover;
} }
.onecontentabsolute { .onecontentabsolute {
position: absolute; position: absolute;
width: 100%; width: 100%;
@@ -215,33 +299,34 @@
color: #666666; color: #666666;
} }
.flex-start { .fivecontent_item_nav_lefttopstart {
margin-top: 8rpx;
.fivecontent_item_nav_leftlang { .fivecontent_item_nav_leftlang {
margin-top: 8rpx; margin-left: 12rpx;
width: max-content; width: max-content;
padding: 4rpx 10rpx; padding: 4rpx 10rpx;
background: #FFF9E1; background: #FFF9E1;
border-radius: 4rpx 4rpx 4rpx 4rpx; border-radius: 4rpx 4rpx 4rpx 4rpx;
text {
.fivecontent_item_nav_leftlangtext {
margin-left: 6rpx; margin-left: 6rpx;
font-family: Source Han Sans CN, Source Han Sans CN; font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400; font-weight: 400;
font-size: 16rpx; font-size: 16rpx;
color: #F9A511; color: #F9A511;
} }
image {
.fivecontent_item_nav_leftlangimage {
width: 10.82rpx; width: 10.82rpx;
height: 14.06rpx; height: 14.06rpx;
} }
} }
.fivecontent_item_nav_leftlang:nth-child(2) { .fivecontent_item_nav_leftlang:nth-child(1) {
margin-left: 12rpx; margin-left: 0;
background: #FEE9DF;
} }
} }
} }
} }
@@ -278,26 +363,35 @@
color: #333333; color: #333333;
} }
} }
.fivecontent_item_boxitemlefttow {
margin-top: 8rpx; .flexstartboxfttow {
width: max-content; .fivecontent_item_boxitemlefttow {
padding: 4rpx 10rpx; margin-left: 16rpx;
background: #FFF9E1; margin-top: 8rpx;
border-radius: 4rpx 4rpx 4rpx 4rpx; width: max-content;
padding: 4rpx 10rpx;
text { background: #FFF9E1;
margin-left: 6rpx; border-radius: 4rpx 4rpx 4rpx 4rpx;
font-family: Source Han Sans CN, Source Han Sans CN; .fivecontent_item_boxitemlefttowtext {
font-weight: 400; margin-left: 6rpx;
font-size: 16rpx; font-family: Source Han Sans CN, Source Han Sans CN;
color: #F9A511; font-weight: 400;
font-size: 16rpx;
color: #F9A511;
}
.fivecontent_item_boxitemlefttowimage {
width: 10.82rpx;
height: 14.06rpx;
}
} }
image { .fivecontent_item_boxitemlefttow:nth-child(1) {
width: 10.82rpx; margin-left: 0;
height: 14.06rpx; background: #FFD6D7;
border-radius: 4rpx 4rpx 4rpx 4rpx;
} }
} }

View File

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

View File

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

View File

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