Initial commit - full huishou project

This commit is contained in:
jiapengyu
2026-07-27 14:07:26 +08:00
commit 60790ad1b3
39127 changed files with 5989265 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "login",
setup(__props) {
const phone = common_vendor.ref("");
const password = common_vendor.ref("");
const rememberMe = common_vendor.ref(false);
const isLoading = common_vendor.ref(false);
const mockUsers = [
{ id: "1", name: "管理员", phone: "13800138000", role: "admin", createTime: "2024-01-01" },
{ id: "2", name: "回收员小王", phone: "18698102228", role: "collector", createTime: "2024-01-15" }
];
const login = async () => {
if (!phone.value) {
common_vendor.index.showToast({ title: "请输入手机号", icon: "none" });
return;
}
if (phone.value.length !== 11) {
common_vendor.index.showToast({ title: "请输入正确的手机号", icon: "none" });
return;
}
if (!password.value) {
common_vendor.index.showToast({ title: "请输入密码", icon: "none" });
return;
}
isLoading.value = true;
try {
const user = mockUsers.find((u) => u.phone === phone.value && u.role === "collector");
console.log("Available users:", JSON.stringify(mockUsers));
console.log("Input phone:", phone.value);
console.log("Found user:", JSON.stringify(user));
if (user) {
if (password.value === "123456") {
common_vendor.index.setStorageSync("collector_login", true);
common_vendor.index.setStorageSync("collector_info", JSON.stringify(user));
common_vendor.index.showToast({ title: "登录成功", icon: "success" });
setTimeout(() => {
common_vendor.index.switchTab({ url: "/pages/index/index" });
}, 1500);
} else {
common_vendor.index.showToast({ title: "密码错误", icon: "none" });
}
} else {
common_vendor.index.showToast({ title: "用户不存在", icon: "none" });
}
} catch (error) {
console.error("Login error:", error);
common_vendor.index.showToast({ title: "登录失败", icon: "none" });
} finally {
isLoading.value = false;
}
};
const forgotPassword = () => {
common_vendor.index.showToast({ title: "请联系管理员重置密码", icon: "none" });
};
return (_ctx, _cache) => {
return common_vendor.e({
a: common_assets._imports_0,
b: phone.value,
c: common_vendor.o(($event) => phone.value = $event.detail.value),
d: password.value,
e: common_vendor.o(($event) => password.value = $event.detail.value),
f: rememberMe.value
}, rememberMe.value ? {} : {}, {
g: rememberMe.value ? 1 : "",
h: common_vendor.o(($event) => rememberMe.value = !rememberMe.value),
i: isLoading.value
}, isLoading.value ? {} : {}, {
j: common_vendor.o(login),
k: isLoading.value ? 1 : "",
l: common_vendor.o(forgotPassword)
});
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ebed24a8"]]);
wx.createPage(MiniProgramPage);
+5
View File
@@ -0,0 +1,5 @@
{
"navigationStyle": "custom",
"navigationBarTitleText": "登录",
"usingComponents": {}
}
+1
View File
@@ -0,0 +1 @@
<view class="login-container data-v-ebed24a8"><view class="login-box data-v-ebed24a8"><image class="login-logo data-v-ebed24a8" src="{{a}}" mode="aspectFit"/><view class="login-title data-v-ebed24a8">易分宝回收</view><view class="login-subtitle data-v-ebed24a8">回收员登录</view><view class="form-group data-v-ebed24a8"><view class="form-label data-v-ebed24a8">手机号</view><input type="text" class="form-input data-v-ebed24a8" placeholder="请输入手机号" maxlength="11" value="{{b}}" bindinput="{{c}}"/></view><view class="form-group data-v-ebed24a8"><view class="form-label data-v-ebed24a8">密码</view><input type="password" class="form-input data-v-ebed24a8" placeholder="请输入密码" value="{{d}}" bindinput="{{e}}"/></view><view class="form-group data-v-ebed24a8"><view class="checkbox data-v-ebed24a8" bindtap="{{h}}"><view class="{{['checkbox-box', 'data-v-ebed24a8', g && 'checked']}}"><text wx:if="{{f}}" class="data-v-ebed24a8">✓</text></view><text class="data-v-ebed24a8">记住密码</text></view></view><view bindtap="{{j}}" class="{{['login-btn', 'data-v-ebed24a8', k && 'disabled']}}"><text wx:if="{{i}}" class="data-v-ebed24a8">登录中...</text><text wx:else class="data-v-ebed24a8">登录</text></view><view class="forgot-link data-v-ebed24a8" bindtap="{{l}}"><text class="data-v-ebed24a8">忘记密码?</text></view></view></view>
+106
View File
@@ -0,0 +1,106 @@
.login-container.data-v-ebed24a8 {
min-height: 100vh;
background: linear-gradient(135deg, #3366ff 0%, #254edb 100%);
display: flex;
align-items: center;
justify-content: center;
padding: 32rpx;
}
.login-box.data-v-ebed24a8 {
width: 100%;
max-width: 600rpx;
background: #fff;
border-radius: 24rpx;
padding: 64rpx 48rpx;
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.15);
}
.login-logo.data-v-ebed24a8 {
width: 160rpx;
height: 160rpx;
margin: 0 auto 24rpx;
display: block;
}
.login-title.data-v-ebed24a8 {
font-size: 40rpx;
font-weight: 700;
color: #333;
text-align: center;
margin-bottom: 8rpx;
}
.login-subtitle.data-v-ebed24a8 {
font-size: 28rpx;
color: #999;
text-align: center;
margin-bottom: 48rpx;
}
.form-group.data-v-ebed24a8 {
margin-bottom: 32rpx;
}
.form-label.data-v-ebed24a8 {
font-size: 28rpx;
color: #666;
margin-bottom: 12rpx;
}
.form-input.data-v-ebed24a8 {
width: 100%;
height: 88rpx;
border: 2rpx solid #e5e7eb;
border-radius: 12rpx;
padding: 0 24rpx;
font-size: 32rpx;
box-sizing: border-box;
}
.form-input.data-v-ebed24a8:focus {
border-color: #3366ff;
}
.checkbox.data-v-ebed24a8 {
display: flex;
align-items: center;
font-size: 26rpx;
color: #666;
}
.checkbox-box.data-v-ebed24a8 {
width: 40rpx;
height: 40rpx;
border: 2rpx solid #ccc;
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 12rpx;
font-size: 24rpx;
color: #fff;
}
.checkbox-box.checked.data-v-ebed24a8 {
background: #3366ff;
border-color: #3366ff;
}
.login-btn.data-v-ebed24a8 {
width: 100%;
height: 88rpx;
background: linear-gradient(135deg, #3366ff 0%, #254edb 100%);
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
margin-top: 16rpx;
}
.login-btn text.data-v-ebed24a8 {
font-size: 32rpx;
font-weight: 600;
color: #fff;
}
.login-btn.data-v-ebed24a8:active:not(.disabled) {
opacity: 0.9;
}
.login-btn.disabled.data-v-ebed24a8 {
opacity: 0.6;
}
.forgot-link.data-v-ebed24a8 {
text-align: center;
margin-top: 32rpx;
}
.forgot-link text.data-v-ebed24a8 {
font-size: 26rpx;
color: #3366ff;
}
+46
View File
@@ -0,0 +1,46 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "profile",
setup(__props) {
const orders = common_vendor.ref([]);
const todayCount = common_vendor.computed(() => {
const today = (/* @__PURE__ */ new Date()).toDateString();
return orders.value.filter((o) => new Date(o.timestamp).toDateString() === today).length;
});
const todayAmount = common_vendor.computed(() => {
const today = (/* @__PURE__ */ new Date()).toDateString();
return orders.value.filter((o) => new Date(o.timestamp).toDateString() === today).reduce((sum, o) => sum + o.totalAmount, 0);
});
const totalCount = common_vendor.computed(() => orders.value.length);
const goToPrice = () => {
common_vendor.index.navigateTo({ url: "/pages/price/price" });
};
const goToBluetooth = () => {
common_vendor.index.navigateTo({ url: "/pages/bluetooth/bluetooth" });
};
const showAbout = () => {
common_vendor.index.showModal({
title: "关于我们",
content: "易分宝现场回收 v1.0.0\n\n致力于为回收行业提供便捷的现场回收解决方案",
showCancel: false
});
};
common_vendor.onMounted(() => {
const data = common_vendor.index.getStorageSync("orders");
orders.value = data ? JSON.parse(data) : [];
});
return (_ctx, _cache) => {
return {
a: common_vendor.t(todayCount.value),
b: common_vendor.t(todayAmount.value.toFixed(2)),
c: common_vendor.t(totalCount.value),
d: common_vendor.o(goToPrice),
e: common_vendor.o(goToBluetooth),
f: common_vendor.o(showAbout)
};
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f6b4f04d"]]);
wx.createPage(MiniProgramPage);
+6
View File
@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "个人中心",
"navigationBarBackgroundColor": "#3366ff",
"navigationBarTextStyle": "white",
"usingComponents": {}
}
+1
View File
@@ -0,0 +1 @@
<view class="container data-v-f6b4f04d"><view class="user-card data-v-f6b4f04d"><view class="avatar data-v-f6b4f04d"><text class="avatar-icon data-v-f6b4f04d">👤</text></view><view class="user-info data-v-f6b4f04d"><text class="user-name data-v-f6b4f04d">回收员</text><text class="user-id data-v-f6b4f04d">ID: YFB20260514</text></view><view class="edit-btn data-v-f6b4f04d"><text class="data-v-f6b4f04d">✏️</text></view></view><view class="stats-card data-v-f6b4f04d"><view class="stat-item data-v-f6b4f04d"><text class="stat-value data-v-f6b4f04d">{{a}}</text><text class="stat-label data-v-f6b4f04d">今日订单</text></view><view class="stat-divider data-v-f6b4f04d"></view><view class="stat-item data-v-f6b4f04d"><text class="stat-value data-v-f6b4f04d">¥{{b}}</text><text class="stat-label data-v-f6b4f04d">今日收入</text></view><view class="stat-divider data-v-f6b4f04d"></view><view class="stat-item data-v-f6b4f04d"><text class="stat-value data-v-f6b4f04d">{{c}}</text><text class="stat-label data-v-f6b4f04d">累计订单</text></view></view><view class="menu-card data-v-f6b4f04d"><view class="menu-title data-v-f6b4f04d">功能菜单</view><view class="menu-list data-v-f6b4f04d"><view class="menu-item data-v-f6b4f04d" bindtap="{{d}}"><text class="menu-icon data-v-f6b4f04d">📊</text><text class="menu-text data-v-f6b4f04d">价格查询</text><text class="menu-arrow data-v-f6b4f04d"></text></view><view class="menu-item data-v-f6b4f04d" bindtap="{{e}}"><text class="menu-icon data-v-f6b4f04d">📱</text><text class="menu-text data-v-f6b4f04d">蓝牙设置</text><text class="menu-arrow data-v-f6b4f04d"></text></view><view class="menu-item data-v-f6b4f04d" bindtap="{{f}}"><text class="menu-icon data-v-f6b4f04d">️</text><text class="menu-text data-v-f6b4f04d">关于我们</text><text class="menu-arrow data-v-f6b4f04d"></text></view></view></view><view class="version-info data-v-f6b4f04d"><text class="version-text data-v-f6b4f04d">易分宝现场回?v1.0.0</text></view></view>
+130
View File
@@ -0,0 +1,130 @@
.container.data-v-f6b4f04d {
min-height: 100vh;
background: #f5f5f5;
padding: 32rpx;
}
.user-card.data-v-f6b4f04d {
background: linear-gradient(135deg, #3366ff 0%, #254edb 100%);
border-radius: 20rpx;
padding: 32rpx;
display: flex;
align-items: center;
margin-bottom: 24rpx;
}
.avatar.data-v-f6b4f04d {
width: 100rpx;
height: 100rpx;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20rpx;
}
.avatar-icon.data-v-f6b4f04d {
font-size: 56rpx;
}
.user-info.data-v-f6b4f04d {
flex: 1;
display: flex;
flex-direction: column;
}
.user-name.data-v-f6b4f04d {
font-size: 36rpx;
font-weight: 600;
color: #fff;
margin-bottom: 8rpx;
}
.user-id.data-v-f6b4f04d {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.8);
}
.edit-btn.data-v-f6b4f04d {
width: 60rpx;
height: 60rpx;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
color: #fff;
}
.stats-card.data-v-f6b4f04d {
background: #fff;
border-radius: 16rpx;
padding: 32rpx;
display: flex;
justify-content: space-around;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
}
.stat-item.data-v-f6b4f04d {
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
}
.stat-value.data-v-f6b4f04d {
font-size: 48rpx;
font-weight: 700;
color: #3366ff;
margin-bottom: 8rpx;
}
.stat-label.data-v-f6b4f04d {
font-size: 24rpx;
color: #999;
}
.stat-divider.data-v-f6b4f04d {
width: 1rpx;
background: #f0f0f0;
}
.menu-card.data-v-f6b4f04d {
background: #fff;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
}
.menu-title.data-v-f6b4f04d {
padding: 24rpx;
font-size: 30rpx;
font-weight: 600;
color: #333;
border-bottom: 1rpx solid #f0f0f0;
}
.menu-list.data-v-f6b4f04d {
padding: 0 24rpx;
}
.menu-item.data-v-f6b4f04d {
display: flex;
align-items: center;
padding: 28rpx 0;
border-bottom: 1rpx solid #f8f9fa;
}
.menu-item.data-v-f6b4f04d:last-child {
border-bottom: none;
}
.menu-item.data-v-f6b4f04d:active {
opacity: 0.7;
}
.menu-icon.data-v-f6b4f04d {
font-size: 40rpx;
margin-right: 20rpx;
}
.menu-text.data-v-f6b4f04d {
flex: 1;
font-size: 30rpx;
color: #333;
}
.menu-arrow.data-v-f6b4f04d {
font-size: 36rpx;
color: #ccc;
}
.version-info.data-v-f6b4f04d {
text-align: center;
padding: 48rpx;
}
.version-text.data-v-f6b4f04d {
font-size: 24rpx;
color: #999;
}