Merge branch 'v1.6' into v1.8
* v1.6: feat: 添加商户端页面
This commit is contained in:
@@ -0,0 +1,183 @@
|
|||||||
|
<template>
|
||||||
|
<view class="tabbar-wrap">
|
||||||
|
<view class="tabbar safe-bottom">
|
||||||
|
<view class="tabbar-inner">
|
||||||
|
<view
|
||||||
|
v-for="item in items"
|
||||||
|
:key="item.pagePath"
|
||||||
|
class="tabbar-item flex1 flex-center flex-column"
|
||||||
|
:class="{ 'tabbar-item--mid': item.isMid }"
|
||||||
|
@tap.stop="onTap(item)"
|
||||||
|
>
|
||||||
|
<view class="iconBox" :class="{ iconBoxMid: item.isMid }">
|
||||||
|
<uni-icons
|
||||||
|
:type="item.icon"
|
||||||
|
:size="item.isMid ? 30 : 24"
|
||||||
|
:color="isActive(item) ? activeColor : normalColor"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="text" :class="{ textActive: isActive(item), textMid: item.isMid }">
|
||||||
|
{{ item.text }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="props.placeholder" class="tabbar-placeholder safe-bottom"></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { computed, ref, watch } from 'vue';
|
||||||
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
path: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
placeholder: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const normalColor = '#666';
|
||||||
|
const activeColor = '#2556EC';
|
||||||
|
|
||||||
|
const currentPath = ref('');
|
||||||
|
|
||||||
|
const normalizePath = (p) => {
|
||||||
|
if (!p) return '';
|
||||||
|
return p.startsWith('/') ? p : `/${p}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateCurrentPath = () => {
|
||||||
|
const pages = getCurrentPages?.() || [];
|
||||||
|
const current = pages[pages.length - 1];
|
||||||
|
const route = current?.route || '';
|
||||||
|
currentPath.value = normalizePath(route);
|
||||||
|
};
|
||||||
|
|
||||||
|
const hideNativeTabBar = () => {
|
||||||
|
try {
|
||||||
|
uni.hideTabBar({
|
||||||
|
fail: () => {},
|
||||||
|
});
|
||||||
|
} catch (e) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
hideNativeTabBar();
|
||||||
|
updateCurrentPath();
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.path,
|
||||||
|
(val) => {
|
||||||
|
if (val) currentPath.value = normalizePath(val);
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
);
|
||||||
|
|
||||||
|
const items = computed(() => [
|
||||||
|
{
|
||||||
|
pagePath: '/pages/merchant/pickupList',
|
||||||
|
text: '提货清单',
|
||||||
|
icon: 'list',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pagePath: '/pages/merchant/scanVerify',
|
||||||
|
text: '扫码核销',
|
||||||
|
icon: 'scan',
|
||||||
|
isMid: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pagePath: '/pages/merchant/storeManage',
|
||||||
|
text: '网店管理',
|
||||||
|
icon: 'shop',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
const isActive = (item) => {
|
||||||
|
return normalizePath(item.pagePath) === normalizePath(currentPath.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onTap = (item) => {
|
||||||
|
if (isActive(item)) return;
|
||||||
|
hideNativeTabBar();
|
||||||
|
uni.reLaunch({
|
||||||
|
url: item.pagePath,
|
||||||
|
fail: () => {
|
||||||
|
uni.navigateTo({ url: item.pagePath });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.tabbar-wrap {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbar {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
padding: 14rpx 24rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbar-inner {
|
||||||
|
width: 100%;
|
||||||
|
height: 110rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
background: rgba(255, 255, 255, 0.98);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 16rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
box-shadow: 0 16rpx 40rpx rgba(0, 0, 0, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbar-item {
|
||||||
|
height: 110rpx;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconBox {
|
||||||
|
width: 56rpx;
|
||||||
|
height: 56rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconBoxMid {
|
||||||
|
width: 76rpx;
|
||||||
|
height: 76rpx;
|
||||||
|
border-radius: 22rpx;
|
||||||
|
background: rgba(37, 86, 236, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
margin-top: 6rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #666;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.textActive {
|
||||||
|
color: #2556ec;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.textMid {
|
||||||
|
font-size: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbar-placeholder {
|
||||||
|
height: calc(110rpx + 28rpx);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
<template>
|
||||||
|
<view class="mode-switch" @tap.stop="open">
|
||||||
|
<view class="mode-switch__text">{{ label }}</view>
|
||||||
|
<uni-icons type="bottom" size="14" color="#333" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { computed } from 'vue';
|
||||||
|
import sheep from '@/sheep';
|
||||||
|
|
||||||
|
const appStore = sheep.$store('app');
|
||||||
|
|
||||||
|
const label = computed(() => (appStore.bizMode === 'merchant' ? '商户' : '用户'));
|
||||||
|
|
||||||
|
const setMode = (mode) => {
|
||||||
|
const next = mode === 'merchant' ? 'merchant' : 'user';
|
||||||
|
if (appStore.bizMode === next) return;
|
||||||
|
appStore.setBizMode(next);
|
||||||
|
const url = next === 'merchant' ? '/pages/merchant/pickupList' : '/pages/index/index';
|
||||||
|
uni.reLaunch({ url });
|
||||||
|
};
|
||||||
|
|
||||||
|
const open = () => {
|
||||||
|
uni.showActionSheet({
|
||||||
|
itemList: ['用户', '商户'],
|
||||||
|
success: ({ tapIndex }) => {
|
||||||
|
setMode(tapIndex === 1 ? 'merchant' : 'user');
|
||||||
|
},
|
||||||
|
fail: () => {},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.mode-switch {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 10rpx 18rpx;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
background: rgba(255, 255, 255, 0.9);
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-switch__text {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #333;
|
||||||
|
margin-right: 8rpx;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+36
@@ -101,6 +101,42 @@
|
|||||||
"title": "购物车",
|
"title": "购物车",
|
||||||
"group": "商城"
|
"group": "商城"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/merchant/pickupList",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "提货清单",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"sync": true,
|
||||||
|
"title": "提货清单",
|
||||||
|
"group": "商户"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/merchant/storeManage",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "网店管理",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"sync": true,
|
||||||
|
"title": "网店管理",
|
||||||
|
"group": "商户"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/merchant/scanVerify",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "扫码核销",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"sync": true,
|
||||||
|
"title": "扫码核销",
|
||||||
|
"group": "商户"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
<!-- 首页,支持店铺装修 -->
|
<!-- 首页,支持店铺装修 -->
|
||||||
<template>
|
<template>
|
||||||
<s-layout title="首页" :showLeftButton="false" tabbar="/pages/index/index" navPreset="light">
|
<s-layout title="首页" :showLeftButton="false" tabbar="/pages/index/index" navPreset="light">
|
||||||
|
<template #navRight>
|
||||||
|
<modeSwitch />
|
||||||
|
</template>
|
||||||
<view class="pagesIndex">
|
<view class="pagesIndex">
|
||||||
<view class="index-header">
|
<view class="index-header">
|
||||||
<view class="index-header__left">
|
<view class="index-header__left">
|
||||||
@@ -120,6 +123,7 @@
|
|||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
|
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
|
||||||
import goods from '@/components/goods/goods.vue';
|
import goods from '@/components/goods/goods.vue';
|
||||||
|
import modeSwitch from '@/components/mode_switch/mode_switch.vue';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import $share from '@/sheep/platform/share';
|
import $share from '@/sheep/platform/share';
|
||||||
import * as api from '@/sheep/api/index/index';
|
import * as api from '@/sheep/api/index/index';
|
||||||
|
|||||||
@@ -0,0 +1,253 @@
|
|||||||
|
<template>
|
||||||
|
<s-layout
|
||||||
|
title="提货清单"
|
||||||
|
:showLeftButton="false"
|
||||||
|
tabbar="/pages/merchant/pickupList"
|
||||||
|
navPreset="light"
|
||||||
|
>
|
||||||
|
<template #navRight>
|
||||||
|
<modeSwitch />
|
||||||
|
</template>
|
||||||
|
<view class="page">
|
||||||
|
<view class="top-bar bg24">
|
||||||
|
<view class="tabs">
|
||||||
|
<view
|
||||||
|
v-for="item in tabs"
|
||||||
|
:key="item.value"
|
||||||
|
class="tab"
|
||||||
|
:class="{ tabActive: currentTab === item.value }"
|
||||||
|
@tap="currentTab = item.value"
|
||||||
|
>
|
||||||
|
{{ item.label }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="search-row">
|
||||||
|
<view class="search-box flex-center">
|
||||||
|
<uni-icons type="search" size="18" color="#8a8a8a" />
|
||||||
|
<uni-easyinput
|
||||||
|
class="search-input flex1"
|
||||||
|
v-model="keyword"
|
||||||
|
placeholder="搜索订单号/取货码/商品名称"
|
||||||
|
:inputBorder="false"
|
||||||
|
:styles="{ fontSize: '28rpx' }"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="list">
|
||||||
|
<view v-for="item in filteredList" :key="item.id" class="card bg24">
|
||||||
|
<view class="card-hd flex-center ju-between">
|
||||||
|
<view class="status" :class="{ statusWait: item.status === 'wait' }">
|
||||||
|
{{ item.statusText }}
|
||||||
|
</view>
|
||||||
|
<view class="time c_999 size24">{{ item.time }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="card-bd flex-center al-flex-start">
|
||||||
|
<image class="thumb" :src="item.pic" mode="aspectFill" />
|
||||||
|
<view class="flex1">
|
||||||
|
<view class="name lineTwo">{{ item.name }}</view>
|
||||||
|
<view class="meta c_999 size24 m-t-10">订单号:{{ item.orderNo }}</view>
|
||||||
|
<view class="meta c_999 size24 m-t-6">取货码:{{ item.pickupCode }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="actions">
|
||||||
|
<view v-if="item.status === 'sorting'" class="btn btnPrimary" @tap="markPicked(item)">
|
||||||
|
标记已分拣
|
||||||
|
</view>
|
||||||
|
<view v-else-if="item.status === 'wait'" class="btn btnOutline" @tap="goScan">
|
||||||
|
去核销
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="filteredList.length === 0" class="empty c_999">暂无数据</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</s-layout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import modeSwitch from '@/components/mode_switch/mode_switch.vue';
|
||||||
|
|
||||||
|
const tabs = [
|
||||||
|
{ label: '全部', value: 'all' },
|
||||||
|
{ label: '待分拣', value: 'sorting' },
|
||||||
|
{ label: '待取货', value: 'wait' },
|
||||||
|
];
|
||||||
|
|
||||||
|
const currentTab = ref('all');
|
||||||
|
const keyword = ref('');
|
||||||
|
|
||||||
|
const list = ref([
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
status: 'sorting',
|
||||||
|
statusText: '待分拣',
|
||||||
|
time: '下单时间:2026-06-25 10:15',
|
||||||
|
name: 'Apple iPhone 15 Pro 256G 原色钛金属',
|
||||||
|
orderNo: 'ORD202406251022',
|
||||||
|
pickupCode: '882910',
|
||||||
|
pic: '/static/empty/goods-empty.png',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
status: 'wait',
|
||||||
|
statusText: '待取货',
|
||||||
|
time: '下单时间:2026-06-25 09:10',
|
||||||
|
name: '索尼 WH-1000XM5 无线降噪耳机',
|
||||||
|
orderNo: 'ORD202406250915',
|
||||||
|
pickupCode: '127736',
|
||||||
|
pic: '/static/empty/goods-empty.png',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
const filteredList = computed(() => {
|
||||||
|
const k = String(keyword.value || '').trim();
|
||||||
|
return list.value.filter((item) => {
|
||||||
|
const hitTab = currentTab.value === 'all' || item.status === currentTab.value;
|
||||||
|
if (!hitTab) return false;
|
||||||
|
if (!k) return true;
|
||||||
|
return (
|
||||||
|
String(item.orderNo).includes(k) ||
|
||||||
|
String(item.pickupCode).includes(k) ||
|
||||||
|
String(item.name).includes(k)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const goScan = () => {
|
||||||
|
uni.reLaunch({ url: '/pages/merchant/scanVerify' });
|
||||||
|
};
|
||||||
|
|
||||||
|
const markPicked = (item) => {
|
||||||
|
item.status = 'wait';
|
||||||
|
item.statusText = '待取货';
|
||||||
|
uni.showToast({ title: '已标记', icon: 'success' });
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.page {
|
||||||
|
padding: 24rpx 24rpx 170rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-bar {
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 18rpx 20rpx 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-bottom: 18rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs {
|
||||||
|
display: flex;
|
||||||
|
gap: 12rpx;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab {
|
||||||
|
padding: 14rpx 22rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
background: #f2f4f7;
|
||||||
|
color: #333;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabActive {
|
||||||
|
background: rgba(37, 86, 236, 0.12);
|
||||||
|
color: #2556ec;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-row {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-box {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
background: #f6f7fb;
|
||||||
|
padding: 6rpx 16rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.search-input .uni-easyinput__content) {
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 18rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 18rpx 18rpx 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-hd {
|
||||||
|
margin-bottom: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #2556ec;
|
||||||
|
background: rgba(37, 86, 236, 0.12);
|
||||||
|
padding: 6rpx 14rpx;
|
||||||
|
border-radius: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.statusWait {
|
||||||
|
color: #6b4eff;
|
||||||
|
background: rgba(107, 78, 255, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.thumb {
|
||||||
|
width: 140rpx;
|
||||||
|
height: 140rpx;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
background: #f2f4f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.name {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #222;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-end;
|
||||||
|
gap: 12rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
padding: 14rpx 20rpx;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnPrimary {
|
||||||
|
background: #2556ec;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnOutline {
|
||||||
|
border: 2rpx solid rgba(37, 86, 236, 0.6);
|
||||||
|
color: #2556ec;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
text-align: center;
|
||||||
|
padding: 80rpx 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,250 @@
|
|||||||
|
<template>
|
||||||
|
<s-layout
|
||||||
|
title="扫码核销"
|
||||||
|
:showLeftButton="false"
|
||||||
|
tabbar="/pages/merchant/scanVerify"
|
||||||
|
navPreset="light"
|
||||||
|
>
|
||||||
|
<template #navRight>
|
||||||
|
<modeSwitch />
|
||||||
|
</template>
|
||||||
|
<view class="page">
|
||||||
|
<view class="seg bg24">
|
||||||
|
<view class="seg-item" :class="{ segActive: tab === 'scan' }" @tap="tab = 'scan'">
|
||||||
|
扫码核销
|
||||||
|
</view>
|
||||||
|
<view class="seg-item" :class="{ segActive: tab === 'input' }" @tap="tab = 'input'">
|
||||||
|
输入取货码
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="panel bg24" v-if="tab === 'scan'">
|
||||||
|
<view class="scan-box">
|
||||||
|
<view class="scan-box__inner">
|
||||||
|
<uni-icons type="scan" size="42" color="#2556EC" />
|
||||||
|
<view class="scan-title">请将用户订单二维码对准扫码框</view>
|
||||||
|
<view class="scan-tip c_999 size24">或点击下方按钮开始扫码</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="btnScan" @tap="startScan">开始扫码</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="panel bg24" v-else>
|
||||||
|
<view class="input-row">
|
||||||
|
<uni-easyinput
|
||||||
|
class="code-input"
|
||||||
|
v-model="manualCode"
|
||||||
|
placeholder="请输入取货码"
|
||||||
|
:inputBorder="false"
|
||||||
|
:styles="{ fontSize: '34rpx' }"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="btnScan" @tap="confirmManual">确认核销</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="records bg24">
|
||||||
|
<view class="records-hd flex-center ju-between">
|
||||||
|
<view class="records-title">近期核销记录</view>
|
||||||
|
<view class="records-link" @tap="clear">清空</view>
|
||||||
|
</view>
|
||||||
|
<view v-for="row in records" :key="row.id" class="record flex-center ju-between">
|
||||||
|
<view class="record-left">
|
||||||
|
<view class="record-code">取货码:{{ row.code }}</view>
|
||||||
|
<view class="record-time c_999 size24">{{ row.time }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="record-right c_999 size24">{{ row.operator }}</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="records.length === 0" class="empty c_999">暂无记录</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</s-layout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import modeSwitch from '@/components/mode_switch/mode_switch.vue';
|
||||||
|
|
||||||
|
const tab = ref('scan');
|
||||||
|
const manualCode = ref('');
|
||||||
|
|
||||||
|
const STORAGE_KEY = 'merchant.verify.records';
|
||||||
|
const records = ref(uni.getStorageSync(STORAGE_KEY) || []);
|
||||||
|
|
||||||
|
const pushRecord = (code) => {
|
||||||
|
const next = [
|
||||||
|
{
|
||||||
|
id: `${Date.now()}-${Math.random()}`,
|
||||||
|
code,
|
||||||
|
time: new Date().toLocaleString(),
|
||||||
|
operator: '当前账号',
|
||||||
|
},
|
||||||
|
...records.value,
|
||||||
|
].slice(0, 20);
|
||||||
|
records.value = next;
|
||||||
|
uni.setStorageSync(STORAGE_KEY, next);
|
||||||
|
};
|
||||||
|
|
||||||
|
const startScan = () => {
|
||||||
|
uni.scanCode({
|
||||||
|
scanType: ['qrCode', 'barCode'],
|
||||||
|
success: (res) => {
|
||||||
|
const code = String(res.result || '').trim();
|
||||||
|
if (!code) {
|
||||||
|
uni.showToast({ title: '未识别到内容', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
pushRecord(code);
|
||||||
|
uni.showToast({ title: '核销成功', icon: 'success' });
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.showToast({ title: '扫码失败', icon: 'none' });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const confirmManual = () => {
|
||||||
|
const code = String(manualCode.value || '').trim();
|
||||||
|
if (!code) {
|
||||||
|
uni.showToast({ title: '请输入取货码', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
pushRecord(code);
|
||||||
|
manualCode.value = '';
|
||||||
|
uni.showToast({ title: '核销成功', icon: 'success' });
|
||||||
|
};
|
||||||
|
|
||||||
|
const clear = () => {
|
||||||
|
records.value = [];
|
||||||
|
uni.setStorageSync(STORAGE_KEY, []);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.page {
|
||||||
|
padding: 24rpx 24rpx 170rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.seg {
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 10rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 18rpx;
|
||||||
|
background: rgba(255, 255, 255, 0.98);
|
||||||
|
}
|
||||||
|
|
||||||
|
.seg-item {
|
||||||
|
flex: 1;
|
||||||
|
height: 76rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.segActive {
|
||||||
|
background: rgba(37, 86, 236, 0.12);
|
||||||
|
color: #2556ec;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel {
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 24rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-bottom: 18rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scan-box {
|
||||||
|
border-radius: 24rpx;
|
||||||
|
border: 2rpx dashed rgba(37, 86, 236, 0.35);
|
||||||
|
height: 360rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
background: rgba(37, 86, 236, 0.04);
|
||||||
|
}
|
||||||
|
|
||||||
|
.scan-box__inner {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scan-title {
|
||||||
|
margin-top: 18rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scan-tip {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnScan {
|
||||||
|
height: 92rpx;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background: #2556ec;
|
||||||
|
color: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-row {
|
||||||
|
border-radius: 24rpx;
|
||||||
|
background: #f6f7fb;
|
||||||
|
padding: 18rpx 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.code-input .uni-easyinput__content) {
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.records {
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 18rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.records-hd {
|
||||||
|
padding-bottom: 12rpx;
|
||||||
|
border-bottom: 2rpx solid #f1f2f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.records-title {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #222;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.records-link {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #2556ec;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record {
|
||||||
|
padding: 16rpx 0;
|
||||||
|
border-bottom: 2rpx solid #f6f7fb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-code {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #333;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
text-align: center;
|
||||||
|
padding: 70rpx 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,240 @@
|
|||||||
|
<template>
|
||||||
|
<s-layout
|
||||||
|
title="网店管理"
|
||||||
|
:showLeftButton="false"
|
||||||
|
tabbar="/pages/merchant/storeManage"
|
||||||
|
navPreset="light"
|
||||||
|
>
|
||||||
|
<template #navRight>
|
||||||
|
<modeSwitch />
|
||||||
|
</template>
|
||||||
|
<view class="page">
|
||||||
|
<view class="stats">
|
||||||
|
<view class="stat bg24">
|
||||||
|
<view class="stat-label c_999 size24">总网店数</view>
|
||||||
|
<view class="stat-value">{{ stats.total }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="stat bg24">
|
||||||
|
<view class="stat-label c_999 size24">营业中</view>
|
||||||
|
<view class="stat-value cGreen">{{ stats.open }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="stat bg24">
|
||||||
|
<view class="stat-label c_999 size24">今日新增订单</view>
|
||||||
|
<view class="stat-value cOrange">{{ stats.todayOrders }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="tool-row bg24">
|
||||||
|
<view class="search-box flex-center flex1">
|
||||||
|
<uni-icons type="search" size="18" color="#8a8a8a" />
|
||||||
|
<uni-easyinput
|
||||||
|
class="search-input flex1"
|
||||||
|
v-model="keyword"
|
||||||
|
placeholder="搜索网店名称/编号"
|
||||||
|
:inputBorder="false"
|
||||||
|
:styles="{ fontSize: '28rpx' }"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="btnAdd" @tap="addStore">+ 新增网店</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="table bg24">
|
||||||
|
<view class="thead flex-center">
|
||||||
|
<view class="th w1">店名</view>
|
||||||
|
<view class="th w2">编号</view>
|
||||||
|
<view class="th w3">状态</view>
|
||||||
|
<view class="th w4">操作</view>
|
||||||
|
</view>
|
||||||
|
<view v-for="row in filteredList" :key="row.id" class="tr flex-center">
|
||||||
|
<view class="td w1 lineOne">{{ row.name }}</view>
|
||||||
|
<view class="td w2 c_999">{{ row.code }}</view>
|
||||||
|
<view class="td w3">
|
||||||
|
<view class="badge" :class="{ badgeOpen: row.status === 'open' }">
|
||||||
|
{{ row.status === 'open' ? '营业中' : '休息中' }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="td w4 flex-center ju-flex-end">
|
||||||
|
<view class="op opPrimary" @tap="edit(row)">编辑</view>
|
||||||
|
<view class="op opDanger" @tap="toggle(row)">{{ row.status === 'open' ? '停用' : '启用' }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="filteredList.length === 0" class="empty c_999">暂无数据</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</s-layout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import modeSwitch from '@/components/mode_switch/mode_switch.vue';
|
||||||
|
|
||||||
|
const stats = ref({
|
||||||
|
total: 28,
|
||||||
|
open: 24,
|
||||||
|
todayOrders: 156,
|
||||||
|
});
|
||||||
|
|
||||||
|
const keyword = ref('');
|
||||||
|
|
||||||
|
const list = ref([
|
||||||
|
{ id: 1, name: '虹桥枢纽自提站', code: 'SP-2024001', status: 'open' },
|
||||||
|
{ id: 2, name: '静安寺中心站', code: 'SP-2024002', status: 'open' },
|
||||||
|
{ id: 3, name: '徐家汇社区站', code: 'SP-2024003', status: 'rest' },
|
||||||
|
{ id: 4, name: '五角场站', code: 'SP-2024004', status: 'open' },
|
||||||
|
]);
|
||||||
|
|
||||||
|
const filteredList = computed(() => {
|
||||||
|
const k = String(keyword.value || '').trim();
|
||||||
|
if (!k) return list.value;
|
||||||
|
return list.value.filter((row) => String(row.name).includes(k) || String(row.code).includes(k));
|
||||||
|
});
|
||||||
|
|
||||||
|
const addStore = () => {
|
||||||
|
uni.showToast({ title: '功能开发中', icon: 'none' });
|
||||||
|
};
|
||||||
|
|
||||||
|
const edit = () => {
|
||||||
|
uni.showToast({ title: '功能开发中', icon: 'none' });
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggle = (row) => {
|
||||||
|
row.status = row.status === 'open' ? 'rest' : 'open';
|
||||||
|
uni.showToast({ title: '已更新', icon: 'success' });
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.page {
|
||||||
|
padding: 24rpx 24rpx 170rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stats {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr 1fr;
|
||||||
|
gap: 16rpx;
|
||||||
|
margin-bottom: 18rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat {
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 18rpx 18rpx 16rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-value {
|
||||||
|
margin-top: 8rpx;
|
||||||
|
font-size: 44rpx;
|
||||||
|
font-weight: 800;
|
||||||
|
color: #222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cGreen {
|
||||||
|
color: #14a44d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cOrange {
|
||||||
|
color: #ff7a00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tool-row {
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 16rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 14rpx;
|
||||||
|
margin-bottom: 18rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-box {
|
||||||
|
border-radius: 18rpx;
|
||||||
|
background: #f6f7fb;
|
||||||
|
padding: 6rpx 16rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.search-input .uni-easyinput__content) {
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnAdd {
|
||||||
|
padding: 14rpx 18rpx;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
background: #2556ec;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
border-radius: 24rpx;
|
||||||
|
padding: 16rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thead {
|
||||||
|
padding: 10rpx 0;
|
||||||
|
border-bottom: 2rpx solid #f1f2f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tr {
|
||||||
|
padding: 18rpx 0;
|
||||||
|
border-bottom: 2rpx solid #f6f7fb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.th,
|
||||||
|
.td {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w1 {
|
||||||
|
width: 34%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w2 {
|
||||||
|
width: 26%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w3 {
|
||||||
|
width: 18%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w4 {
|
||||||
|
width: 22%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
padding: 6rpx 12rpx;
|
||||||
|
border-radius: 999rpx;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #ff7a00;
|
||||||
|
background: rgba(255, 122, 0, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.badgeOpen {
|
||||||
|
color: #14a44d;
|
||||||
|
background: rgba(20, 164, 77, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.op {
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-left: 14rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.opPrimary {
|
||||||
|
color: #2556ec;
|
||||||
|
}
|
||||||
|
|
||||||
|
.opDanger {
|
||||||
|
color: #ff4d4f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty {
|
||||||
|
text-align: center;
|
||||||
|
padding: 80rpx 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -71,7 +71,8 @@
|
|||||||
<!-- 全局快捷入口 -->
|
<!-- 全局快捷入口 -->
|
||||||
<s-menu-tools />
|
<s-menu-tools />
|
||||||
</view>
|
</view>
|
||||||
<cardTabber v-if="props.tabbar" :path="tabbarPath" />
|
<merchantTabber v-if="props.tabbar && isMerchantMode" :path="tabbarPath" />
|
||||||
|
<cardTabber v-else-if="props.tabbar" :path="tabbarPath" />
|
||||||
|
|
||||||
<view v-if="showUpdateProgress" class="update-progress-mask">
|
<view v-if="showUpdateProgress" class="update-progress-mask">
|
||||||
<view class="update-progress-card">
|
<view class="update-progress-card">
|
||||||
@@ -92,6 +93,7 @@
|
|||||||
import cardNavbar from '@/components/card_navbar/card_navbar';
|
import cardNavbar from '@/components/card_navbar/card_navbar';
|
||||||
import transparentNavbar from '@/components/card_navbar/transparent_navbar';
|
import transparentNavbar from '@/components/card_navbar/transparent_navbar';
|
||||||
import cardTabber from '@/components/card_tabber/card_tabber.vue';
|
import cardTabber from '@/components/card_tabber/card_tabber.vue';
|
||||||
|
import merchantTabber from '@/components/merchant_tabber/merchant_tabber.vue';
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
const emits = defineEmits(['onClickLeft']);
|
const emits = defineEmits(['onClickLeft']);
|
||||||
const instance = getCurrentInstance();
|
const instance = getCurrentInstance();
|
||||||
@@ -186,6 +188,7 @@
|
|||||||
const userStore = sheep.$store('user');
|
const userStore = sheep.$store('user');
|
||||||
const appStore = sheep.$store('app');
|
const appStore = sheep.$store('app');
|
||||||
const modalStore = sheep.$store('modal');
|
const modalStore = sheep.$store('modal');
|
||||||
|
const isMerchantMode = computed(() => appStore.bizMode === 'merchant');
|
||||||
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
|
||||||
let paddingTop = ref();
|
let paddingTop = ref();
|
||||||
paddingTop.value = statusBarHeight + uni.upx2px(88);
|
paddingTop.value = statusBarHeight + uni.upx2px(88);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ const toErrorPage = (errCode = '', errMsg = '') => {
|
|||||||
const app = defineStore({
|
const app = defineStore({
|
||||||
id: 'app',
|
id: 'app',
|
||||||
state: () => ({
|
state: () => ({
|
||||||
|
bizMode: 'user',
|
||||||
info: {
|
info: {
|
||||||
// 应用信息
|
// 应用信息
|
||||||
name: '', // 商城名称
|
name: '', // 商城名称
|
||||||
@@ -61,6 +62,9 @@ const app = defineStore({
|
|||||||
has_wechat_trade_managed: 0, // 小程序发货信息管理 0 没有 || 1 有
|
has_wechat_trade_managed: 0, // 小程序发货信息管理 0 没有 || 1 有
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
|
setBizMode(mode = 'user') {
|
||||||
|
this.bizMode = mode === 'merchant' ? 'merchant' : 'user';
|
||||||
|
},
|
||||||
// 获取Shopro应用配置和模板
|
// 获取Shopro应用配置和模板
|
||||||
async init(templateId = null) {
|
async init(templateId = null) {
|
||||||
// 检查网络
|
// 检查网络
|
||||||
|
|||||||
Reference in New Issue
Block a user