调试length的报错1

This commit is contained in:
wangzimeng 2025-08-07 14:09:13 +08:00
parent 83da503279
commit c0319d19b7
14 changed files with 157 additions and 97 deletions

View File

@ -23,11 +23,11 @@
<scroll-view @scrolltolower="onScrolltolower" :refresher-enabled="true" :refresher-triggered="homrS"
@refresherrefresh="onS" scroll-y="true" class="flex align-items"
style="height: 1250rpx;box-sizing: border-box;">
style="height: 75vh;box-sizing: border-box;">
<!-- 食堂招租 -->
<view class="recommend-box" v-if="currentTab == 0">
<view class="rrecommList" v-for="(item,index) in collectRentList" :key="index">
<view class="rrecommList" v-for="(item,index) in searchRentList" :key="index">
<view class="rrecommList">
<view class="reListItem" v-for="(item,index) in rentList" :key="index"
@click="toDetail(item)">
@ -133,14 +133,14 @@
</view>
<!-- 无数据展示
<!-- 无数据展示 -->
<view class="flex flex-column flex-start align-items" style="margin-top: 400rpx;"
v-if="( currentTab == 0 && collectRentList.length == 0) || (currentTab == 1 && collectSchoolList.length == 0)">
v-if="( currentTab == 0 && rentCount == 0) || (currentTab == 1 && schoolCount == 0) || (currentTab == 2 && mallCount == 0)">
<image src="https://jiangxiaoxian.0rui.cn/noneList.png" mode=""
style="width: 520rpx;height: 259rpx;">
</image>
<view style="margin-top: 30rpx;font-size: 28rpx;color: #323232;">暂无数据信息</view>
</view>-->
<view style="margin-top: 30rpx;font-size: 28rpx;color: #323232;">请输入搜索条件</view>
</view>
</scroll-view>
@ -176,9 +176,9 @@
},
];
const currentTab = ref(0)
const collectRentList = ref([])
const searchRentList = ref([])
const rentCount = ref(0)
const collectSchoolList = ref([])
const searchSchoolList = ref([])
const schoolCount = ref(0)
const mallList = ref([])
const mallCount = ref(0)
@ -215,10 +215,10 @@
console.log('切换tabs', currentTab.value,listQuery.value.keywords);
if(listQuery.value.keywords != null) {
if (currentTab.value == 0) {
collectRentList.value = [];
searchRentList.value = [];
getRentList();
} else if (currentTab.value == 1) {
collectSchoolList.value = [];
searchSchoolList.value = [];
getSchoolList();
} else {
getGoods();
@ -229,10 +229,10 @@
function search(e) {
console.log('搜索', e.value);
if (currentTab.value == 0) {
collectRentList.value = [];
searchRentList.value = [];
getRentList();
} else if (currentTab.value == 1) {
collectSchoolList.value = [];
searchSchoolList.value = [];
getSchoolList();
} else {
getGoods();
@ -268,17 +268,17 @@
console.log('招租收藏列表', res);
if (res.code == 1) {
collectRentList.value = [...collectRentList.value, ...res.data.list];
searchRentList.value = [...searchRentList.value, ...res.data.list];
rentCount.value = res.data.count
} else {
// Handle case where data is not in expected format
collectRentList.value = [];
searchRentList.value = [];
uni.showToast({
title: res.msg,
icon: 'none'
})
}
console.log('getList', collectRentList.value);
console.log('getList', searchRentList.value);
}
//
async function getSchoolList() {
@ -291,28 +291,29 @@
console.log('平台课程收藏列表', res);
if (res.code == 1) {
collectSchoolList.value = [...collectSchoolList.value, ...res.data.list];
searchSchoolList.value = [...searchSchoolList.value, ...res.data.list];
schoolCount.value = res.data.count
} else {
// Handle case where data is not in expected format
collectSchoolList.value = [];
searchSchoolList.value = [];
uni.showToast({
title: res.msg,
icon: 'none'
})
}
console.log('平台课程收藏列表-222', collectSchoolList.value);
console.log('平台课程收藏列表-222', searchSchoolList.value);
}
//
function onScrolltolower() {
console.log('搜索页面:',searchRentList.value.length,searchSchoolList.value.length,mallList.value.length);
if (currentTab.value == 0) {
if (collectRentList.value.length < rentCount.value) {
if (searchRentList.value.length < rentCount.value) {
listQuery.value.rentPage += 1;
getRentList();
}
} else if(currentTab.value == 1) {
if (collectSchoolList.value.length < schoolCount.value) {
if (searchSchoolList.value.length < schoolCount.value) {
listQuery.value.schoolPage += 1;
getSchoolList();
}
@ -342,12 +343,12 @@
function resetLists() {
if (currentTab.value == 0) {
listQuery.value.rentPage = 1;
collectRentList.value = [];
searchRentList.value = [];
loadStatus.value = "loading";
getRentList();
} else if(currentTab.value == 1) {
listQuery.value.schoolPage = 1;
collectSchoolList.value = [];
searchSchoolList.value = [];
loadStatus.value = "loading";
getSchoolList();
}else {
@ -360,6 +361,26 @@
</script>
<style lang="scss" scoped>
.flex {
display: flex;
}
.flex-start {
align-items: flex-start;
}
.justify-center {
justify-content: center;
}
.align-items {
align-items: center;
}
.flex-column {
flex-flow: column;
}
.search-result {
padding-top: 10px;
padding-bottom: 20px;

View File

@ -107,6 +107,9 @@
list_rows: 10,
status: 1,
})
const couponList = ref([])
const couponCount = ref(0)
const homrS = ref(false)
const tabMaps = [{
name: '优惠券',
value: '1',
@ -142,9 +145,6 @@
}
//
const couponList = ref([])
const couponCount = ref(0)
const homrS = ref(false)
async function getCouponList() {
const res = await sheep.$api.app.scoreShop.fullList({
page: listQuery.value.page,
@ -231,6 +231,27 @@
</script>
<style lang="scss" scoped>
.flex {
display: flex;
}
.flex-start {
align-items: flex-start;
}
.justify-center {
justify-content: center;
}
.align-items {
align-items: center;
}
.flex-column {
flex-flow: column;
}
.fs30 {
font-size: 30rpx;
}

View File

@ -148,24 +148,7 @@
</view>
</view>
<!--<view class="activity-title ss-m-b-30">签到说明</view>
<view class="activity-des">
1每日签到固定 {{ state.data.rules.everyday }} 积分
<text v-if="state.data.rules.is_inc == '1'">
次日递增奖励 {{ state.data.rules.inc_num }} 积分直到
{{ state.data.rules.until_day }} 天之后不再增加
</text>
</view>
<view class="activity-des" v-if="state.data.rules.discounts?.length > 0">
2<text class="" v-for="i in state.data.rules.discounts" :key="i">连续签到{{ i.full }} 奖励 {{ i.value }}
积分</text>
</view>
<view class="activity-des" v-if="state.data.rules.is_replenish == '1'">
{{ state.data.rules.discounts?.length > 0 ? '3' : '2' }}用户在
{{ state.data.rules.replenish_limit }} 天内可补签
{{ state.data.rules.replenish_days }} 每次补签消耗
{{ state.data.rules.replenish_num }}积分
</view> -->
</view>
</view>
<s-empty v-else-if="!state.data && !state.loading" icon="/static/data-empty.png" text="签到活动还未开始">

View File

@ -182,6 +182,7 @@
const currentShowImgIndex = ref(1)
const showContacted = ref(false)
const showContactNo = ref(false)
const imageList = ref([]);
onLoad((options) => {
console.log('onload', options.id);
rentId.value = options.id
@ -196,7 +197,7 @@
}
})
const imageList = ref([])
async function getDetail() {
const res = await sheep.$api.rent.rentInfo(rentId.value)
console.log('获取招租详情', res);
@ -205,7 +206,7 @@
detailRent.value.release_time_text = detailRent.value.release_time_text.substring(0, 10);
imageList.value = res.data.detail.images
console.log('imageList:', imageList.value);
console.log('imageList:', imageList.value.length);
imagesNum.value = imageList.value.length
console.log('imagesNum:', imagesNum.value);
} else {
@ -310,7 +311,7 @@
showContactNo.value = true
}
}
const phoneTell = ref()
const phoneTell = ref('')
//
async function handleTell() {
const res = await sheep.$api.rent.getPhoneNum({

View File

@ -110,7 +110,7 @@
src="https://jiangxiaoxian.0rui.cn/rightMore.png"></image>
</view>
</view>
<view class="checkedLabel" style="margin-top: 26rpx;" v-if="selectTagslist.length != 0">
<view class="checkedLabel" style="margin-top: 26rpx;" v-if="tagSelectedNum != 0">
<view class="tagLab" v-for="(item, index) in selectTagslist" :key="index" style="">
<view>
{{ item.name }}
@ -320,6 +320,15 @@
const cardShow = ref(false) //
const status = ref(0)
const rentEditId = ref(0)
const typeList = ref([])
const typeShowList = ref([])
const showType = ref(false)
const typeIndex = ref(0); //
const showPopbq = ref(false)
const tagList = ref([])
const tagShowList = ref([])
const selectTagslist = ref([]); //
const tagSelectedNum = ref(0)
onLoad((options) => {
getFbKnow();
@ -400,8 +409,7 @@
}
}
const typeList = ref({})
const typeShowList = ref([])
async function getTypeList() {
const res = await sheep.$api.rent.listType({});
if (res.code == 1) {
@ -415,8 +423,6 @@
//
const showType = ref(false)
const typeIndex = ref(0); //
function closeType() {
console.log('取消type', typeIndex.value);
showType.value = false
@ -436,12 +442,6 @@
//
const showPopbq = ref(false)
const tagList = ref([])
const tagShowList = ref([])
const selectTagslist = ref([]); //
const tagSelectedNum = ref(0)
function openPopbq() {
showPopbq.value = true;
}

View File

@ -144,6 +144,8 @@
})
const dictLabel = ref(null)
const tagList = ref([])
const rentList = ref([])
const rentCount = ref(0)
onLoad(() => {
getList();
@ -227,8 +229,7 @@
}
const rentList = ref([])
const rentCount = ref(0)
//
async function getList() {
const res = await sheep.$api.rent.rentlist({
@ -265,11 +266,6 @@
// Handle case where data is not in expected format
rentList.value = [];
}
// rentList.value = res.data.list;
// for(let i=0;i<rentList.value.length;i++){
// rentList.value[i].release_time_text = rentList.value[i].release_time_text.substring(0, 10)
// }
console.log('getList', rentList.value, rentCount.value);
}
//

View File

@ -93,6 +93,11 @@
list_rows: 10,
status: 1,
})
const couponFullList = ref([])
const couponFullCount = ref(0)
const couponTimesList = ref([])
const couponTimesCount = ref(0)
const homrS = ref(false)
const tabMaps = [{
name: '满减券',
value: '1',
@ -133,9 +138,6 @@
}
/* 满减券 */
const couponFullList = ref([])
const couponFullCount = ref(0)
const homrS = ref(false)
async function getCouponFullList() {
const res = await sheep.$api.coupon.userCoupon({
page: listQuery.value.page,
@ -155,8 +157,6 @@
}
}
/* 次数券 */
const couponTimesList = ref([])
const couponTimesCount = ref(0)
async function getCouponTimesList() {
const res = await sheep.$api.coupon.userTimesList({
page: listQuery.value.page,
@ -263,6 +263,27 @@
<style lang="scss" scoped>
.flex {
display: flex;
}
.flex-start {
align-items: flex-start;
}
.justify-center {
justify-content: center;
}
.align-items {
align-items: center;
}
.flex-column {
flex-flow: column;
}
.fslh60 {
font-size: 60rpx;
line-height: 60rpx;

View File

@ -147,14 +147,14 @@
function onSkuChange(e) {
state.selectedSkuPrice = e;
}
//
function formatPrice(e) {
if (Number(e[0]) > 0) {
return e.length === 1 ? e[0] : e.join('~');
} else {
return '';
}
}
// //
// function formatPrice(e) {
// if (Number(e[0]) > 0) {
// return e.length === 1 ? e[0] : e.join('~');
// } else {
// return '';
// }
// }
//
function onAddCart(e) {
sheep.$store('cart').add(e);

View File

@ -343,6 +343,15 @@
const Negotiate = ref('') //
const cardShow = ref(false) //
const status = ref(0)
const showPopbq = ref(false)
const tagList = ref([])
const tagShowList = ref([])
const selectTagslist = ref([]); //
const tagSelectedNum = ref(0)
const typeList = ref([])
const typeShowList = ref([])
const showType = ref(false)
const typeIndex = ref(0); //
onShow(() => {
getAuthentied();
@ -414,8 +423,7 @@
}
}
const typeList = ref({})
const typeShowList = ref([])
async function getTypeList() {
const res = await sheep.$api.rent.listType({});
if (res.code == 1) {
@ -429,8 +437,6 @@
//
const showType = ref(false)
const typeIndex = ref(0); //
function closeType() {
console.log('取消type', typeIndex.value);
showType.value = false
@ -450,12 +456,6 @@
//
const showPopbq = ref(false)
const tagList = ref([])
const tagShowList = ref([])
const selectTagslist = ref([]); //
const tagSelectedNum = ref(0)
function openPopbq() {
showPopbq.value = true;
}

View File

@ -406,10 +406,6 @@
rentList.value = [];
}
// rentList.value = res.data.list;
// for(let i=0;i<rentList.value.length;i++){
// rentList.value[i].release_time_text = rentList.value[i].release_time_text.substring(0, 10)
// }
console.log('getList', rentList.value);
}

View File

@ -23,8 +23,7 @@
</view>
<view class="info-name fs-36 weight8 flexD" v-else>
<view style="font-weight: 800;" @click="toLogin">登录/注册</view>
<!-- <view class="UnAuthenBox weight8 fs-20" v-if="authenInfo.status == -1 && isLogin == true">未认证</view>
<view class="authenticationBox weight8 fs-20" v-if="authenInfo.status == 1 && isLogin == true">已认证</view> -->
</view>
<view class="fs-28 weight4" style="margin-top: 30rpx;">剩余拨打次数 {{ userInfo.all_mobile_num ? userInfo.all_mobile_num : 0 }}</view>
</view>
@ -225,6 +224,7 @@
const authenInfo = computed(() => sheep.$store('user').authenInfo);
onShow(() => {
console.log('authenInfo',authenInfo.value);
sheep.$store('user').updateUserData();
});

View File

@ -81,7 +81,7 @@
keywords: null,
})
const classCount = ref(0)
const homrS = ref('')
const homrS = ref(false)
const loadStatus = ref('')
onLoad(() => {
getList();

View File

@ -94,7 +94,7 @@
// const today = ref('')
const feetHisList = ref([])
const homrS = ref('')
const homrS = ref(false)
const feetCount = ref(0);
const loadStatus = ref('');
//
@ -204,6 +204,27 @@
</script>
<style lang="scss" scoped>
.flex {
display: flex;
}
.flex-start {
align-items: flex-start;
}
.justify-center {
justify-content: center;
}
.align-items {
align-items: center;
}
.flex-column {
flex-flow: column;
}
.title {
color: #3d3d3d;
font-size: 34rpx;

View File

@ -98,10 +98,10 @@
pid: 0
}]
const areaData = proFirst.concat(uni.getStorageSync('areaCity'))
console.log('province',provinceList,uni.getStorageSync('areaCity'));
console.log('province',uni.getStorageSync('areaCity'));
const getSizeByNameLength = (name) => {
// if (!name) return ''; //
if (!name) return ''; //
console.log('getSizeByNameLength', name, name.length);
let length = name.length;
if (length <= 7) return '';