zhangyu
张宇 2 years ago
parent 1ada99915d
commit 8900aff919

@ -30,6 +30,16 @@ export default {
}); });
}, },
del(data) {
return request({
url: "/admin/recharge/del",
method: "GET",
data,
type: 'store'
});
},
rechargeSet: { rechargeSet: {
list(data) { list(data) {
return request({ return request({

@ -2,223 +2,254 @@
<view class="content pt-2"> <view class="content pt-2">
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading> <kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<view class="px-2 my-1"> <wd-transition duration="320" :show="true" name="zoom-in">
<view class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm"> <view class="px-2 my-1">
<view class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
<view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<view class="flex items-baseline text-xs px-2"> <view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<span class="mr-2 warn-state warn-status-processing bg-emerald-400"></span> <view class="flex items-baseline text-xs px-2">
基础功能 <span class="mr-2 warn-state warn-status-processing bg-emerald-400"></span>
</view> 基础功能
</view> </view>
<view class="grid grid-cols-2 gap-3">
<view @click="utils.toUrl('/store/cat/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
商品分类
</view>
<view @click="utils.toUrl('/store/goods/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
商品管理
</view> </view>
<view @click="utils.toUrl('/store/user/list')" <view class="grid grid-cols-3 gap-3">
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;"> <view @click="utils.toUrl('/store/cat/index')"
会员管理 class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
</view> style="font-size: 0.75rem;">
商品分类
<wd-icon name="setting1 opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/goods/index')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
商品管理
<wd-icon name="goods opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/user/list')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
会员管理
<wd-icon name="user opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/user/memberList')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
会员等级
<wd-icon name="lenovo opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/user/memberList')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
会员等级
</view> </view>
</view> </view>
</view> </view>
</view> </wd-transition>
<view class="px-2 my-1"> <wd-transition duration="340" :show="true" name="zoom-in">
<view class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm"> <view class="px-2 my-1">
<view class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
<view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium "> <view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<view class="flex items-baseline text-xs px-2"> <view class="flex items-baseline text-xs px-2">
<span class="mr-2 warn-state warn-status-processing bg-yellow-600"></span> <span class="mr-2 warn-state warn-status-processing bg-yellow-600"></span>
订单管理 订单管理
</view>
</view> </view>
</view>
<view class="grid grid-cols-3 gap-3"> <view class="grid grid-cols-3 gap-3">
<view @click="utils.toUrl('/store/order/index')" <view @click="utils.toUrl('/store/order/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;"> style="font-size: 0.75rem;">
普通订单 普通订单
<wd-icon name="cart opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/afterSale/index')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
售后订单
<wd-icon name="cart opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/inpersonPay/index')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
当面付订单
<wd-icon name="cart opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
</view> </view>
<view @click="utils.toUrl('/store/afterSale/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
售后订单
</view>
<view @click="utils.toUrl('/store/inpersonPay/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
当面付订单
</view>
</view> </view>
</view> </view>
</view> </wd-transition>
<view class="px-2 my-1">
<view class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
<view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium "> <wd-transition duration="360" :show="true" name="zoom-in">
<view class="flex items-baseline text-xs px-2"> <view class="px-2 my-1">
<span class="mr-2 warn-state warn-status-processing bg-stone-800"></span> <view class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
折扣管理
</view>
</view>
<view class="grid grid-cols-3 gap-3">
<view @click="utils.toUrl('/store/discount/discount/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
限时折扣
</view>
<view @click="utils.toUrl('/store/discount/full_discount/index')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
梯度折扣
</view>
<view @click="utils.toUrl('/store/discount/full_set_redution/index')" <view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <view class="flex items-baseline text-xs px-2">
style="font-size: 0.75rem;"> <span class="mr-2 warn-state warn-status-processing bg-stone-800"></span>
满额立减 折扣管理
</view>
</view> </view>
<!-- <view class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <view class="grid grid-cols-3 gap-3">
<view @click="utils.toUrl('/store/discount/discount/index')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
限时折扣
<wd-icon name="chart-bubble opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/discount/full_discount/index')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
梯度折扣
<wd-icon name="chart-bubble opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/discount/full_set_redution/index')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
满额立减
<wd-icon name="chart-bubble opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<!-- <view class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;"> style="font-size: 0.75rem;">
套餐优惠 套餐优惠
</view> --> </view> -->
</view> </view>
</view>
</view> </view>
</view> </wd-transition>
<view class="px-2 my-1">
<view class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
<view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<view class="flex items-baseline text-xs px-2">
<span class="mr-2 warn-state warn-status-processing bg-teal-300"></span>
积分商城
</view>
</view>
<view class="grid grid-cols-2 gap-3"> <wd-transition duration="380" :show="true" name="zoom-in">
<view @click="utils.toUrl('/store/points/setUp')" <view class="px-2 my-1">
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <view class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
style="font-size: 0.75rem;">
积分设置
</view>
<view @click="utils.toUrl('/store/points/cat')" <view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <view class="flex items-baseline text-xs px-2">
style="font-size: 0.75rem;"> <span class="mr-2 warn-state warn-status-processing bg-teal-300"></span>
商品分类 积分商城
</view>
</view> </view>
<view @click="utils.toUrl('/store/points/goods/index')" <view class="grid grid-cols-2 gap-3">
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <view @click="utils.toUrl('/store/points/setUp')"
style="font-size: 0.75rem;"> class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
商品管理 style="font-size: 0.75rem;">
</view> 积分设置
<wd-icon name="detection opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/points/cat')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
商品分类
<wd-icon name="setting1 opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/points/goods/index')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
商品管理
<wd-icon name="goods opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/points/order')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
订单管理
<wd-icon name="lenovo opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/points/order')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
订单管理
</view> </view>
</view> </view>
</view> </view>
</view> </wd-transition>
<view class="px-2 my-1"> <wd-transition duration="400" :show="true" name="zoom-in">
<view class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm"> <view class="px-2 my-1">
<view class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
<view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium "> <view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<view class="flex items-baseline text-xs px-2"> <view class="flex items-baseline text-xs px-2">
<span class="mr-2 warn-state warn-status-processing bg-fuchsia-950"></span> <span class="mr-2 warn-state warn-status-processing bg-fuchsia-950"></span>
提现管理 提现管理
</view>
</view> </view>
</view>
<view class="grid grid-cols-2 gap-3"> <view class="grid grid-cols-2 gap-3">
<view @click="utils.toUrl('')" <view @click="utils.toUrl('')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;"> style="font-size: 0.75rem;">
提现设置 提现设置
</view> <wd-icon name="chart-bubble opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
分销提现
<wd-icon name="chart-bubble opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
分销提现
</view> </view>
</view> </view>
</view> </view>
</view> </wd-transition>
<view class="px-2 my-1">
<view class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
<view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium "> <wd-transition duration="420" :show="true" name="zoom-in">
<view class="flex items-baseline text-xs px-2"> <view class="px-2 my-1">
<span class="mr-2 warn-state warn-status-processing bg-violet-700"></span> <view class="relative flex flex-col rounded-xl bg-white p-4 shadow-sm">
更多功能
</view>
</view>
<view class="grid grid-cols-2 gap-3"> <view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<view @click="utils.toUrl('/store/recharge/index')" <view class="flex items-baseline text-xs px-2">
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <span class="mr-2 warn-state warn-status-processing bg-violet-700"></span>
style="font-size: 0.75rem;"> 更多功能
充值管理 </view>
</view> </view>
<view @click="utils.toUrl('/store/coupon/index')" <view class="grid grid-cols-2 gap-3">
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between" <view @click="utils.toUrl('/store/recharge/index')"
style="font-size: 0.75rem;"> class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
优惠券 style="font-size: 0.75rem;">
</view> 充值管理
<wd-icon name="chart-bubble opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/coupon/index')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
优惠券
<wd-icon name="chart-bubble opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/check/list')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
核销记录
<wd-icon name="chart-bubble opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/check/list')"
class="item border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
核销记录
</view> </view>
</view> </view>
</view> </view>
</view> </wd-transition>
<view class="bg-transparent h-[80px]"></view> <view class="bg-transparent h-[80px]"></view>

@ -1,7 +1,6 @@
<template> <template>
<view class="content pt-[44px]"> <view class="content pt-[44px]">
<kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading> <kevyloading v-if="loading" type="bsm-loader" color="#618af8" transparent></kevyloading>
<view class="w-full"> <view class="w-full">
<wd-navbar fixed safeAreaInsetTop> <wd-navbar fixed safeAreaInsetTop>
<template #right> <template #right>
@ -20,7 +19,54 @@
</wd-navbar> </wd-navbar>
</view> </view>
<view bg-color="#f7f8fa" class="w-full grid grid-cols-3 gap-3 px-3 my-4"> <view class="px-2 my-2 mb-3">
<view class="relative flex flex-col rounded-2xl bg-white p-4 shadow-sm">
<view class="mb-2 pointer-events-auto relative inline-flex bg-white font-medium ">
<view class="flex items-baseline text-xs px-2">
<span class="mr-2 warn-state warn-status-processing bg-red-300"></span>
猜您想用 ?
</view>
</view>
<view v-if="recommend.length" class="grid grid-cols-3 gap-3">
<view v-for="item of recommend" @click="utils.toUrl(item.url)"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
{{ item.name }}
<wd-icon :name="item.icon" class="opacity-80" size="12px"></wd-icon>
</view>
</view>
<view v-else class="grid grid-cols-3 gap-3">
<view @click="utils.toUrl('/store/user/list')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
会员管理
<wd-icon name="user opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/goods/index')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
商品管理
<wd-icon name="goods opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
<view @click="utils.toUrl('/store/order/index')"
class="items-center border-2 border-solid border-gray-100 rounded bg-slate-50 p-2 flex justify-between"
style="font-size: 0.75rem;">
订单管理
<wd-icon name="lenovo opacity-80" class="opacity-80" size="12px"></wd-icon>
</view>
</view>
</view>
</view>
<!-- <view bg-color="#f7f8fa" class="w-full grid grid-cols-3 gap-3 px-3 my-4">
<view @click="utils.toUrl('/store/user/list')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden" <view @click="utils.toUrl('/store/user/list')" class="text-white rounded-3xl p-4 pb-0 shadow-lg overflow-hidden"
style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);"> style="background-image: linear-gradient(to top, #7ea0ff 0%, #a9bdf5 100%);">
@ -58,7 +104,7 @@
</view> </view>
</view> </view>
</view> </view> -->
<view style="transition: 1s;" class="w-full h-full bg-white pt-2 rounded-tr-2xl rounded-tl-2xl shadow-lg oh"> <view style="transition: 1s;" class="w-full h-full bg-white pt-2 rounded-tr-2xl rounded-tl-2xl shadow-lg oh">
<view class="order mb-2"> <view class="order mb-2">
@ -147,6 +193,7 @@ import myTabbar from "../components/myTabbar/index.vue";
import bar from "../components/bar/bar.vue"; import bar from "../components/bar/bar.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading"; import kevyloading from "@/components/kevy-loading/kevy-loading";
/** /**
* @type {Ref<boolean>} * @type {Ref<boolean>}
* 控制页面加载状态的 Ref * 控制页面加载状态的 Ref
@ -268,6 +315,7 @@ const getOrderGood = (e) => {
// //
getOrderGood({ index: 0 }); getOrderGood({ index: 0 });
const recommend = utils.recommendPage()
</script> </script>

@ -36,16 +36,6 @@
</view> </view>
</view> </view>
<!-- <view class="flex-1 bg-white pb-2">
<div class="rounded-md overflow-hidden">
<wd-tabs @change="search">
<wd-tab :title="`全部`" :name="null"></wd-tab>
<wd-tab :title="`领取后过期`" :name="0"></wd-tab>
<wd-tab :title="`定时过期`" :name="1"></wd-tab>
</wd-tabs>
</div>
</view> -->
<view class="grid p-2"> <view class="grid p-2">
<yList height="84vh" ref="yListRef" noPageSize :apiObj="recharge.List" :params="{ ...params }"> <yList height="84vh" ref="yListRef" noPageSize :apiObj="recharge.List" :params="{ ...params }">
@ -105,7 +95,7 @@
<view class="px-4 text-nowrap h-full bg-stone-800 text-white flex items-center justify-center"> <view class="px-4 text-nowrap h-full bg-stone-800 text-white flex items-center justify-center">
<view @click="utils.toUrl('/store/recharge/edit?id=' + recharge.id)" style="writing-mode: vertical-rl; <view @click="delRecharge(recharge)" style="writing-mode: vertical-rl;
text-orientation: upright;"> text-orientation: upright;">
删除 删除
</view> </view>
@ -134,10 +124,13 @@
import { ref, nextTick } from 'vue'; import { ref, nextTick } from 'vue';
import utils from '@/utils/utils.js'; import utils from '@/utils/utils.js';
import recharge from '@/api/store/recharge.js'; import recharge from '@/api/store/recharge.js';
import yList from "/components/yList/index.vue";
import kevyloading from "@/components/kevy-loading/kevy-loading"; import kevyloading from "@/components/kevy-loading/kevy-loading";
import { useMessage } from '@/uni_modules/wot-design-uni'; import { useMessage } from '@/uni_modules/wot-design-uni';
import { useToast } from '@/uni_modules/wot-design-uni' import { useToast } from '@/uni_modules/wot-design-uni'
import yList from "/components/yList/index.vue"; import { useApi } from "@/hooks/useApi.js"
const message = useMessage();
const toast = useToast()
import { import {
onShow, onShow,
@ -148,41 +141,11 @@ const yListRef = ref(null);
const searchType = ref('券名'); const searchType = ref('券名');
const popover = ref(false); const popover = ref(false);
const search = ({ value } = {}) => { const search = () => {
yListRef.value.upData({});
if (searchType.value == '券名') {
yListRef.value.upData({
name: params.value.keywords,
});
} else if (searchType.value == '券金额') {
yListRef.value.upData({
price: params.value.keywords
});
} else {
yListRef.value.upData({});
}
}; };
const menu = ref([ const params = ref({});
{ content: '券名' },
{ content: '券金额' },
]);
const params = ref({
name: null,
price: null,
send_type: null
});
/**
* 切换搜索类型
* @param {Object} item - 切换的项
*/
function changeSearchType({ item, index }) {
searchType.value = item.content;
search(params.value.keywords)
}
/** /**
* @type {Ref<boolean>} * @type {Ref<boolean>}
@ -190,15 +153,29 @@ function changeSearchType({ item, index }) {
*/ */
const loading = ref(false); const loading = ref(false);
const formatOfTime = (theTimeStamp) => { const delRecharge = (row) => {
const date = new Date(theTimeStamp * 1000); // message
const year = date.getFullYear(); .confirm({
const month = String(date.getMonth() + 1).padStart(2, '0'); title: '删除充值方案',
const day = String(date.getDate()).padStart(2, '0'); })
const hours = String(date.getHours()).padStart(2, '0'); .then(async (resp) => {
const minutes = String(date.getMinutes()).padStart(2, '0'); const { fetchData } = await useApi(recharge.del)
return `${year}-${month}-${day} ${hours}`; fetchData({
id: row.id,
}).then(res => {
if (res.code == 0) {
toast.success('操作成功')
search()
} else {
toast.error('出错了')
}
})
})
.catch((error) => {
console.log(error);
});
} }
// //

@ -0,0 +1,24 @@
const pageList = [
{ url: '/store/cat/index', name: '商品分类', icon: 'setting1 opacity-80' },
{ url: '/store/goods/index', name: '商品管理', icon: 'goods opacity-80' },
{ url: '/store/user/list', name: '会员管理', icon: 'user opacity-80' },
{ url: '/store/user/memberList', name: '会员等级', icon: 'lenovo opacity-80' },
{ url: '/store/order/index', name: '普通订单', icon: 'cart opacity-80' },
{ url: '/store/afterSale/index', name: '售后订单', icon: 'cart opacity-80' },
{ url: '/store/inpersonPay/index', name: '当面付订单', icon: 'cart opacity-80' },
{ url: '/store/discount/discount/index', name: '限时折扣', icon: 'chart-bubble opacity-80' },
{ url: '/store/discount/full_discount/index', name: '梯度折扣', icon: 'chart-bubble opacity-80' },
{ url: '/store/discount/full_set_redution/index', name: '满额立减', icon: 'chart-bubble opacity-80' },
{ url: '/store/points/setUp', name: '积分设置', icon: 'detection opacity-80' },
{ url: '/store/points/cat', name: '商品分类', icon: 'setting1 opacity-80' },
{ url: '/store/points/goods/index', name: '商品管理', icon: 'goods opacity-80' },
{ url: '/store/points/order', name: '订单管理', icon: 'lenovo opacity-80' },
{ url: '', name: '提现设置', icon: 'chart-bubble opacity-80' },
{ url: '', name: '分销提现', icon: 'chart-bubble opacity-80' },
{ url: '/store/recharge/index', name: '充值管理', icon: 'chart-bubble opacity-80' },
{ url: '/store/coupon/index', name: '优惠券', icon: 'chart-bubble opacity-80' },
{ url: '/store/check/list', name: '核销记录', icon: 'chart-bubble opacity-80' }
// Add more entries if needed
];
export default pageList

@ -1,11 +1,5 @@
import { isGetLocation } from "./location.js"; import { isGetLocation } from "./location.js";
import pageList from "./pageList.js";
const tabBarList = [
"/pages/index/index",
"/pages/cat/cat",
"/pages/shoppingCart/index",
"/pages/my/my",
];
export default { export default {
// 跳转页面 // 跳转页面
@ -20,17 +14,6 @@ export default {
} }
try { try {
if (
tabBarList.some((item) => url.indexOf(item) !== -1) &&
type != "reLaunch"
) {
uni.switchTab({
url: url,
});
return;
}
if (type == "redirectTo") { if (type == "redirectTo") {
uni.redirectTo({ uni.redirectTo({
url, url,
@ -49,6 +32,44 @@ export default {
} }
const isPage = pageList.find(item => item.url === url);
if (isPage) {
const countUrl = uni.getStorageSync("countUrl") || {};
// 增加当前页面的触发次数
countUrl[url] = (countUrl[url] || 0) + 1;
// 将更新后的 countUrl 对象保存到存储中
uni.setStorageSync("countUrl", countUrl);
// 现在你可以通过 countUrl[url] 访问每个页面的触发次数
}
},
recommendPage() {
try {
const countUrl = uni.getStorageSync("countUrl") || {};
const sortedPages = Object.keys(countUrl).sort((a, b) => countUrl[b] - countUrl[a]);
// 取出前 6 条数据
const topPages = sortedPages.slice(0, 6);
// 从 pageList 中找到对应的页面信息
const topPageInfo = topPages.map(url => {
const page = pageList.find(item => item.url === url);
return {
url: page.url,
name: page.name,
icon: page.icon,
triggerCount: countUrl[url]
};
});
return topPageInfo || []
} catch (error) {
return []
}
}, },
// 后退页面 // 后退页面

Loading…
Cancel
Save