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 {
// 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);
}

View File

@ -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;
}
}

View File

@ -4,13 +4,12 @@
<!-- 顶部banner -->
<view class="swiper-box">
<view class="swiper_s">
<swiper class="swiper_s" :circular="true" :autoplay="true" :indicator-dots="false" :current="currentImgIndex"
@change="swiperChange" @animationfinish="animationfinish">
<swiper class="swiper_s" :circular="true" :autoplay="true" :indicator-dots="false"
:current="currentImgIndex" @change="swiperChange" @animationfinish="animationfinish">
<!-- 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">
<view style="position: relative;width: 100%;height: 100%;"
>
<image class="swiper-image" :src="item" mode="widthFix"/>
<view style="position: relative;width: 100%;height: 100%;">
<image class="swiper-image" :src="item" mode="widthFix" />
</view>
</swiper-item>
@ -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<imagesNum.value) {
console.log('切换轮播图', e.detail.current);
if (e.detail.current < imagesNum.value) {
// if(e.detail.current == 0){
// currentImgIndex.value = imagesNum.value
// }else {
@ -235,7 +235,7 @@
}
function animationfinish(e) {
console.log('animationfinish',e);
console.log('animationfinish', e);
};
//
@ -263,14 +263,10 @@
}
sheep.$api.rent.rentCollect(data).then((res) => {
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() {
@ -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;

View File

@ -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'
// })
}
}

View File

@ -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'
// })
}
}

View File

@ -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,10 +436,7 @@
})
} else {
setTimeout(() => {
uni.showToast({
title: '请先登录',
icon: 'none',
})
sheep.$helper.toast('请先登录');
}, 500);
setTimeout(() => {
@ -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'
// })
}
}

View File

@ -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({

View File

@ -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({

View File

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

View File

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

View File

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

View File

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

View File

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