uni.showToast的信息提示更换为该商城封装的sheep.$helper.toast('已收藏');

收货时新增收货成功提示
This commit is contained in:
wangzimeng 2025-08-11 09:47:27 +08:00
parent a3e5b3be9f
commit fbd5c288c1
13 changed files with 845 additions and 845 deletions

View File

@ -296,10 +296,11 @@
} else { } else {
// Handle case where data is not in expected format // Handle case where data is not in expected format
searchRentList.value = []; searchRentList.value = [];
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'none' // title: res.msg,
}) // icon: 'none'
// })
} }
console.log('getList', searchRentList.value); console.log('getList', searchRentList.value);
} }
@ -319,10 +320,7 @@
} else { } else {
// Handle case where data is not in expected format // Handle case where data is not in expected format
searchClassesList.value = []; searchClassesList.value = [];
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg,
icon: 'none'
})
} }
console.log('平台课程收藏列表-222', searchClassesList.value); console.log('平台课程收藏列表-222', searchClassesList.value);
} }

View File

@ -157,10 +157,11 @@
couponCount.value = res.data.count; couponCount.value = res.data.count;
score.value = res.data.score score.value = res.data.score
} else { } else {
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'none' // title: res.msg,
}) // icon: 'none'
// })
} }
} }
// //
@ -204,19 +205,21 @@
id: couponSelectId.value id: couponSelectId.value
}); });
if (res.code === 1) { if (res.code === 1) {
uni.showToast({ sheep.$helper.toast('兑换成功');
title: '兑换成功', // uni.showToast({
icon: 'success' // title: '',
}) // icon: 'success'
// })
showCouponPro.value = false; showCouponPro.value = false;
listQuery.value.page = 1; listQuery.value.page = 1;
couponList.value = [] couponList.value = []
getCouponList(); getCouponList();
} else { } else {
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'error' // title: res.msg,
}) // icon: 'error'
// })
showCouponPro.value = false; showCouponPro.value = false;
} }
} }

View File

@ -4,12 +4,11 @@
<!-- 顶部banner --> <!-- 顶部banner -->
<view class="swiper-box"> <view class="swiper-box">
<view class="swiper_s"> <view class="swiper_s">
<swiper class="swiper_s" :circular="true" :autoplay="true" :indicator-dots="false" :current="currentImgIndex" <swiper class="swiper_s" :circular="true" :autoplay="true" :indicator-dots="false"
@change="swiperChange" @animationfinish="animationfinish"> :current="currentImgIndex" @change="swiperChange" @animationfinish="animationfinish">
<!-- v-for="(item, index) in swiperList" :key="index" @click="openSwiper(item)"--> <!-- v-for="(item, index) in swiperList" :key="index" @click="openSwiper(item)"-->
<swiper-item style="margin: 0 auto;" v-for="(item,index) in imageList" :key="index"> <swiper-item style="margin: 0 auto;" v-for="(item,index) in imageList" :key="index">
<view style="position: relative;width: 100%;height: 100%;" <view style="position: relative;width: 100%;height: 100%;">
>
<image class="swiper-image" :src="item" mode="widthFix" /> <image class="swiper-image" :src="item" mode="widthFix" />
</view> </view>
@ -209,10 +208,11 @@
imagesNum.value = imageList.value.length imagesNum.value = imageList.value.length
console.log('imagesNum:', imagesNum.value); console.log('imagesNum:', imagesNum.value);
} else { } else {
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'none' // title: res.msg,
}) // icon: 'none'
// })
} }
} }
@ -263,14 +263,10 @@
} }
sheep.$api.rent.rentCollect(data).then((res) => { sheep.$api.rent.rentCollect(data).then((res) => {
if (res.code == 1) { if (res.code == 1) {
uni.showToast({ sheep.$helper.toast('已取消收藏');
title: '已取消收藏',
icon: 'none',
duration: 2000
})
setTimeout(() => { setTimeout(() => {
getDetail() getDetail()
}, 1000) }, 2000)
// getDetail() // getDetail()
} }
}) })
@ -284,14 +280,10 @@
} }
sheep.$api.rent.rentCollect(data1).then((res) => { sheep.$api.rent.rentCollect(data1).then((res) => {
if (res.code == 1) { if (res.code == 1) {
uni.showToast({ sheep.$helper.toast('已收藏');
title: '已收藏',
icon: 'none',
duration: 2000
})
setTimeout(() => { setTimeout(() => {
getDetail() getDetail()
}, 1000) }, 2000)
// getDetail() // getDetail()
} }
}) })
@ -567,6 +559,7 @@
font-weight: 400; font-weight: 400;
line-height: 42rpx; line-height: 42rpx;
font-size: 28rpx; font-size: 28rpx;
white-space: pre-line;
} }
} }
@ -577,8 +570,10 @@
box-sizing: border-box; box-sizing: border-box;
position: fixed; position: fixed;
bottom: 0rpx; bottom: 0rpx;
padding-bottom: constant(safe-area-inset-bottom); /* iOS 11.0 - 11.1 */ padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom); /* iOS 11.2+ */ /* iOS 11.0 - 11.1 */
padding-bottom: env(safe-area-inset-bottom);
/* iOS 11.2+ */
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: space-between; justify-content: space-between;

View File

@ -382,12 +382,12 @@
url: e url: e
}) })
} else { } else {
sheep.$helper.toast('请先登录');
uni.showToast({ // uni.showToast({
title: '请先登录', // title: '',
icon: 'none', // icon: 'none',
duration: 2000 // duration: 2000
}) // })
setTimeout(function() { setTimeout(function() {
uni.switchTab({ uni.switchTab({
@ -469,20 +469,23 @@
tagSelectedNum.value += 1; tagSelectedNum.value += 1;
tagShowList.value[index].isSelect = true; tagShowList.value[index].isSelect = true;
} else { } else {
uni.showToast({ sheep.$helper.toast('最多选择三个标签');
title: '最多选择三个标签', // uni.showToast({
icon: 'none' // title: '',
}) // icon: 'none'
// })
} }
} else { } else {
if (tagSelectedNum.value > 0) { if (tagSelectedNum.value > 0) {
tagSelectedNum.value -= 1; tagSelectedNum.value -= 1;
tagShowList.value[index].isSelect = false; tagShowList.value[index].isSelect = false;
} else { } else {
uni.showToast({ sheep.$helper.toast('至少选择一个');
title: '至少选择一个', // uni.showToast({
icon: 'none' // title: '',
}) // icon: 'none'
// })
} }
} }
console.log('选择标签', tagSelectedNum.value); console.log('选择标签', tagSelectedNum.value);
@ -582,10 +585,11 @@
async function apply() { async function apply() {
if (agreeAdd.value == false) { if (agreeAdd.value == false) {
uni.showToast({ sheep.$helper.toast('请先同意发布须知');
title: '请先同意发布须知', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
form.value.cate_ids = selectTagslist.value.map((item) => item.id).join(',') form.value.cate_ids = selectTagslist.value.map((item) => item.id).join(',')
@ -596,74 +600,84 @@
console.log('images', form.value.images); console.log('images', form.value.images);
if (form.value.title == '') { if (form.value.title == '') {
uni.showToast({ sheep.$helper.toast('请输入标题');
title: '请输入标题', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.province == '' && form.value.city == '') { if (form.value.province == '' && form.value.city == '') {
uni.showToast({ sheep.$helper.toast('请选择地区');
title: '请选择地区', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.address_detail == '') { if (form.value.address_detail == '') {
uni.showToast({ sheep.$helper.toast('请输入详细地址');
title: '请输入详细地址', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.contacts == '') { if (form.value.contacts == '') {
uni.showToast({ sheep.$helper.toast('请输入联系人');
title: '请输入联系人', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.contact_number == '') { if (form.value.contact_number == '') {
uni.showToast({ sheep.$helper.toast('请输入联系人电话');
title: '请输入联系人电话', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (!/^1[3-9]\d{9}$/.test(form.value.contact_number)) { if (!/^1[3-9]\d{9}$/.test(form.value.contact_number)) {
uni.showToast({ sheep.$helper.toast('请输入正确的手机号');
title: '请输入正确的手机号', // uni.showToast({
icon: 'none', // title: '',
duration: 2000 // icon: 'none',
}) // duration: 2000
// })
return; return;
} }
if (form.value.content == '') { if (form.value.content == '') {
uni.showToast({ sheep.$helper.toast('请输入详细信息');
title: '请输入详细信息', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.images == '') { if (form.value.images == '') {
uni.showToast({ sheep.$helper.toast('请上传图片');
title: '请上传图片', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.type == '') { if (form.value.type == '') {
uni.showToast({ sheep.$helper.toast('请选择项目类型');
title: '请选择项目类型', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.cate_ids == '') { if (form.value.cate_ids == '') {
uni.showToast({ sheep.$helper.toast('请选择标签');
title: '请选择标签', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
console.log('apply——form:', form.value); console.log('apply——form:', form.value);
@ -700,19 +714,21 @@
state.currentCityIndex = [0, 0] state.currentCityIndex = [0, 0]
console.log('currentCityIndex', state.currentCityIndex); console.log('currentCityIndex', state.currentCityIndex);
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'success', // title: res.msg,
}) // icon: 'success',
// })
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 2000) }, 2000)
} else { } else {
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'error' // title: res.msg,
}) // icon: 'error'
// })
} }
} }

View File

@ -148,10 +148,11 @@
couponFullCount.value = res.data.total; couponFullCount.value = res.data.total;
console.log('满减券', couponFullList.value, couponFullList.value[0]); console.log('满减券', couponFullList.value, couponFullList.value[0]);
} else { } else {
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'none' // title: res.msg,
}) // icon: 'none'
// })
} }
} }
/* 次数券 */ /* 次数券 */
@ -170,10 +171,11 @@
console.log('couponTimesList', couponTimesList.value); console.log('couponTimesList', couponTimesList.value);
// score.value = res.data.score // score.value = res.data.score
} else { } else {
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'none' // title: res.msg,
}) // icon: 'none'
// })
} }
} }
@ -192,21 +194,23 @@
const res = await sheep.$api.coupon.useTimes(data) const res = await sheep.$api.coupon.useTimes(data)
console.log('使用次数券_res:', res); console.log('使用次数券_res:', res);
if (res.code == 1) { if (res.code == 1) {
uni.showToast({ sheep.$helper.toast('已增加您的拨打号码次数');
title: '已增加您的拨打号码次数', // uni.showToast({
icon: 'success', // title: '',
duration: 2000, // icon: 'success',
}) // duration: 2000,
// })
setTimeout(() => { setTimeout(() => {
couponTimesList.value = []; couponTimesList.value = [];
getCouponTimesList(); getCouponTimesList();
},1500) },1500)
} else { } else {
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'error' // title: res.msg,
}) // icon: 'error'
// })
} }
} }

View File

@ -384,11 +384,12 @@
} }
}) })
} else { } else {
uni.showToast({ sheep.$helper.toast('请先登录');
title: '请先登录', // uni.showToast({
icon: 'none', // title: '',
duration: 2000 // icon: 'none',
}) // duration: 2000
// })
cardShow.value = false cardShow.value = false
setTimeout(function() { setTimeout(function() {
uni.switchTab({ uni.switchTab({
@ -407,11 +408,11 @@
url: '/pages/user/authentication' url: '/pages/user/authentication'
}) })
} else { } else {
sheep.$helper.toast('请先登录');
uni.showToast({ // uni.showToast({
title: '请先登录', // title: '',
icon: 'none', // icon: 'none',
}) // })
cardShow.value = false cardShow.value = false
setTimeout(function() { setTimeout(function() {
uni.switchTab({ uni.switchTab({
@ -435,10 +436,7 @@
}) })
} else { } else {
setTimeout(() => { setTimeout(() => {
uni.showToast({ sheep.$helper.toast('请先登录');
title: '请先登录',
icon: 'none',
})
}, 500); }, 500);
setTimeout(() => { setTimeout(() => {
@ -530,20 +528,22 @@
tagSelectedNum.value += 1; tagSelectedNum.value += 1;
tagShowList.value[index].isSelect = true; tagShowList.value[index].isSelect = true;
} else { } else {
uni.showToast({ sheep.$helper.toast('最多选择三个标签');
title: '最多选择三个标签', // uni.showToast({
icon: 'none' // title: '',
}) // icon: 'none'
// })
} }
} else { } else {
if (tagSelectedNum.value > 0) { if (tagSelectedNum.value > 0) {
tagSelectedNum.value -= 1; tagSelectedNum.value -= 1;
tagShowList.value[index].isSelect = false; tagShowList.value[index].isSelect = false;
} else { } else {
uni.showToast({ sheep.$helper.toast('至少选择一个');
title: '至少选择一个', // uni.showToast({
icon: 'none' // title: '',
}) // icon: 'none'
// })
} }
} }
console.log('选择标签', tagSelectedNum.value); console.log('选择标签', tagSelectedNum.value);
@ -604,10 +604,11 @@
async function apply() { async function apply() {
console.log('state', state.formData.images); console.log('state', state.formData.images);
if (agreeAdd.value == false) { if (agreeAdd.value == false) {
uni.showToast({ sheep.$helper.toast('请先同意发布须知');
title: '请先同意发布须知', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
form.value.cate_ids = selectTagslist.value.map((item) => item.id).join(',') form.value.cate_ids = selectTagslist.value.map((item) => item.id).join(',')
@ -617,74 +618,84 @@
console.log('images', form.value.images); console.log('images', form.value.images);
if (form.value.title == '') { if (form.value.title == '') {
uni.showToast({ sheep.$helper.toast('请输入标题');
title: '请输入标题', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.province == '' && form.value.city == '') { if (form.value.province == '' && form.value.city == '') {
uni.showToast({ sheep.$helper.toast('请选择地区');
title: '请选择地区', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.address_detail == '') { if (form.value.address_detail == '') {
uni.showToast({ sheep.$helper.toast('请输入详细地址');
title: '请输入详细地址', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.contacts == '') { if (form.value.contacts == '') {
uni.showToast({ sheep.$helper.toast('请输入联系人');
title: '请输入联系人', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.contact_number == '') { if (form.value.contact_number == '') {
uni.showToast({ sheep.$helper.toast('请输入联系人电话');
title: '请输入联系人电话', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (!/^1[3-9]\d{9}$/.test(form.value.contact_number)) { if (!/^1[3-9]\d{9}$/.test(form.value.contact_number)) {
uni.showToast({ sheep.$helper.toast('请输入正确的手机号');
title: '请输入正确的手机号', // uni.showToast({
icon: 'none', // title: '',
duration: 2000 // icon: 'none',
}) // duration: 2000
// })
return; return;
} }
if (form.value.content == '') { if (form.value.content == '') {
uni.showToast({ sheep.$helper.toast('请输入详细信息');
title: '请输入详细信息', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.images == '') { if (form.value.images == '') {
uni.showToast({ sheep.$helper.toast('请上传图片');
title: '请上传图片', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.type == '') { if (form.value.type == '') {
uni.showToast({ sheep.$helper.toast('请选择项目类型');
title: '请选择项目类型', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
if (form.value.cate_ids == '') { if (form.value.cate_ids == '') {
uni.showToast({ sheep.$helper.toast('请选择标签');
title: '请选择标签', // uni.showToast({
icon: 'none', // title: '',
}) // icon: 'none',
// })
return return
} }
console.log('apply——form:', form.value); console.log('apply——form:', form.value);
@ -726,10 +737,11 @@
url: '/pages/index/user' url: '/pages/index/user'
}) })
}else { }else {
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'error' // title: res.msg,
}) // icon: 'error'
// })
} }
} }

View File

@ -351,12 +351,12 @@
url: e url: e
}) })
} else { } else {
sheep.$helper.toast('请先登录');
uni.showToast({ // uni.showToast({
title: '请先登录', // title: '',
icon: 'none', // icon: 'none',
duration: 2000 // duration: 2000
}) // })
setTimeout(function() { setTimeout(function() {
uni.switchTab({ uni.switchTab({

View File

@ -363,10 +363,11 @@
url: '/pages/user/info' url: '/pages/user/info'
}) })
} else { } else {
uni.showToast({ sheep.$helper.toast('请先登录');
title: '请先登录', // uni.showToast({
icon: 'none' // title: '',
}) // icon: 'none'
// })
} }
} }
@ -377,11 +378,12 @@
url: e url: e
}) })
} else { } else {
uni.showToast({ sheep.$helper.toast('请先登录');
title: '请先登录', // uni.showToast({
icon: 'none', // title: '',
duration: 2000 // icon: 'none',
}) // duration: 2000
// })
// setTimeout(function() { // setTimeout(function() {
// uni.switchTab({ // uni.switchTab({

View File

@ -2,25 +2,12 @@
<template> <template>
<s-layout title="我的订单"> <s-layout title="我的订单">
<su-sticky bgColor="#fff"> <su-sticky bgColor="#fff">
<su-tabs <su-tabs :list="tabMaps" :scrollable="false" @change="onTabsChange" :current="state.currentTab"></su-tabs>
:list="tabMaps"
:scrollable="false"
@change="onTabsChange"
:current="state.currentTab"
></su-tabs>
</su-sticky> </su-sticky>
<s-empty <s-empty v-if="state.pagination.total === 0" icon="/static/order-empty.png" text="暂无订单"></s-empty>
v-if="state.pagination.total === 0"
icon="/static/order-empty.png"
text="暂无订单"
></s-empty>
<view v-if="state.pagination.total > 0"> <view v-if="state.pagination.total > 0">
<view <view class="bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20" v-for="order in state.pagination.data"
class="bg-white order-list-card-box ss-r-10 ss-m-t-14 ss-m-20" :key="order.id" @tap="onOrderDetail(order.order_sn)">
v-for="order in state.pagination.data"
:key="order.id"
@tap="onOrderDetail(order.order_sn)"
>
<view class="order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20"> <view class="order-card-header ss-flex ss-col-center ss-row-between ss-p-x-20">
<view class="order-no">订单号{{ order.order_sn }}</view> <view class="order-no">订单号{{ order.order_sn }}</view>
<view class="order-state ss-font-26" :class="formatOrderColor(order.status_code)">{{ <view class="order-state ss-font-26" :class="formatOrderColor(order.status_code)">{{
@ -28,59 +15,41 @@
}}</view> }}</view>
</view> </view>
<view class="border-bottom" v-for="item in order.items" :key="item.id"> <view class="border-bottom" v-for="item in order.items" :key="item.id">
<s-goods-item <s-goods-item :img="item.goods_image" :title="item.goods_title" :skuText="item.goods_sku_text"
:img="item.goods_image" :price="item.goods_price" :score="order.score_amount" :num="item.goods_num">
:title="item.goods_title"
:skuText="item.goods_sku_text"
:price="item.goods_price"
:score="order.score_amount"
:num="item.goods_num"
>
<template #tool> <template #tool>
<view class="ss-flex"> <view class="ss-flex">
<button <button class="ss-reset-button apply-btn" v-if="item.btns.includes('aftersale')"
class="ss-reset-button apply-btn"
v-if="item.btns.includes('aftersale')"
@tap.stop=" @tap.stop="
sheep.$router.go('/pages/order/aftersale/apply', { sheep.$router.go('/pages/order/aftersale/apply', {
item: JSON.stringify(item), item: JSON.stringify(item),
}) })
" ">
>
申请售后 申请售后
</button> </button>
<button <button class="ss-reset-button apply-btn" v-if="item.btns.includes('re_aftersale')"
class="ss-reset-button apply-btn"
v-if="item.btns.includes('re_aftersale')"
@tap.stop=" @tap.stop="
sheep.$router.go('/pages/order/aftersale/apply', { sheep.$router.go('/pages/order/aftersale/apply', {
item: JSON.stringify(item), item: JSON.stringify(item),
}) })
" ">
>
重新售后 重新售后
</button> </button>
<button <button class="ss-reset-button apply-btn" v-if="item.btns.includes('aftersale_info')"
class="ss-reset-button apply-btn"
v-if="item.btns.includes('aftersale_info')"
@tap.stop=" @tap.stop="
sheep.$router.go('/pages/order/aftersale/detail', { sheep.$router.go('/pages/order/aftersale/detail', {
id: item.ext.aftersale_id, id: item.ext.aftersale_id,
}) })
" ">
>
售后详情 售后详情
</button> </button>
<button <button class="ss-reset-button apply-btn" v-if="item.btns.includes('buy_again')"
class="ss-reset-button apply-btn"
v-if="item.btns.includes('buy_again')"
@tap.stop=" @tap.stop="
sheep.$router.go('/pages/goods/index', { sheep.$router.go('/pages/goods/index', {
id: item.goods_id, id: item.goods_id,
}) })
" ">
>
再次购买 再次购买
</button> </button>
</view> </view>
@ -101,18 +70,14 @@
<view class="discounts-money pay-color">{{ order.order_amount }}</view> <view class="discounts-money pay-color">{{ order.order_amount }}</view>
<view v-if="order.score_amount">+</view> <view v-if="order.score_amount">+</view>
<view class="discounts-money pay-color ss-flex ss-col-center" v-if="order.score_amount"> <view class="discounts-money pay-color ss-flex ss-col-center" v-if="order.score_amount">
<image <image :src="sheep.$url.static('/assets/addons/shopro/uniapp/goods/score1.svg')"
:src="sheep.$url.static('/assets/addons/shopro/uniapp/goods/score1.svg')" class="score-img"></image>
class="score-img"
></image>
<view>{{ order.score_amount }}</view> <view>{{ order.score_amount }}</view>
</view> </view>
</view> </view>
</view> </view>
<view <view class="order-card-footer ss-flex ss-col-center ss-p-x-20"
class="order-card-footer ss-flex ss-col-center ss-p-x-20" :class="order.btns.length > 3 ? 'ss-row-between' : 'ss-row-right'">
:class="order.btns.length > 3 ? 'ss-row-between' : 'ss-row-right'"
>
<!-- <su-popover> <!-- <su-popover>
<button class="more-btn ss-reset-button" @click.stop>更多</button> <button class="more-btn ss-reset-button" @click.stop>更多</button>
<template #content> <template #content>
@ -130,88 +95,55 @@
</template> </template>
</su-popover> --> </su-popover> -->
<view class="ss-flex ss-col-center"> <view class="ss-flex ss-col-center">
<button <button v-if="order.btns.includes('groupon')" class="tool-btn ss-reset-button"
v-if="order.btns.includes('groupon')" @tap.stop="onOrderGroupon(order)">
class="tool-btn ss-reset-button"
@tap.stop="onOrderGroupon(order)"
>
{{ order.status_code === 'groupon_ing' ? '邀请拼团' : '拼团详情' }} {{ order.status_code === 'groupon_ing' ? '邀请拼团' : '拼团详情' }}
</button> </button>
<button <button v-if="order.btns.includes('invoice')" class="tool-btn ss-reset-button"
v-if="order.btns.includes('invoice')" @tap.stop="onOrderInvoice(order.invoice?.id)">
class="tool-btn ss-reset-button"
@tap.stop="onOrderInvoice(order.invoice?.id)"
>
查看发票 查看发票
</button> </button>
<button <button v-if="order.btns.length === 0" class="tool-btn ss-reset-button"
v-if="order.btns.length === 0" @tap.stop="onOrderDetail(order.order_sn)">
class="tool-btn ss-reset-button"
@tap.stop="onOrderDetail(order.order_sn)"
>
查看详情 查看详情
</button> </button>
<button <button v-if="order.btns.includes('confirm')" class="tool-btn ss-reset-button"
v-if="order.btns.includes('confirm')" @tap.stop="onConfirm(order)">
class="tool-btn ss-reset-button"
@tap.stop="onConfirm(order)"
>
确认收货 确认收货
</button> </button>
<button <button v-if="order.btns.includes('express')" class="tool-btn ss-reset-button"
v-if="order.btns.includes('express')" @tap.stop="onExpress(order.id)">
class="tool-btn ss-reset-button"
@tap.stop="onExpress(order.id)"
>
查看物流 查看物流
</button> </button>
<button <button v-if="order.btns.includes('apply_refund')" class="tool-btn ss-reset-button"
v-if="order.btns.includes('apply_refund')" @tap.stop="onRefund(order.id)">
class="tool-btn ss-reset-button"
@tap.stop="onRefund(order.id)"
>
申请退款 申请退款
</button> </button>
<button <button v-if="order.btns.includes('re_apply_refund')" class="tool-btn ss-reset-button"
v-if="order.btns.includes('re_apply_refund')" @tap.stop="onRefund(order.id)">
class="tool-btn ss-reset-button"
@tap.stop="onRefund(order.id)"
>
重新退款 重新退款
</button> </button>
<button <button v-if="order.btns.includes('cancel')" class="tool-btn ss-reset-button"
v-if="order.btns.includes('cancel')" @tap.stop="onCancel(order.id)">
class="tool-btn ss-reset-button"
@tap.stop="onCancel(order.id)"
>
取消订单 取消订单
</button> </button>
<button <button v-if="order.btns.includes('comment')" class="tool-btn ss-reset-button"
v-if="order.btns.includes('comment')" @tap.stop="onComment(order.order_sn)">
class="tool-btn ss-reset-button"
@tap.stop="onComment(order.order_sn)"
>
评价晒单 评价晒单
</button> </button>
<button <button v-if="order.btns.includes('delete')" class="delete-btn ss-reset-button"
v-if="order.btns.includes('delete')" @tap.stop="onDelete(order.id)">
class="delete-btn ss-reset-button"
@tap.stop="onDelete(order.id)"
>
删除订单 删除订单
</button> </button>
<button <button v-if="order.btns.includes('pay')" class="tool-btn ss-reset-button ui-BG-Main-Gradient"
v-if="order.btns.includes('pay')" @tap.stop="onPay(order.order_sn)">
class="tool-btn ss-reset-button ui-BG-Main-Gradient"
@tap.stop="onPay(order.order_sn)"
>
继续支付 继续支付
</button> </button>
</view> </view>
@ -220,24 +152,30 @@
</view> </view>
<!-- 加载更多 --> <!-- 加载更多 -->
<uni-load-more <uni-load-more v-if="state.pagination.total > 0" :status="state.loadStatus" :content-text="{
v-if="state.pagination.total > 0"
:status="state.loadStatus"
:content-text="{
contentdown: '上拉加载更多', contentdown: '上拉加载更多',
}" }" @tap="loadmore" />
@tap="loadmore"
/>
</s-layout> </s-layout>
</template> </template>
<script setup> <script setup>
import { computed, reactive } from 'vue'; import {
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'; computed,
import { formatOrderColor } from '@/sheep/hooks/useGoods'; reactive
} from 'vue';
import {
onLoad,
onReachBottom,
onPullDownRefresh
} from '@dcloudio/uni-app';
import {
formatOrderColor
} from '@/sheep/hooks/useGoods';
import sheep from '@/sheep'; import sheep from '@/sheep';
import _ from 'lodash'; import _ from 'lodash';
import { isEmpty } from 'lodash'; import {
isEmpty
} from 'lodash';
const tradeManaged = computed(() => sheep.$store('app').has_wechat_trade_managed); const tradeManaged = computed(() => sheep.$store('app').has_wechat_trade_managed);
@ -261,8 +199,7 @@
error: 0, error: 0,
}); });
const tabMaps = [ const tabMaps = [{
{
name: '全部', name: '全部',
value: 'all', value: 'all',
}, },
@ -348,12 +285,17 @@
} }
// //
const { code, data } = await sheep.$api.order.confirm(order.id); const {
code,
data,
msg
} = await sheep.$api.order.confirm(order.id);
if (code === 1) { if (code === 1) {
let index = state.pagination.data.findIndex((order) => order.id === orderId); sheep.$helper.toast(msg);
state.pagination.data[index] = data; // let index = state.pagination.data.findIndex((order) => order.id === orderId);
// state.pagination = pagination; // state.pagination.data[index] = data;
// getOrderList(); state.pagination = pagination;
getOrderList();
} }
} }
@ -402,7 +344,10 @@
content: '确定要取消订单吗?', content: '确定要取消订单吗?',
success: async function(res) { success: async function(res) {
if (res.confirm) { if (res.confirm) {
const { code, data } = await sheep.$api.order.cancel(orderId); const {
code,
data
} = await sheep.$api.order.cancel(orderId);
if (code === 1) { if (code === 1) {
let index = state.pagination.data.findIndex((order) => order.id === orderId); let index = state.pagination.data.findIndex((order) => order.id === orderId);
state.pagination.data[index] = data; state.pagination.data[index] = data;
@ -419,7 +364,10 @@
content: '确定要删除订单吗?', content: '确定要删除订单吗?',
success: async function(res) { success: async function(res) {
if (res.confirm) { if (res.confirm) {
const { code, data } = await sheep.$api.order.delete(orderId); const {
code,
data
} = await sheep.$api.order.delete(orderId);
if (code === 1) { if (code === 1) {
let index = state.pagination.data.findIndex((order) => order.id === orderId); let index = state.pagination.data.findIndex((order) => order.id === orderId);
state.pagination.data.splice(index, 1); state.pagination.data.splice(index, 1);
@ -439,7 +387,10 @@
// #ifdef MP // #ifdef MP
sheep.$platform.useProvider('wechat').subscribeMessage('order_refund'); sheep.$platform.useProvider('wechat').subscribeMessage('order_refund');
// #endif // #endif
const { code, data } = await sheep.$api.order.applyRefund(orderId); const {
code,
data
} = await sheep.$api.order.applyRefund(orderId);
if (code === 1) { if (code === 1) {
let index = state.pagination.data.findIndex((order) => order.id === orderId); let index = state.pagination.data.findIndex((order) => order.id === orderId);
state.pagination.data[index] = data; state.pagination.data[index] = data;
@ -512,6 +463,7 @@
height: 36rpx; height: 36rpx;
margin: 0 4rpx; margin: 0 4rpx;
} }
.tool-btn { .tool-btn {
width: 160rpx; width: 160rpx;
height: 60rpx; height: 60rpx;
@ -524,6 +476,7 @@
margin-right: 0; margin-right: 0;
} }
} }
.delete-btn { .delete-btn {
width: 160rpx; width: 160rpx;
height: 56rpx; height: 56rpx;
@ -567,8 +520,7 @@
font-weight: 500; font-weight: 500;
} }
.order-state { .order-state {}
}
} }
.pay-box { .pay-box {
@ -622,15 +574,19 @@
:deep(.uni-tooltip-popup) { :deep(.uni-tooltip-popup) {
background: var(--ui-BG); background: var(--ui-BG);
} }
.warning-color { .warning-color {
color: #faad14; color: #faad14;
} }
.danger-color { .danger-color {
color: #ff3000; color: #ff3000;
} }
.success-color { .success-color {
color: #52c41a; color: #52c41a;
} }
.info-color { .info-color {
color: #999999; color: #999999;
} }

View File

@ -138,10 +138,11 @@
// //
detailClass.value.content = formatRichText(detailClass.value.content); detailClass.value.content = formatRichText(detailClass.value.content);
} else { } else {
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'none' // title: res.msg,
}) // icon: 'none'
// })
} }
} }
const newContent = ref('') const newContent = ref('')
@ -196,11 +197,12 @@
} }
sheep.$api.school.classesCollect(data).then((res) => { sheep.$api.school.classesCollect(data).then((res) => {
if(res.code == 1) { if(res.code == 1) {
uni.showToast({ sheep.$helper.toast('已取消收藏');
title:'已取消收藏', // uni.showToast({
icon:'none', // title:'',
duration: 2000, // icon:'none',
}) // duration: 2000,
// })
setTimeout(() =>{ setTimeout(() =>{
getDetail() getDetail()
},1000) },1000)
@ -214,11 +216,12 @@
} }
sheep.$api.school.classesCollect(data1).then((res) => { sheep.$api.school.classesCollect(data1).then((res) => {
if(res.code == 1) { if(res.code == 1) {
uni.showToast({ sheep.$helper.toast('已收藏');
title:'已收藏', // uni.showToast({
icon:'none', // title:'',
duration: 2000, // icon:'none',
}) // duration: 2000,
// })
setTimeout(() =>{ setTimeout(() =>{
getDetail() getDetail()
},1000) },1000)

View File

@ -113,10 +113,11 @@
sheep.$api.user.authPhoto(data).then((res) => { sheep.$api.user.authPhoto(data).then((res) => {
if(res.code == 1) { if(res.code == 1) {
console.log('提交认证成功'); console.log('提交认证成功');
uni.showToast({ sheep.$helper.toast('提交认证成功');
title:'提交认证成功', // uni.showToast({
icon: 'success', // title:'',
}) // icon: 'success',
// })
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()

View File

@ -189,10 +189,11 @@
} else { } else {
// Handle case where data is not in expected format // Handle case where data is not in expected format
collectRentList.value = []; collectRentList.value = [];
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'none' // title: res.msg,
}) // icon: 'none'
// })
} }
console.log('getList', collectRentList.value); console.log('getList', collectRentList.value);
} }
@ -214,10 +215,11 @@
} else { } else {
// Handle case where data is not in expected format // Handle case where data is not in expected format
collectSchoolList.value = []; collectSchoolList.value = [];
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'none' // title: res.msg,
}) // icon: 'none'
// })
} }
console.log('平台课程收藏列表-222', collectSchoolList.value); console.log('平台课程收藏列表-222', collectSchoolList.value);
} }
@ -281,11 +283,12 @@
} }
sheep.$api.rent.rentCollect(data).then((res) => { sheep.$api.rent.rentCollect(data).then((res) => {
if (res.code == 1) { if (res.code == 1) {
uni.showToast({ sheep.$helper.toast('已取消收藏');
title: '已取消收藏', // uni.showToast({
icon: 'none', // title: '',
duration: 2000 // icon: 'none',
}) // duration: 2000
// })
} }
}) })
} else { } else {
@ -296,11 +299,12 @@
} }
sheep.$api.rent.rentCollect(data1).then((res) => { sheep.$api.rent.rentCollect(data1).then((res) => {
if (res.code == 1) { if (res.code == 1) {
uni.showToast({ sheep.$helper.toast('已收藏');
title: '已收藏', // uni.showToast({
icon: 'none', // title: '',
duration: 2000 // icon: 'none',
}) // duration: 2000
// })
} }
}) })
} }
@ -317,11 +321,12 @@
} }
sheep.$api.school.classesCollect(data).then((res) => { sheep.$api.school.classesCollect(data).then((res) => {
if (res.code == 1) { if (res.code == 1) {
uni.showToast({ sheep.$helper.toast('已取消收藏');
title: '已取消收藏', // uni.showToast({
icon: 'none', // title: '',
duration: 2000, // icon: 'none',
}) // duration: 2000,
// })
} }
}) })
} else { } else {
@ -332,11 +337,12 @@
} }
sheep.$api.school.classesCollect(data1).then((res) => { sheep.$api.school.classesCollect(data1).then((res) => {
if (res.code == 1) { if (res.code == 1) {
uni.showToast({ sheep.$helper.toast('已收藏');
title: '已收藏', // uni.showToast({
icon: 'none', // title: '',
duration: 2000, // icon: 'none',
}) // duration: 2000,
// })
} }
}) })
} }

View File

@ -281,10 +281,12 @@
// //
function toDetail(e) { function toDetail(e) {
console.log('跳转详情', e); console.log('跳转详情', e);
if(e.status == 1) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/canteenRent/rentDetail?id=' + e.id url: '/pages/canteenRent/rentDetail?id=' + e.id
}) })
} }
}
// //
function rentEdit(item) { function rentEdit(item) {
console.log('修改招租',item); console.log('修改招租',item);
@ -300,17 +302,19 @@
sheep.$api.rent.delRent({ids:item.id}).then((res) => { sheep.$api.rent.delRent({ids:item.id}).then((res) => {
if(res.code === 1) { if(res.code === 1) {
console.log('delete:',res); console.log('delete:',res);
uni.showToast({ sheep.$helper.toast('取消成功');
title: '取消成功', // uni.showToast({
icon: 'none' // title: '',
}) // icon: 'none'
// })
rentList.value = [] rentList.value = []
getList() getList()
}else { }else {
uni.showToast({ sheep.$helper.toast(res.msg);
title: res.msg, // uni.showToast({
icon: 'error' // title: res.msg,
}) // icon: 'error'
// })
} }
}) })
} }