上传代码

This commit is contained in:
2025-08-18 09:57:10 +08:00
commit ff52db1edc
560 changed files with 102250 additions and 0 deletions

View File

@ -0,0 +1,119 @@
/* 页面样式 */
.example-body.data-v-ae7e1909 {
background-color: #fff;
padding: 10px;
}
.page.data-v-ae7e1909 {
background-color: #fff;
padding: 20px;
}
/* 返回按钮样式 */
.back-button.data-v-ae7e1909 {
position: absolute;
top: 20px;
left: 20px;
}
/* 表单项样式 */
.form-item.data-v-ae7e1909 {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
border-bottom: 1px solid #ddd;
padding-bottom: 10px;
}
.label.data-v-ae7e1909 {
font-size: 16px;
color: #000;
}
.value.data-v-ae7e1909 {
font-size: 16px;
color: #666;
}
/* 上传区域样式 */
.upload-section.data-v-ae7e1909 {
margin-top: 20px;
display: flex;
flex-direction: column;
/* 改为垂直排列 */
gap: 20px;
/* 增加间距 */
}
.upload-item.data-v-ae7e1909 {
background-color: #ecf5ff;
border: 2px dashed #a6b2da;
border-radius: 10px;
padding: 10px;
text-align: center;
width: 100%;
/* 设置宽度为100% */
box-sizing: border-box;
position: relative;
height: 200px;
/* 固定高度 */
}
.upload-item .upload-icon-text.data-v-ae7e1909 {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.upload-item image.data-v-ae7e1909 {
width: 100%;
height: 100%;
object-fit: cover;
/* 确保图片覆盖容器并保持比例 */
border-radius: 8px;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.upload-text.data-v-ae7e1909 {
font-size: 14px;
color: #8cb7fd;
}
/* 提交按钮样式 */
.submit-button.data-v-ae7e1909 {
width: 100%;
height: 50px;
background-color: #5e7dec;
border: none;
border-radius: 10px;
color: #fff;
font-size: 16px;
margin-top: 20px;
}
/* 提交记录样式 */
.submit.data-v-ae7e1909 {
margin-top: 20px;
padding: 20px;
border: 1px solid #ddd;
border-radius: 10px;
background-color: #f9f9f9;
}
.submit-title.data-v-ae7e1909 {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
.submit-bankCard.data-v-ae7e1909 {
font-size: 16px;
color: #333;
margin-bottom: 10px;
}
.submit-frontIdCard image.data-v-ae7e1909,
.submit-backIdCard image.data-v-ae7e1909 {
width: 100%;
height: auto;
border-radius: 8px;
max-height: 300px; /* 设置最大高度以防图片过大 */
object-fit: contain; /* 确保图片内容完整显示 */
}

View File

@ -0,0 +1 @@
<view class="page data-v-ae7e1909"><view class="form-item data-v-ae7e1909"><view class="label data-v-ae7e1909">银行卡号</view><view class="value data-v-ae7e1909"><input class="data-v-ae7e1909" type="text" placeholder="请输入银行卡号" value="{{a}}" onInput="{{b}}"/></view></view><view class="upload-section data-v-ae7e1909"><view class="upload-item data-v-ae7e1909" onTap="{{g}}"><view a:if="{{c}}" class="upload-icon-text data-v-ae7e1909"><uni-icons class="data-v-ae7e1909" u-i="ae7e1909-0" onVI="__l" u-p="{{d||''}}"></uni-icons><view class="upload-text data-v-ae7e1909">点击上传身份证国徽面</view></view><image a:if="{{e}}" class="data-v-ae7e1909" src="{{f}}"></image></view><view class="upload-item data-v-ae7e1909" onTap="{{l}}"><view a:if="{{h}}" class="upload-icon-text data-v-ae7e1909"><uni-icons class="data-v-ae7e1909" u-i="ae7e1909-1" onVI="__l" u-p="{{i||''}}"></uni-icons><view class="upload-text data-v-ae7e1909">点击上传身份证人像面</view></view><image a:if="{{j}}" class="data-v-ae7e1909" src="{{k}}"></image></view></view><button class="submit-button data-v-ae7e1909" onTap="{{m}}">提交</button><view a:if="{{n}}" class="submit data-v-ae7e1909"><view class="submit-title data-v-ae7e1909"> 提交记录 </view><view class="submit-bankCard data-v-ae7e1909">{{o}}</view><view class="submit-frontIdCard data-v-ae7e1909"><view class="submit-title data-v-ae7e1909"> 身份证正面 </view><image class="data-v-ae7e1909" src="{{p}}" mode="widthFix"></image></view><view class="submit-backIdCard data-v-ae7e1909"><view class="submit-title data-v-ae7e1909"> 身份证背面 </view><image class="data-v-ae7e1909" src="{{q}}" mode="widthFix"></image></view></view></view>

View File

@ -0,0 +1,160 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
const _sfc_main = {
data() {
return {
photoSrcFront: "",
// 徽面照片路径
photoSrcBack: "",
// 人像面照片路径
bankCard: "",
// 银行卡号
submitRecord: {},
// 修改为对象
currentUser: common_vendor.index.getStorageSync("currentUser")
};
},
onLoad() {
this.getAuditRecords();
},
methods: {
takePhoto(side) {
const that = this;
common_vendor.index.chooseImage({
count: 1,
sourceType: ["camera"],
success(res) {
if (side === "front") {
that.photoSrcFront = res.tempFilePaths[0];
that.uploadPhoto(res.tempFilePaths[0], "front");
} else if (side === "back") {
that.photoSrcBack = res.tempFilePaths[0];
that.uploadPhoto(res.tempFilePaths[0], "back");
}
}
});
},
uploadPhoto(filePath, side) {
common_vendor.index.uploadFile({
url: API_api.apiImageUrl + "/api/file/upload/server",
filePath,
name: "file",
formData: {
biz: "card"
},
success: (res) => {
console.log("上传成功:", res);
},
fail: (err) => {
console.error("上传失败:", err);
}
});
},
submit() {
const data = {
backIdCard: this.photoSrcBack,
bankCard: this.bankCard,
errandId: this.currentUser.id,
frontIdCard: this.photoSrcFront
};
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errandAuth/add",
method: "POST",
data,
header: {
"Content-Type": "application/json",
// 确保设置正确的 Content-Type
"cookie": common_vendor.index.getStorageSync("cookie") || ""
},
success: (res) => {
console.log("提交成功:", res);
if (res.data.code === 4e4) {
common_vendor.index.showToast({
title: res.data.description,
icon: "fail",
duration: 2e3
});
} else if (res.data.code === 0) {
common_vendor.index.showToast({
title: "提交成功",
icon: "success",
duration: 2e3
});
}
},
fail: (err) => {
console.error("提交失败:", err);
}
});
},
getAuditRecords() {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errandAuth/get/my",
method: "POST",
header: {
"Content-Type": "application/json",
// 确保设置正确的 Content-Type
"cookie": common_vendor.index.getStorageSync("cookie") || ""
},
success: (res) => {
console.log(res);
if (res.data.code === 0 && res.data.data) {
this.submitRecord = res.data.data;
}
},
fail: (err) => {
console.error("获取审核记录失败:", err);
}
});
}
}
};
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
_easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
_easycom_uni_icons();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: $data.bankCard,
b: common_vendor.o(($event) => $data.bankCard = $event.detail.value),
c: !$data.photoSrcFront
}, !$data.photoSrcFront ? {
d: common_vendor.p({
type: "plusempty",
size: "30",
color: "#6a7cbf"
})
} : {}, {
e: $data.photoSrcFront
}, $data.photoSrcFront ? {
f: $data.photoSrcFront
} : {}, {
g: common_vendor.o(($event) => $options.takePhoto("front")),
h: !$data.photoSrcBack
}, !$data.photoSrcBack ? {
i: common_vendor.p({
type: "plusempty",
size: "30",
color: "#6a7cbf"
})
} : {}, {
j: $data.photoSrcBack
}, $data.photoSrcBack ? {
k: $data.photoSrcBack
} : {}, {
l: common_vendor.o(($event) => $options.takePhoto("back")),
m: common_vendor.o((...args) => $options.submit && $options.submit(...args)),
n: $data.submitRecord
}, $data.submitRecord ? {
o: common_vendor.t($data.submitRecord.bankCard),
p: $data.submitRecord.frontIdCard,
q: $data.submitRecord.backIdCard
} : {});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ae7e1909"]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,7 @@
{
"defaultTitle": "身份认证",
"titleBarColor": "#5e7dec",
"usingComponents": {
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
}
}

View File

@ -0,0 +1,86 @@
.user-profile.data-v-983df345 {
background: linear-gradient(to bottom, #5e7dec,white);
padding: 20px;
border-radius: 8px;
display: flex;
flex-direction: column;
align-items: center;
height: 100vh;
}
.avatar-container.data-v-983df345 {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 20px;
}
.avatar-container .avatar.data-v-983df345 {
width: 100px;
height: 100px;
border-radius: 50%;
object-fit: cover;
}
.edit-text.data-v-983df345 {
color: white;
margin-top: 10px;
}
.form-container.data-v-983df345 {
background-color: white;
padding: 20px;
border-radius: 8px;
width: 90%;
max-width: 600px;
}
.form-item.data-v-983df345 {
display: flex;
align-items: center;
margin-bottom: 15px;
}
.label.data-v-983df345 {
width: 35px;
text-align: right;
margin-right: 10px;
}
.gender-item.data-v-983df345 {
align-items: flex-start;
}
/* 确保性别选项水平显示 */
.gender-container.data-v-983df345 {
display: flex;
flex-direction: row; /* 默认值为row这里明确指定是为了清晰 */
}
.gender-container label.data-v-983df345 {
margin-right: 10px;
display: flex;
align-items: center;
}
.input-field.data-v-983df345 {
flex: 1;
box-sizing: border-box;
border: 1px solid #ddd;
border-radius: 4px;
height: 45px;
border-radius: 15px;
}
.save-button.data-v-983df345 {
background-color: transparent; /* 设置背景为透明 */
color: white;
padding: 0px 20px; /* 增加内边距以便按钮看起来更舒适 */
border: 2px solid #5e7dec; /* 添加边框以增强立体感 */
border-radius: 20px;
margin-top: 20px;
width: 100%;
max-width: 300px;
cursor: pointer;
transition: all 0.3s ease; /* 应用到所有属性的过渡效果 */
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 添加阴影以增加立体感 */
}
.save-button.data-v-983df345:hover {
background-color: rgba(94, 125, 236, 0.1); /* 鼠标悬停时轻微改变背景颜色 */
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2); /* 增强阴影效果 */
}
.save-button.data-v-983df345:active {
transform: translateY(2px); /* 点击时向下移动,模拟按下的效果 */
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 减弱阴影效果 */
}

View File

@ -0,0 +1 @@
<view class="user-profile data-v-983df345"><view class="avatar-container data-v-983df345"><image src="{{a}}" mode="aspectFill" class="avatar data-v-983df345" onTap="{{b}}"></image><text class="edit-text data-v-983df345">点击修改头像</text></view><view class="form-container data-v-983df345"><view class="form-item data-v-983df345"><text class="label data-v-983df345">昵称</text><input type="text" class="input-field data-v-983df345" value="{{c}}" onInput="{{d}}"/></view><view class="form-item gender-item data-v-983df345"><text class="label data-v-983df345">性别</text><radio-group class="gender-container data-v-983df345"><label class="data-v-983df345"><radio class="data-v-983df345" checked="{{e}}" value="male" onTap="{{f}}"></radio><text class="data-v-983df345">男</text></label><label class="data-v-983df345"><radio class="data-v-983df345" checked="{{g}}" value="female" onTap="{{h}}"></radio><text class="data-v-983df345">女</text></label></radio-group></view><view class="form-item data-v-983df345"><text class="label data-v-983df345">手机</text><input type="text" class="input-field data-v-983df345" value="{{i}}" onInput="{{j}}"/></view><view class="form-item data-v-983df345"><text class="label data-v-983df345">范围</text><input type="text" class="input-field data-v-983df345" value="{{k}}" onInput="{{l}}"/></view></view><button class="save-button data-v-983df345" onTap="{{m}}">保 存</button></view>

View File

@ -0,0 +1,121 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
const _sfc_main = {
__name: "changeUserMessage",
setup(__props) {
const user = common_vendor.ref({ errandName: "未登录", errandAvatarUrl: "", gender: "", errandPhone: "", distributionScope: "" });
const tempAvatarUrl = common_vendor.ref("");
const getCurrentUser = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errand/get/current",
method: "POST",
header: {
"cookie": common_vendor.index.getStorageSync("cookie")
},
success(res) {
console.log(res);
if (res.data.code === 0 && res.data.data) {
Object.assign(user.value, res.data.data);
}
},
fail(err) {
console.error("请求失败:", err);
}
});
};
common_vendor.onShow(() => {
getCurrentUser();
});
common_vendor.onMounted(() => {
getCurrentUser();
});
const chooseImage = () => {
common_vendor.index.chooseImage({
count: 1,
sizeType: ["original", "compressed"],
sourceType: ["album", "camera"],
success: (res) => {
const tempFilePaths = res.tempFilePaths;
tempAvatarUrl.value = tempFilePaths[0];
uploadImage(tempFilePaths[0]);
}
});
};
const uploadImage = (filePath) => {
common_vendor.index.uploadFile({
url: API_api.apiImageUrl + "/api/file/upload/server",
filePath,
name: "file",
formData: {
biz: "user_avatar"
},
success: (res) => {
const data = JSON.parse(res.data);
if (data.code === 0) {
user.value.errandAvatarUrl = data.data.url;
tempAvatarUrl.value = "";
}
},
fail: (err) => {
console.error("上传失败:", err);
}
});
};
const saveUser = () => {
const updatedUser = {
distributionScope: user.value.distributionScope,
errandName: user.value.errandName,
errandPhone: user.value.errandPhone,
gender: user.value.gender,
id: user.value.id,
state: 0
};
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errand/update/my",
method: "POST",
data: updatedUser,
header: {
"Content-Type": "application/json",
"cookie": common_vendor.index.getStorageSync("cookie")
},
success(res) {
if (res.data.code === 0) {
common_vendor.index.showToast({
title: "更新成功",
icon: "success"
});
getCurrentUser();
} else {
common_vendor.index.showToast({
title: "更新失败",
icon: "none"
});
}
},
fail(err) {
console.error("请求失败:", err);
}
});
};
return (_ctx, _cache) => {
return {
a: tempAvatarUrl.value || user.value.errandAvatarUrl || "../../static/logo.png",
b: common_vendor.o(chooseImage),
c: user.value.errandName,
d: common_vendor.o(($event) => user.value.errandName = $event.detail.value),
e: user.value.gender === 0,
f: common_vendor.o(($event) => user.value.gender = 0),
g: user.value.gender === 1,
h: common_vendor.o(($event) => user.value.gender = 1),
i: user.value.errandPhone,
j: common_vendor.o(($event) => user.value.errandPhone = $event.detail.value),
k: user.value.distributionScope,
l: common_vendor.o(($event) => user.value.distributionScope = $event.detail.value),
m: common_vendor.o(saveUser)
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-983df345"]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,5 @@
{
"defaultTitle": "修改用户信息",
"titleBarColor": "#5e7dec",
"usingComponents": {}
}

View File

@ -0,0 +1,88 @@
.page.data-v-3d78755a {
padding: 20px;
background-color: #fff;
}
.header.data-v-3d78755a {
display: flex;
align-items: center;
margin-bottom: 20px;
margin-top: 20px;
}
.location.data-v-3d78755a {
width: 24px;
/* 稍微增大圆形 */
height: 24px;
background-color: #ff6700;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
margin-right: 12px;
font-size: 12px;
/* 调整文本大小 */
font-weight: bold;
}
.distance.data-v-3d78755a {
color: #999;
font-size: 12px;
padding-right: 5px;
}
.store-name.data-v-3d78755a {
font-size: 20px;
font-weight: bold;
}
.buttons.data-v-3d78755a {
margin-bottom: 20px;
}
.button.data-v-3d78755a {
width: 100%;
padding: 10px;
margin: 10px 0;
text-align: center;
background-color: #2877f2;
color: #fff;
border: none;
border-radius: 8px;
cursor: pointer;
line-height: inherit;
}
.order-details.data-v-3d78755a {
margin-top: 20px;
font-size: 16px;
}
.title.data-v-3d78755a {
font-size: 20px;
font-weight: bold;
margin-bottom: 10px;
}
.detail.data-v-3d78755a {
display: flex;
align-items: center;
margin: 5px 0;
}
/* 定义图标容器的样式 */
.icon-container.data-v-3d78755a {
display: flex;
justify-content: space-around;
/* 水平均匀分布 */
align-items: center;
/* 垂直居中对齐 */
}
/* 定义每个图标和文字组合的样式 */
.icon-wrapper.data-v-3d78755a {
display: flex;
flex-direction: column;
/* 将子元素垂直排列 */
align-items: center;
/* 子元素水平居中对齐 */
}
/* 可选:定义文本标签的样式 */
.icon-wrapper text.data-v-3d78755a {
margin-top: 5px;
/* 文字与图标之间的间距 */
}

View File

@ -0,0 +1 @@
<view class="page data-v-3d78755a"><view class="data-v-3d78755a"><map class="data-v-3d78755a" style="width:100%;height:300px" latitude="{{a}}" longitude="{{b}}" markers="{{c}}" include-points="{{d}}"></map></view><view class="header data-v-3d78755a"><text class="location data-v-3d78755a">取</text><text class="distance data-v-3d78755a">1km</text><text class="store-name data-v-3d78755a">{{e}}</text></view><view class="header data-v-3d78755a"><text class="location data-v-3d78755a">送</text><text class="distance data-v-3d78755a">1km</text><text class="store-name data-v-3d78755a">{{f}}</text></view><view class="buttons data-v-3d78755a"><view class="icon-container data-v-3d78755a"><view class="icon-wrapper data-v-3d78755a" onTap="{{h}}"><uni-icons class="data-v-3d78755a" u-i="3d78755a-0" onVI="__l" u-p="{{g||''}}"></uni-icons><text class="data-v-3d78755a">联系商家</text></view><view class="icon-wrapper data-v-3d78755a" onTap="{{j}}"><uni-icons class="data-v-3d78755a" u-i="3d78755a-1" onVI="__l" u-p="{{i||''}}"></uni-icons><text class="data-v-3d78755a">联系用户</text></view><view class="icon-wrapper data-v-3d78755a"><uni-icons class="data-v-3d78755a" onClick="{{k}}" u-i="3d78755a-2" onVI="__l" u-p="{{l||''}}"></uni-icons><text class="data-v-3d78755a">拍照送达</text></view></view></view><view class="order-details data-v-3d78755a"><text class="title data-v-3d78755a">跑单详情</text><view class="detail data-v-3d78755a"><text class="data-v-3d78755a">取餐地址:</text><text class="data-v-3d78755a">{{m}}</text></view><view class="detail data-v-3d78755a"><text class="data-v-3d78755a">下单时间:</text><text class="data-v-3d78755a">{{n}}</text></view><view class="detail data-v-3d78755a"><text class="data-v-3d78755a">送达时间:</text><text class="data-v-3d78755a" style="color:red">{{o}}</text></view><view class="detail data-v-3d78755a"><text class="data-v-3d78755a">送达地址:</text><text class="data-v-3d78755a">{{p}}</text></view></view></view>

View File

@ -0,0 +1,279 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
_easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
_easycom_uni_icons();
}
const _sfc_main = {
__name: "deliveryDetail",
setup(__props) {
const orderDetail = common_vendor.ref(common_vendor.index.getStorageSync("orderDetail"));
const apartmentLocations = {
"1公寓": {
latitude: 45.878148,
longitude: 126.542369
},
"2公寓": {
latitude: 45.878016,
longitude: 126.542924
},
"3公寓": {
latitude: 45.878117,
longitude: 126.543476
},
"4公寓": {
latitude: 45.878118,
longitude: 126.54415
},
"5公寓": {
latitude: 45.878978,
longitude: 126.54127
},
"6公寓": {
latitude: 45.878982,
longitude: 126.541879
},
"9公寓": {
latitude: 45.878435,
longitude: 126.544863
},
"10公寓": {
latitude: 45.879196,
longitude: 126.543891
},
"11公寓": {
latitude: 45.879157,
longitude: 126.542722
},
"12公寓": {
latitude: 45.875638,
longitude: 126.540502
},
"育才大厦": {
latitude: 45.875638,
longitude: 126.540502
}
};
const formatDate = (dateString) => {
const date = new Date(dateString);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
const seconds = String(date.getSeconds()).padStart(2, "0");
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
};
const handlePickup = (id, imageUrl) => {
common_vendor.index.showLoading({
title: "提交中...",
mask: true
});
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errand/update/state",
method: "POST",
data: {
errandsState: 4,
orderId: id,
imageAddress: imageUrl
},
header: {
"Content-Type": "application/json",
// 确保设置正确的 Content-Type
"cookie": common_vendor.index.getStorageSync("cookie") || ""
},
success(res) {
console.log(res);
common_vendor.index.hideLoading();
if (res.data.code === 0) {
common_vendor.index.showToast({
title: "成功送达",
icon: "none",
duration: 2e3,
success: () => {
const pages = getCurrentPages();
const prevPage = pages[pages.length - 3];
if (prevPage && prevPage.robOrder) {
prevPage.robOrder(3);
}
common_vendor.index.navigateBack({
delta: 2,
success: () => {
common_vendor.index.$emit("refresh-delivery-list");
}
});
}
});
} else {
common_vendor.index.showToast({
title: res.data.message || "送达失败",
icon: "none"
});
}
},
fail(err) {
console.log(err);
common_vendor.index.showToast({
title: "网络异常,请检查连接",
icon: "none"
});
}
});
};
const handleContact = (item) => {
common_vendor.index.makePhoneCall({
phoneNumber: item
});
};
const handleCall = (item) => {
console.log(item);
common_vendor.index.makePhoneCall({
phoneNumber: item
});
};
const latitude = common_vendor.ref("");
const longitude = common_vendor.ref("");
const includePoints = common_vendor.ref([]);
const covers = common_vendor.ref([]);
common_vendor.onMounted(() => {
getLocation();
});
function getLocation() {
common_vendor.index.getLocation({
type: "gcj02",
// 返回可以用于uni.openLocation的坐标
success(res) {
console.log("当前位置的经度:" + res.longitude);
console.log("当前位置的纬度:" + res.latitude);
latitude.value = res.latitude;
longitude.value = res.longitude;
updateCover(res.latitude, res.longitude, 2, "我的位置", "/static/logo.png");
if (orderDetail.value.location in apartmentLocations) {
const targetApartment = apartmentLocations[orderDetail.value.location];
updateCover(
targetApartment.latitude,
targetApartment.longitude,
1,
orderDetail.value.location,
"/static/errand.jpg"
);
includePoints.value = [
{
latitude: targetApartment.latitude,
longitude: targetApartment.longitude
},
// 目标公寓的位置
{
latitude: res.latitude,
longitude: res.longitude
}
// 用户的位置
];
} else {
console.warn(`未找到名为"${orderDetail.value.location}"的公寓位置`);
}
},
fail(err) {
console.error("获取位置失败", err);
}
});
}
function updateCover(lat, lng, id, title, iconPath) {
const position = {
id,
latitude: lat,
longitude: lng,
iconPath,
// 标记图标路径,现在通过参数传递
width: 30,
height: 30,
title
// 可选:标记点标题
};
const existingIndex = covers.value.findIndex((item) => item.id === position.id);
if (existingIndex !== -1) {
covers.value[existingIndex] = position;
} else {
covers.value.push(position);
}
}
const takephoto = () => {
common_vendor.index.chooseImage({
count: 1,
// 默认9这里设置为1因为只需要一张照片
sizeType: ["compressed"],
// 可以指定是原图还是压缩图,默认二者都有
sourceType: ["camera"],
// 从相机选择
success: function(res) {
const tempFilePaths = res.tempFilePaths;
uploadPhoto(tempFilePaths[0]);
}
});
};
const uploadPhoto = (filePath) => {
common_vendor.index.uploadFile({
url: `${API_api.apiImageUrl}/api/file/upload/server`,
// 接口地址
filePath,
name: "file",
formData: {
biz: "takeout"
// 根据要求填写的biz参数
},
header: {
"Content-Type": "application/json",
// 确保设置正确的 Content-Type
"cookie": common_vendor.index.getStorageSync("cookie") || ""
},
success(res) {
console.log("上传成功", res);
const imageUrl = JSON.parse(res.data).data;
handlePickup(orderDetail.value.id, imageUrl);
},
fail(err) {
console.error("上传失败", err);
}
});
};
return (_ctx, _cache) => {
return {
a: latitude.value,
b: longitude.value,
c: covers.value,
d: includePoints.value,
e: common_vendor.t(orderDetail.value.address),
f: common_vendor.t(orderDetail.value.location),
g: common_vendor.p({
type: "phone",
size: "30"
}),
h: common_vendor.o(($event) => {
var _a;
return handleCall((_a = orderDetail.value.businessVO) == null ? void 0 : _a.businessPhone);
}),
i: common_vendor.p({
type: "phone-filled",
size: "30"
}),
j: common_vendor.o(($event) => handleContact(orderDetail.value.phone)),
k: common_vendor.o(($event) => takephoto(orderDetail.value.id)),
l: common_vendor.p({
type: "camera",
size: "30"
}),
m: common_vendor.t(orderDetail.value.address),
n: common_vendor.t(formatDate(orderDetail.value.createTime)),
o: common_vendor.t(formatDate(orderDetail.value.pickupEndTime)),
p: common_vendor.t(orderDetail.value.location)
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3d78755a"]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,7 @@
{
"defaultTitle": "订单详情",
"titleBarColor": "#5e7dec",
"usingComponents": {
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
}
}

View File

@ -0,0 +1,264 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.time-id.data-v-1cf27b2a {
font-size: 20px;
color: #ff6700;
font-weight: 700;
}
.tab-menu.data-v-1cf27b2a {
display: flex;
justify-content: space-around;
padding: 10px 0;
background-color: #5e7dec;
color: #9cb0f4;
}
.tab-item.data-v-1cf27b2a {
padding: 10px;
cursor: pointer;
}
.tab-item.active.data-v-1cf27b2a {
color: #fff;
font-weight: bold;
}
.fixed-buttons.data-v-1cf27b2a {
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: center;
background-color: #fff;
padding: 10px;
box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}
.button-container.data-v-1cf27b2a {
display: flex;
flex-direction: column;
align-items: center;
margin-right: 10px;
}
.button-container text.data-v-1cf27b2a {
margin-top: 5px;
}
.fixed-font.data-v-1cf27b2a {
font-size: 12px;
}
.refresh-button.data-v-1cf27b2a {
width: 60%;
background-color: pink;
border-radius: 15px;
color: #fff;
background-color: #5e7dec;
}
.button-text.data-v-1cf27b2a {
color: #fff;
font-size: 12px;
}
.text.data-v-1cf27b2a {
font-size: 12px;
color: #333;
}
.popup-content.data-v-1cf27b2a {
padding: 20px;
border-radius: 8px;
background-color: #fff;
}
.modal-header.data-v-1cf27b2a {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.tab-button.data-v-1cf27b2a {
background-color: transparent;
border: none;
font-size: 16px;
cursor: pointer;
padding: 5px 10px;
}
.tab-button.active.data-v-1cf27b2a {
color: #007AFF;
border-bottom: 2px solid #007AFF;
}
.modal-title.data-v-1cf27b2a {
font-size: 18px;
font-weight: bold;
}
.modal-close.data-v-1cf27b2a {
font-size: 16px;
cursor: pointer;
}
.modal-body.data-v-1cf27b2a {
padding: 10px 0;
}
.modal-item.data-v-1cf27b2a {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.modal-label.data-v-1cf27b2a {
font-size: 15px;
font-weight: bold;
}
.modal-value.data-v-1cf27b2a {
font-size: 14px;
color: #333;
}
.arrow.data-v-1cf27b2a {
margin-left: 10px;
}
.modal-list.data-v-1cf27b2a {
display: grid;
grid-template-columns: 1fr 1fr;
/* 创建两列,每列占据相等的空间 */
gap: 10px;
padding: 10px 10px 10px 0;
border-radius: 5px;
}
.item.data-v-1cf27b2a {
background-color: #f1f1f1;
padding: 10px;
border-radius: 5px;
text-align: center;
cursor: pointer;
font-size: 14px;
}
.item.selected.data-v-1cf27b2a {
background-color: #eef6ff;
color: #80a6da;
}
.tips.data-v-1cf27b2a {
font-size: 12px;
color: #c8c8c8;
}
.order-card.data-v-1cf27b2a {
background-color: #fff;
border-radius: 12px;
/* 增大圆角 */
padding: 10px;
/* 增大内边距 */
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.16);
/* 更深的阴影 */
width: 90%;
margin: 0 auto;
margin-bottom: 20px;
transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
/* 添加过渡效果 */
}
.order-card.data-v-1cf27b2a:hover {
transform: translateY(-4px);
/* 当鼠标悬停时稍微提升 */
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
/* 更大的阴影当悬停 */
}
/* 修改前 */
.order-card.data-v-1cf27b2a:last-child {
margin-bottom: 100px;
}
/* 修改后 */
.order-card.data-v-1cf27b2a:last-child {
margin-bottom: 100px !important;
/* 添加 !important 确保优先级 */
}
.delivery-info.data-v-1cf27b2a {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
}
.time.data-v-1cf27b2a,
.price.data-v-1cf27b2a {
font-size: 16px;
/* 增大字体大小 */
}
.price.data-v-1cf27b2a {
color: #ff6700;
font-weight: bold;
}
.address-info.data-v-1cf27b2a {
margin-bottom: 15px;
border-bottom: 1px solid #e0e0e0;
/* 添加底部边框 */
padding-bottom: 10px;
}
.address-item.data-v-1cf27b2a {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.circle.data-v-1cf27b2a {
width: 24px;
/* 稍微增大圆形 */
height: 24px;
background-color: #ff6700;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
margin-right: 12px;
font-size: 12px;
/* 调整文本大小 */
font-weight: bold;
}
.distance.data-v-1cf27b2a {
color: #666;
font-size: 14px;
margin-right: 12px;
}
.address-name.data-v-1cf27b2a {
color: #333;
font-size: 16px;
font-weight: 600;
}
.button-container.data-v-1cf27b2a {
text-align: center;
/* 增加按钮顶部间距 */
}
.order-button.data-v-1cf27b2a {
background-color: #5e7dec;
color: #fff;
padding: 12px 24px;
/* 增大按钮尺寸 */
border-radius: 6px;
/* 圆滑按钮边缘 */
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease-in-out;
/* 添加过渡效果 */
width: 85%;
}
.order-button.data-v-1cf27b2a:hover {
background-color: #4a69bd;
/* 改变悬停颜色 */
}
.content.data-v-1cf27b2a {
padding-bottom: 50px;
/* 根据底部按钮高度调整 */
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,421 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
if (!Array) {
const _easycom_uni_notice_bar2 = common_vendor.resolveComponent("uni-notice-bar");
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
(_easycom_uni_notice_bar2 + _easycom_uni_icons2 + _easycom_uni_popup2)();
}
const _easycom_uni_notice_bar = () => "../../uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.js";
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
(_easycom_uni_notice_bar + _easycom_uni_icons + _easycom_uni_popup)();
}
const _sfc_main = {
__name: "index",
setup(__props) {
const radius = common_vendor.ref(common_vendor.index.getStorageSync("currentUser.distributionScope"));
const currentIndex = common_vendor.ref(0);
const tabs = [
{
name: "待抢单"
},
{
name: "待取货"
},
{
name: "待送达"
}
];
const switchTab = (index) => {
currentIndex.value = index;
const stateMap = [1, 2, 3];
if (index >= 0 && index < stateMap.length) {
robOrder(stateMap[index]);
}
};
const switchTabs = (index) => {
activeTab.value = index;
};
const type = common_vendor.ref("center");
const activeTab = common_vendor.ref(0);
const selectedItem = common_vendor.ref(null);
const popupRef = common_vendor.ref(null);
const array = common_vendor.ref(["1公寓", "2公寓", "3公寓", "4公寓", "5公寓", "6公寓", "7公寓", "8公寓", "9公寓", "10公寓", "11公寓", "12公寓", "育才大厦"]);
common_vendor.ref(0);
const items = common_vendor.ref([
"考核时间从多到少",
"运单金额从高到低",
"配送距离从近到远",
"取货距离从近到远",
"推荐排序"
]);
const tipsItems = common_vendor.ref([
"新单置顶",
"已抢商户置顶"
]);
const change = (e) => {
console.log("当前模式:" + e.type + ",状态:" + e.show);
};
const toggle = (typeValue) => {
type.value = typeValue;
popupRef.value.open(typeValue);
};
const map = () => {
common_vendor.index.navigateTo({
url: "/pages/map/map"
});
};
const bindPickerChange = (e) => {
console.log("picker发送选择改变携带值为", e.detail.value);
const newValue = array.value[e.detail.value];
radius.value = newValue;
const requestData = {
distributionScope: newValue,
errandName: currentUser.value.errandName,
// 动态获取
errandPhone: currentUser.value.errandPhone,
// 动态获取
gender: currentUser.value.gender,
// 动态获取
id: currentUser.value.id,
// 动态获取
state: currentUser.value.state
// 动态获取
};
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errand/update/my",
method: "POST",
data: requestData,
header: {
"Content-Type": "application/json",
"cookie": common_vendor.index.getStorageSync("cookie") || ""
},
success(res) {
console.log("配送范围更新成功:", res);
console.log(res.data.code);
if (res.data.code === 50001) {
common_vendor.index.showToast({
title: "还有未送达订单",
icon: "fail"
});
} else if (res.data.code === 0) {
common_vendor.index.showToast({
title: "配送范围已更新",
icon: "success"
});
refreshOrders();
}
},
fail(err) {
console.error("配送范围更新失败:", err);
common_vendor.index.showToast({
title: "更新失败,请重试",
icon: "none"
});
}
});
};
const handleClick = (item) => {
selectedItem.value = item;
};
const refreshOrders = () => {
const stateMap = [1, 2, 3];
const currentState = stateMap[currentIndex.value] || 1;
robOrder(currentState);
};
common_vendor.onMounted(() => {
robOrder(1);
});
let errandOrder = common_vendor.ref([]);
const robOrder = (errandStateValue) => {
if (typeof errandStateValue !== "number" || isNaN(errandStateValue)) {
console.error("Invalid errandState value:", errandStateValue);
return;
}
const params = `errandState=${encodeURIComponent(errandStateValue.toString())}`;
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errand/list/order",
method: "POST",
header: {
"Content-Type": "application/x-www-form-urlencoded",
// 设置正确的内容类型
"cookie": common_vendor.index.getStorageSync("cookie") || ""
},
data: params,
// 直接使用构建好的查询字符串
success(res) {
console.log("请求成功:", res);
if (res.data.code !== 0) {
common_vendor.index.showToast({
title: `请求失败:${res.data.message}`,
icon: "none"
});
} else {
console.log(res.data.data);
errandOrder.value = res.data.data;
console.log("Updated errandOrder:", errandOrder.value);
}
},
fail(err) {
console.log("请求失败:", err);
}
});
};
const plunder = (id) => {
console.log(id);
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errand/get/order",
method: "POST",
data: {
id
},
header: {
"Content-Type": "application/json",
"cookie": common_vendor.index.getStorageSync("cookie") || ""
},
success: (res) => {
console.log(res);
if (res.data.code === 0) {
common_vendor.index.showToast({
title: "抢单成功",
icon: "success",
success: () => {
const stateMap = [1, 2, 3];
const currentState = stateMap[currentIndex.value];
robOrder(currentState);
if (currentIndex.value === 0) {
robOrder(2);
}
}
});
} else {
common_vendor.index.showToast({
title: res.data.message || "抢单失败",
icon: "none"
});
}
},
fail: (err) => {
console.log(err);
common_vendor.index.showToast({
title: "网络错误,请重试",
icon: "none"
});
}
});
};
const obtain = (id) => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errand/update/state",
method: "POST",
data: {
errandsState: 3,
orderId: id
},
header: {
"Content-Type": "application/json",
"cookie": common_vendor.index.getStorageSync("cookie") || ""
},
success: (res) => {
console.log(res);
if (res.data.code === 0) {
common_vendor.index.showToast({
title: "取货成功",
icon: "success",
success: () => {
robOrder(2);
robOrder(3);
}
});
} else {
common_vendor.index.showToast({
title: res.data.description || "取货失败",
icon: "none"
});
}
},
fail: (err) => {
console.log(err);
common_vendor.index.showToast({
title: "网络异常,请检查连接",
icon: "none"
});
}
});
};
let currentUser = common_vendor.ref({});
const getCurrentUser = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errand/get/current",
method: "POST",
header: {
"Content-Type": "application/json",
"cookie": common_vendor.index.getStorageSync("cookie")
},
success(res) {
console.log(res);
if (res.data.code === 0) {
const userData = res.data.data;
currentUser.value = userData;
if (array.value.includes(userData.distributionScope)) {
radius.value = userData.distributionScope;
} else {
console.warn("用户的配送范围不在预设的选项中");
}
}
},
fail(err) {
console.error("请求失败:", err);
}
});
};
common_vendor.onMounted(() => {
robOrder(1);
getCurrentUser();
});
common_vendor.onShow(() => {
getCurrentUser();
robOrder(1);
});
const orderDetail = (item) => {
common_vendor.index.setStorageSync("orderDetail", item);
common_vendor.index.navigateTo({
url: "/pages/orderDetail/orderDetail"
});
};
const deliveryDetail = (item) => {
console.log("4567845678945678900");
console.log(item);
common_vendor.index.setStorageSync("orderDetail", item);
common_vendor.index.navigateTo({
url: "/pages/deliveryDetail/deliveryDetail"
});
};
const formatDate = (isoString) => {
if (!isoString)
return "";
return isoString.slice(5, 10) + " " + isoString.slice(11, 19);
};
common_vendor.index.$on("refresh-delivery-list", () => {
this.robOrder(3);
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.f(tabs, (tab, index, i0) => {
return {
a: common_vendor.t(tab.name),
b: tab.name,
c: currentIndex.value === index ? 1 : "",
d: common_vendor.o(($event) => switchTab(index))
};
}),
b: common_vendor.p({
["show-icon"]: true,
scrollable: true,
text: "今日放假"
}),
c: currentIndex.value === 0
}, currentIndex.value === 0 ? {
d: common_vendor.f(common_vendor.unref(errandOrder), (item, index, i0) => {
var _a;
return {
a: common_vendor.t(item.id),
b: common_vendor.t(formatDate(item.pickupEndTime)),
c: common_vendor.t(item.address),
d: common_vendor.t((_a = item.businessVO) == null ? void 0 : _a.businessName),
e: common_vendor.t(item.location),
f: common_vendor.o(($event) => plunder(item.id)),
g: index
};
})
} : {}, {
e: currentIndex.value === 1
}, currentIndex.value === 1 ? {
f: common_vendor.f(common_vendor.unref(errandOrder), (item, index, i0) => {
var _a;
return {
a: common_vendor.t(item.id),
b: common_vendor.t(formatDate(item.pickupEndTime)),
c: common_vendor.t(item.address),
d: common_vendor.t((_a = item.businessVO) == null ? void 0 : _a.businessName),
e: common_vendor.t(item.location),
f: common_vendor.o(($event) => obtain(item.id)),
g: index,
h: common_vendor.o(($event) => orderDetail(item))
};
})
} : {}, {
g: currentIndex.value === 2
}, currentIndex.value === 2 ? {
h: common_vendor.f(common_vendor.unref(errandOrder), (item, index, i0) => {
var _a;
return {
a: common_vendor.t(item.id),
b: common_vendor.t(formatDate(item.pickupEndTime)),
c: common_vendor.t(item.address),
d: common_vendor.t((_a = item.businessVO) == null ? void 0 : _a.businessName),
e: common_vendor.t(item.location),
f: index,
g: common_vendor.o(($event) => deliveryDetail(item))
};
})
} : {}, {
i: common_vendor.p({
type: "gear-filled",
size: "24"
}),
j: common_vendor.o(($event) => toggle("bottom")),
k: common_vendor.p({
type: "location-filled",
size: "24"
}),
l: common_vendor.o(map),
m: common_vendor.o(refreshOrders),
n: activeTab.value === 0 ? 1 : "",
o: common_vendor.o(($event) => switchTabs(0)),
p: activeTab.value === 1 ? 1 : "",
q: common_vendor.o(($event) => switchTabs(1)),
r: activeTab.value === 0
}, activeTab.value === 0 ? {
s: common_vendor.t(radius.value.value || "修改配送区域"),
t: array.value.indexOf(radius.value.value),
v: array.value,
w: common_vendor.o(bindPickerChange)
} : {}, {
x: activeTab.value === 1
}, activeTab.value === 1 ? {
y: common_vendor.f(items.value, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: common_vendor.o(($event) => handleClick(item)),
c: index,
d: selectedItem.value === item ? 1 : ""
};
}),
z: common_vendor.f(tipsItems.value, (item, index, i0) => {
return {
a: common_vendor.t(item),
b: common_vendor.o(($event) => handleClick(item)),
c: index,
d: selectedItem.value === item ? 1 : ""
};
})
} : {}, {
A: type.value === "left" || type.value === "right" ? 1 : "",
B: () => ({
r: popupRef,
k: "popupRef"
}),
C: common_vendor.o(change),
D: common_vendor.p({
["background-color"]: "#fff"
})
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1cf27b2a"]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,9 @@
{
"defaultTitle": "首页",
"titleBarColor": "#5e7dec",
"usingComponents": {
"uni-notice-bar": "../../uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar",
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons",
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup"
}
}

View File

@ -0,0 +1,125 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
page {
background: url("../../static/login.jpg") repeat fixed center;
}
.normal-login-container {
width: 100%;
}
.normal-login-container .logo-content {
width: 100%;
font-size: 21px;
text-align: center;
padding-top: 15%;
}
.normal-login-container .logo-content image {
border-radius: 4px;
}
.normal-login-container .logo-content .title {
margin-left: 10px;
}
.normal-login-container .login-form-content {
text-align: center;
margin: 20px auto;
width: 80%;
}
.normal-login-container .login-form-content .input-item {
margin: 20px auto;
background-color: #f5f6f7;
height: 45px;
border-radius: 20px;
}
.normal-login-container .login-form-content .input-item .icon {
font-size: 38rpx;
margin-left: 10px;
color: #999;
}
.normal-login-container .login-form-content .input-item .input {
width: 80%;
font-size: 14px;
line-height: 20px;
text-align: left;
padding-left: 15px;
padding-top: 8px;
padding-bottom: 8px;
background-color: #f5f6f7;
}
.normal-login-container .login-form-content .login-btn {
margin-top: 40px;
height: 45px;
border-radius: 30px;
}
.normal-login-container .login-form-content .reg {
margin-top: 15px;
}
.normal-login-container .login-form-content .xieyi {
color: #333;
margin-top: 20px;
}
.normal-login-container .login-form-content .login-code {
height: 38px;
float: right;
}
.normal-login-container .login-form-content .login-code .login-code-img {
height: 38px;
position: absolute;
margin-left: 10px;
width: 200rpx;
}
.img-a {
position: absolute;
width: 100%;
top: -74px;
right: 0;
z-index: 100;
}
.img-b {
position: absolute;
width: 50%;
bottom: 0;
left: -50rpx;
z-index: 100;
}
.text {
margin-left: -111px;
margin-top: 28px;
}
.t-b {
font-size: 29px;
color: #000;
padding: 60px 0 10px 0;
font-weight: bold;
}
.t-b2 {
text-align: center;
font-size: 32rpx;
color: #2a2a2a;
}
.goLogin {
float: right;
color: #444444;
padding: 10px;
}

View File

@ -0,0 +1 @@
<view class="normal-login-container"><view class="logo-content align-center justify-center flex"><image class="img-a" src="{{a}}"/><image class="img-b" src="{{b}}"/><view class="text"><view class="t-b">校食通跑腿端</view><view class="t-b2">一款专为在校同学开发的配送app</view></view></view><view class="login-form-content"><view class="input-item flex align-center"><view class="iconfont icon-user icon"></view><input class="input" type="text" placeholder="请输入账号" maxlength="30" value="{{c}}" onInput="{{d}}"/></view><view class="input-item flex align-center"><view class="iconfont icon-password icon"></view><input type="password" class="input" placeholder="请输入密码" maxlength="20" value="{{e}}" onInput="{{f}}"/></view><view class="action-btn"><button onTap="{{g}}" class="login-btn cu-btn block bg-blue lg round">登录</button></view><view onTap="{{h}}" class="goLogin">去注册</view></view></view>

View File

@ -0,0 +1,140 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
data() {
return {
loginForm: {
userAccount: "",
userPassword: ""
},
apiImageUrl: "https://xiaokuaisong.shop:6448"
// 直接在这里设置后端地址
};
},
methods: {
// handleLogin() {
// console.log('userAccount:', this.loginForm.userAccount);
// console.log('userPassword:', this.loginForm.userPassword);
// // 检查表单字段是否已填充
// if (!this.loginForm.userAccount || !this.loginForm.userPassword) {
// uni.showToast({
// icon: 'error',
// title: '请输入账号和密码'
// });
// return;
// }
// uni.request({
// url: this.apiImageUrl + '/api/user/login',
// method: 'POST',
// data: {
// userAccount: this.loginForm.userAccount,
// userPassword: this.loginForm.userPassword
// },
// header:{
// 'cookie':uni.getStorageSync("cookie")
// },
// success: (res) => {
// console.log(res.data.code);
// if (res.data.code === 0) {
// uni.showToast({
// title: '登录成功',
// duration: 2000
// });
// uni.removeStorageSync('cookie');
// uni.setStorageSync('userInfo', res.data.data);
// uni.setStorageSync('cookie', res.header['Set-Cookie']);
// uni.switchTab({
// url: '/pages/index/index'
// });
// } else {
// uni.showToast({
// icon: 'error',
// title: '登录失败,请联系管理员'
// });
// return;
// }
// },
// fail: (err) => {
// console.error(err);
// uni.showToast({
// icon: 'error',
// title: '请求失败,请检查网络'
// });
// }
// });
// }
handleLogin() {
console.log("userAccount:", this.loginForm.userAccount);
console.log("userPassword:", this.loginForm.userPassword);
common_vendor.index.showLoading({
title: "正在登录...",
mask: true
});
common_vendor.index.request({
url: this.apiImageUrl + "/api/user/login",
method: "POST",
data: {
appName: "errand",
userAccount: this.loginForm.userAccount,
userPassword: this.loginForm.userPassword
},
header: {
"Content-Type": "application/json",
// 确保设置正确的 Content-Type
"cookie": common_vendor.index.getStorageSync("cookie") || ""
},
success: (res) => {
console.log("Response Data:", res);
if (res.statusCode === 200 && res.data.code === 0) {
common_vendor.index.showToast({
title: "登录成功",
duration: 2e3
});
common_vendor.index.removeStorageSync("cookie");
common_vendor.index.setStorageSync("userInfo", res.data.data);
if (res.header && res.header["Set-Cookie"]) {
common_vendor.index.setStorageSync("cookie", res.header["Set-Cookie"]);
}
common_vendor.index.switchTab({
url: "/pages/index/index"
});
} else {
common_vendor.index.showToast({
icon: "error",
title: "登录失败,请联系管理员"
});
}
},
fail: (err) => {
console.error("Request failed:", err);
common_vendor.index.showToast({
icon: "error",
title: "网络请求失败,请重试"
});
},
complete: () => {
common_vendor.index.hideLoading();
}
});
},
goLogin() {
common_vendor.index.navigateTo({
url: "/pages/register/register"
});
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: $data.apiImageUrl + "/static/images/b-1.png",
b: $data.apiImageUrl + "/static/images/b-2.png",
c: $data.loginForm.userAccount,
d: common_vendor.o(($event) => $data.loginForm.userAccount = $event.detail.value),
e: $data.loginForm.userPassword,
f: common_vendor.o(($event) => $data.loginForm.userPassword = $event.detail.value),
g: common_vendor.o((...args) => $options.handleLogin && $options.handleLogin(...args)),
h: common_vendor.o((...args) => $options.goLogin && $options.goLogin(...args))
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,5 @@
{
"defaultTitle": "登录",
"titleBarColor": "#5e7dec",
"usingComponents": {}
}

View File

@ -0,0 +1 @@
<view><button onTap="{{a}}">获取定位</button></view>

View File

@ -0,0 +1,25 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
__name: "map",
setup(__props) {
const getAddress = () => {
common_vendor.index.chooseLocation({
success: (res) => {
location.value = {
name: res.name,
address: res.address,
latitude: res.latitude,
longitude: res.longitude
};
}
});
};
return (_ctx, _cache) => {
return {
a: common_vendor.o(getAddress)
};
};
}
};
my.createPage(_sfc_main);

View File

@ -0,0 +1,5 @@
{
"defaultTitle": "配送范围",
"titleBarColor": "#5e7dec",
"usingComponents": {}
}

View File

@ -0,0 +1,154 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.container.data-v-2f1ef635 {
background-image: linear-gradient(to bottom, #5e7dec, #d0f0ff);
padding: 20px;
height: 100vh;
}
.header.data-v-2f1ef635 {
display: flex;
align-items: center;
padding: 10px;
background-color: #ffffff;
border-radius: 15px;
}
.user-icon.data-v-2f1ef635 {
width: 60px;
height: 60px;
border-radius: 50%;
margin-right: 10px;
}
.user-info.data-v-2f1ef635 {
display: flex;
flex-direction: column;
align-items: flex-start;
}
.name.data-v-2f1ef635 {
font-size: 16px;
font-weight: bold;
}
.rule.data-v-2f1ef635 {
font-size: 12px;
color: #999;
}
.rating.data-v-2f1ef635 {
color: #ff9800;
margin-top: 5px;
}
.settings.data-v-2f1ef635 {
margin-left: auto;
}
.settings-icon.data-v-2f1ef635 {
width: 24px;
height: 24px;
}
.summary.data-v-2f1ef635 {
display: flex;
justify-content: space-around;
margin-top: 20px;
background-color: #1970fd;
padding: 10px;
border-radius: 15px;
}
.summary-item.data-v-2f1ef635 {
text-align: center;
color: #ffffff;
display: flex;
flex-direction: column;
align-items: center;
}
.summary-label.data-v-2f1ef635 {
padding: 5px;
font-size: 14px;
}
.summary-detail.data-v-2f1ef635 {
font-size: 12px;
color: #92b1e9;
padding: 5px;
}
.summary-value.data-v-2f1ef635 {
font-size: 20px;
font-weight: bold;
padding: 5px;
}
.menu.data-v-2f1ef635 {
background-color: #ffffff;
border-radius: 8px;
margin-top: 20px;
padding: 0 15px;
}
.menu .menu-item.data-v-2f1ef635 {
display: flex;
align-items: center;
justify-content: space-between;
/* 关键属性 */
height: 50px;
border-bottom: 1px solid #f5f5f5;
}
.menu .menu-item.data-v-2f1ef635:last-child {
border-bottom: none;
}
.menu .menu-item text.data-v-2f1ef635 {
font-size: 15px;
color: #333;
flex-shrink: 0;
/* 防止文字被压缩 */
}
.menu .menu-item .arrow-icon.data-v-2f1ef635 {
color: #999;
margin-left: 20px;
/* 增加图标与文字的间距 */
}
.popup-content.data-v-2f1ef635 {
background-color: #ffffff;
padding: 30px 40px;
border-radius: 16px;
min-width: 240px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
text-align: center;
animation: fadeIn-2f1ef635 0.3s ease;
border: 2px solid #5e7dec;
/* 主色调蓝边框 */
}
.popup-text.data-v-2f1ef635 {
font-size: 24px;
color: #2a3f88;
/* 深蓝文字 */
font-weight: bold;
letter-spacing: 1px;
}
/* 弹出动画 */
@keyframes fadeIn-2f1ef635 {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}

View File

@ -0,0 +1 @@
<view class="container data-v-2f1ef635"><view class="header data-v-2f1ef635"><image src="{{a}}" class="user-icon data-v-2f1ef635" onTap="{{b}}"></image><view class="user-info data-v-2f1ef635"><text class="name data-v-2f1ef635">{{c}}</text><text class="rating data-v-2f1ef635">跑腿星级 ★★★★</text></view><view class="settings data-v-2f1ef635"><text class="rule data-v-2f1ef635">跑腿评分规则</text><uni-icons class="settings-icon data-v-2f1ef635" u-i="2f1ef635-0" onVI="__l" u-p="{{d||''}}"></uni-icons></view></view><view class="summary data-v-2f1ef635"><view class="summary-item data-v-2f1ef635"><text class="summary-value data-v-2f1ef635">{{e}}</text><text class="summary-label data-v-2f1ef635">总收入</text><text class="summary-detail data-v-2f1ef635">总金额></text></view><view class="summary-item data-v-2f1ef635" onTap="{{g}}"><text class="summary-value data-v-2f1ef635">{{f}}</text><text class="summary-label data-v-2f1ef635">今日完成</text><text class="summary-detail data-v-2f1ef635">完成订单数></text></view><view class="summary-item data-v-2f1ef635" onTap="{{i}}"><text class="summary-value data-v-2f1ef635">{{h}}</text><text class="summary-label data-v-2f1ef635">已结算</text><text class="summary-detail data-v-2f1ef635">用户已确认></text></view><view class="summary-item data-v-2f1ef635"><text class="summary-value data-v-2f1ef635">{{j}}</text><text class="summary-label data-v-2f1ef635">待结算</text><text class="summary-detail data-v-2f1ef635">等待用户确认></text></view></view><view class="menu data-v-2f1ef635"><view class="menu-item data-v-2f1ef635" onTap="{{l}}"><text class="data-v-2f1ef635">我的订单</text><uni-icons class="arrow-icon data-v-2f1ef635" u-i="2f1ef635-1" onVI="__l" u-p="{{k||''}}"></uni-icons></view><view class="data-v-2f1ef635"><view class="menu-item data-v-2f1ef635" onTap="{{n}}"><text class="data-v-2f1ef635">我的钱包</text><uni-icons class="arrow-icon data-v-2f1ef635" u-i="2f1ef635-2" onVI="__l" u-p="{{m||''}}"></uni-icons></view><uni-popup class="data-v-2f1ef635" u-s="{{['d']}}" ref="__r" u-r="{{o}}" u-i="2f1ef635-3" onVI="__l" u-p="{{p||''}}"><view class="popup-content data-v-2f1ef635"><text class="popup-text data-v-2f1ef635" style="">敬请期待</text></view></uni-popup></view><view class="menu-item data-v-2f1ef635" onTap="{{r}}"><text class="data-v-2f1ef635">身份认证</text><uni-icons class="arrow-icon data-v-2f1ef635" u-i="2f1ef635-4" onVI="__l" u-p="{{q||''}}"></uni-icons></view><view class="menu-item data-v-2f1ef635" onTap="{{t}}"><text class="data-v-2f1ef635">申诉中心</text><uni-icons class="arrow-icon data-v-2f1ef635" u-i="2f1ef635-5" onVI="__l" u-p="{{s||''}}"></uni-icons></view><view class="menu-item data-v-2f1ef635" onTap="{{w}}"><text class="data-v-2f1ef635">服务评价</text><uni-icons class="arrow-icon data-v-2f1ef635" u-i="2f1ef635-6" onVI="__l" u-p="{{v||''}}"></uni-icons></view><view class="menu-item data-v-2f1ef635" onTap="{{y}}"><text class="data-v-2f1ef635">注销账户</text><uni-icons class="arrow-icon data-v-2f1ef635" u-i="2f1ef635-7" onVI="__l" u-p="{{x||''}}"></uni-icons></view><view class="menu-item data-v-2f1ef635" onTap="{{B}}"><text class="data-v-2f1ef635">{{z}}</text><uni-icons class="arrow-icon data-v-2f1ef635" u-i="2f1ef635-8" onVI="__l" u-p="{{A||''}}"></uni-icons></view></view></view>

View File

@ -0,0 +1,270 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
(_easycom_uni_icons2 + _easycom_uni_popup2)();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
(_easycom_uni_icons + _easycom_uni_popup)();
}
const __default__ = {
data() {
return {
items: [
{
label: "我的订单"
},
{
label: "收入查询"
},
{
label: "我的钱包"
},
{
label: "身份认证"
},
{
label: "申诉中心"
},
{
label: "服务评价"
}
]
};
}
};
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
__name: "my",
setup(__props) {
common_vendor.index.getStorageSync("userInfo");
const login = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/user/logout",
method: "POST",
success(res) {
console.log(res);
common_vendor.index.removeStorageSync("userInfo");
common_vendor.index.removeStorageSync("currentUser");
common_vendor.index.reLaunch({
url: "/pages/login/login"
});
},
fail(err) {
console.log(err);
}
});
};
const signOut = () => {
common_vendor.index.showModal({
title: "是否注销账号",
content: "注销账号后将无法再次登录",
showCancel: true,
success: function(res) {
if (res.confirm) {
console.log("点击了确定按钮");
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errand/delete",
method: "POST",
success(res2) {
console.log(res2);
common_vendor.index.reLaunch({
url: "/pages/login/login"
});
},
fail(err) {
console.log(err);
}
});
} else if (res.cancel) {
console.log("点击了取消按钮");
}
}
});
};
const changeUserMessage = () => {
common_vendor.index.navigateTo({
url: "/pages/changeUserMessage/changeUserMessage"
});
};
const navigateToOrder = () => {
common_vendor.index.navigateTo({
url: "/pages/order/order"
});
};
const popupRef = common_vendor.ref("敬请期待");
const purse = () => {
popupRef.value.open();
setTimeout(() => {
popupRef.value.close();
}, 1e3);
};
const navigateToAuthentication = () => {
common_vendor.index.navigateTo({
url: "/pages/authentication/authentication"
});
};
const navigateToAppeal = () => {
common_vendor.index.navigateTo({
url: "/pages/appeal/appeal"
});
};
const navigateToServiceEvaluation = () => {
common_vendor.index.navigateTo({
url: "/pages/serviceEvaluation/serviceEvaluation"
});
};
const user = common_vendor.ref({ username: "未登录" });
const loginState = common_vendor.ref({ loginName: "去登录" });
const getCurrentUser = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errand/get/current",
method: "POST",
header: {
"cookie": common_vendor.index.getStorageSync("cookie")
},
success(res) {
console.log(res);
if (res.data.code === 0) {
common_vendor.index.setStorageSync("currentUser", res.data.data);
user.value = res.data.data;
loginState.value = { loginName: "退出登录" };
} else {
user.value = { username: "未登录" };
}
},
fail(err) {
console.error("请求失败:", err);
user.value = { username: "未登录" };
}
});
};
common_vendor.onShow(() => {
getCurrentUser(), getOrderNumber(), getOrderMoney();
getwaitMoney();
getallMoney();
});
const OrderNumber = common_vendor.ref(0);
const getOrderNumber = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errandIncome/count/number",
method: "POST",
success(res) {
console.log(res.data.data);
OrderNumber.value = res.data.data;
},
fail(err) {
console.log(err);
}
});
};
const OrderMoney = common_vendor.ref(0);
const getOrderMoney = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errandIncome/count/money",
method: "POST",
success(res) {
console.log(res);
OrderMoney.value = res.data.data;
},
fail(err) {
console.log(err);
}
});
};
const waitMoney = common_vendor.ref(0);
const getwaitMoney = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errandIncome/count/money/no",
method: "POST",
success(res) {
console.log(res);
waitMoney.value = res.data.data;
},
fail(err) {
console.log(err);
}
});
};
const allMoney = common_vendor.ref(0);
const getallMoney = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errandIncome/count/money/no",
method: "POST",
success(res) {
console.log(res);
allMoney.value = res.data.data;
},
fail(err) {
console.log(err);
}
});
};
return (_ctx, _cache) => {
return {
a: user.value.errandAvatarUrl || "../../static/logo.png",
b: common_vendor.o(changeUserMessage),
c: common_vendor.t(user.value.errandName || "未登录"),
d: common_vendor.p({
type: "right",
size: "16"
}),
e: common_vendor.t(allMoney.value),
f: common_vendor.t(OrderNumber.value),
g: common_vendor.o(navigateToOrder),
h: common_vendor.t(OrderMoney.value),
i: common_vendor.o(purse),
j: common_vendor.t(waitMoney.value),
k: common_vendor.p({
type: "right",
size: "16"
}),
l: common_vendor.o(navigateToOrder),
m: common_vendor.p({
type: "right",
size: "25"
}),
n: common_vendor.o(purse),
o: () => ({
r: popupRef,
k: "popupRef"
}),
p: common_vendor.p({
type: "center",
["background-color"]: "#fff"
}),
q: common_vendor.p({
type: "right",
size: "16"
}),
r: common_vendor.o(navigateToAuthentication),
s: common_vendor.p({
type: "right",
size: "16"
}),
t: common_vendor.o(navigateToAppeal),
v: common_vendor.p({
type: "right",
size: "16"
}),
w: common_vendor.o(navigateToServiceEvaluation),
x: common_vendor.p({
type: "right",
size: "16"
}),
y: common_vendor.o(signOut),
z: common_vendor.t(loginState.value.loginName),
A: common_vendor.p({
type: "right",
size: "16"
}),
B: common_vendor.o(login)
};
};
}
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2f1ef635"]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,8 @@
{
"defaultTitle": "我的",
"titleBarColor": "#5e7dec",
"usingComponents": {
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons",
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup"
}
}

View File

@ -0,0 +1,83 @@
.page.data-v-1353b6cf {
padding: 20px;
background-color: #fff;
}
.header.data-v-1353b6cf {
display: flex;
align-items: center;
margin-bottom: 20px;
margin-top: 20px;
}
.location.data-v-1353b6cf {
width: 24px;
/* 稍微增大圆形 */
height: 24px;
background-color: #ff6700;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
margin-right: 12px;
font-size: 12px;
/* 调整文本大小 */
font-weight: bold;
}
.distance.data-v-1353b6cf {
color: #999;
font-size: 12px;
padding-right: 5px;
}
.store-name.data-v-1353b6cf {
font-size: 20px;
font-weight: bold;
}
.buttons.data-v-1353b6cf {
margin-bottom: 20px;
}
.button.data-v-1353b6cf {
width: 100%;
padding: 10px;
margin: 10px 0;
text-align: center;
background-color: #2877f2;
color: #fff;
border: none;
border-radius: 8px;
cursor: pointer;
line-height: inherit;
}
.order-details.data-v-1353b6cf {
margin-top: 20px;
font-size: 16px;
}
.title.data-v-1353b6cf {
font-size: 20px;
font-weight: bold;
margin-bottom: 10px;
}
.detail.data-v-1353b6cf {
display: flex;
align-items: center;
margin: 5px 0;
}
/* 定义图标容器的样式 */
.icon-container.data-v-1353b6cf {
display: flex;
justify-content: space-around; /* 水平均匀分布 */
align-items: center; /* 垂直居中对齐 */
}
/* 定义每个图标和文字组合的样式 */
.icon-wrapper.data-v-1353b6cf {
display: flex;
flex-direction: column; /* 将子元素垂直排列 */
align-items: center; /* 子元素水平居中对齐 */
}
/* 可选:定义文本标签的样式 */
.icon-wrapper text.data-v-1353b6cf {
margin-top: 5px; /* 文字与图标之间的间距 */
}

View File

@ -0,0 +1 @@
<view class="page data-v-1353b6cf"><view class="data-v-1353b6cf"><map class="data-v-1353b6cf" style="width:100%;height:300px" latitude="{{a}}" longitude="{{b}}" markers="{{c}}" include-points="{{d}}"></map></view><view class="header data-v-1353b6cf"><text class="location data-v-1353b6cf">取</text><text class="distance data-v-1353b6cf">1km</text><text class="store-name data-v-1353b6cf">{{e}}</text></view><view class="header data-v-1353b6cf"><text class="location data-v-1353b6cf">送</text><text class="distance data-v-1353b6cf">1km</text><text class="store-name data-v-1353b6cf">{{f}}</text></view><view class="buttons data-v-1353b6cf"><view class="icon-container data-v-1353b6cf"><view class="icon-wrapper data-v-1353b6cf" onTap="{{h}}"><uni-icons class="data-v-1353b6cf" u-i="1353b6cf-0" onVI="__l" u-p="{{g||''}}"></uni-icons><text class="data-v-1353b6cf">联系商家</text></view><view class="icon-wrapper data-v-1353b6cf" onTap="{{j}}"><uni-icons class="data-v-1353b6cf" u-i="1353b6cf-1" onVI="__l" u-p="{{i||''}}"></uni-icons><text class="data-v-1353b6cf">联系用户</text></view><view class="icon-wrapper data-v-1353b6cf"><uni-icons class="data-v-1353b6cf" onClick="{{k}}" u-i="1353b6cf-2" onVI="__l" u-p="{{l||''}}"></uni-icons><text class="data-v-1353b6cf">拍照取到</text></view></view></view><view class="order-details data-v-1353b6cf"><text class="title data-v-1353b6cf">跑单详情</text><view class="detail data-v-1353b6cf"><text class="data-v-1353b6cf">取餐地址:</text><text class="data-v-1353b6cf">{{m}}</text></view><view class="detail data-v-1353b6cf"><text class="data-v-1353b6cf">下单时间:</text><text class="data-v-1353b6cf">{{n}}</text></view><view class="detail data-v-1353b6cf"><text class="data-v-1353b6cf">送达时间:</text><text class="data-v-1353b6cf" style="color:red">{{o}}</text></view><view class="detail data-v-1353b6cf"><text class="data-v-1353b6cf">送达地址:</text><text class="data-v-1353b6cf">{{p}}</text></view></view></view>

View File

@ -0,0 +1,159 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
_easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
_easycom_uni_icons();
}
const _sfc_main = {
__name: "orderDetail",
setup(__props) {
const orderDetail = common_vendor.ref(common_vendor.index.getStorageSync("orderDetail"));
const apartmentLocations = {
"1公寓": { latitude: 45.878148, longitude: 126.542369 },
"2公寓": { latitude: 45.878016, longitude: 126.542924 },
"3公寓": { latitude: 45.878117, longitude: 126.543476 },
"4公寓": { latitude: 45.878118, longitude: 126.54415 },
"5公寓": { latitude: 45.878978, longitude: 126.54127 },
"6公寓": { latitude: 45.878982, longitude: 126.541879 },
"9公寓": { latitude: 45.878435, longitude: 126.544863 },
"10公寓": { latitude: 45.879196, longitude: 126.543891 },
"11公寓": { latitude: 45.879157, longitude: 126.542722 },
"12公寓": { latitude: 45.875638, longitude: 126.540502 },
"育才大厦": { latitude: 45.875638, longitude: 126.540502 }
};
const formatDate = (dateString) => {
const date = new Date(dateString);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const hours = String(date.getHours()).padStart(2, "0");
const minutes = String(date.getMinutes()).padStart(2, "0");
const seconds = String(date.getSeconds()).padStart(2, "0");
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
};
const handlePickup = (id) => {
console.log(id);
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errand/update/state",
method: "POST",
data: {
errandsState: 3,
orderId: id
},
success(res) {
console.log(res);
common_vendor.index.navigateBack({
delta: 1,
animationType: "pop-out",
animationDuration: 200
});
},
fail(err) {
console.log(err);
}
});
};
const handleContact = (item) => {
common_vendor.index.makePhoneCall({
phoneNumber: item
});
};
const handleCall = (item) => {
common_vendor.index.makePhoneCall({
phoneNumber: item
});
};
const latitude = common_vendor.ref("");
const longitude = common_vendor.ref("");
const includePoints = common_vendor.ref([]);
const covers = common_vendor.ref([]);
common_vendor.onMounted(() => {
getLocation();
});
function getLocation() {
common_vendor.index.getLocation({
type: "gcj02",
// 返回可以用于uni.openLocation的坐标
success(res) {
console.log("当前位置的经度:" + res.longitude);
console.log("当前位置的纬度:" + res.latitude);
latitude.value = res.latitude;
longitude.value = res.longitude;
updateCover(res.latitude, res.longitude, 2, "我的位置", "/static/logo.png");
if (orderDetail.value.location in apartmentLocations) {
const targetApartment = apartmentLocations[orderDetail.value.location];
includePoints.value = [
{ latitude: targetApartment.latitude, longitude: targetApartment.longitude },
// 目标公寓的位置
{ latitude: res.latitude, longitude: res.longitude }
// 用户的位置
];
} else {
console.warn(`未找到名为"${orderDetail.value.location}"的公寓位置`);
}
},
fail(err) {
console.error("获取位置失败", err);
}
});
}
function updateCover(lat, lng, id, title, iconPath) {
const position = {
id,
latitude: lat,
longitude: lng,
iconPath,
// 标记图标路径,现在通过参数传递
width: 30,
height: 30,
title
// 可选:标记点标题
};
const existingIndex = covers.value.findIndex((item) => item.id === position.id);
if (existingIndex !== -1) {
covers.value[existingIndex] = position;
} else {
covers.value.push(position);
}
}
return (_ctx, _cache) => {
return {
a: latitude.value,
b: longitude.value,
c: covers.value,
d: includePoints.value,
e: common_vendor.t(orderDetail.value.address),
f: common_vendor.t(orderDetail.value.location),
g: common_vendor.p({
type: "phone",
size: "30"
}),
h: common_vendor.o(($event) => {
var _a;
return handleCall((_a = orderDetail.value.businessVO) == null ? void 0 : _a.businessPhone);
}),
i: common_vendor.p({
type: "phone-filled",
size: "30"
}),
j: common_vendor.o(($event) => handleContact(orderDetail.value.phone)),
k: common_vendor.o(($event) => handlePickup(orderDetail.value.id)),
l: common_vendor.p({
type: "camera",
size: "30"
}),
m: common_vendor.t(orderDetail.value.address),
n: common_vendor.t(formatDate(orderDetail.value.createTime)),
o: common_vendor.t(formatDate(orderDetail.value.pickupEndTime)),
p: common_vendor.t(orderDetail.value.location)
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1353b6cf"]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,7 @@
{
"defaultTitle": "订单详情",
"titleBarColor": "#5e7dec",
"usingComponents": {
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
}
}

View File

@ -0,0 +1,39 @@
/* 保持原有样式不变 */
.order-list.data-v-1d51308d {
display: flex;
flex-direction: column;
}
.order-details.data-v-1d51308d {
display: flex;
justify-content: space-between;
width: 90%;
margin: 0 auto;
background-color: #fff;
padding: 5px 10px 5px 10px;
border-bottom: 1px solid #f6f6f6;
}
.left-column.data-v-1d51308d,
.right-column.data-v-1d51308d {
display: flex;
flex-direction: column;
}
.userName.data-v-1d51308d,
.orderMoney.data-v-1d51308d {
margin: 5px 0;
font-size: 14px;
}
.orderTime.data-v-1d51308d,
.orderState.data-v-1d51308d {
font-size: 12px;
margin-bottom: 5px;
}
.userName.data-v-1d51308d {
color: #333;
}
.orderTime.data-v-1d51308d {
color: #666;
}
.orderMoney.data-v-1d51308d {
color: #007bff;
}

View File

@ -0,0 +1 @@
<view class="order-list data-v-1d51308d"><block a:for="{{a}}" a:for-item="item" a:key="f"><view class="order-details data-v-1d51308d"><view class="left-column data-v-1d51308d"><view class="userName data-v-1d51308d">订单派送-{{item.a}}</view><view class="orderTime data-v-1d51308d">{{item.b}}</view></view><view class="right-column data-v-1d51308d"><view class="orderMoney data-v-1d51308d"> +{{item.c}}</view><view class="orderState data-v-1d51308d" style="{{'color:' + item.e}}">{{item.d}}</view></view></view></block></view>

View File

@ -0,0 +1,48 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
const _sfc_main = {
__name: "orderList",
setup(__props) {
const orderList = common_vendor.ref([]);
const getOrder = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/bill/list",
method: "POST",
header: {
"Content-Type": "application/json",
"cookie": common_vendor.index.getStorageSync("cookie") || ""
},
success(res) {
console.log(res);
if (res.data.code === 0) {
console.log(res.data.data);
orderList.value = res.data.data;
}
},
fail(err) {
console.log(err);
}
});
};
common_vendor.onMounted(() => {
getOrder();
});
return (_ctx, _cache) => {
return {
a: common_vendor.f(orderList.value, (item, index, i0) => {
return {
a: common_vendor.t(item.username),
b: common_vendor.t(item.orderStartTime.slice(0, 10)),
c: common_vendor.t(item.income),
d: common_vendor.t(item.errandState === 0 ? "待结算" : "已结算"),
e: item.errandState === 0 ? "#ff9900" : "#00cc66",
f: index
};
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1d51308d"]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,5 @@
{
"defaultTitle": "历史订单查询",
"titleBarColor": "#5e7dec",
"usingComponents": {}
}

View File

@ -0,0 +1,118 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.wallet-page.data-v-7378640c {
display: flex;
flex-direction: column;
height: 100%;
background-color: #f1f1f1;
}
.wallet-page .balance-section.data-v-7378640c {
padding: 16px;
background-color: #5e7dec;
color: #fff;
}
.wallet-page .balance-section .balance-label.data-v-7378640c {
margin-bottom: 8px;
padding-left: 20px;
}
.wallet-page .balance-section .balance-amount.data-v-7378640c {
display: flex;
justify-content: space-between;
align-items: center;
}
.wallet-page .balance-section .balance-amount .amount.data-v-7378640c {
font-size: 24px;
font-weight: bold;
padding: 20px;
}
.wallet-page .balance-section .balance-amount .view-detail.data-v-7378640c {
margin: 0 20px;
border-radius: 15px;
background-color: rgba(255, 255, 255, 0.2);
color: #fff;
border: none;
cursor: pointer;
line-height: inherit;
padding: 8px 20px;
/* 添加内边距 */
}
.wallet-page .balance-section .transactions-section.data-v-7378640c {
padding: 16px;
border-top: 1rpx solid #e0e0e0;
}
.wallet-page .balance-section .transactions-section .transaction-item.data-v-7378640c {
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px;
}
.wallet-page .balance-section .transactions-section .transaction-item .transaction-label.data-v-7378640c {
font-size: 16px;
color: #fff;
}
.wallet-page .menu-section.data-v-7378640c {
flex: 1;
overflow-y: auto;
}
.wallet-page .menu-section .menu-item.data-v-7378640c {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 16px;
background-color: #fff;
border-bottom: 1px solid #e0e0e0;
margin-top: 10px;
}
.wallet-page .menu-section .menu-item .menu-title.data-v-7378640c {
font-size: 18px;
font-weight: bold;
}
.wallet-page .menu-section .menu-item .menu-subtitle.data-v-7378640c {
font-size: 16px;
color: #666;
}
.wallet-page .menu-section .menu-item .menu-icon.data-v-7378640c {
margin-left: auto;
}
.wallet-page .menu-section .menu-item .subtitles-container.data-v-7378640c {
display: flex;
gap: 16px;
margin-top: 8px;
}
.wallet-page .menu-section .menu-item.today-bill .subtitles-container.data-v-7378640c {
margin-top: 16px;
}
.wallet-page .menu-section .menu-item.today-bill .view-history.data-v-7378640c {
margin-left: 16px;
color: #333;
cursor: pointer;
}
.wallet-page .no-bill-message.data-v-7378640c {
text-align: center;
padding: 16px;
color: #999;
background-color: #fff;
}

View File

@ -0,0 +1 @@
<view class="wallet-page data-v-7378640c"><view class="balance-section data-v-7378640c"><text class="balance-label data-v-7378640c">钱包余额(元)</text><view class="balance-amount data-v-7378640c"><text class="amount data-v-7378640c">¥{{a}}</text><button class="view-detail data-v-7378640c" onTap="{{b}}">去提现</button></view><view class="transactions-section data-v-7378640c"><view class="transaction-item data-v-7378640c"><text class="transaction-label data-v-7378640c">未到账0.00 ></text><text class="transaction-label data-v-7378640c">可提现0.00 ></text></view><view class="transaction-item data-v-7378640c"><text class="transaction-label data-v-7378640c">已冻结0.00 ></text></view></view></view><view class="menu-section data-v-7378640c"><view class="menu-item data-v-7378640c"><view class="data-v-7378640c"><text class="menu-title data-v-7378640c">慧民贷款</text><view class="subtitles-container data-v-7378640c"><text class="menu-subtitle data-v-7378640c">余额 <text class="data-v-7378640c" style="color:#3292bc">0.00</text></text><text class="menu-subtitle data-v-7378640c">未到账 <text class="data-v-7378640c" style="color:#3292bc">0.00</text></text></view></view><uni-icons class="menu-icon data-v-7378640c" u-i="7378640c-0" onVI="__l" u-p="{{c||''}}"></uni-icons></view><view class="menu-item data-v-7378640c"><text class="menu-title data-v-7378640c">保证金</text><uni-icons class="menu-icon data-v-7378640c" u-i="7378640c-1" onVI="__l" u-p="{{d||''}}"></uni-icons></view><view class="menu-item today-bill data-v-7378640c"><view class="data-v-7378640c"><text class="menu-title data-v-7378640c">今日账单</text><view class="subtitles-container data-v-7378640c"><text class="menu-subtitle data-v-7378640c">收入 <text class="data-v-7378640c" style="color:#3292bc">0.00</text></text><text class="menu-subtitle data-v-7378640c">支出 <text class="data-v-7378640c" style="color:#3292bc">0.00</text></text></view></view><text class="menu-subtitle view-history data-v-7378640c">查看历史账单 <uni-icons class="data-v-7378640c" u-i="7378640c-2" onVI="__l" u-p="{{e||''}}"></uni-icons></text><uni-icons class="menu-icon data-v-7378640c" u-i="7378640c-3" onVI="__l" u-p="{{f||''}}"></uni-icons></view></view><view class="no-bill-message data-v-7378640c"><text class="data-v-7378640c">今天还没有账单哦</text></view></view>

View File

@ -0,0 +1,73 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
_easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
_easycom_uni_icons();
}
const _sfc_main = {
__name: "purse",
setup(__props) {
const totalIncome = common_vendor.ref(0);
common_vendor.onMounted(() => {
getIncome();
});
const getIncome = () => {
common_vendor.index.request({
url: API_api.apiImageUrl + "/api/errandIncome/count/money",
method: "POST",
header: {
"Content-Type": "application/json",
"cookie": common_vendor.index.getStorageSync("cookie") || ""
// 如果需要带上登录态
},
success: (res) => {
console.log("接口返回:", res);
if (res.data.code === 0 && res.data.data != null) {
totalIncome.value = res.data.data;
} else {
common_vendor.index.showToast({
title: res.data.message || "获取数据失败",
icon: "none"
});
}
},
fail: (err) => {
console.error("请求失败:", err);
common_vendor.index.showToast({
title: "网络错误,请检查连接",
icon: "none"
});
}
});
};
return (_ctx, _cache) => {
return {
a: common_vendor.t(totalIncome.value.toFixed(2)),
b: common_vendor.o((...args) => _ctx.viewDetail && _ctx.viewDetail(...args)),
c: common_vendor.p({
type: "angle-right",
size: "24"
}),
d: common_vendor.p({
type: "angle-right",
size: "24"
}),
e: common_vendor.p({
type: "right",
size: "16"
}),
f: common_vendor.p({
type: "angle-right",
size: "24"
})
};
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7378640c"]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,7 @@
{
"defaultTitle": "我的钱包",
"titleBarColor": "#5e7dec",
"usingComponents": {
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
}
}

View File

@ -0,0 +1,127 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.container.data-v-bac4a35d {
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.header.data-v-bac4a35d {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.header .title.data-v-bac4a35d {
font-size: 24px;
font-weight: bold;
}
.form .input-group.data-v-bac4a35d {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.form .input-group .label.data-v-bac4a35d {
flex: 1;
font-size: 14px;
margin-right: 20px;
}
.form .input-group .input.data-v-bac4a35d {
flex: 3;
}
.form .input-group .input .styled-input.data-v-bac4a35d {
font-size: 14px;
width: 100%;
padding: 10px;
background-color: rgba(255, 235, 59, 0.6);
/* 淡黄色并带有透明度 */
border: none;
border-radius: 20px;
/* 圆角 */
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
/* 添加阴影以创建立体效果 */
outline: none;
transition: all 0.2s ease-in-out;
}
.form .input-group .input .styled-input.data-v-bac4a35d:focus {
background-color: rgba(255, 235, 59, 0.8);
/* 增加透明度 */
box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
/* 更强的阴影 */
}
.form .button.data-v-bac4a35d {
margin-top: 20px;
}
.form .button .styled-button.data-v-bac4a35d {
width: 100%;
padding: 10px;
background-color: #5e7dec;
color: #fff;
border: none;
border-radius: 15px;
cursor: pointer;
font-size: 16px;
line-height: inherit;
transition: background-color 0.2s;
}
.form .button .styled-button.data-v-bac4a35d:hover {
background-color: #5e7dec;
}
/* 新增radio样式 */
.radio-group.data-v-bac4a35d {
display: flex;
align-items: center;
height: 100%;
}
.radio-group .radio-label.data-v-bac4a35d {
display: flex;
align-items: center;
margin-right: 30px;
font-size: 14px;
/* 移除直接对radio的样式操作 */
/* 改为通过包裹元素实现间距 */
}
.radio-group .radio-label .radio-wrapper.data-v-bac4a35d {
display: inline-block;
margin-right: 5px;
transform: scale(0.9);
}
/* 新增下拉选择样式 */
.distribution-select.data-v-bac4a35d {
width: 100%;
}
.distribution-select .uni-select.data-v-bac4a35d {
padding: 10px;
background-color: rgba(255, 235, 59, 0.6);
border-radius: 20px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
}
.distribution-select .uni-select.data-v-bac4a35d::after {
border-color: #5e7dec;
/* 下拉箭头颜色 */
}

View File

@ -0,0 +1 @@
<view class="container data-v-bac4a35d"><view class="header data-v-bac4a35d"><view class="title data-v-bac4a35d">跑腿注册</view></view><view class="form data-v-bac4a35d"><view a:for="{{a}}" a:for-item="field" a:key="l" class="input-group data-v-bac4a35d"><view class="label data-v-bac4a35d">{{field.a}}</view><view class="input data-v-bac4a35d"><block a:if="{{field.b}}"><radio-group value="{{field.c}}" onChange="{{field.d}}" class="radio-group data-v-bac4a35d"><label class="radio-label data-v-bac4a35d"><view class="radio-wrapper data-v-bac4a35d"><radio class="data-v-bac4a35d" value="男" color="#5e7dec"/></view> 男 </label><label class="radio-label data-v-bac4a35d"><view class="radio-wrapper data-v-bac4a35d"><radio class="data-v-bac4a35d" value="女" color="#5e7dec"/></view> 女 </label></radio-group></block><block a:elif="{{field.e}}"><uni-data-select class="distribution-select data-v-bac4a35d" u-i="{{field.f}}" onVI="__l" onUpdateModelValue="{{field.g}}" u-p="{{field.h||''}}"></uni-data-select></block><input a:else placeholder="{{field.i}}" class="styled-input data-v-bac4a35d" value="{{field.j}}" onInput="{{field.k}}"/></view></view><view class="button data-v-bac4a35d"><button onTap="{{b}}" class="styled-button data-v-bac4a35d">点击注册</button></view></view></view>

View File

@ -0,0 +1,278 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const API_api = require("../../API/api.js");
const _sfc_main = {
data() {
return {
formData: {
checkPassword: "",
distributionScope: "",
errandName: "",
errandPhone: "",
gender: "",
userAccount: "",
userPassword: ""
},
range: [
{
value: "1公寓",
text: "1公寓"
},
{
value: "2公寓",
text: "2公寓"
},
{
value: "3公寓",
text: "3公寓"
},
{
value: "4公寓",
text: "4公寓"
},
{
value: "5公寓",
text: "5公寓"
},
{
value: "6公寓",
text: "6公寓"
},
{
value: "7公寓",
text: "7公寓"
},
{
value: "8公寓",
text: "8公寓"
},
{
value: "9公寓",
text: "9公寓"
},
{
value: "10公寓",
text: "10公寓"
},
{
value: "11公寓",
text: "11公寓"
},
{
value: "12公寓",
text: "12公寓"
},
{
value: "育才大厦",
text: "育才大厦"
}
],
fields: [
{
label: "账户",
model: "userAccount",
placeholder: "请输入账户"
},
{
label: "密码",
model: "userPassword",
placeholder: "请输入密码"
},
{
label: "确认密码",
model: "checkPassword",
placeholder: "请再次输入密码"
},
{
label: "用户名称",
model: "errandName",
placeholder: "请输入用户名称"
},
{
label: "手机号",
model: "errandPhone",
placeholder: "请输入手机号"
},
{
label: "性别",
model: "gender",
placeholder: "请选择性别"
},
{
label: "配送范围",
model: "distributionScope",
placeholder: "请选择配送范围"
}
]
};
},
methods: {
handleGenderChange(e) {
this.formData.gender = e.detail.value === "男" ? 0 : 1;
},
saveAddress() {
if (!this.validateForm()) {
return;
}
const url = API_api.apiImageUrl + "/api/errand/add";
const data = {
checkPassword: this.formData.checkPassword,
distributionScope: this.formData.distributionScope,
errandName: this.formData.errandName,
errandPhone: this.formData.errandPhone,
gender: this.formData.gender,
userAccount: this.formData.userAccount,
userPassword: this.formData.userPassword
};
common_vendor.index.request({
url,
method: "POST",
data,
header: {
"Content-Type": "application/json"
},
success(res) {
console.log(res.data);
if (res.data.code === 0) {
common_vendor.index.showToast({
title: "注册成功!",
duration: 2e3,
icon: "success"
});
common_vendor.index.reLaunch({
url: "/pages/login/login"
});
} else if (res.data.code === 4e4) {
common_vendor.index.showToast({
title: res.data.description,
duration: 2e3,
icon: "fail"
});
}
},
fail(err) {
console.error(err);
common_vendor.index.showModal({
title: "注册失败",
//提示标题
content: "请重新输入"
//提示内容
//showCancel: true, //是否显示取消按钮
// success: function (res) {
// if (res.confirm) { //confirm为ture代表用户点击确定
// console.log('点击了确定按钮');
// } else if (res.cancel) { //cancel为ture代表用户点击取消
// console.log('点击了取消按钮');
// }
// }
});
}
});
},
validateForm() {
if (!this.formData.userAccount) {
common_vendor.index.showToast({
title: "请输入账户",
icon: "none"
});
return false;
}
if (!this.formData.userPassword) {
common_vendor.index.showToast({
title: "请输入密码",
icon: "none"
});
return false;
}
if (this.formData.userPassword.length < 8) {
common_vendor.index.showToast({
title: "密码过短至少8位",
icon: "none"
});
return false;
}
if (!this.formData.checkPassword) {
common_vendor.index.showToast({
title: "请输入确认密码",
icon: "none"
});
return false;
}
if (this.formData.userPassword !== this.formData.checkPassword) {
common_vendor.index.showToast({
title: "两次密码不一致",
icon: "none"
});
return false;
}
if (!this.formData.errandName) {
common_vendor.index.showToast({
title: "请输入用户名称",
icon: "none"
});
return false;
}
if (!this.formData.errandPhone) {
common_vendor.index.showToast({
title: "请输入手机号",
icon: "none"
});
return false;
}
if (!this.formData.gender) {
common_vendor.index.showToast({
title: "请选择性别",
icon: "none"
});
return false;
}
if (!this.formData.distributionScope) {
common_vendor.index.showToast({
title: "请选择配送范围",
icon: "none"
});
return false;
}
return true;
}
}
};
if (!Array) {
const _easycom_uni_data_select2 = common_vendor.resolveComponent("uni-data-select");
_easycom_uni_data_select2();
}
const _easycom_uni_data_select = () => "../../uni_modules/uni-data-select/components/uni-data-select/uni-data-select.js";
if (!Math) {
_easycom_uni_data_select();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.f($data.fields, (field, index, i0) => {
return common_vendor.e({
a: common_vendor.t(field.label),
b: field.model === "gender"
}, field.model === "gender" ? {
c: $data.formData.gender,
d: common_vendor.o((...args) => $options.handleGenderChange && $options.handleGenderChange(...args))
} : field.model === "distributionScope" ? {
f: "bac4a35d-0-" + i0,
g: common_vendor.o(($event) => $data.formData.distributionScope = $event),
h: common_vendor.p({
localdata: $data.range,
clear: false,
modelValue: $data.formData.distributionScope
})
} : {
i: field.placeholder,
j: $data.formData[field.model],
k: common_vendor.o(($event) => $data.formData[field.model] = $event.detail.value)
}, {
e: field.model === "distributionScope",
l: index
});
}),
b: common_vendor.o((...args) => $options.saveAddress && $options.saveAddress(...args))
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-bac4a35d"]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,7 @@
{
"defaultTitle": "注册",
"titleBarColor": "#5e7dec",
"usingComponents": {
"uni-data-select": "../../uni_modules/uni-data-select/components/uni-data-select/uni-data-select"
}
}

View File

@ -0,0 +1,29 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.example-body {
padding: 10px;
padding-top: 0;
}

View File

@ -0,0 +1 @@
<view class="container"><view class="example-body"><uni-file-picker u-i="13c4a816-0" onVI="__l" u-p="{{a||''}}"></uni-file-picker></view></view>

View File

@ -0,0 +1,21 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {};
if (!Array) {
const _easycom_uni_file_picker2 = common_vendor.resolveComponent("uni-file-picker");
_easycom_uni_file_picker2();
}
const _easycom_uni_file_picker = () => "../../uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.js";
if (!Math) {
_easycom_uni_file_picker();
}
function _sfc_render(_ctx, _cache) {
return {
a: common_vendor.p({
limit: "9",
title: "最多选择9张图片"
})
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
my.createPage(MiniProgramPage);

View File

@ -0,0 +1,7 @@
{
"defaultTitle": "拍照",
"titleBarColor": "#5e7dec",
"usingComponents": {
"uni-file-picker": "../../uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker"
}
}

View File

@ -0,0 +1 @@
<button onTap="{{a}}">获取定位</button>

View File

@ -0,0 +1,24 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
__name: "test",
setup(__props) {
const getAddress = () => {
common_vendor.index.chooseLocation({
success: (res) => {
console.log(res);
console.log("位置名称:" + res.name);
console.log("详细地址:" + res.address);
console.log("纬度:" + res.latitude);
console.log("经度:" + res.longitude);
}
});
};
return (_ctx, _cache) => {
return {
a: common_vendor.o(getAddress)
};
};
}
};
my.createPage(_sfc_main);

View File

@ -0,0 +1,5 @@
{
"defaultTitle": "测试",
"titleBarColor": "#5e7dec",
"usingComponents": {}
}