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

View File

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

View File

@ -148,24 +148,7 @@
</view> </view>
</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>
</view> </view>
<s-empty v-else-if="!state.data && !state.loading" icon="/static/data-empty.png" text="签到活动还未开始"> <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 currentShowImgIndex = ref(1)
const showContacted = ref(false) const showContacted = ref(false)
const showContactNo = ref(false) const showContactNo = ref(false)
const imageList = ref([]);
onLoad((options) => { onLoad((options) => {
console.log('onload', options.id); console.log('onload', options.id);
rentId.value = options.id rentId.value = options.id
@ -196,7 +197,7 @@
} }
}) })
const imageList = ref([])
async function getDetail() { async function getDetail() {
const res = await sheep.$api.rent.rentInfo(rentId.value) const res = await sheep.$api.rent.rentInfo(rentId.value)
console.log('获取招租详情', res); console.log('获取招租详情', res);
@ -205,7 +206,7 @@
detailRent.value.release_time_text = detailRent.value.release_time_text.substring(0, 10); detailRent.value.release_time_text = detailRent.value.release_time_text.substring(0, 10);
imageList.value = res.data.detail.images imageList.value = res.data.detail.images
console.log('imageList:', imageList.value); console.log('imageList:', imageList.value.length);
imagesNum.value = imageList.value.length imagesNum.value = imageList.value.length
console.log('imagesNum:', imagesNum.value); console.log('imagesNum:', imagesNum.value);
} else { } else {
@ -310,7 +311,7 @@
showContactNo.value = true showContactNo.value = true
} }
} }
const phoneTell = ref() const phoneTell = ref('')
// //
async function handleTell() { async function handleTell() {
const res = await sheep.$api.rent.getPhoneNum({ const res = await sheep.$api.rent.getPhoneNum({

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -406,10 +406,6 @@
rentList.value = []; 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); console.log('getList', rentList.value);
} }

View File

@ -23,8 +23,7 @@
</view> </view>
<view class="info-name fs-36 weight8 flexD" v-else> <view class="info-name fs-36 weight8 flexD" v-else>
<view style="font-weight: 800;" @click="toLogin">登录/注册</view> <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>
<view class="fs-28 weight4" style="margin-top: 30rpx;">剩余拨打次数 {{ userInfo.all_mobile_num ? userInfo.all_mobile_num : 0 }}</view> <view class="fs-28 weight4" style="margin-top: 30rpx;">剩余拨打次数 {{ userInfo.all_mobile_num ? userInfo.all_mobile_num : 0 }}</view>
</view> </view>
@ -225,6 +224,7 @@
const authenInfo = computed(() => sheep.$store('user').authenInfo); const authenInfo = computed(() => sheep.$store('user').authenInfo);
onShow(() => { onShow(() => {
console.log('authenInfo',authenInfo.value);
sheep.$store('user').updateUserData(); sheep.$store('user').updateUserData();
}); });

View File

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

View File

@ -94,7 +94,7 @@
// const today = ref('') // const today = ref('')
const feetHisList = ref([]) const feetHisList = ref([])
const homrS = ref('') const homrS = ref(false)
const feetCount = ref(0); const feetCount = ref(0);
const loadStatus = ref(''); const loadStatus = ref('');
// //
@ -204,6 +204,27 @@
</script> </script>
<style lang="scss" scoped> <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 { .title {
color: #3d3d3d; color: #3d3d3d;
font-size: 34rpx; font-size: 34rpx;

View File

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