适配微信小程序

This commit is contained in:
zhonghua.li
2026-04-17 09:41:37 +08:00
parent 18455a311d
commit 36b8784bc1
59 changed files with 650 additions and 586 deletions

View File

@@ -4,24 +4,24 @@
<view class="category-section two-column">
<view class="category-header">
<text class="category-icon">🏷</text>
<text class="category-title">接待页面标签</text>
<text class="category-title">接待</text>
</view>
<view class="function-grid">
<view class="function-item" @click="openReceptionTab('reception')">
<view class="function-icon">🛎</view>
<text class="function-name">开始接待</text>
<text class="function-desc">进入接待页并切到开始接待</text>
<text class="function-desc"></text>
</view>
<view class="function-item" @click="openReceptionTab('status')">
<view class="function-icon">📌</view>
<text class="function-name">服务中</text>
<text class="function-desc">进入接待页并切到服务中</text>
<text class="function-desc"></text>
</view>
<view class="function-item" @click="openReceptionTab('tag')">
<view class="function-icon">🗂</view>
<text class="function-name">标签管理</text>
<text class="function-desc">进入接待页并切到标签管理</text>
<text class="function-desc"></text>
</view>
</view>
</view>
@@ -29,18 +29,18 @@
<view class="category-section two-column">
<view class="category-header">
<text class="category-icon">👤</text>
<text class="category-title">客户页面标签</text>
<text class="category-title">客户</text>
</view>
<view class="function-grid">
<view class="function-item" @click="openCustomerTab('service')">
<view class="function-icon">📝</view>
<text class="function-name">服务记录</text>
<text class="function-desc">进入客户页并切到服务记录</text>
<text class="function-desc"></text>
</view>
<view class="function-item" @click="openCustomerTab('customer')">
<view class="function-icon">👥</view>
<text class="function-name">客户</text>
<text class="function-desc">进入客户页并切到客户列表</text>
<text class="function-desc"></text>
</view>
</view>
</view>
@@ -62,32 +62,24 @@ export default {
},
},
methods: {
/** 与「服务记录」一致:直跳分包页 + query避免主包宿主页在微信上的 ref/占位问题 */
openReceptionTab(tab) {
this.switchTabWithQuery('/pages/furniture_reception/furniture_reception', tab);
const allowed = ['status', 'reception', 'tag'];
if (!allowed.includes(tab)) {
return;
}
const url = `/pages-subpackage/furniture_reception/furniture_reception_entry?tab=${encodeURIComponent(tab)}`;
uni.navigateTo({
url,
fail: () => {
uni.showToast({ title: '跳转接待页失败', icon: 'none' });
},
});
},
openCustomerTab(tab) {
const url = `/pages-subpackage/furniture_customer/furniture_customer?tab=${tab}`;
uni.navigateTo({ url });
},
switchTabWithQuery(basePath, tab) {
if (basePath === '/pages/furniture_reception/furniture_reception') {
uni.setStorageSync('workbench-reception-tab', tab);
uni.navigateTo({
url: basePath,
fail: () => {
uni.showToast({ title: '跳转接待页失败', icon: 'none' });
},
});
return;
}
uni.switchTab({
url: basePath,
fail: () => {
const fallbackUrl = `${basePath}?tab=${tab}`;
uni.navigateTo({ url: fallbackUrl });
},
});
},
},
};
</script>