首页完善
This commit is contained in:
@@ -5,29 +5,29 @@
|
|||||||
<text class="contentonetext">精选推荐</text>
|
<text class="contentonetext">精选推荐</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="contenttow flex-between">
|
<view class="contenttow flex-between">
|
||||||
<view class="contenttowitem" v-for="(item,index) in 6">
|
<view class="contenttowitem" v-for="(item,index) in list" :key="index" @click="clickproduct(item)">
|
||||||
<image class="contenttowitemimage" src="@/static/icon_cart.png" mode=""></image>
|
<image class="contenttowitemimage" :src="item.image" mode=""></image>
|
||||||
<view class="contenttowitemtiter">
|
<view class="contenttowitemtiter">
|
||||||
库迪咖啡|全场饮品任选券|多店美团可用
|
{{item.shopName}}|{{item.productName}}
|
||||||
</view>
|
</view>
|
||||||
<view class="contenttowitemone flex-between">
|
<view class="contenttowitemone flex-between">
|
||||||
<view class="contenttowitemone_dingwei flex-start">
|
<view class="contenttowitemone_dingwei flex-start">
|
||||||
<image class="contenttowitemone_dingweiimage"
|
<image class="contenttowitemone_dingweiimage"
|
||||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/dw.png" mode="aspectFill"></image>
|
:src="item.image" mode="aspectFill"></image>
|
||||||
<view class="contenttowitemone_dingweinumer">
|
<view class="contenttowitemone_dingweinumer">
|
||||||
2.5km
|
{{item.distances}}km
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="contenttowitemone_text">
|
<view class="contenttowitemone_text">
|
||||||
已售192.9万
|
已售{{item.realSalesNumber}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="contenttowitemtow flex-start">
|
<view class="contenttowitemtow flex-start">
|
||||||
<view class="contenttowitemtow_one">
|
<view class="contenttowitemtow_one">
|
||||||
券后¥7.22
|
券后¥{{item.salePrice}}
|
||||||
</view>
|
</view>
|
||||||
<view class="contenttowitemtow_tow">
|
<view class="contenttowitemtow_tow">
|
||||||
3.2折
|
{{item.discount}}折
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -41,9 +41,11 @@
|
|||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
title: {
|
list: {
|
||||||
type: String,
|
type: Array,
|
||||||
default: ''
|
default () {
|
||||||
|
return []
|
||||||
|
}
|
||||||
},
|
},
|
||||||
opacity: {
|
opacity: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -60,6 +62,11 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
clickproduct(item) {
|
||||||
|
uni.pro.navigateTo('product/index', {
|
||||||
|
id:item.id
|
||||||
|
})
|
||||||
|
},
|
||||||
clicknavigateBack() {
|
clicknavigateBack() {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,11 @@
|
|||||||
},
|
},
|
||||||
"usingComponents": true,
|
"usingComponents": true,
|
||||||
"libVersion": "latest",
|
"libVersion": "latest",
|
||||||
|
"permission": {
|
||||||
|
"scope.userLocation": {
|
||||||
|
"desc": "你的位置信息将用于小程序位置接口的效果展示"
|
||||||
|
}
|
||||||
|
},
|
||||||
"requiredPrivateInfos": ["getLocation", "onLocationChange", "chooseLocation", "chooseAddress"]
|
"requiredPrivateInfos": ["getLocation", "onLocationChange", "chooseLocation", "chooseAddress"]
|
||||||
},
|
},
|
||||||
"h5": {
|
"h5": {
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
timersetnteritem(newVal, oldVal) {
|
timersetnteritem(newVal, oldVal) {
|
||||||
console.log(newVal, oldVal)
|
// console.log(newVal, oldVal)
|
||||||
if (newVal == 1) {
|
if (newVal == 1) {
|
||||||
clearTimeout(this.timersetInterval);
|
clearTimeout(this.timersetInterval);
|
||||||
this.timersetInterval = null;
|
this.timersetInterval = null;
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
endMove(e) {
|
endMove(e) {
|
||||||
// this.itemStyless = []
|
// this.itemStyless = []
|
||||||
var newList = JSON.parse(JSON.stringify(this.itemStyle))
|
var newList = JSON.parse(JSON.stringify(this.itemStyle))
|
||||||
console.log(newList)
|
// console.log(newList)
|
||||||
// if ((e.changedTouches[0].pageX - this.slideNote.x) < 0) {
|
// if ((e.changedTouches[0].pageX - this.slideNote.x) < 0) {
|
||||||
// 向左滑动
|
// 向左滑动
|
||||||
var last = [newList.pop()]
|
var last = [newList.pop()]
|
||||||
|
|||||||
116
pages/index/components/category.vue
Normal file
116
pages/index/components/category.vue
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
<template>
|
||||||
|
<view class="fourcontent flex-between">
|
||||||
|
<view class="fourcontent_item flex-start" v-for="(item,index) in menu" :key="index"
|
||||||
|
@click="viewHistorycategoryss(item,index)"
|
||||||
|
:class="!item.isChild && viewHistoryindex == index ? 'fourcontent_itemactev':''">
|
||||||
|
<text>{{item.name}}</text>
|
||||||
|
<u-icon v-if="item.isChild" style="margin-left: 8rpx;" name="arrow-down-fill" color="#333333"
|
||||||
|
size="16"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
menu: {
|
||||||
|
type: Array,
|
||||||
|
default () {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: '每日特价'
|
||||||
|
},
|
||||||
|
viewHistoryindex: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
viewHistorycategoryss(item, index) {
|
||||||
|
console.log(item, index)
|
||||||
|
uni.$emit('viewHistory', {
|
||||||
|
item:item,
|
||||||
|
index:index
|
||||||
|
});
|
||||||
|
},
|
||||||
|
clickdistrict(item) {
|
||||||
|
switch (item.jumpType) {
|
||||||
|
case 'absolute':
|
||||||
|
uni.pro.navigateTo('webview/webview', {
|
||||||
|
url: item.absUrl
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 'relative':
|
||||||
|
uni.pro.navigateTo(item.absUrl, item);
|
||||||
|
break;
|
||||||
|
case 'scan':
|
||||||
|
if (!uni.utils.pluschooseImage()) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// #ifdef H5
|
||||||
|
if (this.wxSdk) {
|
||||||
|
wx.scanQRCode({
|
||||||
|
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
||||||
|
scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
|
||||||
|
success: res => {
|
||||||
|
// 当needResult 为 1 时,扫码返回的结果
|
||||||
|
console.log(res.resultStr, res)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showModal({
|
||||||
|
title: '注意',
|
||||||
|
content: '微信sdk初始化失败,请重新加载',
|
||||||
|
success: res => {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifdef APP || MP-WEIXIN
|
||||||
|
uni.scanCode({
|
||||||
|
success: res => {
|
||||||
|
console.log(res.result, res)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.fourcontent {
|
||||||
|
padding: 32rpx 28rpx 32rpx 28rpx;
|
||||||
|
overflow-x: auto;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
|
||||||
|
.fourcontent_item {
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
margin-left: 22rpx;
|
||||||
|
padding: 4rpx 14rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||||
|
|
||||||
|
text {
|
||||||
|
width: max-content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fourcontent_itemactev {
|
||||||
|
background: #fee06a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fourcontent_item:nth-child(1) {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -102,7 +102,9 @@
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
clickproduct(item){
|
clickproduct(item){
|
||||||
uni.pro.navigateTo('product/index',item)
|
uni.pro.navigateTo('product/index',{
|
||||||
|
id:item.id
|
||||||
|
})
|
||||||
},
|
},
|
||||||
jrtoday(e){
|
jrtoday(e){
|
||||||
if(e == 0){
|
if(e == 0){
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
<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="after"></view>
|
<view class="after"></view>
|
||||||
<view class="onecontentabsolute">
|
<view class="onecontentabsolute">
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="towcontent">
|
<view class="towcontent">
|
||||||
<view :class="isFixedTop?'towcontentlistxitemboxfixed':''" :style="{'top':customheighttop + 'px'}">
|
<!-- <view :class="isFixedTop?'towcontentlistxitemboxfixed':''" :style="{'top':customheighttop + 'px'}">
|
||||||
<view class="towcontentlistxitem flex-start">
|
<view class="towcontentlistxitem flex-start">
|
||||||
<view class="towcontentlistxitembox flex-colum"
|
<view class="towcontentlistxitembox flex-colum"
|
||||||
:class="towcontentclickindex == index?'towcontentlistxitemboxopacity':''"
|
:class="towcontentclickindex == index?'towcontentlistxitemboxopacity':''"
|
||||||
@@ -22,35 +22,28 @@
|
|||||||
</image>
|
</image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="towcontentlistxitembt flex-start">
|
</view> -->
|
||||||
<view class="towcontentlistxitembtitem" :class="index==1?'towcontentlistxitembtitemaktev':''"
|
|
||||||
v-for="(item,index) in 3" :key="index">
|
|
||||||
2小时销量飙升榜
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<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">
|
<view class="fivecontent_item_nav flex-start">
|
||||||
<image 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"
|
<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}">
|
||||||
<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>
|
||||||
@@ -63,34 +56,39 @@
|
|||||||
<view>{{item.productName}}</view>
|
<view>{{item.productName}}</view>
|
||||||
<text>已抢{{item.realSalesNumber}}份</text>
|
<text>已抢{{item.realSalesNumber}}份</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="flex-start flexstartboxfttow">
|
||||||
<view class="fivecontent_item_boxitemlefttow flex-start"
|
<view class="fivecontent_item_boxitemlefttow flex-start"
|
||||||
v-for="(c,index2) in item.proTag" :key="index2">
|
v-for="(c,index2) in item.proTag" :key="index2"
|
||||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/hong_h.png"
|
:style="{'background':c.backColor,'color':c.backColor}">
|
||||||
mode="aspectFill"></image>
|
<image class="fivecontent_item_boxitemlefttowimage" v-if="c.shareImg"
|
||||||
<text>{{c}}</text>
|
: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">
|
||||||
马上抢
|
马上抢
|
||||||
</view>
|
</view>
|
||||||
<view class="indexboxitemlefttheretext flex-start">
|
<view class="indexboxitemlefttheretext flex-start">
|
||||||
<view class="indexboxitemlefttheretextone">
|
<view class="fivecontent_item_boxitemlefthere_one flex-start">
|
||||||
<text>¥</text>
|
<text class="flex_startone">到手</text>
|
||||||
<text>{{item.salePrice}}</text>
|
<text class="flex_starttow">¥{{item.salePrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="indexboxitemlefttheretexttow">
|
<view class="fivecontent_item_boxitemlefthere_tow">
|
||||||
¥{{item.discount}}
|
{{item.discount || ''}}折
|
||||||
|
</view>
|
||||||
|
<view class="fivecontent_item_boxitemlefthere_there">
|
||||||
|
¥{{item.originPrice}}
|
||||||
</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" :hour="item.end_times.h"
|
:day="item.end_times.d" :hour="item.end_times.h"
|
||||||
:minute="item.end_times.m" :second="item.end_times.s"
|
:minute="item.end_times.m" :second="item.end_times.s"
|
||||||
:indexs='index' color="#FFFFFF" border-color="#00B26A"
|
:indexs='index' color="#FFFFFF" border-color="#00B26A"
|
||||||
splitorColor="#FFFFFF" :font-size="7"></uni-countdown> -->
|
splitorColor="#FFFFFF" :font-size="7"></uni-countdown>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -125,16 +123,9 @@
|
|||||||
customheighttop: '', //top高度
|
customheighttop: '', //top高度
|
||||||
isFixedTop: false,
|
isFixedTop: false,
|
||||||
Topdistance: 3000, //吸顶初始距离
|
Topdistance: 3000, //吸顶初始距离
|
||||||
listbox: [{
|
list: [],
|
||||||
name: '全部'
|
toplist: {},
|
||||||
},
|
listbox: [],
|
||||||
{
|
|
||||||
name: '美食正餐'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '饮品小吃'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
form: {
|
form: {
|
||||||
address: '', //地址
|
address: '', //地址
|
||||||
type: '', //品类
|
type: '', //品类
|
||||||
@@ -158,17 +149,92 @@
|
|||||||
this.isFixedTop = false
|
this.isFixedTop = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(e) {
|
||||||
|
this.type = e.value
|
||||||
|
this.distiricttopCommon()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.GetTop()
|
this.GetTop()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
this.init_fn()
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
HeighT() { //手机类型的尺寸
|
HeighT() { //手机类型的尺寸
|
||||||
return this.$store.getters.is_BarHeight
|
return this.$store.getters.is_BarHeight
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
clickproduct(item){
|
||||||
|
uni.pro.navigateTo('product/index',{
|
||||||
|
id:item.id
|
||||||
|
})
|
||||||
|
},
|
||||||
|
init_fn() {
|
||||||
|
this.list = []
|
||||||
|
this.form = {
|
||||||
|
address: uni.cache.get('getLocationstorage').address, //地址
|
||||||
|
lng: uni.cache.get('getLocationstorage').lng,
|
||||||
|
lat: uni.cache.get('getLocationstorage').lat,
|
||||||
|
type:this.type, //品类
|
||||||
|
orderBy:0, //0.今日上新 1.离我最近 2.销量优先 3.价格优先 4.热榜推荐
|
||||||
|
other: '', //附近1KM 1选中 0不选中
|
||||||
|
page: 1, //页数
|
||||||
|
size: 10, //页容量
|
||||||
|
dateType: 1,
|
||||||
|
status: 'loadmore'
|
||||||
|
}
|
||||||
|
this.onLoadlist()
|
||||||
|
},
|
||||||
|
async distiricttopCommon(e) {
|
||||||
|
let res = await this.api.distiricttopCommon({
|
||||||
|
type: this.type, //团购卷品类Id/subShop-预约到店
|
||||||
|
orderBy: ''
|
||||||
|
})
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.toplist = res.data.carousel[0]
|
||||||
|
this.listbox = res.data.menu
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async onLoadlist() {
|
||||||
|
try {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.data.pages < this.form.page) {
|
||||||
|
this.form.status = 'nomore'
|
||||||
|
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) {}
|
||||||
|
},
|
||||||
//G滚动底部
|
//G滚动底部
|
||||||
loadMore(e) {
|
loadMore(e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
@@ -218,12 +284,14 @@
|
|||||||
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%;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.after {
|
.after {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 32rpx;
|
bottom: 32rpx;
|
||||||
@@ -234,6 +302,7 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
background-image: radial-gradient(160rpx at 0px 0px, rgba(0, 0, 0, 0) 40rpx, #fff 40rpx);
|
background-image: radial-gradient(160rpx at 0px 0px, rgba(0, 0, 0, 0) 40rpx, #fff 40rpx);
|
||||||
}
|
}
|
||||||
|
|
||||||
.onecontentabsolute {
|
.onecontentabsolute {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -479,7 +548,6 @@
|
|||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
padding-left: 16rpx;
|
padding-left: 16rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
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%;
|
||||||
|
|
||||||
@@ -494,42 +562,59 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.indexboxitemlefttheretext {
|
.indexboxitemlefttheretext {
|
||||||
.indexboxitemlefttheretextone {
|
// width: 100%;
|
||||||
text {
|
margin-top: 12rpx;
|
||||||
font-family: SourceHanSansCN-Bold, SourceHanSansCN-Bold;
|
align-items: flex-end;
|
||||||
font-weight: normal;
|
|
||||||
color: #FF5053;
|
.fivecontent_item_boxitemlefthere_one {
|
||||||
|
align-items: flex-end;
|
||||||
|
|
||||||
|
.flex_startone {
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 16rpx;
|
||||||
|
color: #FF7127;
|
||||||
}
|
}
|
||||||
|
|
||||||
text:nth-child(2) {
|
.flex_starttow {
|
||||||
font-weight: bold;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
font-size: 34rpx;
|
font-weight: 500;
|
||||||
}
|
|
||||||
|
|
||||||
text:nth-child(1) {
|
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
color: #FF7127;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexboxitemlefttheretexttow {
|
.fivecontent_item_boxitemlefthere_tow {
|
||||||
margin-left: 12rpx;
|
margin-left: 4rpx;
|
||||||
font-size: 20rpx;
|
padding: 2rpx 10rpx;
|
||||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN-Regular;
|
border-radius: 4rpx 4rpx 4rpx 4rpx;
|
||||||
font-weight: normal;
|
border: 2rpx solid #FF7127;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 16rpx;
|
||||||
|
color: #FF7127;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fivecontent_item_boxitemlefthere_there {
|
||||||
|
margin-left: 6rpx;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 16rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
text-decoration: line-through;
|
text-decoration-line: line-through;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexboxitemleftthere_countdown {
|
.indexboxitemleftthere_countdown {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-right: 7rpx;
|
padding-right: 7rpx;
|
||||||
|
margin-top: 2rpx;
|
||||||
.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;
|
||||||
|
padding-bottom: 8rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.indexboxitemleftthere_countdowntexts {
|
.indexboxitemleftthere_countdowntexts {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<view class="fivecontent_item_boxitemleft flex-colum-start">
|
<view class="fivecontent_item_boxitemleft flex-colum-start">
|
||||||
<view class="fivecontent_item_boxitemleftone">
|
<view class="fivecontent_item_boxitemleftone">
|
||||||
<view class="fivecontent_item_boxitemleftone_t"><text
|
<view class="fivecontent_item_boxitemleftone_t"><text
|
||||||
class="fivecontent_item_boxitemleftone_o">热销TOP.{{index + 1}}</text>热销热销热销热销热销热销热销热销热销热销热销热销热销已抢{{item.realSalesNumber}}份
|
class="fivecontent_item_boxitemleftone_o">热销TOP.{{index + 1}}</text>{{item.productName}}份
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fivecontent_item_boxitemlefttow flex-between">
|
<view class="fivecontent_item_boxitemlefttow flex-between">
|
||||||
@@ -232,7 +232,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
clickproduct(item) {
|
clickproduct(item) {
|
||||||
uni.pro.navigateTo('product/index', item)
|
uni.pro.navigateTo('product/index', {
|
||||||
|
id:item.id
|
||||||
|
})
|
||||||
},
|
},
|
||||||
async onLoadlist() {
|
async onLoadlist() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -294,23 +294,23 @@
|
|||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
type: 'wgs84',
|
type: 'wgs84',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log(res, '获取距离')
|
// console.log(res, '获取距离')
|
||||||
// this.lng = res.longitude
|
// this.lng = res.longitude
|
||||||
// this.lat = res.latitude
|
// this.lat = res.latitude
|
||||||
// this.positionindex()
|
// // 测试
|
||||||
|
let datastorage = {
|
||||||
|
address: '西安市', //地址
|
||||||
|
lng: res.longitude,
|
||||||
|
lat: res.latitude,
|
||||||
|
}
|
||||||
|
uni.cache.set('getLocationstorage', datastorage);
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
// this.positionindex()
|
// this.positionindex()
|
||||||
console.log(err, '获取错误')
|
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)
|
||||||
@@ -335,7 +335,9 @@
|
|||||||
uni.pro.navigateTo('index/uindexlist')
|
uni.pro.navigateTo('index/uindexlist')
|
||||||
},
|
},
|
||||||
fivecontentclick(item) {
|
fivecontentclick(item) {
|
||||||
uni.pro.navigateTo('product/index', item)
|
uni.pro.navigateTo('product/index',{
|
||||||
|
id:item.id
|
||||||
|
})
|
||||||
},
|
},
|
||||||
updateCity(data) {
|
updateCity(data) {
|
||||||
thiss.list[data].end_times = 0;
|
thiss.list[data].end_times = 0;
|
||||||
@@ -357,7 +359,6 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
changeParentValue(newValue) {
|
changeParentValue(newValue) {
|
||||||
console.log(newValue)
|
|
||||||
this.itemStyle = newValue
|
this.itemStyle = newValue
|
||||||
},
|
},
|
||||||
getStyle(e) {
|
getStyle(e) {
|
||||||
@@ -786,7 +787,7 @@
|
|||||||
|
|
||||||
.fivecontent_item_boxitemleft {
|
.fivecontent_item_boxitemleft {
|
||||||
margin-left: 24rpx;
|
margin-left: 24rpx;
|
||||||
flex: auto;
|
flex: 1;
|
||||||
|
|
||||||
.fivecontent_item_boxitemleftone {
|
.fivecontent_item_boxitemleftone {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -799,6 +800,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
view {
|
view {
|
||||||
|
width: 300rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space:nowrap; //溢出不换行white-space:nowrap; //溢出不换行
|
||||||
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;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
|||||||
@@ -73,11 +73,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>
|
||||||
|
|
||||||
@@ -108,9 +108,9 @@
|
|||||||
list: [],
|
list: [],
|
||||||
toplist: {},
|
toplist: {},
|
||||||
form: {
|
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不选中
|
||||||
@@ -145,14 +145,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
clickproduct(item) {
|
clickproduct(item) {
|
||||||
uni.pro.navigateTo('product/index',item)
|
uni.pro.navigateTo('product/index',{
|
||||||
|
id:item.id
|
||||||
|
})
|
||||||
},
|
},
|
||||||
async onLoadlist() {
|
async onLoadlist() {
|
||||||
try {
|
try {
|
||||||
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: '', //团购卷品类Id
|
type: '', //团购卷品类Id
|
||||||
distanceInKm: '', //默认10 以经纬度为中心 多大范围以内 单位km
|
distanceInKm: '', //默认10 以经纬度为中心 多大范围以内 单位km
|
||||||
orderBy: 0, //0.今日上新 1.离我最近 2.销量优先/热榜推荐 3.价格优先
|
orderBy: 0, //0.今日上新 1.离我最近 2.销量优先/热榜推荐 3.价格优先
|
||||||
@@ -469,6 +471,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
padding-right: 7rpx;
|
padding-right: 7rpx;
|
||||||
margin-top: 2rpx;
|
margin-top: 2rpx;
|
||||||
|
|
||||||
.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;
|
||||||
|
|||||||
@@ -60,7 +60,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
clickproduct(item) {
|
clickproduct(item) {
|
||||||
uni.pro.navigateTo('product/index', item)
|
uni.pro.navigateTo('product/index',{
|
||||||
|
id:item.id
|
||||||
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -88,7 +88,8 @@
|
|||||||
<view>
|
<view>
|
||||||
{{item1.name}}
|
{{item1.name}}
|
||||||
</view>
|
</view>
|
||||||
<view v-for="(item2,index2) in item1.proTag" :style="{'background':item.backColor,'color':item.fontColor}" :key="index2">
|
<view v-for="(item2,index2) in item1.proTag"
|
||||||
|
:style="{'background':item.backColor,'color':item.fontColor}" :key="index2">
|
||||||
{{item2.name}}
|
{{item2.name}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -171,6 +172,36 @@
|
|||||||
<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 :style="{height:height}">
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="fixedview flex-between">
|
||||||
|
<view class="fixedview_letr flex-start">
|
||||||
|
<view class="fixedview_letr_item flex-colum" @click="eeInfoindex">
|
||||||
|
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/product/index.png" mode="aspectFill"></image>
|
||||||
|
<text>首页</text>
|
||||||
|
</view>
|
||||||
|
<view class="fixedview_letr_item flex-colum" @click="makePhoneCall">
|
||||||
|
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/product/Call.png" mode="aspectFill"></image>
|
||||||
|
<text>客服</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="fixedview_tow">
|
||||||
|
<!-- <view class="fixedview_towone" @click="overlayshowsboxs(1)">
|
||||||
|
加入购物车
|
||||||
|
</view> -->
|
||||||
|
<view class="fixedview_towtow" @click="overlayshowsboxs(2)">
|
||||||
|
立即购买
|
||||||
|
</view>
|
||||||
|
<!-- <view class="fixedview_towtow" style="background: #ccc;">
|
||||||
|
立即购买
|
||||||
|
</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">
|
||||||
附近推荐
|
附近推荐
|
||||||
@@ -303,7 +334,8 @@
|
|||||||
titlename: '详情',
|
titlename: '详情',
|
||||||
opacity: false,
|
opacity: false,
|
||||||
showpopup: false,
|
showpopup: false,
|
||||||
indexform: {},
|
indexform: '',
|
||||||
|
height: '',
|
||||||
listdata: {
|
listdata: {
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -323,9 +355,31 @@
|
|||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
this.indexform = e
|
this.indexform = e.id
|
||||||
this.onLoadInfo()
|
this.onLoadInfo()
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
//#ifdef MP-WEIXIN || H5
|
||||||
|
var query = uni.createSelectorQuery().in(this).select('.fixedview')
|
||||||
|
query.boundingClientRect(ele => {
|
||||||
|
var that = this;
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success(res) {
|
||||||
|
that.height = (ele.height) + "px";
|
||||||
|
that = null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).exec();
|
||||||
|
//#endif
|
||||||
|
//#ifdef MP-ALIPAY
|
||||||
|
my.createSelectorQuery().selectAll('.fixedview').boundingClientRect().exec(ele => {
|
||||||
|
var nodeData = ele[0]
|
||||||
|
var that = this;
|
||||||
|
that.height = (nodeData.height) + "px";
|
||||||
|
that = null;
|
||||||
|
})
|
||||||
|
//#endif
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//打电话
|
//打电话
|
||||||
clickphone(e) {
|
clickphone(e) {
|
||||||
@@ -341,7 +395,7 @@
|
|||||||
},
|
},
|
||||||
async onLoadInfo() { //详情接口
|
async onLoadInfo() { //详情接口
|
||||||
let res = await this.api.productproductInfo({
|
let res = await this.api.productproductInfo({
|
||||||
productId: this.indexform.id,
|
productId: this.indexform,
|
||||||
lng: uni.cache.get('getLocationstorage').lng,
|
lng: uni.cache.get('getLocationstorage').lng,
|
||||||
lat: uni.cache.get('getLocationstorage').lat
|
lat: uni.cache.get('getLocationstorage').lat
|
||||||
})
|
})
|
||||||
@@ -388,6 +442,92 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fixedview {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
padding: 24rpx 28rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
z-index: 999;
|
||||||
|
|
||||||
|
.fixedview_letr {
|
||||||
|
.fixedview_letr_item:nth-child(1) {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedview_letr_item {
|
||||||
|
margin-left: 32rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
text {
|
||||||
|
margin-top: 8rpx;
|
||||||
|
font-size: 20rpx;
|
||||||
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedview_one {
|
||||||
|
.fixedview_oneone {
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
||||||
|
font-weight: normal;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedview_onetow {
|
||||||
|
font-size: 44rpx;
|
||||||
|
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
||||||
|
font-weight: normal;
|
||||||
|
color: #F45C4C;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
text {
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedview_tow {
|
||||||
|
// flex: auto;
|
||||||
|
padding-left: 24rpx;
|
||||||
|
|
||||||
|
.fixedview_towone {
|
||||||
|
width: 50%;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||||
|
font-weight: bold;
|
||||||
|
color: var(--cart-text-color);
|
||||||
|
height: 72rpx;
|
||||||
|
line-height: 72rpx;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 50rpx 0 0 50rpx;
|
||||||
|
background: var(--cart-background-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedview_towtow {
|
||||||
|
width: 302rpx;
|
||||||
|
height: 72rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 72rpx;
|
||||||
|
background: linear-gradient( 110deg, #F1A666 0%, #FF4C11 100%);
|
||||||
|
border-radius: 48rpx 48rpx 48rpx 48rpx;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.towcontent {
|
.towcontent {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: -40rpx;
|
margin-top: -40rpx;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<listitem></listitem>
|
<listitem :list='list'></listitem>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -41,9 +41,13 @@
|
|||||||
shopUser: {},
|
shopUser: {},
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
shopInfo: {},
|
shopInfo: {},
|
||||||
teblist: []
|
teblist: [],
|
||||||
|
list:[]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.init_fn()
|
||||||
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if (uni.cache.get('token')) {
|
if (uni.cache.get('token')) {
|
||||||
this.loginwxuserInfo()
|
this.loginwxuserInfo()
|
||||||
@@ -71,6 +75,45 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 精选推荐
|
||||||
|
// 下面初始数据
|
||||||
|
init_fn() {
|
||||||
|
this.list = []
|
||||||
|
this.form = {
|
||||||
|
address: uni.cache.get('getLocationstorage').address, //地址
|
||||||
|
lng: uni.cache.get('getLocationstorage').lng,
|
||||||
|
lat: uni.cache.get('getLocationstorage').lat,
|
||||||
|
type: '', //品类
|
||||||
|
orderBy: 5, //0.今日上新 1.离我最近 2.销量优先 3.价格优先 4.热榜推荐
|
||||||
|
other: '', //附近1KM 1选中 0不选中
|
||||||
|
page: 1, //页数
|
||||||
|
size: 10, //页容量
|
||||||
|
dateType: '',
|
||||||
|
status: 'loadmore'
|
||||||
|
}
|
||||||
|
this.onLoadlist()
|
||||||
|
},
|
||||||
|
async onLoadlist() {
|
||||||
|
try {
|
||||||
|
let res = await this.api.indexlist(this.form)
|
||||||
|
if (res.data.pages < this.form.page) {
|
||||||
|
this.form.status = 'nomore'
|
||||||
|
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) {}
|
||||||
|
},
|
||||||
clickinfo(item, index) {
|
clickinfo(item, index) {
|
||||||
switch (item.jumpType) {
|
switch (item.jumpType) {
|
||||||
case 'scan': //特殊处理点击
|
case 'scan': //特殊处理点击
|
||||||
|
|||||||
Reference in New Issue
Block a user