上传代码
3
distribution/unpackage/dist/dev/mp-alipay/API/api.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
const apiImageUrl = "https://xiaokuaisong.shop:6448";
|
||||
exports.apiImageUrl = apiImageUrl;
|
3
distribution/unpackage/dist/dev/mp-alipay/app.acss
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
/*每个页面公共css */
|
||||
page{--status-bar-height:25px;--top-window-height:0px;--window-top:0px;--window-bottom:0px;--window-left:0px;--window-right:0px;--window-magin:0px}
|
37
distribution/unpackage/dist/dev/mp-alipay/app.js
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
const common_vendor = require("./common/vendor.js");
|
||||
if (!Math) {
|
||||
"./pages/index/index.js";
|
||||
"./pages/my/my.js";
|
||||
"./pages/orderList/orderList.js";
|
||||
"./pages/test/test.js";
|
||||
"./pages/map/map.js";
|
||||
"./pages/takePhoto/takePhoto.js";
|
||||
"./pages/purse/purse.js";
|
||||
"./pages/login/login.js";
|
||||
"./pages/register/register.js";
|
||||
"./pages/authentication/authentication.js";
|
||||
"./pages/changeUserMessage/changeUserMessage.js";
|
||||
"./pages/orderDetail/orderDetail.js";
|
||||
"./pages/deliveryDetail/deliveryDetail.js";
|
||||
}
|
||||
const _sfc_main = {
|
||||
onLaunch: function() {
|
||||
console.log("App Launch");
|
||||
},
|
||||
onShow: function() {
|
||||
console.log("App Show");
|
||||
},
|
||||
onHide: function() {
|
||||
console.log("App Hide");
|
||||
}
|
||||
};
|
||||
function createApp() {
|
||||
const app = common_vendor.createSSRApp(_sfc_main);
|
||||
return {
|
||||
app
|
||||
};
|
||||
}
|
||||
createApp().app.mount("#app");
|
||||
exports.createApp = createApp;
|
48
distribution/unpackage/dist/dev/mp-alipay/app.json
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/my/my",
|
||||
"pages/orderList/orderList",
|
||||
"pages/test/test",
|
||||
"pages/map/map",
|
||||
"pages/takePhoto/takePhoto",
|
||||
"pages/purse/purse",
|
||||
"pages/login/login",
|
||||
"pages/register/register",
|
||||
"pages/authentication/authentication",
|
||||
"pages/changeUserMessage/changeUserMessage",
|
||||
"pages/orderDetail/orderDetail",
|
||||
"pages/deliveryDetail/deliveryDetail"
|
||||
],
|
||||
"window": {
|
||||
"defaultTitle": "uni-app",
|
||||
"titleBarColor": "#F8F8F8",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
},
|
||||
"tabBar": {
|
||||
"textColor": "#B4BCC6",
|
||||
"selectedColor": "#2588FF",
|
||||
"items": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"name": "首页",
|
||||
"icon": "static/tabbar/index.png",
|
||||
"activeIcon": "static/tabbar/index1.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/orderList/orderList",
|
||||
"name": "订单",
|
||||
"icon": "static/tabbar/order.png",
|
||||
"activeIcon": "static/tabbar/order1.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/my/my",
|
||||
"name": "我的",
|
||||
"icon": "static/tabbar/my.png",
|
||||
"activeIcon": "static/tabbar/my1.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"subPackageBuildType": "shared",
|
||||
"usingComponents": {}
|
||||
}
|
BIN
distribution/unpackage/dist/dev/mp-alipay/assets/uniicons.32e978a5.ttf
vendored
Normal file
11205
distribution/unpackage/dist/dev/mp-alipay/common/vendor.js
vendored
Normal file
11
distribution/unpackage/dist/dev/mp-alipay/mini.project.json
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"format": 2,
|
||||
"compileOptions": {
|
||||
"component2": true,
|
||||
"enableNodeModuleBabelTransform": true
|
||||
},
|
||||
"unknownConfig": {
|
||||
"appid": "touristappid",
|
||||
"projectname": "distribution"
|
||||
}
|
||||
}
|
119
distribution/unpackage/dist/dev/mp-alipay/pages/authentication/authentication.acss
vendored
Normal 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; /* 确保图片内容完整显示 */
|
||||
}
|
1
distribution/unpackage/dist/dev/mp-alipay/pages/authentication/authentication.axml
vendored
Normal 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>
|
160
distribution/unpackage/dist/dev/mp-alipay/pages/authentication/authentication.js
vendored
Normal 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);
|
7
distribution/unpackage/dist/dev/mp-alipay/pages/authentication/authentication.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"defaultTitle": "身份认证",
|
||||
"titleBarColor": "#5e7dec",
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
86
distribution/unpackage/dist/dev/mp-alipay/pages/changeUserMessage/changeUserMessage.acss
vendored
Normal 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); /* 减弱阴影效果 */
|
||||
}
|
1
distribution/unpackage/dist/dev/mp-alipay/pages/changeUserMessage/changeUserMessage.axml
vendored
Normal 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>
|
121
distribution/unpackage/dist/dev/mp-alipay/pages/changeUserMessage/changeUserMessage.js
vendored
Normal 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);
|
5
distribution/unpackage/dist/dev/mp-alipay/pages/changeUserMessage/changeUserMessage.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"defaultTitle": "修改用户信息",
|
||||
"titleBarColor": "#5e7dec",
|
||||
"usingComponents": {}
|
||||
}
|
88
distribution/unpackage/dist/dev/mp-alipay/pages/deliveryDetail/deliveryDetail.acss
vendored
Normal 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;
|
||||
/* 文字与图标之间的间距 */
|
||||
}
|
1
distribution/unpackage/dist/dev/mp-alipay/pages/deliveryDetail/deliveryDetail.axml
vendored
Normal 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>
|
279
distribution/unpackage/dist/dev/mp-alipay/pages/deliveryDetail/deliveryDetail.js
vendored
Normal 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);
|
7
distribution/unpackage/dist/dev/mp-alipay/pages/deliveryDetail/deliveryDetail.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"defaultTitle": "订单详情",
|
||||
"titleBarColor": "#5e7dec",
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
264
distribution/unpackage/dist/dev/mp-alipay/pages/index/index.acss
vendored
Normal 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;
|
||||
/* 根据底部按钮高度调整 */
|
||||
}
|
1
distribution/unpackage/dist/dev/mp-alipay/pages/index/index.axml
vendored
Normal file
421
distribution/unpackage/dist/dev/mp-alipay/pages/index/index.js
vendored
Normal 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);
|
9
distribution/unpackage/dist/dev/mp-alipay/pages/index/index.json
vendored
Normal 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"
|
||||
}
|
||||
}
|
125
distribution/unpackage/dist/dev/mp-alipay/pages/login/login.acss
vendored
Normal 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;
|
||||
}
|
1
distribution/unpackage/dist/dev/mp-alipay/pages/login/login.axml
vendored
Normal 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>
|
140
distribution/unpackage/dist/dev/mp-alipay/pages/login/login.js
vendored
Normal 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);
|
5
distribution/unpackage/dist/dev/mp-alipay/pages/login/login.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"defaultTitle": "登录",
|
||||
"titleBarColor": "#5e7dec",
|
||||
"usingComponents": {}
|
||||
}
|
0
distribution/unpackage/dist/dev/mp-alipay/pages/map/map.acss
vendored
Normal file
1
distribution/unpackage/dist/dev/mp-alipay/pages/map/map.axml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view><button onTap="{{a}}">获取定位</button></view>
|
25
distribution/unpackage/dist/dev/mp-alipay/pages/map/map.js
vendored
Normal 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);
|
5
distribution/unpackage/dist/dev/mp-alipay/pages/map/map.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"defaultTitle": "配送范围",
|
||||
"titleBarColor": "#5e7dec",
|
||||
"usingComponents": {}
|
||||
}
|
154
distribution/unpackage/dist/dev/mp-alipay/pages/my/my.acss
vendored
Normal 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);
|
||||
}
|
||||
}
|
1
distribution/unpackage/dist/dev/mp-alipay/pages/my/my.axml
vendored
Normal 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>
|
270
distribution/unpackage/dist/dev/mp-alipay/pages/my/my.js
vendored
Normal 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);
|
8
distribution/unpackage/dist/dev/mp-alipay/pages/my/my.json
vendored
Normal 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"
|
||||
}
|
||||
}
|
83
distribution/unpackage/dist/dev/mp-alipay/pages/orderDetail/orderDetail.acss
vendored
Normal 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; /* 文字与图标之间的间距 */
|
||||
}
|
||||
|
1
distribution/unpackage/dist/dev/mp-alipay/pages/orderDetail/orderDetail.axml
vendored
Normal 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>
|
159
distribution/unpackage/dist/dev/mp-alipay/pages/orderDetail/orderDetail.js
vendored
Normal 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);
|
7
distribution/unpackage/dist/dev/mp-alipay/pages/orderDetail/orderDetail.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"defaultTitle": "订单详情",
|
||||
"titleBarColor": "#5e7dec",
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
39
distribution/unpackage/dist/dev/mp-alipay/pages/orderList/orderList.acss
vendored
Normal 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;
|
||||
}
|
1
distribution/unpackage/dist/dev/mp-alipay/pages/orderList/orderList.axml
vendored
Normal 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>
|
48
distribution/unpackage/dist/dev/mp-alipay/pages/orderList/orderList.js
vendored
Normal 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);
|
5
distribution/unpackage/dist/dev/mp-alipay/pages/orderList/orderList.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"defaultTitle": "历史订单查询",
|
||||
"titleBarColor": "#5e7dec",
|
||||
"usingComponents": {}
|
||||
}
|
118
distribution/unpackage/dist/dev/mp-alipay/pages/purse/purse.acss
vendored
Normal 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;
|
||||
}
|
1
distribution/unpackage/dist/dev/mp-alipay/pages/purse/purse.axml
vendored
Normal 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>
|
73
distribution/unpackage/dist/dev/mp-alipay/pages/purse/purse.js
vendored
Normal 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);
|
7
distribution/unpackage/dist/dev/mp-alipay/pages/purse/purse.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"defaultTitle": "我的钱包",
|
||||
"titleBarColor": "#5e7dec",
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../uni_modules/uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
127
distribution/unpackage/dist/dev/mp-alipay/pages/register/register.acss
vendored
Normal 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;
|
||||
/* 下拉箭头颜色 */
|
||||
}
|
1
distribution/unpackage/dist/dev/mp-alipay/pages/register/register.axml
vendored
Normal 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>
|
278
distribution/unpackage/dist/dev/mp-alipay/pages/register/register.js
vendored
Normal 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);
|
7
distribution/unpackage/dist/dev/mp-alipay/pages/register/register.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"defaultTitle": "注册",
|
||||
"titleBarColor": "#5e7dec",
|
||||
"usingComponents": {
|
||||
"uni-data-select": "../../uni_modules/uni-data-select/components/uni-data-select/uni-data-select"
|
||||
}
|
||||
}
|
29
distribution/unpackage/dist/dev/mp-alipay/pages/takePhoto/takePhoto.acss
vendored
Normal 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;
|
||||
}
|
1
distribution/unpackage/dist/dev/mp-alipay/pages/takePhoto/takePhoto.axml
vendored
Normal 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>
|
21
distribution/unpackage/dist/dev/mp-alipay/pages/takePhoto/takePhoto.js
vendored
Normal 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);
|
7
distribution/unpackage/dist/dev/mp-alipay/pages/takePhoto/takePhoto.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"defaultTitle": "拍照",
|
||||
"titleBarColor": "#5e7dec",
|
||||
"usingComponents": {
|
||||
"uni-file-picker": "../../uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker"
|
||||
}
|
||||
}
|
0
distribution/unpackage/dist/dev/mp-alipay/pages/test/test.acss
vendored
Normal file
1
distribution/unpackage/dist/dev/mp-alipay/pages/test/test.axml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<button onTap="{{a}}">获取定位</button>
|
24
distribution/unpackage/dist/dev/mp-alipay/pages/test/test.js
vendored
Normal 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);
|
5
distribution/unpackage/dist/dev/mp-alipay/pages/test/test.json
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"defaultTitle": "测试",
|
||||
"titleBarColor": "#5e7dec",
|
||||
"usingComponents": {}
|
||||
}
|
BIN
distribution/unpackage/dist/dev/mp-alipay/static/login.jpg
vendored
Normal file
After Width: | Height: | Size: 104 KiB |
BIN
distribution/unpackage/dist/dev/mp-alipay/static/logo.png
vendored
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
distribution/unpackage/dist/dev/mp-alipay/static/tabbar/index.png
vendored
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
distribution/unpackage/dist/dev/mp-alipay/static/tabbar/index1.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
distribution/unpackage/dist/dev/mp-alipay/static/tabbar/message.png
vendored
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
distribution/unpackage/dist/dev/mp-alipay/static/tabbar/message1.png
vendored
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
distribution/unpackage/dist/dev/mp-alipay/static/tabbar/my.png
vendored
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
distribution/unpackage/dist/dev/mp-alipay/static/tabbar/my1.png
vendored
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
distribution/unpackage/dist/dev/mp-alipay/static/tabbar/order.png
vendored
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
distribution/unpackage/dist/dev/mp-alipay/static/tabbar/order1.png
vendored
Normal file
After Width: | Height: | Size: 3.4 KiB |
@ -0,0 +1,199 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
@media screen and (max-width: 500px) {
|
||||
.hide-on-phone {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.uni-stat__select {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.uni-stat-box {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
.uni-stat__actived {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
.uni-label-text {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #6a6a6a;
|
||||
margin: auto 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.uni-select {
|
||||
font-size: 14px;
|
||||
border: 1px solid #e5e5e5;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
padding: 0 5px;
|
||||
padding-left: 10px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
border-bottom: solid 1px #e5e5e5;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
height: 35px;
|
||||
}
|
||||
.uni-select--disabled {
|
||||
background-color: #f5f7fa;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
.uni-select__label {
|
||||
font-size: 16px;
|
||||
height: 35px;
|
||||
padding-right: 10px;
|
||||
color: #909399;
|
||||
}
|
||||
.uni-select__input-box {
|
||||
height: 35px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
.uni-select__input {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.uni-select__input-plac {
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
}
|
||||
.uni-select__selector {
|
||||
box-sizing: border-box;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #FFFFFF;
|
||||
border: 1px solid #EBEEF5;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
z-index: 3;
|
||||
padding: 4px 0;
|
||||
}
|
||||
.uni-select__selector-scroll {
|
||||
max-height: 200px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.uni-select__selector-empty,
|
||||
.uni-select__selector-item {
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
line-height: 35px;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
/* border-bottom: solid 1px $uni-border-3; */
|
||||
padding: 0px 10px;
|
||||
}
|
||||
.uni-select__selector-item:hover {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
.uni-select__selector-empty:last-child,
|
||||
.uni-select__selector-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.uni-select__selector__disabled {
|
||||
opacity: 0.4;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* picker 弹出层通用的指示小三角 */
|
||||
.uni-popper__arrow_bottom,
|
||||
.uni-popper__arrow_bottom::after,
|
||||
.uni-popper__arrow_top,
|
||||
.uni-popper__arrow_top::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: transparent;
|
||||
border-style: solid;
|
||||
border-width: 6px;
|
||||
}
|
||||
.uni-popper__arrow_bottom {
|
||||
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
||||
top: -6px;
|
||||
left: 10%;
|
||||
margin-right: 3px;
|
||||
border-top-width: 0;
|
||||
border-bottom-color: #EBEEF5;
|
||||
}
|
||||
.uni-popper__arrow_bottom::after {
|
||||
content: " ";
|
||||
top: 1px;
|
||||
margin-left: -6px;
|
||||
border-top-width: 0;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
.uni-popper__arrow_top {
|
||||
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
||||
bottom: -6px;
|
||||
left: 10%;
|
||||
margin-right: 3px;
|
||||
border-bottom-width: 0;
|
||||
border-top-color: #EBEEF5;
|
||||
}
|
||||
.uni-popper__arrow_top::after {
|
||||
content: " ";
|
||||
bottom: 1px;
|
||||
margin-left: -6px;
|
||||
border-bottom-width: 0;
|
||||
border-top-color: #fff;
|
||||
}
|
||||
.uni-select__input-text {
|
||||
width: 100%;
|
||||
color: #333;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
.uni-select__input-placeholder {
|
||||
color: #6a6a6a;
|
||||
font-size: 12px;
|
||||
}
|
||||
.uni-select--mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
}
|
@ -0,0 +1 @@
|
||||
<view class="uni-stat__select"><label a:if="{{a}}" class="uni-label-text hide-on-phone">{{b}}</label><view class="{{('uni-stat-box') + ' ' + (t && 'uni-stat__actived')}}"><view class="{{('uni-select') + ' ' + (s && 'uni-select--disabled')}}"><view class="uni-select__input-box" onTap="{{j}}"><view a:if="{{c}}" class="uni-select__input-text">{{d}}</view><view a:else class="uni-select__input-text uni-select__input-placeholder">{{e}}</view><view a:if="{{f}}" catchTap="{{h}}"><uni-icons u-i="dce84b52-0" onVI="__l" u-p="{{g||''}}"/></view><view a:else><uni-icons u-i="dce84b52-1" onVI="__l" u-p="{{i||''}}"/></view></view><view a:if="{{k}}" class="uni-select--mask" onTap="{{l}}"/><view a:if="{{m}}" class="uni-select__selector" style="{{r}}"><view class="{{n}}"></view><scroll-view scroll-y="true" class="uni-select__selector-scroll"><view a:if="{{o}}" class="uni-select__selector-empty"><text>{{p}}</text></view><block a:else><view a:for="{{q}}" a:for-item="item" a:key="c" class="uni-select__selector-item" onTap="{{item.d}}"><text class="{{(item.b && 'uni-select__selector__disabled')}}">{{item.a}}</text></view></block></scroll-view></view></view></view></view>
|
@ -0,0 +1,318 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "uni-data-select",
|
||||
mixins: [common_vendor.Zs.mixinDatacom || {}],
|
||||
props: {
|
||||
localdata: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
},
|
||||
modelValue: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "请选择"
|
||||
},
|
||||
emptyTips: {
|
||||
type: String,
|
||||
default: "无选项"
|
||||
},
|
||||
clear: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
defItem: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 格式化输出 用法 field="_id as value, version as text, uni_platform as label" format="{label} - {text}"
|
||||
format: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
placement: {
|
||||
type: String,
|
||||
default: "bottom"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showSelector: false,
|
||||
current: "",
|
||||
mixinDatacomResData: [],
|
||||
apps: [],
|
||||
channels: [],
|
||||
cacheKey: "uni-data-select-lastSelectedValue"
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.debounceGet = this.debounce(() => {
|
||||
this.query();
|
||||
}, 300);
|
||||
if (this.collection && !this.localdata.length) {
|
||||
this.debounceGet();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
typePlaceholder() {
|
||||
const text = {
|
||||
"opendb-stat-app-versions": "版本",
|
||||
"opendb-app-channels": "渠道",
|
||||
"opendb-app-list": "应用"
|
||||
};
|
||||
const common = this.placeholder;
|
||||
const placeholder = text[this.collection];
|
||||
return placeholder ? common + placeholder : common;
|
||||
},
|
||||
valueCom() {
|
||||
return this.modelValue;
|
||||
},
|
||||
textShow() {
|
||||
let text = this.current;
|
||||
if (text.length > 10) {
|
||||
return text.slice(0, 25) + "...";
|
||||
}
|
||||
return text;
|
||||
},
|
||||
getOffsetByPlacement() {
|
||||
switch (this.placement) {
|
||||
case "top":
|
||||
return "bottom:calc(100% + 12px);";
|
||||
case "bottom":
|
||||
return "top:calc(100% + 12px);";
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
localdata: {
|
||||
immediate: true,
|
||||
handler(val, old) {
|
||||
if (Array.isArray(val) && old !== val) {
|
||||
this.mixinDatacomResData = val;
|
||||
}
|
||||
}
|
||||
},
|
||||
valueCom(val, old) {
|
||||
this.initDefVal();
|
||||
},
|
||||
mixinDatacomResData: {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
if (val.length) {
|
||||
this.initDefVal();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
debounce(fn, time = 100) {
|
||||
let timer = null;
|
||||
return function(...args) {
|
||||
if (timer)
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
fn.apply(this, args);
|
||||
}, time);
|
||||
};
|
||||
},
|
||||
// 执行数据库查询
|
||||
query() {
|
||||
this.mixinDatacomEasyGet();
|
||||
},
|
||||
// 监听查询条件变更事件
|
||||
onMixinDatacomPropsChange() {
|
||||
if (this.collection) {
|
||||
this.debounceGet();
|
||||
}
|
||||
},
|
||||
initDefVal() {
|
||||
let defValue = "";
|
||||
if ((this.valueCom || this.valueCom === 0) && !this.isDisabled(this.valueCom)) {
|
||||
defValue = this.valueCom;
|
||||
} else {
|
||||
let strogeValue;
|
||||
if (this.collection) {
|
||||
strogeValue = this.getCache();
|
||||
}
|
||||
if (strogeValue || strogeValue === 0) {
|
||||
defValue = strogeValue;
|
||||
} else {
|
||||
let defItem = "";
|
||||
if (this.defItem > 0 && this.defItem <= this.mixinDatacomResData.length) {
|
||||
defItem = this.mixinDatacomResData[this.defItem - 1].value;
|
||||
}
|
||||
defValue = defItem;
|
||||
}
|
||||
if (defValue || defValue === 0) {
|
||||
this.emit(defValue);
|
||||
}
|
||||
}
|
||||
const def = this.mixinDatacomResData.find((item) => item.value === defValue);
|
||||
this.current = def ? this.formatItemName(def) : "";
|
||||
},
|
||||
/**
|
||||
* @param {[String, Number]} value
|
||||
* 判断用户给的 value 是否同时为禁用状态
|
||||
*/
|
||||
isDisabled(value) {
|
||||
let isDisabled = false;
|
||||
this.mixinDatacomResData.forEach((item) => {
|
||||
if (item.value === value) {
|
||||
isDisabled = item.disable;
|
||||
}
|
||||
});
|
||||
return isDisabled;
|
||||
},
|
||||
clearVal() {
|
||||
this.emit("");
|
||||
if (this.collection) {
|
||||
this.removeCache();
|
||||
}
|
||||
},
|
||||
change(item) {
|
||||
if (!item.disable) {
|
||||
this.showSelector = false;
|
||||
this.current = this.formatItemName(item);
|
||||
this.emit(item.value);
|
||||
}
|
||||
},
|
||||
emit(val) {
|
||||
this.$emit("input", val);
|
||||
this.$emit("update:modelValue", val);
|
||||
this.$emit("change", val);
|
||||
if (this.collection) {
|
||||
this.setCache(val);
|
||||
}
|
||||
},
|
||||
toggleSelector() {
|
||||
if (this.disabled) {
|
||||
return;
|
||||
}
|
||||
this.showSelector = !this.showSelector;
|
||||
},
|
||||
formatItemName(item) {
|
||||
let {
|
||||
text,
|
||||
value,
|
||||
channel_code
|
||||
} = item;
|
||||
channel_code = channel_code ? `(${channel_code})` : "";
|
||||
if (this.format) {
|
||||
let str = "";
|
||||
str = this.format;
|
||||
for (let key in item) {
|
||||
str = str.replace(new RegExp(`{${key}}`, "g"), item[key]);
|
||||
}
|
||||
return str;
|
||||
} else {
|
||||
return this.collection.indexOf("app-list") > 0 ? `${text}(${value})` : text ? text : `未命名${channel_code}`;
|
||||
}
|
||||
},
|
||||
// 获取当前加载的数据
|
||||
getLoadData() {
|
||||
return this.mixinDatacomResData;
|
||||
},
|
||||
// 获取当前缓存key
|
||||
getCurrentCacheKey() {
|
||||
return this.collection;
|
||||
},
|
||||
// 获取缓存
|
||||
getCache(name = this.getCurrentCacheKey()) {
|
||||
let cacheData = common_vendor.index.getStorageSync(this.cacheKey) || {};
|
||||
return cacheData[name];
|
||||
},
|
||||
// 设置缓存
|
||||
setCache(value, name = this.getCurrentCacheKey()) {
|
||||
let cacheData = common_vendor.index.getStorageSync(this.cacheKey) || {};
|
||||
cacheData[name] = value;
|
||||
common_vendor.index.setStorageSync(this.cacheKey, cacheData);
|
||||
},
|
||||
// 删除缓存
|
||||
removeCache(name = this.getCurrentCacheKey()) {
|
||||
let cacheData = common_vendor.index.getStorageSync(this.cacheKey) || {};
|
||||
delete cacheData[name];
|
||||
common_vendor.index.setStorageSync(this.cacheKey, cacheData);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
_easycom_uni_icons2();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../../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: $props.label
|
||||
}, $props.label ? {
|
||||
b: common_vendor.t($props.label + ":")
|
||||
} : {}, {
|
||||
c: $data.current
|
||||
}, $data.current ? {
|
||||
d: common_vendor.t($options.textShow)
|
||||
} : {
|
||||
e: common_vendor.t($options.typePlaceholder)
|
||||
}, {
|
||||
f: $data.current && $props.clear && !$props.disabled
|
||||
}, $data.current && $props.clear && !$props.disabled ? {
|
||||
g: common_vendor.p({
|
||||
type: "clear",
|
||||
color: "#c0c4cc",
|
||||
size: "24"
|
||||
}),
|
||||
h: common_vendor.o((...args) => $options.clearVal && $options.clearVal(...args))
|
||||
} : {
|
||||
i: common_vendor.p({
|
||||
type: $data.showSelector ? "top" : "bottom",
|
||||
size: "14",
|
||||
color: "#999"
|
||||
})
|
||||
}, {
|
||||
j: common_vendor.o((...args) => $options.toggleSelector && $options.toggleSelector(...args)),
|
||||
k: $data.showSelector
|
||||
}, $data.showSelector ? {
|
||||
l: common_vendor.o((...args) => $options.toggleSelector && $options.toggleSelector(...args))
|
||||
} : {}, {
|
||||
m: $data.showSelector
|
||||
}, $data.showSelector ? common_vendor.e({
|
||||
n: common_vendor.n($props.placement == "bottom" ? "uni-popper__arrow_bottom" : "uni-popper__arrow_top"),
|
||||
o: $data.mixinDatacomResData.length === 0
|
||||
}, $data.mixinDatacomResData.length === 0 ? {
|
||||
p: common_vendor.t($props.emptyTips)
|
||||
} : {
|
||||
q: common_vendor.f($data.mixinDatacomResData, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t($options.formatItemName(item)),
|
||||
b: item.disable ? 1 : "",
|
||||
c: index,
|
||||
d: common_vendor.o(($event) => $options.change(item))
|
||||
};
|
||||
})
|
||||
}, {
|
||||
r: common_vendor.s($options.getOffsetByPlacement)
|
||||
}) : {}, {
|
||||
s: $props.disabled ? 1 : "",
|
||||
t: $data.current ? 1 : ""
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
my.createComponent(Component);
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"styleIsolation": "apply-shared",
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../../uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
@ -0,0 +1,199 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const ERR_MSG_OK = "chooseAndUploadFile:ok";
|
||||
const ERR_MSG_FAIL = "chooseAndUploadFile:fail";
|
||||
function chooseImage(opts) {
|
||||
const {
|
||||
count,
|
||||
sizeType = ["original", "compressed"],
|
||||
sourceType,
|
||||
extension
|
||||
} = opts;
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.chooseImage({
|
||||
count,
|
||||
sizeType,
|
||||
sourceType,
|
||||
extension,
|
||||
success(res) {
|
||||
resolve(normalizeChooseAndUploadFileRes(res, "image"));
|
||||
},
|
||||
fail(res) {
|
||||
reject({
|
||||
errMsg: res.errMsg.replace("chooseImage:fail", ERR_MSG_FAIL)
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function chooseVideo(opts) {
|
||||
const {
|
||||
count,
|
||||
camera,
|
||||
compressed,
|
||||
maxDuration,
|
||||
sourceType,
|
||||
extension
|
||||
} = opts;
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.chooseVideo({
|
||||
camera,
|
||||
compressed,
|
||||
maxDuration,
|
||||
sourceType,
|
||||
extension,
|
||||
success(res) {
|
||||
const {
|
||||
tempFilePath,
|
||||
duration,
|
||||
size,
|
||||
height,
|
||||
width
|
||||
} = res;
|
||||
resolve(normalizeChooseAndUploadFileRes({
|
||||
errMsg: "chooseVideo:ok",
|
||||
tempFilePaths: [tempFilePath],
|
||||
tempFiles: [{
|
||||
name: res.tempFile && res.tempFile.name || "",
|
||||
path: tempFilePath,
|
||||
size,
|
||||
type: res.tempFile && res.tempFile.type || "",
|
||||
width,
|
||||
height,
|
||||
duration,
|
||||
fileType: "video",
|
||||
cloudPath: ""
|
||||
}]
|
||||
}, "video"));
|
||||
},
|
||||
fail(res) {
|
||||
reject({
|
||||
errMsg: res.errMsg.replace("chooseVideo:fail", ERR_MSG_FAIL)
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function chooseAll(opts) {
|
||||
const {
|
||||
count,
|
||||
extension
|
||||
} = opts;
|
||||
return new Promise((resolve, reject) => {
|
||||
let chooseFile = common_vendor.index.chooseFile;
|
||||
if (typeof wx !== "undefined" && typeof wx.chooseMessageFile === "function") {
|
||||
chooseFile = wx.chooseMessageFile;
|
||||
}
|
||||
if (typeof chooseFile !== "function") {
|
||||
return reject({
|
||||
errMsg: ERR_MSG_FAIL + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
|
||||
});
|
||||
}
|
||||
chooseFile({
|
||||
type: "all",
|
||||
count,
|
||||
extension,
|
||||
success(res) {
|
||||
resolve(normalizeChooseAndUploadFileRes(res));
|
||||
},
|
||||
fail(res) {
|
||||
reject({
|
||||
errMsg: res.errMsg.replace("chooseFile:fail", ERR_MSG_FAIL)
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
function normalizeChooseAndUploadFileRes(res, fileType) {
|
||||
res.tempFiles.forEach((item, index) => {
|
||||
if (!item.name) {
|
||||
item.name = item.path.substring(item.path.lastIndexOf("/") + 1);
|
||||
}
|
||||
if (fileType) {
|
||||
item.fileType = fileType;
|
||||
}
|
||||
item.cloudPath = Date.now() + "_" + index + item.name.substring(item.name.lastIndexOf("."));
|
||||
});
|
||||
if (!res.tempFilePaths) {
|
||||
res.tempFilePaths = res.tempFiles.map((file) => file.path);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
function uploadCloudFiles(files, max = 5, onUploadProgress) {
|
||||
files = JSON.parse(JSON.stringify(files));
|
||||
const len = files.length;
|
||||
let count = 0;
|
||||
let self = this;
|
||||
return new Promise((resolve) => {
|
||||
while (count < max) {
|
||||
next();
|
||||
}
|
||||
function next() {
|
||||
let cur = count++;
|
||||
if (cur >= len) {
|
||||
!files.find((item) => !item.url && !item.errMsg) && resolve(files);
|
||||
return;
|
||||
}
|
||||
const fileItem = files[cur];
|
||||
const index = self.files.findIndex((v) => v.uuid === fileItem.uuid);
|
||||
fileItem.url = "";
|
||||
delete fileItem.errMsg;
|
||||
common_vendor.Zs.uploadFile({
|
||||
filePath: fileItem.path,
|
||||
cloudPath: fileItem.cloudPath,
|
||||
fileType: fileItem.fileType,
|
||||
onUploadProgress: (res) => {
|
||||
res.index = index;
|
||||
onUploadProgress && onUploadProgress(res);
|
||||
}
|
||||
}).then((res) => {
|
||||
fileItem.url = res.fileID;
|
||||
fileItem.index = index;
|
||||
if (cur < len) {
|
||||
next();
|
||||
}
|
||||
}).catch((res) => {
|
||||
fileItem.errMsg = res.errMsg || res.message;
|
||||
fileItem.index = index;
|
||||
if (cur < len) {
|
||||
next();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function uploadFiles(choosePromise, {
|
||||
onChooseFile,
|
||||
onUploadProgress
|
||||
}) {
|
||||
return choosePromise.then((res) => {
|
||||
if (onChooseFile) {
|
||||
const customChooseRes = onChooseFile(res);
|
||||
if (typeof customChooseRes !== "undefined") {
|
||||
return Promise.resolve(customChooseRes).then((chooseRes) => typeof chooseRes === "undefined" ? res : chooseRes);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}).then((res) => {
|
||||
if (res === false) {
|
||||
return {
|
||||
errMsg: ERR_MSG_OK,
|
||||
tempFilePaths: [],
|
||||
tempFiles: []
|
||||
};
|
||||
}
|
||||
return res;
|
||||
});
|
||||
}
|
||||
function chooseAndUploadFile(opts = {
|
||||
type: "all"
|
||||
}) {
|
||||
if (opts.type === "image") {
|
||||
return uploadFiles(chooseImage(opts), opts);
|
||||
} else if (opts.type === "video") {
|
||||
return uploadFiles(chooseVideo(opts), opts);
|
||||
}
|
||||
return uploadFiles(chooseAll(opts), opts);
|
||||
}
|
||||
exports.chooseAndUploadFile = chooseAndUploadFile;
|
||||
exports.uploadCloudFiles = uploadCloudFiles;
|
@ -0,0 +1,42 @@
|
||||
|
||||
.uni-file-picker {
|
||||
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
|
||||
flex: 1;
|
||||
}
|
||||
.uni-file-picker__header {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 10px;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: space-between;
|
||||
}
|
||||
.file-title {
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
.file-count {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
.is-add {
|
||||
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.icon-add {
|
||||
width: 50px;
|
||||
height: 5px;
|
||||
background-color: #f1f1f1;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.rotate {
|
||||
position: absolute;
|
||||
transform: rotate(90deg);
|
||||
}
|
@ -0,0 +1 @@
|
||||
<view class="uni-file-picker"><view a:if="{{a}}" class="uni-file-picker__header"><text class="file-title">{{b}}</text><text class="file-count">{{c}}/{{d}}</text></view><upload-image a:if="{{e}}" u-s="{{['d']}}" onUploadFiles="{{f}}" onChoose="{{g}}" onDelFile="{{h}}" u-i="5c62a7d7-0" onVI="__l" u-p="{{i||''}}"><slot><view class="is-add"><view class="icon-add"></view><view class="icon-add rotate"></view></view></slot></upload-image><upload-file a:if="{{j}}" u-s="{{['d']}}" onUploadFiles="{{k}}" onChoose="{{l}}" onDelFile="{{m}}" u-i="5c62a7d7-1" onVI="__l" u-p="{{n||''}}"><slot><button type="primary" size="mini">选择文件</button></slot></upload-file></view>
|
@ -0,0 +1,556 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const uni_modules_uniFilePicker_components_uniFilePicker_chooseAndUploadFile = require("./choose-and-upload-file.js");
|
||||
const uni_modules_uniFilePicker_components_uniFilePicker_utils = require("./utils.js");
|
||||
const uploadImage = () => "./upload-image.js";
|
||||
const uploadFile = () => "./upload-file.js";
|
||||
const _sfc_main = {
|
||||
name: "uniFilePicker",
|
||||
components: {
|
||||
uploadImage,
|
||||
uploadFile
|
||||
},
|
||||
options: {
|
||||
virtualHost: true
|
||||
},
|
||||
emits: ["select", "success", "fail", "progress", "delete", "update:modelValue", "input"],
|
||||
props: {
|
||||
modelValue: {
|
||||
type: [Array, Object],
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
value: {
|
||||
type: [Array, Object],
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
disablePreview: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
delIcon: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 自动上传
|
||||
autoUpload: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 最大选择个数 ,h5只能限制单选或是多选
|
||||
limit: {
|
||||
type: [Number, String],
|
||||
default: 9
|
||||
},
|
||||
// 列表样式 grid | list | list-card
|
||||
mode: {
|
||||
type: String,
|
||||
default: "grid"
|
||||
},
|
||||
// 选择文件类型 image/video/all
|
||||
fileMediatype: {
|
||||
type: String,
|
||||
default: "image"
|
||||
},
|
||||
// 文件类型筛选
|
||||
fileExtname: {
|
||||
type: [Array, String],
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
listStyles: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
// 是否显示边框
|
||||
border: true,
|
||||
// 是否显示分隔线
|
||||
dividline: true,
|
||||
// 线条样式
|
||||
borderStyle: {}
|
||||
};
|
||||
}
|
||||
},
|
||||
imageStyles: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
width: "auto",
|
||||
height: "auto"
|
||||
};
|
||||
}
|
||||
},
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
returnType: {
|
||||
type: String,
|
||||
default: "array"
|
||||
},
|
||||
sizeType: {
|
||||
type: Array,
|
||||
default() {
|
||||
return ["original", "compressed"];
|
||||
}
|
||||
},
|
||||
sourceType: {
|
||||
type: Array,
|
||||
default() {
|
||||
return ["album", "camera"];
|
||||
}
|
||||
},
|
||||
provider: {
|
||||
type: String,
|
||||
default: ""
|
||||
// 默认上传到 unicloud 内置存储 extStorage 扩展存储
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
files: [],
|
||||
localValue: []
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(newVal, oldVal) {
|
||||
this.setValue(newVal, oldVal);
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
modelValue: {
|
||||
handler(newVal, oldVal) {
|
||||
this.setValue(newVal, oldVal);
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
filesList() {
|
||||
let files = [];
|
||||
this.files.forEach((v) => {
|
||||
files.push(v);
|
||||
});
|
||||
return files;
|
||||
},
|
||||
showType() {
|
||||
if (this.fileMediatype === "image") {
|
||||
return this.mode;
|
||||
}
|
||||
return "list";
|
||||
},
|
||||
limitLength() {
|
||||
if (this.returnType === "object") {
|
||||
return 1;
|
||||
}
|
||||
if (!this.limit) {
|
||||
return 1;
|
||||
}
|
||||
if (this.limit >= 9) {
|
||||
return 9;
|
||||
}
|
||||
return this.limit;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (!(common_vendor.Zs.config && common_vendor.Zs.config.provider)) {
|
||||
this.noSpace = true;
|
||||
common_vendor.Zs.chooseAndUploadFile = uni_modules_uniFilePicker_components_uniFilePicker_chooseAndUploadFile.chooseAndUploadFile;
|
||||
}
|
||||
this.form = this.getForm("uniForms");
|
||||
this.formItem = this.getForm("uniFormsItem");
|
||||
if (this.form && this.formItem) {
|
||||
if (this.formItem.name) {
|
||||
this.rename = this.formItem.name;
|
||||
this.form.inputChildrens.push(this);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 公开用户使用,清空文件
|
||||
* @param {Object} index
|
||||
*/
|
||||
clearFiles(index) {
|
||||
if (index !== 0 && !index) {
|
||||
this.files = [];
|
||||
this.$nextTick(() => {
|
||||
this.setEmit();
|
||||
});
|
||||
} else {
|
||||
this.files.splice(index, 1);
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.setEmit();
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 公开用户使用,继续上传
|
||||
*/
|
||||
upload() {
|
||||
let files = [];
|
||||
this.files.forEach((v, index) => {
|
||||
if (v.status === "ready" || v.status === "error") {
|
||||
files.push(Object.assign({}, v));
|
||||
}
|
||||
});
|
||||
return this.uploadFiles(files);
|
||||
},
|
||||
async setValue(newVal, oldVal) {
|
||||
const newData = async (v) => {
|
||||
const reg = /cloud:\/\/([\w.]+\/?)\S*/;
|
||||
let url = "";
|
||||
if (v.fileID) {
|
||||
url = v.fileID;
|
||||
} else {
|
||||
url = v.url;
|
||||
}
|
||||
if (reg.test(url)) {
|
||||
v.fileID = url;
|
||||
v.url = await this.getTempFileURL(url);
|
||||
}
|
||||
if (v.url)
|
||||
v.path = v.url;
|
||||
return v;
|
||||
};
|
||||
if (this.returnType === "object") {
|
||||
if (newVal) {
|
||||
await newData(newVal);
|
||||
} else {
|
||||
newVal = {};
|
||||
}
|
||||
} else {
|
||||
if (!newVal)
|
||||
newVal = [];
|
||||
for (let i = 0; i < newVal.length; i++) {
|
||||
let v = newVal[i];
|
||||
await newData(v);
|
||||
}
|
||||
}
|
||||
this.localValue = newVal;
|
||||
if (this.form && this.formItem && !this.is_reset) {
|
||||
this.is_reset = false;
|
||||
this.formItem.setValue(this.localValue);
|
||||
}
|
||||
let filesData = Object.keys(newVal).length > 0 ? newVal : [];
|
||||
this.files = [].concat(filesData);
|
||||
},
|
||||
/**
|
||||
* 选择文件
|
||||
*/
|
||||
choose() {
|
||||
if (this.disabled)
|
||||
return;
|
||||
if (this.files.length >= Number(this.limitLength) && this.showType !== "grid" && this.returnType === "array") {
|
||||
common_vendor.index.showToast({
|
||||
title: `您最多选择 ${this.limitLength} 个文件`,
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.chooseFiles();
|
||||
},
|
||||
/**
|
||||
* 选择文件并上传
|
||||
*/
|
||||
chooseFiles() {
|
||||
const _extname = uni_modules_uniFilePicker_components_uniFilePicker_utils.get_extname(this.fileExtname);
|
||||
common_vendor.Zs.chooseAndUploadFile({
|
||||
type: this.fileMediatype,
|
||||
compressed: false,
|
||||
sizeType: this.sizeType,
|
||||
sourceType: this.sourceType,
|
||||
// TODO 如果为空,video 有问题
|
||||
extension: _extname.length > 0 ? _extname : void 0,
|
||||
count: this.limitLength - this.files.length,
|
||||
//默认9
|
||||
onChooseFile: this.chooseFileCallback,
|
||||
onUploadProgress: (progressEvent) => {
|
||||
this.setProgress(progressEvent, progressEvent.index);
|
||||
}
|
||||
}).then((result) => {
|
||||
this.setSuccessAndError(result.tempFiles);
|
||||
}).catch((err) => {
|
||||
console.log("选择失败", err);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 选择文件回调
|
||||
* @param {Object} res
|
||||
*/
|
||||
async chooseFileCallback(res) {
|
||||
const _extname = uni_modules_uniFilePicker_components_uniFilePicker_utils.get_extname(this.fileExtname);
|
||||
const is_one = Number(this.limitLength) === 1 && this.disablePreview && !this.disabled || this.returnType === "object";
|
||||
if (is_one) {
|
||||
this.files = [];
|
||||
}
|
||||
let {
|
||||
filePaths,
|
||||
files
|
||||
} = uni_modules_uniFilePicker_components_uniFilePicker_utils.get_files_and_is_max(res, _extname);
|
||||
if (!(_extname && _extname.length > 0)) {
|
||||
filePaths = res.tempFilePaths;
|
||||
files = res.tempFiles;
|
||||
}
|
||||
let currentData = [];
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
if (this.limitLength - this.files.length <= 0)
|
||||
break;
|
||||
files[i].uuid = Date.now();
|
||||
let filedata = await uni_modules_uniFilePicker_components_uniFilePicker_utils.get_file_data(files[i], this.fileMediatype);
|
||||
filedata.progress = 0;
|
||||
filedata.status = "ready";
|
||||
this.files.push(filedata);
|
||||
currentData.push({
|
||||
...filedata,
|
||||
file: files[i]
|
||||
});
|
||||
}
|
||||
this.$emit("select", {
|
||||
tempFiles: currentData,
|
||||
tempFilePaths: filePaths
|
||||
});
|
||||
res.tempFiles = files;
|
||||
if (!this.autoUpload || this.noSpace) {
|
||||
res.tempFiles = [];
|
||||
}
|
||||
res.tempFiles.forEach((fileItem, index) => {
|
||||
this.provider && (fileItem.provider = this.provider);
|
||||
const fileNameSplit = fileItem.name.split(".");
|
||||
const ext = fileNameSplit.pop();
|
||||
const fileName = fileNameSplit.join(".").replace(/[\s\/\?<>\\:\*\|":]/g, "_");
|
||||
fileItem.cloudPath = fileName + "_" + Date.now() + "_" + index + "." + ext;
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 批传
|
||||
* @param {Object} e
|
||||
*/
|
||||
uploadFiles(files) {
|
||||
files = [].concat(files);
|
||||
return uni_modules_uniFilePicker_components_uniFilePicker_chooseAndUploadFile.uploadCloudFiles.call(this, files, 5, (res) => {
|
||||
this.setProgress(res, res.index, true);
|
||||
}).then((result) => {
|
||||
this.setSuccessAndError(result);
|
||||
return result;
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 成功或失败
|
||||
*/
|
||||
async setSuccessAndError(res, fn) {
|
||||
let successData = [];
|
||||
let errorData = [];
|
||||
let tempFilePath = [];
|
||||
let errorTempFilePath = [];
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
const item = res[i];
|
||||
const index = item.uuid ? this.files.findIndex((p) => p.uuid === item.uuid) : item.index;
|
||||
if (index === -1 || !this.files)
|
||||
break;
|
||||
if (item.errMsg === "request:fail") {
|
||||
this.files[index].url = item.path;
|
||||
this.files[index].status = "error";
|
||||
this.files[index].errMsg = item.errMsg;
|
||||
errorData.push(this.files[index]);
|
||||
errorTempFilePath.push(this.files[index].url);
|
||||
} else {
|
||||
this.files[index].errMsg = "";
|
||||
this.files[index].fileID = item.url;
|
||||
const reg = /cloud:\/\/([\w.]+\/?)\S*/;
|
||||
if (reg.test(item.url)) {
|
||||
this.files[index].url = await this.getTempFileURL(item.url);
|
||||
} else {
|
||||
this.files[index].url = item.url;
|
||||
}
|
||||
this.files[index].status = "success";
|
||||
this.files[index].progress += 1;
|
||||
successData.push(this.files[index]);
|
||||
tempFilePath.push(this.files[index].fileID);
|
||||
}
|
||||
}
|
||||
if (successData.length > 0) {
|
||||
this.setEmit();
|
||||
this.$emit("success", {
|
||||
tempFiles: this.backObject(successData),
|
||||
tempFilePaths: tempFilePath
|
||||
});
|
||||
}
|
||||
if (errorData.length > 0) {
|
||||
this.$emit("fail", {
|
||||
tempFiles: this.backObject(errorData),
|
||||
tempFilePaths: errorTempFilePath
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取进度
|
||||
* @param {Object} progressEvent
|
||||
* @param {Object} index
|
||||
* @param {Object} type
|
||||
*/
|
||||
setProgress(progressEvent, index, type) {
|
||||
this.files.length;
|
||||
const percentCompleted = Math.round(progressEvent.loaded * 100 / progressEvent.total);
|
||||
let idx = index;
|
||||
if (!type) {
|
||||
idx = this.files.findIndex((p) => p.uuid === progressEvent.tempFile.uuid);
|
||||
}
|
||||
if (idx === -1 || !this.files[idx])
|
||||
return;
|
||||
this.files[idx].progress = percentCompleted - 1;
|
||||
this.$emit("progress", {
|
||||
index: idx,
|
||||
progress: parseInt(percentCompleted),
|
||||
tempFile: this.files[idx]
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 删除文件
|
||||
* @param {Object} index
|
||||
*/
|
||||
delFile(index) {
|
||||
this.$emit("delete", {
|
||||
index,
|
||||
tempFile: this.files[index],
|
||||
tempFilePath: this.files[index].url
|
||||
});
|
||||
this.files.splice(index, 1);
|
||||
this.$nextTick(() => {
|
||||
this.setEmit();
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取文件名和后缀
|
||||
* @param {Object} name
|
||||
*/
|
||||
getFileExt(name) {
|
||||
const last_len = name.lastIndexOf(".");
|
||||
const len = name.length;
|
||||
return {
|
||||
name: name.substring(0, last_len),
|
||||
ext: name.substring(last_len + 1, len)
|
||||
};
|
||||
},
|
||||
/**
|
||||
* 处理返回事件
|
||||
*/
|
||||
setEmit() {
|
||||
let data = [];
|
||||
if (this.returnType === "object") {
|
||||
data = this.backObject(this.files)[0];
|
||||
this.localValue = data ? data : null;
|
||||
} else {
|
||||
data = this.backObject(this.files);
|
||||
if (!this.localValue) {
|
||||
this.localValue = [];
|
||||
}
|
||||
this.localValue = [...data];
|
||||
}
|
||||
this.$emit("update:modelValue", this.localValue);
|
||||
},
|
||||
/**
|
||||
* 处理返回参数
|
||||
* @param {Object} files
|
||||
*/
|
||||
backObject(files) {
|
||||
let newFilesData = [];
|
||||
files.forEach((v) => {
|
||||
newFilesData.push({
|
||||
extname: v.extname,
|
||||
fileType: v.fileType,
|
||||
image: v.image,
|
||||
name: v.name,
|
||||
path: v.path,
|
||||
size: v.size,
|
||||
fileID: v.fileID,
|
||||
url: v.url,
|
||||
// 修改删除一个文件后不能再上传的bug, #694
|
||||
uuid: v.uuid,
|
||||
status: v.status,
|
||||
cloudPath: v.cloudPath
|
||||
});
|
||||
});
|
||||
return newFilesData;
|
||||
},
|
||||
async getTempFileURL(fileList) {
|
||||
fileList = {
|
||||
fileList: [].concat(fileList)
|
||||
};
|
||||
const urls = await common_vendor.Zs.getTempFileURL(fileList);
|
||||
return urls.fileList[0].tempFileURL || "";
|
||||
},
|
||||
/**
|
||||
* 获取父元素实例
|
||||
*/
|
||||
getForm(name = "uniForms") {
|
||||
let parent = this.$parent;
|
||||
let parentName = parent.$options.name;
|
||||
while (parentName !== name) {
|
||||
parent = parent.$parent;
|
||||
if (!parent)
|
||||
return false;
|
||||
parentName = parent.$options.name;
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _component_upload_image = common_vendor.resolveComponent("upload-image");
|
||||
const _component_upload_file = common_vendor.resolveComponent("upload-file");
|
||||
(_component_upload_image + _component_upload_file)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: $props.title
|
||||
}, $props.title ? {
|
||||
b: common_vendor.t($props.title),
|
||||
c: common_vendor.t($options.filesList.length),
|
||||
d: common_vendor.t($options.limitLength)
|
||||
} : {}, {
|
||||
e: $props.fileMediatype === "image" && $options.showType === "grid"
|
||||
}, $props.fileMediatype === "image" && $options.showType === "grid" ? {
|
||||
f: common_vendor.o($options.uploadFiles),
|
||||
g: common_vendor.o($options.choose),
|
||||
h: common_vendor.o($options.delFile),
|
||||
i: common_vendor.p({
|
||||
readonly: $props.readonly,
|
||||
["image-styles"]: $props.imageStyles,
|
||||
["files-list"]: $options.filesList,
|
||||
limit: $options.limitLength,
|
||||
disablePreview: $props.disablePreview,
|
||||
delIcon: $props.delIcon
|
||||
})
|
||||
} : {}, {
|
||||
j: $props.fileMediatype !== "image" || $options.showType !== "grid"
|
||||
}, $props.fileMediatype !== "image" || $options.showType !== "grid" ? {
|
||||
k: common_vendor.o($options.uploadFiles),
|
||||
l: common_vendor.o($options.choose),
|
||||
m: common_vendor.o($options.delFile),
|
||||
n: common_vendor.p({
|
||||
readonly: $props.readonly,
|
||||
["list-styles"]: $props.listStyles,
|
||||
["files-list"]: $options.filesList,
|
||||
showType: $options.showType,
|
||||
delIcon: $props.delIcon
|
||||
})
|
||||
} : {});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
my.createComponent(Component);
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"component": true,
|
||||
"styleIsolation": "apply-shared",
|
||||
"usingComponents": {
|
||||
"upload-image": "./upload-image",
|
||||
"upload-file": "./upload-file"
|
||||
}
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.uni-file-picker__files {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.uni-file-picker__lists {
|
||||
position: relative;
|
||||
margin-top: 5px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.file-picker__mask {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
.uni-file-picker__lists-box {
|
||||
position: relative;
|
||||
}
|
||||
.uni-file-picker__item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 10px;
|
||||
padding-right: 5px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.files-border {
|
||||
border-top: 1px #eee solid;
|
||||
}
|
||||
.files__name {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-right: 25px;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.icon-files {
|
||||
position: static;
|
||||
background-color: initial;
|
||||
}
|
||||
.is-list-card {
|
||||
border: 1px #eee solid;
|
||||
margin-bottom: 5px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.1);
|
||||
padding: 5px;
|
||||
}
|
||||
.files__image {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.header-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.is-text-box {
|
||||
border: 1px #eee solid;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.is-text-image {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.rotate {
|
||||
position: absolute;
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.icon-del-box {
|
||||
display: flex;
|
||||
margin: auto 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
bottom: 0;
|
||||
right: 5px;
|
||||
height: 26px;
|
||||
width: 26px;
|
||||
z-index: 2;
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
.icon-del {
|
||||
width: 15px;
|
||||
height: 1px;
|
||||
background-color: #333;
|
||||
}
|
@ -0,0 +1 @@
|
||||
<view class="uni-file-picker__files"><view a:if="{{a}}" class="files-button" onTap="{{b}}"><slot></slot></view><view a:if="{{c}}" class="uni-file-picker__lists is-text-box" style="{{f}}"><view a:for="{{d}}" a:for-item="item" a:key="h" class="{{('uni-file-picker__lists-box') + ' ' + (item.i && 'files-border')}}" style="{{item.j}}"><view class="uni-file-picker__item"><view class="files__name">{{item.a}}</view><view a:if="{{e}}" class="icon-del-box icon-files" onTap="{{item.b}}"><view class="icon-del icon-files"></view><view class="icon-del rotate"></view></view></view><view a:if="{{item.c}}" class="file-picker__progress"><progress class="file-picker__progress-item" percent="{{item.d}}" stroke-width="4" backgroundColor="{{item.e}}"/></view><view a:if="{{item.f}}" class="file-picker__mask" catchTap="{{item.g}}"> 点击重试 </view></view></view></view>
|
@ -0,0 +1,172 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "uploadFile",
|
||||
emits: ["uploadFiles", "choose", "delFile"],
|
||||
props: {
|
||||
filesList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
delIcon: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
limit: {
|
||||
type: [Number, String],
|
||||
default: 9
|
||||
},
|
||||
showType: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
listStyles: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
// 是否显示边框
|
||||
border: true,
|
||||
// 是否显示分隔线
|
||||
dividline: true,
|
||||
// 线条样式
|
||||
borderStyle: {}
|
||||
};
|
||||
}
|
||||
},
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
list() {
|
||||
let files = [];
|
||||
this.filesList.forEach((v) => {
|
||||
files.push(v);
|
||||
});
|
||||
return files;
|
||||
},
|
||||
styles() {
|
||||
let styles = {
|
||||
border: true,
|
||||
dividline: true,
|
||||
"border-style": {}
|
||||
};
|
||||
return Object.assign(styles, this.listStyles);
|
||||
},
|
||||
borderStyle() {
|
||||
let {
|
||||
borderStyle,
|
||||
border
|
||||
} = this.styles;
|
||||
let obj = {};
|
||||
if (!border) {
|
||||
obj.border = "none";
|
||||
} else {
|
||||
let width = borderStyle && borderStyle.width || 1;
|
||||
width = this.value2px(width);
|
||||
let radius = borderStyle && borderStyle.radius || 5;
|
||||
radius = this.value2px(radius);
|
||||
obj = {
|
||||
"border-width": width,
|
||||
"border-style": borderStyle && borderStyle.style || "solid",
|
||||
"border-color": borderStyle && borderStyle.color || "#eee",
|
||||
"border-radius": radius
|
||||
};
|
||||
}
|
||||
let classles = "";
|
||||
for (let i in obj) {
|
||||
classles += `${i}:${obj[i]};`;
|
||||
}
|
||||
return classles;
|
||||
},
|
||||
borderLineStyle() {
|
||||
let obj = {};
|
||||
let {
|
||||
borderStyle
|
||||
} = this.styles;
|
||||
if (borderStyle && borderStyle.color) {
|
||||
obj["border-color"] = borderStyle.color;
|
||||
}
|
||||
if (borderStyle && borderStyle.width) {
|
||||
let width = borderStyle && borderStyle.width || 1;
|
||||
let style = borderStyle && borderStyle.style || 0;
|
||||
if (typeof width === "number") {
|
||||
width += "px";
|
||||
} else {
|
||||
width = width.indexOf("px") ? width : width + "px";
|
||||
}
|
||||
obj["border-width"] = width;
|
||||
if (typeof style === "number") {
|
||||
style += "px";
|
||||
} else {
|
||||
style = style.indexOf("px") ? style : style + "px";
|
||||
}
|
||||
obj["border-top-style"] = style;
|
||||
}
|
||||
let classles = "";
|
||||
for (let i in obj) {
|
||||
classles += `${i}:${obj[i]};`;
|
||||
}
|
||||
return classles;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
uploadFiles(item, index) {
|
||||
this.$emit("uploadFiles", {
|
||||
item,
|
||||
index
|
||||
});
|
||||
},
|
||||
choose() {
|
||||
this.$emit("choose");
|
||||
},
|
||||
delFile(index) {
|
||||
this.$emit("delFile", index);
|
||||
},
|
||||
value2px(value) {
|
||||
if (typeof value === "number") {
|
||||
value += "px";
|
||||
} else {
|
||||
value = value.indexOf("px") !== -1 ? value : value + "px";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: !$props.readonly
|
||||
}, !$props.readonly ? {
|
||||
b: common_vendor.o((...args) => $options.choose && $options.choose(...args))
|
||||
} : {}, {
|
||||
c: $options.list.length > 0
|
||||
}, $options.list.length > 0 ? {
|
||||
d: common_vendor.f($options.list, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t(item.name)
|
||||
}, $props.delIcon && !$props.readonly ? {
|
||||
b: common_vendor.o(($event) => $options.delFile(index))
|
||||
} : {}, {
|
||||
c: item.progress && item.progress !== 100 || item.progress === 0
|
||||
}, item.progress && item.progress !== 100 || item.progress === 0 ? {
|
||||
d: item.progress === -1 ? 0 : item.progress,
|
||||
e: item.errMsg ? "#ff5a5f" : "#EBEBEB"
|
||||
} : {}, {
|
||||
f: item.status === "error"
|
||||
}, item.status === "error" ? {
|
||||
g: common_vendor.o(($event) => $options.uploadFiles(item, index))
|
||||
} : {}, {
|
||||
h: index,
|
||||
i: index !== 0 && $options.styles.dividline ? 1 : "",
|
||||
j: common_vendor.s(index !== 0 && $options.styles.dividline && $options.borderLineStyle)
|
||||
});
|
||||
}),
|
||||
e: $props.delIcon && !$props.readonly,
|
||||
f: common_vendor.s($options.borderStyle)
|
||||
} : {});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
my.createComponent(Component);
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"component": true,
|
||||
"styleIsolation": "apply-shared",
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.uni-file-picker__container {
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
flex-wrap: wrap;
|
||||
margin: -5px;
|
||||
}
|
||||
.file-picker__box {
|
||||
position: relative;
|
||||
width: 33.3%;
|
||||
height: 0;
|
||||
padding-top: 33.33%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.file-picker__box-content {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
margin: 5px;
|
||||
border: 1px #eee solid;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.file-picker__progress {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
/* border: 1px red solid; */
|
||||
z-index: 2;
|
||||
}
|
||||
.file-picker__progress-item {
|
||||
width: 100%;
|
||||
}
|
||||
.file-picker__mask {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
.file-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.is-add {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.icon-add {
|
||||
width: 50px;
|
||||
height: 5px;
|
||||
background-color: #f1f1f1;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.rotate {
|
||||
position: absolute;
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.icon-del-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
right: 3px;
|
||||
height: 26px;
|
||||
width: 26px;
|
||||
border-radius: 50%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
z-index: 2;
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
.icon-del {
|
||||
width: 15px;
|
||||
height: 2px;
|
||||
background-color: #fff;
|
||||
border-radius: 2px;
|
||||
}
|
@ -0,0 +1 @@
|
||||
<view class="uni-file-picker__container"><view a:for="{{a}}" a:for-item="item" a:key="i" class="file-picker__box" style="{{d}}"><view class="file-picker__box-content" style="{{c}}"><image class="file-image" src="{{item.a}}" mode="aspectFill" catchTap="{{item.b}}"></image><view a:if="{{b}}" class="icon-del-box" catchTap="{{item.c}}"><view class="icon-del"></view><view class="icon-del rotate"></view></view><view a:if="{{item.d}}" class="file-picker__progress"><progress class="file-picker__progress-item" percent="{{item.e}}" stroke-width="4" backgroundColor="{{item.f}}"/></view><view a:if="{{item.g}}" class="file-picker__mask" catchTap="{{item.h}}"> 点击重试 </view></view></view><view a:if="{{e}}" class="file-picker__box" style="{{h}}"><view class="file-picker__box-content is-add" style="{{f}}" onTap="{{g}}"><slot><view class="icon-add"></view><view class="icon-add rotate"></view></slot></view></view></view>
|
@ -0,0 +1,182 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "uploadImage",
|
||||
emits: ["uploadFiles", "choose", "delFile"],
|
||||
props: {
|
||||
filesList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
disablePreview: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
limit: {
|
||||
type: [Number, String],
|
||||
default: 9
|
||||
},
|
||||
imageStyles: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
border: {}
|
||||
};
|
||||
}
|
||||
},
|
||||
delIcon: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
styles() {
|
||||
let styles = {
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
border: {}
|
||||
};
|
||||
return Object.assign(styles, this.imageStyles);
|
||||
},
|
||||
boxStyle() {
|
||||
const {
|
||||
width = "auto",
|
||||
height = "auto"
|
||||
} = this.styles;
|
||||
let obj = {};
|
||||
if (height === "auto") {
|
||||
if (width !== "auto") {
|
||||
obj.height = this.value2px(width);
|
||||
obj["padding-top"] = 0;
|
||||
} else {
|
||||
obj.height = 0;
|
||||
}
|
||||
} else {
|
||||
obj.height = this.value2px(height);
|
||||
obj["padding-top"] = 0;
|
||||
}
|
||||
if (width === "auto") {
|
||||
if (height !== "auto") {
|
||||
obj.width = this.value2px(height);
|
||||
} else {
|
||||
obj.width = "33.3%";
|
||||
}
|
||||
} else {
|
||||
obj.width = this.value2px(width);
|
||||
}
|
||||
let classles = "";
|
||||
for (let i in obj) {
|
||||
classles += `${i}:${obj[i]};`;
|
||||
}
|
||||
return classles;
|
||||
},
|
||||
borderStyle() {
|
||||
let {
|
||||
border
|
||||
} = this.styles;
|
||||
let obj = {};
|
||||
const widthDefaultValue = 1;
|
||||
const radiusDefaultValue = 3;
|
||||
if (typeof border === "boolean") {
|
||||
obj.border = border ? "1px #eee solid" : "none";
|
||||
} else {
|
||||
let width = border && border.width || widthDefaultValue;
|
||||
width = this.value2px(width);
|
||||
let radius = border && border.radius || radiusDefaultValue;
|
||||
radius = this.value2px(radius);
|
||||
obj = {
|
||||
"border-width": width,
|
||||
"border-style": border && border.style || "solid",
|
||||
"border-color": border && border.color || "#eee",
|
||||
"border-radius": radius
|
||||
};
|
||||
}
|
||||
let classles = "";
|
||||
for (let i in obj) {
|
||||
classles += `${i}:${obj[i]};`;
|
||||
}
|
||||
return classles;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
uploadFiles(item, index) {
|
||||
this.$emit("uploadFiles", item);
|
||||
},
|
||||
choose() {
|
||||
this.$emit("choose");
|
||||
},
|
||||
delFile(index) {
|
||||
this.$emit("delFile", index);
|
||||
},
|
||||
prviewImage(img, index) {
|
||||
let urls = [];
|
||||
if (Number(this.limit) === 1 && this.disablePreview && !this.disabled) {
|
||||
this.$emit("choose");
|
||||
}
|
||||
if (this.disablePreview)
|
||||
return;
|
||||
this.filesList.forEach((i) => {
|
||||
urls.push(i.url);
|
||||
});
|
||||
common_vendor.index.previewImage({
|
||||
urls,
|
||||
current: index
|
||||
});
|
||||
},
|
||||
value2px(value) {
|
||||
if (typeof value === "number") {
|
||||
value += "px";
|
||||
} else {
|
||||
if (value.indexOf("%") === -1) {
|
||||
value = value.indexOf("px") !== -1 ? value : value + "px";
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.f($props.filesList, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.url,
|
||||
b: common_vendor.o(($event) => $options.prviewImage(item, index))
|
||||
}, $props.delIcon && !$props.readonly ? {
|
||||
c: common_vendor.o(($event) => $options.delFile(index))
|
||||
} : {}, {
|
||||
d: item.progress && item.progress !== 100 || item.progress === 0
|
||||
}, item.progress && item.progress !== 100 || item.progress === 0 ? {
|
||||
e: item.progress === -1 ? 0 : item.progress,
|
||||
f: item.errMsg ? "#ff5a5f" : "#EBEBEB"
|
||||
} : {}, {
|
||||
g: item.errMsg
|
||||
}, item.errMsg ? {
|
||||
h: common_vendor.o(($event) => $options.uploadFiles(item, index))
|
||||
} : {}, {
|
||||
i: index
|
||||
});
|
||||
}),
|
||||
b: $props.delIcon && !$props.readonly,
|
||||
c: common_vendor.s($options.borderStyle),
|
||||
d: common_vendor.s($options.boxStyle),
|
||||
e: $props.filesList.length < $props.limit && !$props.readonly
|
||||
}, $props.filesList.length < $props.limit && !$props.readonly ? {
|
||||
f: common_vendor.s($options.borderStyle),
|
||||
g: common_vendor.o((...args) => $options.choose && $options.choose(...args)),
|
||||
h: common_vendor.s($options.boxStyle)
|
||||
} : {});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
my.createComponent(Component);
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"component": true,
|
||||
"styleIsolation": "apply-shared",
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const get_file_ext = (name) => {
|
||||
const last_len = name.lastIndexOf(".");
|
||||
const len = name.length;
|
||||
return {
|
||||
name: name.substring(0, last_len),
|
||||
ext: name.substring(last_len + 1, len)
|
||||
};
|
||||
};
|
||||
const get_extname = (fileExtname) => {
|
||||
if (!Array.isArray(fileExtname)) {
|
||||
let extname = fileExtname.replace(/(\[|\])/g, "");
|
||||
return extname.split(",");
|
||||
} else {
|
||||
return fileExtname;
|
||||
}
|
||||
};
|
||||
const get_files_and_is_max = (res, _extname) => {
|
||||
let filePaths = [];
|
||||
let files = [];
|
||||
if (!_extname || _extname.length === 0) {
|
||||
return {
|
||||
filePaths,
|
||||
files
|
||||
};
|
||||
}
|
||||
res.tempFiles.forEach((v) => {
|
||||
let fileFullName = get_file_ext(v.name);
|
||||
const extname = fileFullName.ext.toLowerCase();
|
||||
if (_extname.indexOf(extname) !== -1) {
|
||||
files.push(v);
|
||||
filePaths.push(v.path);
|
||||
}
|
||||
});
|
||||
if (files.length !== res.tempFiles.length) {
|
||||
common_vendor.index.showToast({
|
||||
title: `当前选择了${res.tempFiles.length}个文件 ,${res.tempFiles.length - files.length} 个文件格式不正确`,
|
||||
icon: "none",
|
||||
duration: 5e3
|
||||
});
|
||||
}
|
||||
return {
|
||||
filePaths,
|
||||
files
|
||||
};
|
||||
};
|
||||
const get_file_info = (filepath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.getImageInfo({
|
||||
src: filepath,
|
||||
success(res) {
|
||||
resolve(res);
|
||||
},
|
||||
fail(err) {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
const get_file_data = async (files, type = "image") => {
|
||||
let fileFullName = get_file_ext(files.name);
|
||||
const extname = fileFullName.ext.toLowerCase();
|
||||
let filedata = {
|
||||
name: files.name,
|
||||
uuid: files.uuid,
|
||||
extname: extname || "",
|
||||
cloudPath: files.cloudPath,
|
||||
fileType: files.fileType,
|
||||
thumbTempFilePath: files.thumbTempFilePath,
|
||||
url: files.path || files.path,
|
||||
size: files.size,
|
||||
//单位是字节
|
||||
image: {},
|
||||
path: files.path,
|
||||
video: {}
|
||||
};
|
||||
if (type === "image") {
|
||||
const imageinfo = await get_file_info(files.path);
|
||||
delete filedata.video;
|
||||
filedata.image.width = imageinfo.width;
|
||||
filedata.image.height = imageinfo.height;
|
||||
filedata.image.location = imageinfo.path;
|
||||
} else {
|
||||
delete filedata.image;
|
||||
}
|
||||
return filedata;
|
||||
};
|
||||
exports.get_extname = get_extname;
|
||||
exports.get_file_data = get_file_data;
|
||||
exports.get_files_and_is_max = get_files_and_is_max;
|
532
distribution/unpackage/dist/dev/mp-alipay/uni_modules/uni-icons/components/uni-icons/uni-icons.acss
vendored
Normal file
@ -0,0 +1,532 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.uniui-cart-filled:before {
|
||||
content: "\e6d0";
|
||||
}
|
||||
.uniui-gift-filled:before {
|
||||
content: "\e6c4";
|
||||
}
|
||||
.uniui-color:before {
|
||||
content: "\e6cf";
|
||||
}
|
||||
.uniui-wallet:before {
|
||||
content: "\e6b1";
|
||||
}
|
||||
.uniui-settings-filled:before {
|
||||
content: "\e6ce";
|
||||
}
|
||||
.uniui-auth-filled:before {
|
||||
content: "\e6cc";
|
||||
}
|
||||
.uniui-shop-filled:before {
|
||||
content: "\e6cd";
|
||||
}
|
||||
.uniui-staff-filled:before {
|
||||
content: "\e6cb";
|
||||
}
|
||||
.uniui-vip-filled:before {
|
||||
content: "\e6c6";
|
||||
}
|
||||
.uniui-plus-filled:before {
|
||||
content: "\e6c7";
|
||||
}
|
||||
.uniui-folder-add-filled:before {
|
||||
content: "\e6c8";
|
||||
}
|
||||
.uniui-color-filled:before {
|
||||
content: "\e6c9";
|
||||
}
|
||||
.uniui-tune-filled:before {
|
||||
content: "\e6ca";
|
||||
}
|
||||
.uniui-calendar-filled:before {
|
||||
content: "\e6c0";
|
||||
}
|
||||
.uniui-notification-filled:before {
|
||||
content: "\e6c1";
|
||||
}
|
||||
.uniui-wallet-filled:before {
|
||||
content: "\e6c2";
|
||||
}
|
||||
.uniui-medal-filled:before {
|
||||
content: "\e6c3";
|
||||
}
|
||||
.uniui-fire-filled:before {
|
||||
content: "\e6c5";
|
||||
}
|
||||
.uniui-refreshempty:before {
|
||||
content: "\e6bf";
|
||||
}
|
||||
.uniui-location-filled:before {
|
||||
content: "\e6af";
|
||||
}
|
||||
.uniui-person-filled:before {
|
||||
content: "\e69d";
|
||||
}
|
||||
.uniui-personadd-filled:before {
|
||||
content: "\e698";
|
||||
}
|
||||
.uniui-arrowthinleft:before {
|
||||
content: "\e6d2";
|
||||
}
|
||||
.uniui-arrowthinup:before {
|
||||
content: "\e6d3";
|
||||
}
|
||||
.uniui-arrowthindown:before {
|
||||
content: "\e6d4";
|
||||
}
|
||||
.uniui-back:before {
|
||||
content: "\e6b9";
|
||||
}
|
||||
.uniui-forward:before {
|
||||
content: "\e6ba";
|
||||
}
|
||||
.uniui-arrow-right:before {
|
||||
content: "\e6bb";
|
||||
}
|
||||
.uniui-arrow-left:before {
|
||||
content: "\e6bc";
|
||||
}
|
||||
.uniui-arrow-up:before {
|
||||
content: "\e6bd";
|
||||
}
|
||||
.uniui-arrow-down:before {
|
||||
content: "\e6be";
|
||||
}
|
||||
.uniui-arrowthinright:before {
|
||||
content: "\e6d1";
|
||||
}
|
||||
.uniui-down:before {
|
||||
content: "\e6b8";
|
||||
}
|
||||
.uniui-bottom:before {
|
||||
content: "\e6b8";
|
||||
}
|
||||
.uniui-arrowright:before {
|
||||
content: "\e6d5";
|
||||
}
|
||||
.uniui-right:before {
|
||||
content: "\e6b5";
|
||||
}
|
||||
.uniui-up:before {
|
||||
content: "\e6b6";
|
||||
}
|
||||
.uniui-top:before {
|
||||
content: "\e6b6";
|
||||
}
|
||||
.uniui-left:before {
|
||||
content: "\e6b7";
|
||||
}
|
||||
.uniui-arrowup:before {
|
||||
content: "\e6d6";
|
||||
}
|
||||
.uniui-eye:before {
|
||||
content: "\e651";
|
||||
}
|
||||
.uniui-eye-filled:before {
|
||||
content: "\e66a";
|
||||
}
|
||||
.uniui-eye-slash:before {
|
||||
content: "\e6b3";
|
||||
}
|
||||
.uniui-eye-slash-filled:before {
|
||||
content: "\e6b4";
|
||||
}
|
||||
.uniui-info-filled:before {
|
||||
content: "\e649";
|
||||
}
|
||||
.uniui-reload:before {
|
||||
content: "\e6b2";
|
||||
}
|
||||
.uniui-micoff-filled:before {
|
||||
content: "\e6b0";
|
||||
}
|
||||
.uniui-map-pin-ellipse:before {
|
||||
content: "\e6ac";
|
||||
}
|
||||
.uniui-map-pin:before {
|
||||
content: "\e6ad";
|
||||
}
|
||||
.uniui-location:before {
|
||||
content: "\e6ae";
|
||||
}
|
||||
.uniui-starhalf:before {
|
||||
content: "\e683";
|
||||
}
|
||||
.uniui-star:before {
|
||||
content: "\e688";
|
||||
}
|
||||
.uniui-star-filled:before {
|
||||
content: "\e68f";
|
||||
}
|
||||
.uniui-calendar:before {
|
||||
content: "\e6a0";
|
||||
}
|
||||
.uniui-fire:before {
|
||||
content: "\e6a1";
|
||||
}
|
||||
.uniui-medal:before {
|
||||
content: "\e6a2";
|
||||
}
|
||||
.uniui-font:before {
|
||||
content: "\e6a3";
|
||||
}
|
||||
.uniui-gift:before {
|
||||
content: "\e6a4";
|
||||
}
|
||||
.uniui-link:before {
|
||||
content: "\e6a5";
|
||||
}
|
||||
.uniui-notification:before {
|
||||
content: "\e6a6";
|
||||
}
|
||||
.uniui-staff:before {
|
||||
content: "\e6a7";
|
||||
}
|
||||
.uniui-vip:before {
|
||||
content: "\e6a8";
|
||||
}
|
||||
.uniui-folder-add:before {
|
||||
content: "\e6a9";
|
||||
}
|
||||
.uniui-tune:before {
|
||||
content: "\e6aa";
|
||||
}
|
||||
.uniui-auth:before {
|
||||
content: "\e6ab";
|
||||
}
|
||||
.uniui-person:before {
|
||||
content: "\e699";
|
||||
}
|
||||
.uniui-email-filled:before {
|
||||
content: "\e69a";
|
||||
}
|
||||
.uniui-phone-filled:before {
|
||||
content: "\e69b";
|
||||
}
|
||||
.uniui-phone:before {
|
||||
content: "\e69c";
|
||||
}
|
||||
.uniui-email:before {
|
||||
content: "\e69e";
|
||||
}
|
||||
.uniui-personadd:before {
|
||||
content: "\e69f";
|
||||
}
|
||||
.uniui-chatboxes-filled:before {
|
||||
content: "\e692";
|
||||
}
|
||||
.uniui-contact:before {
|
||||
content: "\e693";
|
||||
}
|
||||
.uniui-chatbubble-filled:before {
|
||||
content: "\e694";
|
||||
}
|
||||
.uniui-contact-filled:before {
|
||||
content: "\e695";
|
||||
}
|
||||
.uniui-chatboxes:before {
|
||||
content: "\e696";
|
||||
}
|
||||
.uniui-chatbubble:before {
|
||||
content: "\e697";
|
||||
}
|
||||
.uniui-upload-filled:before {
|
||||
content: "\e68e";
|
||||
}
|
||||
.uniui-upload:before {
|
||||
content: "\e690";
|
||||
}
|
||||
.uniui-weixin:before {
|
||||
content: "\e691";
|
||||
}
|
||||
.uniui-compose:before {
|
||||
content: "\e67f";
|
||||
}
|
||||
.uniui-qq:before {
|
||||
content: "\e680";
|
||||
}
|
||||
.uniui-download-filled:before {
|
||||
content: "\e681";
|
||||
}
|
||||
.uniui-pyq:before {
|
||||
content: "\e682";
|
||||
}
|
||||
.uniui-sound:before {
|
||||
content: "\e684";
|
||||
}
|
||||
.uniui-trash-filled:before {
|
||||
content: "\e685";
|
||||
}
|
||||
.uniui-sound-filled:before {
|
||||
content: "\e686";
|
||||
}
|
||||
.uniui-trash:before {
|
||||
content: "\e687";
|
||||
}
|
||||
.uniui-videocam-filled:before {
|
||||
content: "\e689";
|
||||
}
|
||||
.uniui-spinner-cycle:before {
|
||||
content: "\e68a";
|
||||
}
|
||||
.uniui-weibo:before {
|
||||
content: "\e68b";
|
||||
}
|
||||
.uniui-videocam:before {
|
||||
content: "\e68c";
|
||||
}
|
||||
.uniui-download:before {
|
||||
content: "\e68d";
|
||||
}
|
||||
.uniui-help:before {
|
||||
content: "\e679";
|
||||
}
|
||||
.uniui-navigate-filled:before {
|
||||
content: "\e67a";
|
||||
}
|
||||
.uniui-plusempty:before {
|
||||
content: "\e67b";
|
||||
}
|
||||
.uniui-smallcircle:before {
|
||||
content: "\e67c";
|
||||
}
|
||||
.uniui-minus-filled:before {
|
||||
content: "\e67d";
|
||||
}
|
||||
.uniui-micoff:before {
|
||||
content: "\e67e";
|
||||
}
|
||||
.uniui-closeempty:before {
|
||||
content: "\e66c";
|
||||
}
|
||||
.uniui-clear:before {
|
||||
content: "\e66d";
|
||||
}
|
||||
.uniui-navigate:before {
|
||||
content: "\e66e";
|
||||
}
|
||||
.uniui-minus:before {
|
||||
content: "\e66f";
|
||||
}
|
||||
.uniui-image:before {
|
||||
content: "\e670";
|
||||
}
|
||||
.uniui-mic:before {
|
||||
content: "\e671";
|
||||
}
|
||||
.uniui-paperplane:before {
|
||||
content: "\e672";
|
||||
}
|
||||
.uniui-close:before {
|
||||
content: "\e673";
|
||||
}
|
||||
.uniui-help-filled:before {
|
||||
content: "\e674";
|
||||
}
|
||||
.uniui-paperplane-filled:before {
|
||||
content: "\e675";
|
||||
}
|
||||
.uniui-plus:before {
|
||||
content: "\e676";
|
||||
}
|
||||
.uniui-mic-filled:before {
|
||||
content: "\e677";
|
||||
}
|
||||
.uniui-image-filled:before {
|
||||
content: "\e678";
|
||||
}
|
||||
.uniui-locked-filled:before {
|
||||
content: "\e668";
|
||||
}
|
||||
.uniui-info:before {
|
||||
content: "\e669";
|
||||
}
|
||||
.uniui-locked:before {
|
||||
content: "\e66b";
|
||||
}
|
||||
.uniui-camera-filled:before {
|
||||
content: "\e658";
|
||||
}
|
||||
.uniui-chat-filled:before {
|
||||
content: "\e659";
|
||||
}
|
||||
.uniui-camera:before {
|
||||
content: "\e65a";
|
||||
}
|
||||
.uniui-circle:before {
|
||||
content: "\e65b";
|
||||
}
|
||||
.uniui-checkmarkempty:before {
|
||||
content: "\e65c";
|
||||
}
|
||||
.uniui-chat:before {
|
||||
content: "\e65d";
|
||||
}
|
||||
.uniui-circle-filled:before {
|
||||
content: "\e65e";
|
||||
}
|
||||
.uniui-flag:before {
|
||||
content: "\e65f";
|
||||
}
|
||||
.uniui-flag-filled:before {
|
||||
content: "\e660";
|
||||
}
|
||||
.uniui-gear-filled:before {
|
||||
content: "\e661";
|
||||
}
|
||||
.uniui-home:before {
|
||||
content: "\e662";
|
||||
}
|
||||
.uniui-home-filled:before {
|
||||
content: "\e663";
|
||||
}
|
||||
.uniui-gear:before {
|
||||
content: "\e664";
|
||||
}
|
||||
.uniui-smallcircle-filled:before {
|
||||
content: "\e665";
|
||||
}
|
||||
.uniui-map-filled:before {
|
||||
content: "\e666";
|
||||
}
|
||||
.uniui-map:before {
|
||||
content: "\e667";
|
||||
}
|
||||
.uniui-refresh-filled:before {
|
||||
content: "\e656";
|
||||
}
|
||||
.uniui-refresh:before {
|
||||
content: "\e657";
|
||||
}
|
||||
.uniui-cloud-upload:before {
|
||||
content: "\e645";
|
||||
}
|
||||
.uniui-cloud-download-filled:before {
|
||||
content: "\e646";
|
||||
}
|
||||
.uniui-cloud-download:before {
|
||||
content: "\e647";
|
||||
}
|
||||
.uniui-cloud-upload-filled:before {
|
||||
content: "\e648";
|
||||
}
|
||||
.uniui-redo:before {
|
||||
content: "\e64a";
|
||||
}
|
||||
.uniui-images-filled:before {
|
||||
content: "\e64b";
|
||||
}
|
||||
.uniui-undo-filled:before {
|
||||
content: "\e64c";
|
||||
}
|
||||
.uniui-more:before {
|
||||
content: "\e64d";
|
||||
}
|
||||
.uniui-more-filled:before {
|
||||
content: "\e64e";
|
||||
}
|
||||
.uniui-undo:before {
|
||||
content: "\e64f";
|
||||
}
|
||||
.uniui-images:before {
|
||||
content: "\e650";
|
||||
}
|
||||
.uniui-paperclip:before {
|
||||
content: "\e652";
|
||||
}
|
||||
.uniui-settings:before {
|
||||
content: "\e653";
|
||||
}
|
||||
.uniui-search:before {
|
||||
content: "\e654";
|
||||
}
|
||||
.uniui-redo-filled:before {
|
||||
content: "\e655";
|
||||
}
|
||||
.uniui-list:before {
|
||||
content: "\e644";
|
||||
}
|
||||
.uniui-mail-open-filled:before {
|
||||
content: "\e63a";
|
||||
}
|
||||
.uniui-hand-down-filled:before {
|
||||
content: "\e63c";
|
||||
}
|
||||
.uniui-hand-down:before {
|
||||
content: "\e63d";
|
||||
}
|
||||
.uniui-hand-up-filled:before {
|
||||
content: "\e63e";
|
||||
}
|
||||
.uniui-hand-up:before {
|
||||
content: "\e63f";
|
||||
}
|
||||
.uniui-heart-filled:before {
|
||||
content: "\e641";
|
||||
}
|
||||
.uniui-mail-open:before {
|
||||
content: "\e643";
|
||||
}
|
||||
.uniui-heart:before {
|
||||
content: "\e639";
|
||||
}
|
||||
.uniui-loop:before {
|
||||
content: "\e633";
|
||||
}
|
||||
.uniui-pulldown:before {
|
||||
content: "\e632";
|
||||
}
|
||||
.uniui-scan:before {
|
||||
content: "\e62a";
|
||||
}
|
||||
.uniui-bars:before {
|
||||
content: "\e627";
|
||||
}
|
||||
.uniui-checkbox:before {
|
||||
content: "\e62b";
|
||||
}
|
||||
.uniui-checkbox-filled:before {
|
||||
content: "\e62c";
|
||||
}
|
||||
.uniui-shop:before {
|
||||
content: "\e62f";
|
||||
}
|
||||
.uniui-headphones:before {
|
||||
content: "\e630";
|
||||
}
|
||||
.uniui-cart:before {
|
||||
content: "\e631";
|
||||
}
|
||||
@font-face {
|
||||
font-family: uniicons;
|
||||
src: url("../../../../assets/uniicons.32e978a5.ttf");
|
||||
}
|
||||
.uni-icons {
|
||||
font-family: uniicons;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
}
|
@ -0,0 +1 @@
|
||||
<text style="{{a}}" class="{{('uni-icons') + ' ' + b + ' ' + c + ' ' + d}}" onTap="{{e}}"><slot></slot></text>
|
@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
const uni_modules_uniIcons_components_uniIcons_uniicons_file_vue = require("./uniicons_file_vue.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const getVal = (val) => {
|
||||
const reg = /^[0-9]*$/g;
|
||||
return typeof val === "number" || reg.test(val) ? val + "px" : val;
|
||||
};
|
||||
const _sfc_main = {
|
||||
name: "UniIcons",
|
||||
emits: ["click"],
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: "#333333"
|
||||
},
|
||||
size: {
|
||||
type: [Number, String],
|
||||
default: 16
|
||||
},
|
||||
customPrefix: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
fontFamily: {
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
icons: uni_modules_uniIcons_components_uniIcons_uniicons_file_vue.fontData
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
unicode() {
|
||||
let code = this.icons.find((v) => v.font_class === this.type);
|
||||
if (code) {
|
||||
return code.unicode;
|
||||
}
|
||||
return "";
|
||||
},
|
||||
iconSize() {
|
||||
return getVal(this.size);
|
||||
},
|
||||
styleObj() {
|
||||
if (this.fontFamily !== "") {
|
||||
return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`;
|
||||
}
|
||||
return `color: ${this.color}; font-size: ${this.iconSize};`;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
_onClick() {
|
||||
this.$emit("click");
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.s($options.styleObj),
|
||||
b: common_vendor.n("uniui-" + $props.type),
|
||||
c: common_vendor.n($props.customPrefix),
|
||||
d: common_vendor.n($props.customPrefix ? $props.type : ""),
|
||||
e: common_vendor.o((...args) => $options._onClick && $options._onClick(...args))
|
||||
};
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
my.createComponent(Component);
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"component": true,
|
||||
"styleIsolation": "apply-shared",
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,648 @@
|
||||
"use strict";
|
||||
const fontData = [
|
||||
{
|
||||
"font_class": "arrow-down",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "arrow-left",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "arrow-right",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "arrow-up",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "auth",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "auth-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "back",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "bars",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "calendar",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "calendar-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "camera",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "camera-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "cart",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "cart-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "chat",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "chat-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "chatboxes",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "chatboxes-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "chatbubble",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "chatbubble-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "checkbox",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "checkbox-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "checkmarkempty",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "circle",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "circle-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "clear",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "close",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "closeempty",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "cloud-download",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "cloud-download-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "cloud-upload",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "cloud-upload-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "color",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "color-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "compose",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "contact",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "contact-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "down",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "bottom",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "download",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "download-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "email",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "email-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "eye",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "eye-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "eye-slash",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "eye-slash-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "fire",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "fire-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "flag",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "flag-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "folder-add",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "folder-add-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "font",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "forward",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "gear",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "gear-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "gift",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "gift-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "hand-down",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "hand-down-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "hand-up",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "hand-up-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "headphones",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "heart",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "heart-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "help",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "help-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "home",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "home-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "image",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "image-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "images",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "images-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "info",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "info-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "left",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "link",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "list",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "location",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "location-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "locked",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "locked-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "loop",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "mail-open",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "mail-open-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "map",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "map-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "map-pin",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "map-pin-ellipse",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "medal",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "medal-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "mic",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "mic-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "micoff",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "micoff-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "minus",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "minus-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "more",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "more-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "navigate",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "navigate-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "notification",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "notification-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "paperclip",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "paperplane",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "paperplane-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "person",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "person-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "personadd",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "personadd-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "personadd-filled-copy",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "phone",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "phone-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "plus",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "plus-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "plusempty",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "pulldown",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "pyq",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "qq",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "redo",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "redo-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "refresh",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "refresh-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "refreshempty",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "reload",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "right",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "scan",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "search",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "settings",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "settings-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "shop",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "shop-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "smallcircle",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "smallcircle-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "sound",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "sound-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "spinner-cycle",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "staff",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "staff-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "star",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "star-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "starhalf",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "trash",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "trash-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "tune",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "tune-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "undo",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "undo-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "up",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "top",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "upload",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "upload-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "videocam",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "videocam-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "vip",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "vip-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "wallet",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "wallet-filled",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "weibo",
|
||||
"unicode": ""
|
||||
},
|
||||
{
|
||||
"font_class": "weixin",
|
||||
"unicode": ""
|
||||
}
|
||||
];
|
||||
exports.fontData = fontData;
|
@ -0,0 +1,101 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.uni-noticebar.data-v-c3453ea3 {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding: 10px 12px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.uni-noticebar-close.data-v-c3453ea3 {
|
||||
margin-left: 8px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.uni-noticebar-icon.data-v-c3453ea3 {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.uni-noticebar__content-wrapper.data-v-c3453ea3 {
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
.uni-noticebar__content-wrapper--single.data-v-c3453ea3 {
|
||||
line-height: 18px;
|
||||
}
|
||||
.uni-noticebar__content-wrapper--single.data-v-c3453ea3,
|
||||
.uni-noticebar__content-wrapper--scrollable.data-v-c3453ea3 {
|
||||
flex-direction: row;
|
||||
}
|
||||
.uni-noticebar__content-wrapper--scrollable.data-v-c3453ea3 {
|
||||
position: relative;
|
||||
}
|
||||
.uni-noticebar__content--scrollable.data-v-c3453ea3 {
|
||||
flex: 1;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
}
|
||||
.uni-noticebar__content--single.data-v-c3453ea3 {
|
||||
display: flex;
|
||||
flex: none;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
.uni-noticebar__content-text.data-v-c3453ea3 {
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.uni-noticebar__content-text--single.data-v-c3453ea3 {
|
||||
display: block;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.uni-noticebar__content-text--scrollable.data-v-c3453ea3 {
|
||||
position: absolute;
|
||||
display: block;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
white-space: nowrap;
|
||||
padding-left: 100%;
|
||||
animation: notice-c3453ea3 10s 0s linear infinite both;
|
||||
animation-play-state: paused;
|
||||
}
|
||||
.uni-noticebar__more.data-v-c3453ea3 {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
padding-left: 5px;
|
||||
}
|
||||
@keyframes notice-c3453ea3 {
|
||||
100% {
|
||||
transform: translate3d(-100%, 0, 0);
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
<view a:if="{{a}}" class="uni-noticebar data-v-c3453ea3" style="{{'background-color:' + I}}" onTap="{{J}}"><uni-icons a:if="{{b}}" class="uni-noticebar-icon data-v-c3453ea3" u-i="c3453ea3-0" onVI="__l" u-p="{{c||''}}"/><view ref="textBox" class="{{('uni-noticebar__content-wrapper') + ' ' + 'data-v-c3453ea3' + ' ' + (v && 'uni-noticebar__content-wrapper--scrollable') + ' ' + (w && 'uni-noticebar__content-wrapper--single')}}" style="{{'height:' + x}}"><view id="{{r}}" class="{{('uni-noticebar__content') + ' ' + 'data-v-c3453ea3' + ' ' + (s && 'uni-noticebar__content--scrollable') + ' ' + (t && 'uni-noticebar__content--single')}}"><text id="{{e}}" ref="animationEle" class="{{('uni-noticebar__content-text') + ' ' + 'data-v-c3453ea3' + ' ' + (f && 'uni-noticebar__content-text--scrollable') + ' ' + (g && 'uni-noticebar__content-text--single')}}" style="{{'color:' + h + ';' + ('font-size:' + i) + ';' + ('line-height:' + j) + ';' + ('width:' + k) + ';' + ('animation-duration:' + l) + ';' + ('-webkit-animation-duration:' + m) + ';' + ('animation-play-state:' + n) + ';' + ('-webkit-animation-play-state:' + o) + ';' + ('animation-delay:' + p) + ';' + ('-webkit-animation-delay:' + q)}}">{{d}}</text></view></view><view a:if="{{y}}" class="uni-noticebar__more uni-cursor-point data-v-c3453ea3" onTap="{{E}}"><text a:if="{{z}}" class="data-v-c3453ea3" style="{{'color:' + B + ';' + ('font-size:' + C)}}">{{A}}</text><uni-icons a:else class="data-v-c3453ea3" u-i="c3453ea3-1" onVI="__l" u-p="{{D||''}}"/></view><view a:if="{{F}}" class="uni-noticebar-close uni-cursor-point data-v-c3453ea3"><uni-icons class="data-v-c3453ea3" onClick="{{G}}" u-i="c3453ea3-2" onVI="__l" u-p="{{H||''}}"/></view></view>
|
@ -0,0 +1,207 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "UniNoticeBar",
|
||||
emits: ["click", "getmore", "close"],
|
||||
props: {
|
||||
text: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
moreText: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
backgroundColor: {
|
||||
type: String,
|
||||
default: "#FFF9EA"
|
||||
},
|
||||
speed: {
|
||||
// 默认1s滚动100px
|
||||
type: Number,
|
||||
default: 100
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: "#FF9A43"
|
||||
},
|
||||
fontSize: {
|
||||
type: Number,
|
||||
default: 14
|
||||
},
|
||||
moreColor: {
|
||||
type: String,
|
||||
default: "#FF9A43"
|
||||
},
|
||||
single: {
|
||||
// 是否单行
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
},
|
||||
scrollable: {
|
||||
// 是否滚动,添加后控制单行效果取消
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
},
|
||||
showIcon: {
|
||||
// 是否显示左侧icon
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
},
|
||||
showGetMore: {
|
||||
// 是否显示右侧查看更多
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
},
|
||||
showClose: {
|
||||
// 是否显示左侧关闭按钮
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const elId = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
|
||||
const elIdBox = `Uni_${Math.ceil(Math.random() * 1e6).toString(36)}`;
|
||||
return {
|
||||
textWidth: 0,
|
||||
boxWidth: 0,
|
||||
wrapWidth: "",
|
||||
webviewHide: false,
|
||||
elId,
|
||||
elIdBox,
|
||||
show: true,
|
||||
animationDuration: "none",
|
||||
animationPlayState: "paused",
|
||||
animationDelay: "0s"
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
text: function(newValue, oldValue) {
|
||||
this.initSize();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isShowGetMore() {
|
||||
return this.showGetMore === true || this.showGetMore === "true";
|
||||
},
|
||||
isShowClose() {
|
||||
return (this.showClose === true || this.showClose === "true") && (this.showGetMore === false || this.showGetMore === "false");
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initSize();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initSize() {
|
||||
if (this.scrollable) {
|
||||
let query = [];
|
||||
let textQuery = new Promise((resolve, reject) => {
|
||||
common_vendor.index.createSelectorQuery().select(`#${this.elId}`).boundingClientRect().exec((ret) => {
|
||||
this.textWidth = ret[0].width;
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
let boxQuery = new Promise((resolve, reject) => {
|
||||
common_vendor.index.createSelectorQuery().select(`#${this.elIdBox}`).boundingClientRect().exec((ret) => {
|
||||
this.boxWidth = ret[0].width;
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
query.push(textQuery);
|
||||
query.push(boxQuery);
|
||||
Promise.all(query).then(() => {
|
||||
this.animationDuration = `${this.textWidth / this.speed}s`;
|
||||
this.animationDelay = `-${this.boxWidth / this.speed}s`;
|
||||
setTimeout(() => {
|
||||
this.animationPlayState = "running";
|
||||
}, 1e3);
|
||||
});
|
||||
}
|
||||
},
|
||||
loopAnimation() {
|
||||
},
|
||||
clickMore() {
|
||||
this.$emit("getmore");
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
this.$emit("close");
|
||||
},
|
||||
onClick() {
|
||||
this.$emit("click");
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
_easycom_uni_icons2();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../../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.show
|
||||
}, $data.show ? common_vendor.e({
|
||||
b: $props.showIcon === true || $props.showIcon === "true"
|
||||
}, $props.showIcon === true || $props.showIcon === "true" ? {
|
||||
c: common_vendor.p({
|
||||
type: "sound",
|
||||
color: $props.color,
|
||||
size: $props.fontSize * 1.5
|
||||
})
|
||||
} : {}, {
|
||||
d: common_vendor.t($props.text),
|
||||
e: $data.elId,
|
||||
f: $props.scrollable ? 1 : "",
|
||||
g: !$props.scrollable && ($props.single || $props.showGetMore) ? 1 : "",
|
||||
h: $props.color,
|
||||
i: $props.fontSize + "px",
|
||||
j: $props.fontSize * 1.5 + "px",
|
||||
k: $data.wrapWidth + "px",
|
||||
l: $data.animationDuration,
|
||||
m: $data.animationDuration,
|
||||
n: $data.webviewHide ? "paused" : $data.animationPlayState,
|
||||
o: $data.webviewHide ? "paused" : $data.animationPlayState,
|
||||
p: $data.animationDelay,
|
||||
q: $data.animationDelay,
|
||||
r: $data.elIdBox,
|
||||
s: $props.scrollable ? 1 : "",
|
||||
t: !$props.scrollable && ($props.single || $props.moreText) ? 1 : "",
|
||||
v: $props.scrollable ? 1 : "",
|
||||
w: !$props.scrollable && ($props.single || $props.moreText) ? 1 : "",
|
||||
x: $props.scrollable ? $props.fontSize * 1.5 + "px" : "auto",
|
||||
y: $options.isShowGetMore
|
||||
}, $options.isShowGetMore ? common_vendor.e({
|
||||
z: $props.moreText.length > 0
|
||||
}, $props.moreText.length > 0 ? {
|
||||
A: common_vendor.t($props.moreText),
|
||||
B: $props.moreColor,
|
||||
C: $props.fontSize + "px"
|
||||
} : {
|
||||
D: common_vendor.p({
|
||||
type: "right",
|
||||
color: $props.moreColor,
|
||||
size: $props.fontSize * 1.1
|
||||
})
|
||||
}, {
|
||||
E: common_vendor.o((...args) => $options.clickMore && $options.clickMore(...args))
|
||||
}) : {}, {
|
||||
F: $options.isShowClose
|
||||
}, $options.isShowClose ? {
|
||||
G: common_vendor.o($options.close),
|
||||
H: common_vendor.p({
|
||||
type: "closeempty",
|
||||
color: $props.color,
|
||||
size: $props.fontSize * 1.1
|
||||
})
|
||||
} : {}, {
|
||||
I: $props.backgroundColor,
|
||||
J: common_vendor.o((...args) => $options.onClick && $options.onClick(...args))
|
||||
}) : {});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-c3453ea3"]]);
|
||||
my.createComponent(Component);
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"styleIsolation": "apply-shared",
|
||||
"usingComponents": {
|
||||
"uni-icons": "../../../uni-icons/components/uni-icons/uni-icons"
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.uni-popup {
|
||||
position: fixed;
|
||||
z-index: 99;
|
||||
}
|
||||
.uni-popup.top, .uni-popup.left, .uni-popup.right {
|
||||
top: 0;
|
||||
}
|
||||
.uni-popup .uni-popup__wrapper {
|
||||
display: block;
|
||||
position: relative;
|
||||
/* iphonex 等安全区设置,底部安全区适配 */
|
||||
}
|
||||
.uni-popup .uni-popup__wrapper.left, .uni-popup .uni-popup__wrapper.right {
|
||||
padding-top: 0;
|
||||
flex: 1;
|
||||
}
|
||||
.fixforpc-z-index {
|
||||
z-index: 999;
|
||||
}
|
||||
.fixforpc-top {
|
||||
top: 0;
|
||||
}
|
@ -0,0 +1 @@
|
||||
<view a:if="{{a}}" class="{{('uni-popup') + ' ' + k + ' ' + l}}"><view onTouchStart="{{j}}"><uni-transition a:if="{{b}}" key="1" onClick="{{c}}" u-i="7e14be24-0" onVI="__l" u-p="{{d||''}}"/><uni-transition u-s="{{['d']}}" key="2" onClick="{{h}}" u-i="7e14be24-1" onVI="__l" u-p="{{i||''}}"><view style="{{e}}" class="{{('uni-popup__wrapper') + ' ' + f}}" onTap="{{g}}"><slot/></view></uni-transition></view></view>
|
396
distribution/unpackage/dist/dev/mp-alipay/uni_modules/uni-popup/components/uni-popup/uni-popup.js
vendored
Normal file
@ -0,0 +1,396 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "uniPopup",
|
||||
components: {},
|
||||
emits: ["change", "maskClick"],
|
||||
props: {
|
||||
// 开启动画
|
||||
animation: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
|
||||
// message: 消息提示 ; dialog : 对话框
|
||||
type: {
|
||||
type: String,
|
||||
default: "center"
|
||||
},
|
||||
// maskClick
|
||||
isMaskClick: {
|
||||
type: Boolean,
|
||||
default: null
|
||||
},
|
||||
// TODO 2 个版本后废弃属性 ,使用 isMaskClick
|
||||
maskClick: {
|
||||
type: Boolean,
|
||||
default: null
|
||||
},
|
||||
backgroundColor: {
|
||||
type: String,
|
||||
default: "none"
|
||||
},
|
||||
safeArea: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
maskBackgroundColor: {
|
||||
type: String,
|
||||
default: "rgba(0, 0, 0, 0.4)"
|
||||
},
|
||||
borderRadius: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
/**
|
||||
* 监听type类型
|
||||
*/
|
||||
type: {
|
||||
handler: function(type) {
|
||||
if (!this.config[type])
|
||||
return;
|
||||
this[this.config[type]](true);
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
isDesktop: {
|
||||
handler: function(newVal) {
|
||||
if (!this.config[newVal])
|
||||
return;
|
||||
this[this.config[this.type]](true);
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
/**
|
||||
* 监听遮罩是否可点击
|
||||
* @param {Object} val
|
||||
*/
|
||||
maskClick: {
|
||||
handler: function(val) {
|
||||
this.mkclick = val;
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
isMaskClick: {
|
||||
handler: function(val) {
|
||||
this.mkclick = val;
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
// H5 下禁止底部滚动
|
||||
showPopup(show) {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
duration: 300,
|
||||
ani: [],
|
||||
showPopup: false,
|
||||
showTrans: false,
|
||||
popupWidth: 0,
|
||||
popupHeight: 0,
|
||||
config: {
|
||||
top: "top",
|
||||
bottom: "bottom",
|
||||
center: "center",
|
||||
left: "left",
|
||||
right: "right",
|
||||
message: "top",
|
||||
dialog: "center",
|
||||
share: "bottom"
|
||||
},
|
||||
maskClass: {
|
||||
position: "fixed",
|
||||
bottom: 0,
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
backgroundColor: "rgba(0, 0, 0, 0.4)"
|
||||
},
|
||||
transClass: {
|
||||
backgroundColor: "transparent",
|
||||
borderRadius: this.borderRadius || "0",
|
||||
position: "fixed",
|
||||
left: 0,
|
||||
right: 0
|
||||
},
|
||||
maskShow: true,
|
||||
mkclick: true,
|
||||
popupstyle: "top"
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
getStyles() {
|
||||
let res = { backgroundColor: this.bg };
|
||||
if (this.borderRadius || "0") {
|
||||
res = Object.assign(res, { borderRadius: this.borderRadius });
|
||||
}
|
||||
return res;
|
||||
},
|
||||
isDesktop() {
|
||||
return this.popupWidth >= 500 && this.popupHeight >= 500;
|
||||
},
|
||||
bg() {
|
||||
if (this.backgroundColor === "" || this.backgroundColor === "none") {
|
||||
return "transparent";
|
||||
}
|
||||
return this.backgroundColor;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const fixSize = () => {
|
||||
const {
|
||||
windowWidth,
|
||||
windowHeight,
|
||||
windowTop,
|
||||
safeArea,
|
||||
screenHeight,
|
||||
safeAreaInsets
|
||||
} = common_vendor.index.getSystemInfoSync();
|
||||
this.popupWidth = windowWidth;
|
||||
this.popupHeight = windowHeight + (windowTop || 0);
|
||||
if (safeArea && this.safeArea) {
|
||||
this.safeAreaInsets = safeAreaInsets.bottom;
|
||||
} else {
|
||||
this.safeAreaInsets = 0;
|
||||
}
|
||||
};
|
||||
fixSize();
|
||||
},
|
||||
// TODO vue3
|
||||
unmounted() {
|
||||
this.setH5Visible();
|
||||
},
|
||||
activated() {
|
||||
this.setH5Visible(!this.showPopup);
|
||||
},
|
||||
deactivated() {
|
||||
this.setH5Visible(true);
|
||||
},
|
||||
created() {
|
||||
if (this.isMaskClick === null && this.maskClick === null) {
|
||||
this.mkclick = true;
|
||||
} else {
|
||||
this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick;
|
||||
}
|
||||
if (this.animation) {
|
||||
this.duration = 300;
|
||||
} else {
|
||||
this.duration = 0;
|
||||
}
|
||||
this.messageChild = null;
|
||||
this.clearPropagation = false;
|
||||
this.maskClass.backgroundColor = this.maskBackgroundColor;
|
||||
},
|
||||
methods: {
|
||||
setH5Visible(visible = true) {
|
||||
},
|
||||
/**
|
||||
* 公用方法,不显示遮罩层
|
||||
*/
|
||||
closeMask() {
|
||||
this.maskShow = false;
|
||||
},
|
||||
/**
|
||||
* 公用方法,遮罩层禁止点击
|
||||
*/
|
||||
disableMask() {
|
||||
this.mkclick = false;
|
||||
},
|
||||
// TODO nvue 取消冒泡
|
||||
clear(e) {
|
||||
e.stopPropagation();
|
||||
this.clearPropagation = true;
|
||||
},
|
||||
open(direction) {
|
||||
if (this.showPopup) {
|
||||
return;
|
||||
}
|
||||
let innerType = ["top", "center", "bottom", "left", "right", "message", "dialog", "share"];
|
||||
if (!(direction && innerType.indexOf(direction) !== -1)) {
|
||||
direction = this.type;
|
||||
}
|
||||
if (!this.config[direction]) {
|
||||
console.error("缺少类型:", direction);
|
||||
return;
|
||||
}
|
||||
this[this.config[direction]]();
|
||||
this.$emit("change", {
|
||||
show: true,
|
||||
type: direction
|
||||
});
|
||||
},
|
||||
close(type) {
|
||||
this.showTrans = false;
|
||||
this.$emit("change", {
|
||||
show: false,
|
||||
type: this.type
|
||||
});
|
||||
clearTimeout(this.timer);
|
||||
this.timer = setTimeout(() => {
|
||||
this.showPopup = false;
|
||||
}, 300);
|
||||
},
|
||||
// TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容
|
||||
touchstart() {
|
||||
this.clearPropagation = false;
|
||||
},
|
||||
onTap() {
|
||||
if (this.clearPropagation) {
|
||||
this.clearPropagation = false;
|
||||
return;
|
||||
}
|
||||
this.$emit("maskClick");
|
||||
if (!this.mkclick)
|
||||
return;
|
||||
this.close();
|
||||
},
|
||||
/**
|
||||
* 顶部弹出样式处理
|
||||
*/
|
||||
top(type) {
|
||||
this.popupstyle = this.isDesktop ? "fixforpc-top" : "top";
|
||||
this.ani = ["slide-top"];
|
||||
this.transClass = {
|
||||
position: "fixed",
|
||||
left: 0,
|
||||
right: 0,
|
||||
backgroundColor: this.bg,
|
||||
borderRadius: this.borderRadius || "0"
|
||||
};
|
||||
if (type)
|
||||
return;
|
||||
this.showPopup = true;
|
||||
this.showTrans = true;
|
||||
this.$nextTick(() => {
|
||||
this.showPoptrans();
|
||||
if (this.messageChild && this.type === "message") {
|
||||
this.messageChild.timerClose();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 底部弹出样式处理
|
||||
*/
|
||||
bottom(type) {
|
||||
this.popupstyle = "bottom";
|
||||
this.ani = ["slide-bottom"];
|
||||
this.transClass = {
|
||||
position: "fixed",
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
paddingBottom: this.safeAreaInsets + "px",
|
||||
backgroundColor: this.bg,
|
||||
borderRadius: this.borderRadius || "0"
|
||||
};
|
||||
if (type)
|
||||
return;
|
||||
this.showPoptrans();
|
||||
},
|
||||
/**
|
||||
* 中间弹出样式处理
|
||||
*/
|
||||
center(type) {
|
||||
this.popupstyle = "center";
|
||||
this.ani = ["zoom-out", "fade"];
|
||||
this.transClass = {
|
||||
position: "fixed",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
borderRadius: this.borderRadius || "0"
|
||||
};
|
||||
if (type)
|
||||
return;
|
||||
this.showPoptrans();
|
||||
},
|
||||
left(type) {
|
||||
this.popupstyle = "left";
|
||||
this.ani = ["slide-left"];
|
||||
this.transClass = {
|
||||
position: "fixed",
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
top: 0,
|
||||
backgroundColor: this.bg,
|
||||
borderRadius: this.borderRadius || "0",
|
||||
display: "flex",
|
||||
flexDirection: "column"
|
||||
};
|
||||
if (type)
|
||||
return;
|
||||
this.showPoptrans();
|
||||
},
|
||||
right(type) {
|
||||
this.popupstyle = "right";
|
||||
this.ani = ["slide-right"];
|
||||
this.transClass = {
|
||||
position: "fixed",
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
backgroundColor: this.bg,
|
||||
borderRadius: this.borderRadius || "0",
|
||||
display: "flex",
|
||||
flexDirection: "column"
|
||||
};
|
||||
if (type)
|
||||
return;
|
||||
this.showPoptrans();
|
||||
},
|
||||
showPoptrans() {
|
||||
this.$nextTick(() => {
|
||||
this.showPopup = true;
|
||||
this.showTrans = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_transition2 = common_vendor.resolveComponent("uni-transition");
|
||||
_easycom_uni_transition2();
|
||||
}
|
||||
const _easycom_uni_transition = () => "../../../uni-transition/components/uni-transition/uni-transition.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_transition();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: $data.showPopup
|
||||
}, $data.showPopup ? common_vendor.e({
|
||||
b: $data.maskShow
|
||||
}, $data.maskShow ? {
|
||||
c: common_vendor.o($options.onTap),
|
||||
d: common_vendor.p({
|
||||
name: "mask",
|
||||
["mode-class"]: "fade",
|
||||
styles: $data.maskClass,
|
||||
duration: $data.duration,
|
||||
show: $data.showTrans
|
||||
})
|
||||
} : {}, {
|
||||
e: common_vendor.s($options.getStyles),
|
||||
f: common_vendor.n($data.popupstyle),
|
||||
g: common_vendor.o((...args) => $options.clear && $options.clear(...args)),
|
||||
h: common_vendor.o($options.onTap),
|
||||
i: common_vendor.p({
|
||||
["mode-class"]: $data.ani,
|
||||
name: "content",
|
||||
styles: $data.transClass,
|
||||
duration: $data.duration,
|
||||
show: $data.showTrans
|
||||
}),
|
||||
j: common_vendor.o((...args) => $options.touchstart && $options.touchstart(...args)),
|
||||
k: common_vendor.n($data.popupstyle),
|
||||
l: common_vendor.n($options.isDesktop ? "fixforpc-z-index" : "")
|
||||
}) : {});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
my.createComponent(Component);
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"styleIsolation": "apply-shared",
|
||||
"usingComponents": {
|
||||
"uni-transition": "../../../uni-transition/components/uni-transition/uni-transition"
|
||||
}
|
||||
}
|