From fbd5c288c18b08a1ac7efb86ac7acb48fbf08d3e Mon Sep 17 00:00:00 2001 From: wangzimeng <3297159934@qq.com> Date: Mon, 11 Aug 2025 09:47:27 +0800 Subject: [PATCH] =?UTF-8?q?uni.showToast=E7=9A=84=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=9B=B4=E6=8D=A2=E4=B8=BA=E8=AF=A5=E5=95=86?= =?UTF-8?q?=E5=9F=8E=E5=B0=81=E8=A3=85=E7=9A=84sheep.$helper.toast('?= =?UTF-8?q?=E5=B7=B2=E6=94=B6=E8=97=8F');=20=E6=94=B6=E8=B4=A7=E6=97=B6?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=94=B6=E8=B4=A7=E6=88=90=E5=8A=9F=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packageA/search/index.vue | 14 +- pages/app/score-shop.vue | 27 +- pages/canteenRent/rentDetail.vue | 67 +- pages/canteenRent/rentEdit.vue | 150 +++-- pages/coupon/list.vue | 38 +- pages/index/fabu.vue | 156 +++-- pages/index/index.vue | 12 +- pages/index/user.vue | 20 +- pages/order/list.vue | 1078 ++++++++++++++---------------- pages/school/classesDetail.vue | 31 +- pages/user/authentication.vue | 9 +- pages/user/goods-collect.vue | 62 +- pages/user/myRelease/list.vue | 26 +- 13 files changed, 845 insertions(+), 845 deletions(-) diff --git a/packageA/search/index.vue b/packageA/search/index.vue index 510f294..503a6d4 100644 --- a/packageA/search/index.vue +++ b/packageA/search/index.vue @@ -296,10 +296,11 @@ } else { // Handle case where data is not in expected format searchRentList.value = []; - uni.showToast({ - title: res.msg, - icon: 'none' - }) + sheep.$helper.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'none' + // }) } console.log('getList', searchRentList.value); } @@ -319,10 +320,7 @@ } else { // Handle case where data is not in expected format searchClassesList.value = []; - uni.showToast({ - title: res.msg, - icon: 'none' - }) + sheep.$helper.toast(res.msg); } console.log('平台课程收藏列表-222', searchClassesList.value); } diff --git a/pages/app/score-shop.vue b/pages/app/score-shop.vue index 6421b4b..5c2527b 100644 --- a/pages/app/score-shop.vue +++ b/pages/app/score-shop.vue @@ -157,10 +157,11 @@ couponCount.value = res.data.count; score.value = res.data.score } else { - uni.showToast({ - title: res.msg, - icon: 'none' - }) + sheep.$helper.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'none' + // }) } } //加载更多 @@ -204,19 +205,21 @@ id: couponSelectId.value }); if (res.code === 1) { - uni.showToast({ - title: '兑换成功', - icon: 'success' - }) + sheep.$helper.toast('兑换成功'); + // uni.showToast({ + // title: '兑换成功', + // icon: 'success' + // }) showCouponPro.value = false; listQuery.value.page = 1; couponList.value = [] getCouponList(); } else { - uni.showToast({ - title: res.msg, - icon: 'error' - }) + sheep.$helper.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'error' + // }) showCouponPro.value = false; } } diff --git a/pages/canteenRent/rentDetail.vue b/pages/canteenRent/rentDetail.vue index 3301a12..0070709 100644 --- a/pages/canteenRent/rentDetail.vue +++ b/pages/canteenRent/rentDetail.vue @@ -4,15 +4,14 @@ - + - - + + - + @@ -195,7 +194,7 @@ getDetail(); } }) - + const imageList = ref([]) async function getDetail() { const res = await sheep.$api.rent.rentInfo(rentId.value) @@ -209,16 +208,17 @@ imagesNum.value = imageList.value.length console.log('imagesNum:', imagesNum.value); } else { - uni.showToast({ - title: res.msg, - icon: 'none' - }) + sheep.$helper.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'none' + // }) } } - + function swiperChange(e) { - console.log('切换轮播图',e.detail.current); - if(e.detail.current { if (res.code == 1) { - uni.showToast({ - title: '已取消收藏', - icon: 'none', - duration: 2000 - }) + sheep.$helper.toast('已取消收藏'); setTimeout(() => { getDetail() - }, 1000) + }, 2000) // getDetail() } }) @@ -284,14 +280,10 @@ } sheep.$api.rent.rentCollect(data1).then((res) => { if (res.code == 1) { - uni.showToast({ - title: '已收藏', - icon: 'none', - duration: 2000 - }) + sheep.$helper.toast('已收藏'); setTimeout(() => { getDetail() - }, 1000) + }, 2000) // getDetail() } }) @@ -342,7 +334,7 @@ //联系平台客服 function handleService() { - console.log('联系平台客服',detailRent.value.platform_contact_number); + console.log('联系平台客服', detailRent.value.platform_contact_number); wx.makePhoneCall({ phoneNumber: detailRent.value.platform_contact_number, success: function() { @@ -455,7 +447,7 @@ .swiper_s { width: 100%; - height: 750rpx; + height: 750rpx; // height: 100%; // display: grid; // justify-content: center; @@ -567,6 +559,7 @@ font-weight: 400; line-height: 42rpx; font-size: 28rpx; + white-space: pre-line; } } @@ -577,8 +570,10 @@ box-sizing: border-box; position: fixed; bottom: 0rpx; - padding-bottom: constant(safe-area-inset-bottom); /* iOS 11.0 - 11.1 */ - padding-bottom: env(safe-area-inset-bottom); /* iOS 11.2+ */ + padding-bottom: constant(safe-area-inset-bottom); + /* iOS 11.0 - 11.1 */ + padding-bottom: env(safe-area-inset-bottom); + /* iOS 11.2+ */ display: flex; align-items: flex-start‌; justify-content: space-between; @@ -610,12 +605,12 @@ } } - + /* 对于没有安全区域的设备,设置默认值 */ @supports not (padding-bottom: env(safe-area-inset-bottom)) { - .footer-box { - padding-bottom: 0; - } + .footer-box { + padding-bottom: 0; + } } } diff --git a/pages/canteenRent/rentEdit.vue b/pages/canteenRent/rentEdit.vue index fe65f78..9a59e94 100644 --- a/pages/canteenRent/rentEdit.vue +++ b/pages/canteenRent/rentEdit.vue @@ -382,12 +382,12 @@ url: e }) } else { - - uni.showToast({ - title: '请先登录', - icon: 'none', - duration: 2000 - }) + sheep.$helper.toast('请先登录'); + // uni.showToast({ + // title: '请先登录', + // icon: 'none', + // duration: 2000 + // }) setTimeout(function() { uni.switchTab({ @@ -469,20 +469,23 @@ tagSelectedNum.value += 1; tagShowList.value[index].isSelect = true; } else { - uni.showToast({ - title: '最多选择三个标签', - icon: 'none' - }) + sheep.$helper.toast('最多选择三个标签'); + // uni.showToast({ + // title: '最多选择三个标签', + // icon: 'none' + // }) } } else { + if (tagSelectedNum.value > 0) { tagSelectedNum.value -= 1; tagShowList.value[index].isSelect = false; } else { - uni.showToast({ - title: '至少选择一个', - icon: 'none' - }) + sheep.$helper.toast('至少选择一个'); + // uni.showToast({ + // title: '至少选择一个', + // icon: 'none' + // }) } } console.log('选择标签', tagSelectedNum.value); @@ -582,10 +585,11 @@ async function apply() { if (agreeAdd.value == false) { - uni.showToast({ - title: '请先同意发布须知', - icon: 'none', - }) + sheep.$helper.toast('请先同意发布须知'); + // uni.showToast({ + // title: '请先同意发布须知', + // icon: 'none', + // }) return } form.value.cate_ids = selectTagslist.value.map((item) => item.id).join(',') @@ -596,74 +600,84 @@ console.log('images', form.value.images); if (form.value.title == '') { - uni.showToast({ - title: '请输入标题', - icon: 'none', - }) + sheep.$helper.toast('请输入标题'); + // uni.showToast({ + // title: '请输入标题', + // icon: 'none', + // }) return } if (form.value.province == '' && form.value.city == '') { - uni.showToast({ - title: '请选择地区', - icon: 'none', - }) + sheep.$helper.toast('请选择地区'); + // uni.showToast({ + // title: '请选择地区', + // icon: 'none', + // }) return } if (form.value.address_detail == '') { - uni.showToast({ - title: '请输入详细地址', - icon: 'none', - }) + sheep.$helper.toast('请输入详细地址'); + // uni.showToast({ + // title: '请输入详细地址', + // icon: 'none', + // }) return } if (form.value.contacts == '') { - uni.showToast({ - title: '请输入联系人', - icon: 'none', - }) + sheep.$helper.toast('请输入联系人'); + // uni.showToast({ + // title: '请输入联系人', + // icon: 'none', + // }) return } if (form.value.contact_number == '') { - uni.showToast({ - title: '请输入联系人电话', - icon: 'none', - }) + sheep.$helper.toast('请输入联系人电话'); + // uni.showToast({ + // title: '请输入联系人电话', + // icon: 'none', + // }) return } if (!/^1[3-9]\d{9}$/.test(form.value.contact_number)) { - uni.showToast({ - title: '请输入正确的手机号', - icon: 'none', - duration: 2000 - }) + sheep.$helper.toast('请输入正确的手机号'); + // uni.showToast({ + // title: '请输入正确的手机号', + // icon: 'none', + // duration: 2000 + // }) return; } if (form.value.content == '') { - uni.showToast({ - title: '请输入详细信息', - icon: 'none', - }) + sheep.$helper.toast('请输入详细信息'); + // uni.showToast({ + // title: '请输入详细信息', + // icon: 'none', + // }) return } if (form.value.images == '') { - uni.showToast({ - title: '请上传图片', - icon: 'none', - }) + sheep.$helper.toast('请上传图片'); + // uni.showToast({ + // title: '请上传图片', + // icon: 'none', + // }) return } if (form.value.type == '') { - uni.showToast({ - title: '请选择项目类型', - icon: 'none', - }) + sheep.$helper.toast('请选择项目类型'); + // uni.showToast({ + // title: '请选择项目类型', + // icon: 'none', + // }) return } if (form.value.cate_ids == '') { - uni.showToast({ - title: '请选择标签', - icon: 'none', - }) + sheep.$helper.toast('请选择标签'); + // uni.showToast({ + // title: '请选择标签', + // icon: 'none', + // }) return } console.log('apply——form:', form.value); @@ -700,19 +714,21 @@ state.currentCityIndex = [0, 0] console.log('currentCityIndex', state.currentCityIndex); - uni.showToast({ - title: res.msg, - icon: 'success', - }) + sheep.$helper.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'success', + // }) setTimeout(() => { uni.navigateBack() }, 2000) } else { - uni.showToast({ - title: res.msg, - icon: 'error' - }) + sheep.$helper.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'error' + // }) } } diff --git a/pages/coupon/list.vue b/pages/coupon/list.vue index 8d1024b..2f3dbbd 100644 --- a/pages/coupon/list.vue +++ b/pages/coupon/list.vue @@ -148,10 +148,11 @@ couponFullCount.value = res.data.total; console.log('满减券', couponFullList.value, couponFullList.value[0]); } else { - uni.showToast({ - title: res.msg, - icon: 'none' - }) + sheep.$helper.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'none' + // }) } } /* 次数券 */ @@ -170,10 +171,11 @@ console.log('couponTimesList', couponTimesList.value); // score.value = res.data.score } else { - uni.showToast({ - title: res.msg, - icon: 'none' - }) + sheep.$helper.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'none' + // }) } } @@ -192,21 +194,23 @@ const res = await sheep.$api.coupon.useTimes(data) console.log('使用次数券_res:', res); if (res.code == 1) { - uni.showToast({ - title: '已增加您的拨打号码次数', - icon: 'success', - duration: 2000, - }) + sheep.$helper.toast('已增加您的拨打号码次数'); + // uni.showToast({ + // title: '已增加您的拨打号码次数', + // icon: 'success', + // duration: 2000, + // }) setTimeout(() => { couponTimesList.value = []; getCouponTimesList(); },1500) } else { - uni.showToast({ - title: res.msg, - icon: 'error' - }) + sheep.$helper.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'error' + // }) } } diff --git a/pages/index/fabu.vue b/pages/index/fabu.vue index b99d000..b5afab9 100644 --- a/pages/index/fabu.vue +++ b/pages/index/fabu.vue @@ -384,11 +384,12 @@ } }) } else { - uni.showToast({ - title: '请先登录', - icon: 'none', - duration: 2000 - }) + sheep.$helper.toast('请先登录'); + // uni.showToast({ + // title: '请先登录', + // icon: 'none', + // duration: 2000 + // }) cardShow.value = false setTimeout(function() { uni.switchTab({ @@ -407,11 +408,11 @@ url: '/pages/user/authentication' }) } else { - - uni.showToast({ - title: '请先登录', - icon: 'none', - }) + sheep.$helper.toast('请先登录'); + // uni.showToast({ + // title: '请先登录', + // icon: 'none', + // }) cardShow.value = false setTimeout(function() { uni.switchTab({ @@ -435,11 +436,8 @@ }) } else { setTimeout(() => { - uni.showToast({ - title: '请先登录', - icon: 'none', - }) - + sheep.$helper.toast('请先登录'); + }, 500); setTimeout(() => { uni.switchTab({ @@ -530,20 +528,22 @@ tagSelectedNum.value += 1; tagShowList.value[index].isSelect = true; } else { - uni.showToast({ - title: '最多选择三个标签', - icon: 'none' - }) + sheep.$helper.toast('最多选择三个标签'); + // uni.showToast({ + // title: '最多选择三个标签', + // icon: 'none' + // }) } } else { if (tagSelectedNum.value > 0) { tagSelectedNum.value -= 1; tagShowList.value[index].isSelect = false; } else { - uni.showToast({ - title: '至少选择一个', - icon: 'none' - }) + sheep.$helper.toast('至少选择一个'); + // uni.showToast({ + // title: '至少选择一个', + // icon: 'none' + // }) } } console.log('选择标签', tagSelectedNum.value); @@ -604,10 +604,11 @@ async function apply() { console.log('state', state.formData.images); if (agreeAdd.value == false) { - uni.showToast({ - title: '请先同意发布须知', - icon: 'none', - }) + sheep.$helper.toast('请先同意发布须知'); + // uni.showToast({ + // title: '请先同意发布须知', + // icon: 'none', + // }) return } form.value.cate_ids = selectTagslist.value.map((item) => item.id).join(',') @@ -617,74 +618,84 @@ console.log('images', form.value.images); if (form.value.title == '') { - uni.showToast({ - title: '请输入标题', - icon: 'none', - }) + sheep.$helper.toast('请输入标题'); + // uni.showToast({ + // title: '请输入标题', + // icon: 'none', + // }) return } if (form.value.province == '' && form.value.city == '') { - uni.showToast({ - title: '请选择地区', - icon: 'none', - }) + sheep.$helper.toast('请选择地区'); + // uni.showToast({ + // title: '请选择地区', + // icon: 'none', + // }) return } if (form.value.address_detail == '') { - uni.showToast({ - title: '请输入详细地址', - icon: 'none', - }) + sheep.$helper.toast('请输入详细地址'); + // uni.showToast({ + // title: '请输入详细地址', + // icon: 'none', + // }) return } if (form.value.contacts == '') { - uni.showToast({ - title: '请输入联系人', - icon: 'none', - }) + sheep.$helper.toast('请输入联系人'); + // uni.showToast({ + // title: '请输入联系人', + // icon: 'none', + // }) return } if (form.value.contact_number == '') { - uni.showToast({ - title: '请输入联系人电话', - icon: 'none', - }) + sheep.$helper.toast('请输入联系人电话'); + // uni.showToast({ + // title: '请输入联系人电话', + // icon: 'none', + // }) return } if (!/^1[3-9]\d{9}$/.test(form.value.contact_number)) { - uni.showToast({ - title: '请输入正确的手机号', - icon: 'none', - duration: 2000 - }) + sheep.$helper.toast('请输入正确的手机号'); + // uni.showToast({ + // title: '请输入正确的手机号', + // icon: 'none', + // duration: 2000 + // }) return; } if (form.value.content == '') { - uni.showToast({ - title: '请输入详细信息', - icon: 'none', - }) + sheep.$helper.toast('请输入详细信息'); + // uni.showToast({ + // title: '请输入详细信息', + // icon: 'none', + // }) return } if (form.value.images == '') { - uni.showToast({ - title: '请上传图片', - icon: 'none', - }) + sheep.$helper.toast('请上传图片'); + // uni.showToast({ + // title: '请上传图片', + // icon: 'none', + // }) return } if (form.value.type == '') { - uni.showToast({ - title: '请选择项目类型', - icon: 'none', - }) + sheep.$helper.toast('请选择项目类型'); + // uni.showToast({ + // title: '请选择项目类型', + // icon: 'none', + // }) return } if (form.value.cate_ids == '') { - uni.showToast({ - title: '请选择标签', - icon: 'none', - }) + sheep.$helper.toast('请选择标签'); + // uni.showToast({ + // title: '请选择标签', + // icon: 'none', + // }) return } console.log('apply——form:', form.value); @@ -726,10 +737,11 @@ url: '/pages/index/user' }) }else { - uni.showToast({ - title: res.msg, - icon: 'error' - }) + sheep.$helper.toast(res.msg); + // uni.showToast({ + // title: res.msg, + // icon: 'error' + // }) } } diff --git a/pages/index/index.vue b/pages/index/index.vue index 7702fe9..a12e0ad 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -351,12 +351,12 @@ url: e }) } else { - - uni.showToast({ - title: '请先登录', - icon: 'none', - duration: 2000 - }) + sheep.$helper.toast('请先登录'); + // uni.showToast({ + // title: '请先登录', + // icon: 'none', + // duration: 2000 + // }) setTimeout(function() { uni.switchTab({ diff --git a/pages/index/user.vue b/pages/index/user.vue index b1bcd1a..a50323b 100644 --- a/pages/index/user.vue +++ b/pages/index/user.vue @@ -363,10 +363,11 @@ url: '/pages/user/info' }) } else { - uni.showToast({ - title: '请先登录', - icon: 'none' - }) + sheep.$helper.toast('请先登录'); + // uni.showToast({ + // title: '请先登录', + // icon: 'none' + // }) } } @@ -377,11 +378,12 @@ url: e }) } else { - uni.showToast({ - title: '请先登录', - icon: 'none', - duration: 2000 - }) + sheep.$helper.toast('请先登录'); + // uni.showToast({ + // title: '请先登录', + // icon: 'none', + // duration: 2000 + // }) // setTimeout(function() { // uni.switchTab({ diff --git a/pages/order/list.vue b/pages/order/list.vue index aeb08bd..04cb192 100644 --- a/pages/order/list.vue +++ b/pages/order/list.vue @@ -1,119 +1,84 @@