霸王餐更改

This commit is contained in:
wwz
2025-03-25 21:58:59 +08:00
parent 1169e300df
commit 3a6fa55234
14 changed files with 130 additions and 100 deletions

View File

@@ -3,7 +3,7 @@
<view class="therecontent_box_item">
<view class="therecontent_box_imge flex-between" @click="jrtoday(0)">
<view class="therecontent_box_imge_text">
{{todayList.name}}
{{todayList.name|| ''}}
</view>
<view class="therecontent_box_imge_right flex-start">
<view>

View File

@@ -32,7 +32,7 @@
</view>
<!-- 首页抢购区域 -->
<view class="fivecontent">
<view class="fivecontent_item" v-for="(item,index) in homelist" :key="index"
<view class="fivecontent_item" v-for="(item,index) in formhomelist.list" :key="index"
@click="fivecontentclick(item)">
<view class="fivecontent_item_nav flex-start">
<image :src="item.shopImage" mode="aspectFill"></image>
@@ -124,7 +124,7 @@
</view>
</view>
</view>
<up-loadmore height='40' :status="formhomelist.status" iconSize='16' fontSize='16' />
<up-loadmore :status="formhomelist.status" fontSize="14" color="#999" iconSize="14" />
</view>
</view>
<indexs v-if="showindex == 'shopIndex'"></indexs>
@@ -234,7 +234,8 @@
page: 1, //页数
size: 10, //页容量
status: 'loadmore',
name: '1'
name: '1',
list:[]
})
// 使用 reactive 创建响应式对象
const timeData = ref({});
@@ -243,7 +244,6 @@
const onChange = (e) => {
timeData.value = e;
};
const homelist = ref([]) //接收数据
const onLoadhome = async () => {
try {
let res = await APIhome(formhomelist)
@@ -265,30 +265,34 @@
item.end_times = 0
}
})
if (res.pages < formhomelist.page) {
if ((res.totalPage == 0 || res.totalPage == 1) && res.totalRow <= 10) {
console.log(res)
formhomelist.status = 'nomore'
if (form.page == 1 && res.list.length == 0) {
formhomelist.list = res.records
if (formhomelist.page == 1 && res.records.length == 0) {
formhomelist.list = []
}
return false;
} else {
formhomelist.status = 'loading';
if (formhomelist.page == 1) {
formhomelist.list = res.records
} else {
formhomelist.list = [...formhomelist.list, ...res.records];
}
formhomelist.page = ++formhomelist.page;
setTimeout(() => {
homelist.value = [...homelist.value, ...res.list];
if (formhomelist.page > res.totalPage) {
formhomelist.status = 'nomore';
} else {
formhomelist.status = 'loading';
if (res.pageNum == res.pages) {
formhomelist.status = 'nomore';
} else {
formhomelist.status = 'loading';
}
}, 500)
}
}
} catch (e) {}
}
// /筛选数据处理
const init_fn = async () => {
homelist.value = []
formhomelist.list = []
Object.assign(formhomelist, {
address: uni.cache.get('getLocationstorage').address, //地址
lng: uni.cache.get('getLocationstorage').lng,

View File

@@ -1,7 +1,7 @@
<template>
<view class="content">
<view class="contentbox"
:style="'background:url('+(shopExtend?shopExtend.shopExtendList[0].value:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png')+') no-repeat center center / cover' ">
:style="'background:url('+(shopExtend[0]?shopExtend[0].value:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png')+') no-repeat center center / cover' ">
<view class="contentboxitem flex-between">
<view class="contentboxitemleft flex-colum" @click="scanCodehandle(0)">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xdiancan.png" mode="aspectFill">
@@ -42,7 +42,7 @@
import {
productStore
} from '@/stores/user.js';
const shopExtend = uni.cache.get('shopId') ? uni.cache.get('shopUserInfo') : 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png'
const shopExtend = uni.cache.get('shopUserInfo').shopExtendList ? uni.cache.get('shopUserInfo').shopExtendList : 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png'
const scanCodehandle = async (i) => {
const store = productStore();
await store.scanCodeactions()