上传代码
This commit is contained in:
154
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/distributionBox.js
vendored
Normal file
154
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/distributionBox.js
vendored
Normal file
@ -0,0 +1,154 @@
|
||||
"use strict";
|
||||
const pages_evaluateList_utils = require("./utils.js");
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "distributionBox",
|
||||
props: {
|
||||
getTime: String
|
||||
// 接收父组件传来的初始值
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sendTime: "",
|
||||
sRightDate: "",
|
||||
sLDate: "",
|
||||
jmhDay: [],
|
||||
timeList: [
|
||||
{ disabled: false, time: "11:00-13:00", id: 1 },
|
||||
{ disabled: false, time: "13:00-15:00", id: 2 },
|
||||
{ disabled: false, time: "15:00-17:00", id: 3 },
|
||||
{ disabled: false, time: "17:00-19:00", id: 4 },
|
||||
{ disabled: false, time: "19:00-21:00", id: 5 },
|
||||
{ disabled: false, time: "21:00-23:00", id: 6 }
|
||||
]
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getNextDay();
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.$refs.popup.close();
|
||||
},
|
||||
getWeekDate(day) {
|
||||
const weeks = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
|
||||
return weeks[day];
|
||||
},
|
||||
getNextDay() {
|
||||
const day = this.getWeekDate((/* @__PURE__ */ new Date()).getDay());
|
||||
const isDay = pages_evaluateList_utils.getDate().fullDate;
|
||||
const nextDay = this.getWeekDate(new Date((/* @__PURE__ */ new Date()).getTime() + 24 * 60 * 60 * 1e3).getDay());
|
||||
const nDate = pages_evaluateList_utils.getDate(new Date((/* @__PURE__ */ new Date()).getTime() + 24 * 60 * 60 * 1e3)).fullDate;
|
||||
const HDay = this.getWeekDate(new Date((/* @__PURE__ */ new Date()).getTime() + 48 * 60 * 60 * 1e3).getDay());
|
||||
const hDate = pages_evaluateList_utils.getDate(new Date((/* @__PURE__ */ new Date()).getTime() + 48 * 60 * 60 * 1e3)).fullDate;
|
||||
const d1 = hDate.substr(hDate.indexOf("-") + 1);
|
||||
this.sLDate = isDay;
|
||||
this.selectLDate(1);
|
||||
this.jmhDay = [
|
||||
{ name: day, id: 1, formatDate: isDay, desc: "今天" },
|
||||
{ name: nextDay, id: 2, formatDate: nDate, desc: "明天" },
|
||||
{ name: HDay, id: 3, formatDate: hDate, desc: d1.substr(0, d1.indexOf("-")) + "月" + d1.substr(d1.indexOf("-") + 1) + "日" }
|
||||
];
|
||||
},
|
||||
showBox() {
|
||||
this.$refs.popup.open();
|
||||
},
|
||||
selectRDate(item) {
|
||||
if (item.disabled) {
|
||||
return;
|
||||
}
|
||||
this.sRightDate = item.time;
|
||||
this.sendTime = `${this.sLDate} ${item.time}`;
|
||||
this.$emit("update:getTime", this.sendTime);
|
||||
this.$emit("timeSelected", this.sendTime);
|
||||
this.$refs.popup.close();
|
||||
},
|
||||
selectLDate(val) {
|
||||
if (val !== 1) {
|
||||
this.sLDate = val.formatDate;
|
||||
}
|
||||
let t = [
|
||||
{ disabled: false, time: "11:00-13:00", id: 1 },
|
||||
{ disabled: false, time: "13:00-15:00", id: 2 },
|
||||
{ disabled: false, time: "15:00-17:00", id: 3 },
|
||||
{ disabled: false, time: "17:00-19:00", id: 4 },
|
||||
{ disabled: false, time: "19:00-21:00", id: 5 },
|
||||
{ disabled: false, time: "21:00-23:00", id: 6 }
|
||||
];
|
||||
if (val.desc === "今天" || val === 1) {
|
||||
const currentHour = (/* @__PURE__ */ new Date()).getHours();
|
||||
if (currentHour <= 10) {
|
||||
this.timeList = t;
|
||||
} else if (currentHour <= 12) {
|
||||
t[0].disabled = true;
|
||||
this.timeList = t;
|
||||
} else if (currentHour <= 14) {
|
||||
t[0].disabled = true;
|
||||
t[1].disabled = true;
|
||||
this.timeList = t;
|
||||
} else if (currentHour <= 16) {
|
||||
t[0].disabled = true;
|
||||
t[1].disabled = true;
|
||||
t[2].disabled = true;
|
||||
this.timeList = t;
|
||||
} else if (currentHour <= 18) {
|
||||
t[0].disabled = true;
|
||||
t[1].disabled = true;
|
||||
t[2].disabled = true;
|
||||
t[3].disabled = true;
|
||||
this.timeList = t;
|
||||
} else if (currentHour <= 20) {
|
||||
t[0].disabled = true;
|
||||
t[1].disabled = true;
|
||||
t[2].disabled = true;
|
||||
t[3].disabled = true;
|
||||
t[4].disabled = true;
|
||||
this.timeList = t;
|
||||
}
|
||||
} else {
|
||||
this.timeList = t;
|
||||
}
|
||||
this.sRightDate = "";
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
||||
_easycom_uni_popup2();
|
||||
}
|
||||
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
|
||||
if (!Math) {
|
||||
_easycom_uni_popup();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.f($data.jmhDay, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.desc),
|
||||
b: common_vendor.t(item.name),
|
||||
c: common_vendor.o(($event) => $options.selectLDate(item), index),
|
||||
d: common_vendor.n($data.sLDate === item.formatDate ? "ed" : ""),
|
||||
e: index
|
||||
};
|
||||
}),
|
||||
b: common_vendor.f($data.timeList, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.time),
|
||||
b: common_vendor.t(item.disabled ? " (超出配送时间)" : ""),
|
||||
c: common_vendor.o(($event) => $options.selectRDate(item), index),
|
||||
d: common_vendor.n($data.sRightDate === item.time ? "ed" : ""),
|
||||
e: common_vendor.n(item.disabled ? "disabled" : ""),
|
||||
f: index
|
||||
};
|
||||
}),
|
||||
c: $data.timeList.length < 1
|
||||
}, $data.timeList.length < 1 ? {} : {}, {
|
||||
d: common_vendor.o(($event) => $options.close()),
|
||||
e: common_vendor.sr("popup", "ce85a3dd-0"),
|
||||
f: common_vendor.p({
|
||||
type: "bottom"
|
||||
})
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ce85a3dd"]]);
|
||||
wx.createComponent(Component);
|
6
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/distributionBox.json
vendored
Normal file
6
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/distributionBox.json
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"uni-popup": "../../uni_modules/uni-popup/components/uni-popup/uni-popup"
|
||||
}
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/distributionBox.wxml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/distributionBox.wxml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<uni-popup wx:if="{{f}}" class="r data-v-ce85a3dd" u-s="{{['d']}}" u-r="popup" u-i="ce85a3dd-0" bind:__l="__l" u-p="{{f}}"><view class="pBoxUp data-v-ce85a3dd"><view class="textCenter f32 psTitle border-bottom data-v-ce85a3dd"> 请选择配送时间 </view><view class="shopPopup bgff justify-between default-flex data-v-ce85a3dd"><view class="f30 t666 lBox data-v-ce85a3dd"><view wx:for="{{a}}" wx:for-item="item" wx:key="e" bindtap="{{item.c}}" class="{{[item.d, 'boxLDate', 'data-v-ce85a3dd']}}">{{item.a}}({{item.b}}) </view></view><view class="data-v-ce85a3dd"><view wx:for="{{b}}" wx:for-item="item" wx:key="f" bindtap="{{item.c}}" class="{{[item.d, item.e, 'rBox', 'data-v-ce85a3dd']}}">{{item.a}}{{item.b}}</view><view wx:if="{{c}}" class="empty f28 text-center data-v-ce85a3dd" style="color:#999;margin-top:40rpx"> 今天没有时间了,看看明天吧 </view></view></view><view class="cancelButton data-v-ce85a3dd" bindtap="{{d}}"> 取消 </view></view></uni-popup>
|
76
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/distributionBox.wxss
vendored
Normal file
76
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/distributionBox.wxss
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.pBoxUp.data-v-ce85a3dd {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.pBoxUp .psTitle.data-v-ce85a3dd {
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
border-bottom: 1rpx solid #f7f7f7;
|
||||
}
|
||||
.pBoxUp .shopPopup.data-v-ce85a3dd {
|
||||
backgound: #ffffff;
|
||||
font-size: 32rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.pBoxUp .boxLDate.data-v-ce85a3dd {
|
||||
font-size: 24rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
width: 273rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.pBoxUp .lBox.data-v-ce85a3dd {
|
||||
color: #666666;
|
||||
background: #f5f5f5;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.pBoxUp .boxLDate.ed.data-v-ce85a3dd {
|
||||
color: #1DA337;
|
||||
background: #fff;
|
||||
}
|
||||
.pBoxUp .rBox.ed.data-v-ce85a3dd {
|
||||
color: #1DA337;
|
||||
}
|
||||
.pBoxUp .rBox.data-v-ce85a3dd {
|
||||
width: 239px;
|
||||
padding-left: 20rpx;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
height: 80rpx;
|
||||
background: #fff;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
.pBoxUp .cancelButton.data-v-ce85a3dd {
|
||||
font-size: 36rpx;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
background: #FFF;
|
||||
}
|
37
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/evaluateList.js
vendored
Normal file
37
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/evaluateList.js
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
if (!Math) {
|
||||
DistributionBox();
|
||||
}
|
||||
const DistributionBox = () => "./distributionBox.js";
|
||||
const _sfc_main = {
|
||||
__name: "evaluateList",
|
||||
setup(__props) {
|
||||
const sendTime = common_vendor.ref("");
|
||||
const dsbonBox = common_vendor.ref(null);
|
||||
const showTime = () => {
|
||||
if (dsbonBox.value) {
|
||||
dsbonBox.value.showBox();
|
||||
}
|
||||
};
|
||||
const handleTimeSelected = (time) => {
|
||||
console.log("Selected Time:", time);
|
||||
sendTime.value = time;
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_vendor.t(sendTime.value || "请选择配送时间"),
|
||||
b: common_vendor.o(showTime),
|
||||
c: common_vendor.sr(dsbonBox, "43d98410-0", {
|
||||
"k": "dsbonBox"
|
||||
}),
|
||||
d: common_vendor.o(handleTimeSelected),
|
||||
e: common_vendor.p({
|
||||
["get-time"]: sendTime.value
|
||||
})
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-43d98410"]]);
|
||||
wx.createPage(MiniProgramPage);
|
6
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/evaluateList.json
vendored
Normal file
6
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/evaluateList.json
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "评分列表",
|
||||
"usingComponents": {
|
||||
"distribution-box": "./distributionBox"
|
||||
}
|
||||
}
|
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/evaluateList.wxml
vendored
Normal file
1
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/evaluateList.wxml
vendored
Normal file
@ -0,0 +1 @@
|
||||
<view class="align-center justify-between default-flex secondBox data-v-43d98410" bindtap="{{b}}"><view class="default-flex align-center data-v-43d98410"><view class="lImg mr-2 data-v-43d98410"><image class="data-v-43d98410" src="https://yujia-shanghai-bucket.oss-cn-shanghai.aliyuncs.com/small-program/yvmuShop/hTime.png" alt=""></image></view><view class="t666 f28 data-v-43d98410"> 配送时间 </view></view><view class="tDesc data-v-43d98410"><view class="sTime data-v-43d98410">{{a}}</view><view class="bj data-v-43d98410"><image class="data-v-43d98410" src="https://yujia-shanghai-bucket.oss-cn-shanghai.aliyuncs.com/small-program/yvmuShop/timeEdit.png" alt=""></image></view></view></view><distribution-box wx:if="{{e}}" class="r data-v-43d98410" u-r="dsbonBox" bindtimeSelected="{{d}}" u-i="43d98410-0" bind:__l="__l" u-p="{{e}}"></distribution-box>
|
68
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/evaluateList.wxss
vendored
Normal file
68
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/evaluateList.wxss
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.bgff.data-v-43d98410 {
|
||||
background: #ffffff;
|
||||
}
|
||||
.justify-between.data-v-43d98410 {
|
||||
justify-content: space-between;
|
||||
}
|
||||
.default-flex.data-v-43d98410 {
|
||||
display: flex;
|
||||
}
|
||||
.align-center.data-v-43d98410 {
|
||||
align-items: center;
|
||||
}
|
||||
.mr-2.data-v-43d98410 {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.secondBox.data-v-43d98410 {
|
||||
padding: 20rpx 30rpx 20rpx 30rpx;
|
||||
}
|
||||
.secondBox img.data-v-43d98410 {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
.secondBox image.data-v-43d98410 {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
.secondBox .lImg.data-v-43d98410 {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
.secondBox .bj.data-v-43d98410 {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
.secondBox .tDesc.data-v-43d98410 {
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #666;
|
||||
}
|
||||
.secondBox .tDesc .sTime.data-v-43d98410 {
|
||||
margin-right: 20rpx;
|
||||
}
|
22
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/utils.js
vendored
Normal file
22
uniapp04/unpackage/dist/dev/mp-weixin/pages/evaluateList/utils.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
function getDate(date, AddDayCount = 0) {
|
||||
if (!date) {
|
||||
date = /* @__PURE__ */ new Date();
|
||||
}
|
||||
if (typeof date !== "object") {
|
||||
date = date.replace(/-/g, "/");
|
||||
}
|
||||
const dd = new Date(date);
|
||||
dd.setDate(dd.getDate() + AddDayCount);
|
||||
const y = dd.getFullYear();
|
||||
const m = dd.getMonth() + 1 < 10 ? "0" + (dd.getMonth() + 1) : dd.getMonth() + 1;
|
||||
const d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();
|
||||
return {
|
||||
fullDate: y + "-" + m + "-" + d,
|
||||
year: y,
|
||||
month: m,
|
||||
date: d,
|
||||
day: dd.getDay()
|
||||
};
|
||||
}
|
||||
exports.getDate = getDate;
|
Reference in New Issue
Block a user