正在显示
59 个修改的文件
包含
1310 行增加
和
426 行删除
@@ -28,8 +28,10 @@ | @@ -28,8 +28,10 @@ | ||
28 | "pages/refund-after/refund-after", | 28 | "pages/refund-after/refund-after", |
29 | "pages/my-discount-card/my-discount-card", | 29 | "pages/my-discount-card/my-discount-card", |
30 | "pages/all-evaluate/all-evaluate", | 30 | "pages/all-evaluate/all-evaluate", |
31 | - "pages/index/index" | ||
32 | - | 31 | + "pages/index/index", |
32 | + "components/navbar/navbar", | ||
33 | + "pages/timedmo/timedmo", | ||
34 | + "components/timepicker/timepicker" | ||
33 | ], | 35 | ], |
34 | "window": { | 36 | "window": { |
35 | "backgroundTextStyle": "light", | 37 | "backgroundTextStyle": "light", |
@@ -40,7 +42,35 @@ | @@ -40,7 +42,35 @@ | ||
40 | "style": "v2", | 42 | "style": "v2", |
41 | "sitemapLocation": "sitemap.json", | 43 | "sitemapLocation": "sitemap.json", |
42 | "selectedColor": "#355DFF", | 44 | "selectedColor": "#355DFF", |
43 | - | 45 | + "tabBar": { |
46 | + "borderStyle": "white", | ||
47 | + "list": [ | ||
48 | + { | ||
49 | + "pagePath": "pages/home/home", | ||
50 | + "text": "首页", | ||
51 | + "iconPath": "/images/tab/home.png", | ||
52 | + "selectedIconPath": "/images/tab/home (2).png" | ||
53 | + }, | ||
54 | + { | ||
55 | + "pagePath": "pages/classify/classify", | ||
56 | + "text": "分类", | ||
57 | + "iconPath": "/images/tab/classify (2).png", | ||
58 | + "selectedIconPath": "/images/tab/classify.png" | ||
59 | + }, | ||
60 | + { | ||
61 | + "pagePath": "pages/shopping-cart/shopping-cart", | ||
62 | + "text": "购物车", | ||
63 | + "iconPath": "/images/tab/cart (2).png", | ||
64 | + "selectedIconPath": "/images/tab/cart.png" | ||
65 | + }, | ||
66 | + { | ||
67 | + "pagePath": "pages/user/user", | ||
68 | + "text": "我的", | ||
69 | + "iconPath": "/images/tab/user.png", | ||
70 | + "selectedIconPath": "/images/tab/user (2).png" | ||
71 | + } | ||
72 | + ] | ||
73 | + }, | ||
44 | "plugins": { | 74 | "plugins": { |
45 | "chooseLocation": { | 75 | "chooseLocation": { |
46 | "version": "1.0.5", | 76 | "version": "1.0.5", |
components/navbar/navbar.js
0 → 100644
1 | +// components/navbar/navbar.js | ||
2 | +Page({ | ||
3 | + | ||
4 | + /** | ||
5 | + * 页面的初始数据 | ||
6 | + */ | ||
7 | + data: { | ||
8 | + | ||
9 | + }, | ||
10 | + | ||
11 | + /** | ||
12 | + * 生命周期函数--监听页面加载 | ||
13 | + */ | ||
14 | + onLoad: function (options) { | ||
15 | + | ||
16 | + }, | ||
17 | + | ||
18 | + /** | ||
19 | + * 生命周期函数--监听页面初次渲染完成 | ||
20 | + */ | ||
21 | + onReady: function () { | ||
22 | + | ||
23 | + }, | ||
24 | + | ||
25 | + /** | ||
26 | + * 生命周期函数--监听页面显示 | ||
27 | + */ | ||
28 | + onShow: function () { | ||
29 | + | ||
30 | + }, | ||
31 | + | ||
32 | + /** | ||
33 | + * 生命周期函数--监听页面隐藏 | ||
34 | + */ | ||
35 | + onHide: function () { | ||
36 | + | ||
37 | + }, | ||
38 | + | ||
39 | + /** | ||
40 | + * 生命周期函数--监听页面卸载 | ||
41 | + */ | ||
42 | + onUnload: function () { | ||
43 | + | ||
44 | + }, | ||
45 | + | ||
46 | + /** | ||
47 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
48 | + */ | ||
49 | + onPullDownRefresh: function () { | ||
50 | + | ||
51 | + }, | ||
52 | + | ||
53 | + /** | ||
54 | + * 页面上拉触底事件的处理函数 | ||
55 | + */ | ||
56 | + onReachBottom: function () { | ||
57 | + | ||
58 | + }, | ||
59 | + | ||
60 | + /** | ||
61 | + * 用户点击右上角分享 | ||
62 | + */ | ||
63 | + onShareAppMessage: function () { | ||
64 | + | ||
65 | + } | ||
66 | +}) |
components/navbar/navbar.json
0 → 100644
components/navbar/navbar.wxml
0 → 100644
components/navbar/navbar.wxss
0 → 100644
1 | +/* components/navbar/navbar.wxss */ |
components/timepicker/timepicker.js
0 → 100644
1 | +// component/time-picker/index.js | ||
2 | +let utils=require("../../utils/util.js") | ||
3 | +const app = getApp() | ||
4 | +Component({ | ||
5 | + /** | ||
6 | + * 组件的属性列表 | ||
7 | + */ | ||
8 | + properties: { | ||
9 | + | ||
10 | + }, | ||
11 | + | ||
12 | + /** | ||
13 | + * 组件的初始数据 | ||
14 | + */ | ||
15 | + data: { | ||
16 | + deliveryTime: "", | ||
17 | + selfData: [], //自提日期 | ||
18 | + showDelivery: false, | ||
19 | + deliveryTimeList: [{ | ||
20 | + day: "", | ||
21 | + timeList: "" | ||
22 | + }], | ||
23 | + nowDay: 0, | ||
24 | + selectTime: '', | ||
25 | + selectTimeIndex: '', | ||
26 | + selectDay: 0 | ||
27 | + }, | ||
28 | + pageLifetimes: { | ||
29 | + show: function() { | ||
30 | + this.getDliveryTime() | ||
31 | + } | ||
32 | + }, | ||
33 | + /** | ||
34 | + * 组件的方法列表 | ||
35 | + */ | ||
36 | + methods: { | ||
37 | + getnowDay(e) { | ||
38 | + this.setData({ | ||
39 | + nowDay: e.currentTarget.dataset.index | ||
40 | + }) | ||
41 | + }, | ||
42 | + clickTime(e) { | ||
43 | + let selfData = this.data.selfData[this.data.nowDay] | ||
44 | + let index = e.currentTarget.dataset.index | ||
45 | + let selectTime = this.data.deliveryTimeList[this.data.nowDay].timeList[index] | ||
46 | + let deliveryTime = selfData.year + '-' + selfData.month + '-' + selfData.day + ' ' + selectTime | ||
47 | + let nowDay = this.data.nowDay | ||
48 | + this.setData({ | ||
49 | + selectTimeIndex: index, | ||
50 | + selectTime: selectTime, | ||
51 | + deliveryTime: deliveryTime, | ||
52 | + selectDay: nowDay | ||
53 | + }) | ||
54 | + this.triggerEvent('selectTime', { | ||
55 | + deliveryTime: this.data.deliveryTime | ||
56 | + }) | ||
57 | + }, | ||
58 | + //计算配送时间 | ||
59 | + getDliveryTime() { | ||
60 | + let deliveryTimeList = []; | ||
61 | + let date = new Date(); | ||
62 | + this.setData({ | ||
63 | + selfData: utils.getDates(5) | ||
64 | + // selfData: utils.getDates(5) | ||
65 | + }) | ||
66 | + //获取时间段 | ||
67 | + let timeDate = new Date(date.getTime()); | ||
68 | + let todayList = getTimeList(timeDate.getHours(), 1); | ||
69 | + deliveryTimeList.push({ | ||
70 | + timeList: todayList | ||
71 | + }); | ||
72 | + let nextDayList = getTimeList(9, 0); | ||
73 | + for (let i = 1; i < 5; i++) { | ||
74 | + deliveryTimeList.push({ | ||
75 | + timeList: nextDayList | ||
76 | + }); | ||
77 | + } | ||
78 | + this.triggerEvent('selectTime', { | ||
79 | + deliveryTime: this.data.deliveryTime | ||
80 | + }) | ||
81 | + this.setData({ | ||
82 | + deliveryTimeList: [] | ||
83 | + }) | ||
84 | + this.setData({ | ||
85 | + deliveryTimeList: deliveryTimeList | ||
86 | + }) | ||
87 | + // today 1 是今天 0 不是今天 | ||
88 | + function getTimeList(hour, today) { | ||
89 | + let timeList = []; | ||
90 | + let startTime = hour <= 9 ? 9 : hour; | ||
91 | + for (let i = 0; i < 8; i++) { | ||
92 | + if (((hour <= 9) && (startTime + 2 * i >21)) || ((hour > 9) && (startTime + 2 * i >= 21))) { | ||
93 | + break; | ||
94 | + } else { | ||
95 | + if (hour <= 9) { | ||
96 | + timeList.push( | ||
97 | + startTime + 2 * i + ":00" + "-" + (startTime + 2 * (i + 1)) + ":00" | ||
98 | + ); | ||
99 | + } else { | ||
100 | + if (startTime % 2 === 0) { | ||
101 | + timeList.push( | ||
102 | + startTime + 2 * i + 1 + ":00" + "-" + (startTime + 2 * i + 3) + ":00" | ||
103 | + ); | ||
104 | + } else { | ||
105 | + console.log(i,'i') | ||
106 | + timeList.push( | ||
107 | + startTime + 2 * i +2 + ":00" + "-" + (startTime + 2 * i + 4) + ":00" | ||
108 | + ); | ||
109 | + } | ||
110 | + } | ||
111 | + } | ||
112 | + } | ||
113 | + return timeList; | ||
114 | + } | ||
115 | + } | ||
116 | + } | ||
117 | +}) |
components/timepicker/timepicker.json
0 → 100644
components/timepicker/timepicker.wxml
0 → 100644
1 | +<!--components/time-picker/time-picker.wxml--> | ||
2 | +<!--component/time-picker/index.wxml--> | ||
3 | +<view class="select-date"> | ||
4 | + <view class="time-title">自提时间</view> | ||
5 | + <view class="select-day"> | ||
6 | + <view class="day" wx:for="{{selfData}}" wx:key="index" class='{{nowDay===index?"day active":"day"}}' | ||
7 | + bindtap="getnowDay" data-index='{{index}}'>{{item.month}}月{{item.day}}号【{{item.week}}】</view> | ||
8 | + </view> | ||
9 | + <view class="select-time"> | ||
10 | + <view wx:if="{{nowDay===0}}"> | ||
11 | + <view wx:if='{{deliveryTimeList[nowDay].timeList.length>0}}'> | ||
12 | + <view class='{{index===selectTimeIndex&&nowDay===selectDay?"select-time-item select":"select-time-item"}}' | ||
13 | + wx:for="{{deliveryTimeList[nowDay].timeList}}" bindtap="clickTime" wx:key="index" data-index='{{index}}'> | ||
14 | + {{item}} | ||
15 | + </view> | ||
16 | + </view> | ||
17 | + <view wx:else class="time-title">对不起,今日暂无自提时间 | ||
18 | + </view> | ||
19 | + </view> | ||
20 | + <view wx:if="{{nowDay!==0}}"> | ||
21 | + <view class='{{index===selectTimeIndex&&nowDay===selectDay?"select-time-item select":"select-time-item"}}' | ||
22 | + wx:for="{{deliveryTimeList[nowDay].timeList}}" bindtap="clickTime" wx:key="index" data-index='{{index}}'> | ||
23 | + {{item}} | ||
24 | + </view> | ||
25 | + </view> | ||
26 | + </view> | ||
27 | + <!-- </view> --> | ||
28 | +</view> |
components/timepicker/timepicker.wxss
0 → 100644
1 | +/* component/time-picker/index.wxss */ | ||
2 | + | ||
3 | +.time-title { | ||
4 | + font-family: PingFangSC; | ||
5 | + font-weight: 600; | ||
6 | + color: rgba(50, 50, 50, 1); | ||
7 | + font-size: 32rpx; | ||
8 | + margin: 40rpx 20rpx 20rpx 20rpx; | ||
9 | +} | ||
10 | + | ||
11 | +.select-date { | ||
12 | + max-height: 400rpx; | ||
13 | + height: 672rpx; | ||
14 | +} | ||
15 | + | ||
16 | +.select-day { | ||
17 | + float: left; | ||
18 | + width: 300rpx; | ||
19 | + height: 392rpx; | ||
20 | +} | ||
21 | + | ||
22 | +.day { | ||
23 | + font-size: 30rpx; | ||
24 | + height: 100rpx; | ||
25 | + display: flex; | ||
26 | + justify-content: center; | ||
27 | + align-items: center; | ||
28 | + background: rgba(239, 239, 239, 1); | ||
29 | +} | ||
30 | + | ||
31 | +.day.active { | ||
32 | + background-color: #fff; | ||
33 | +} | ||
34 | + | ||
35 | +.select-time { | ||
36 | + height: 100%; | ||
37 | + margin-left: 330rpx; | ||
38 | + background-color: #fff; | ||
39 | + overflow-y: auto; | ||
40 | +} | ||
41 | + | ||
42 | +.select-time-item { | ||
43 | + padding: 30rpx 36rpx; | ||
44 | + width: 314rpx; | ||
45 | + height: 42rpx; | ||
46 | + border-radius: 18rpx; | ||
47 | + border: 2px solid rgba(151, 151, 151, 1); | ||
48 | + font-size: 30rpx; | ||
49 | + margin-bottom: 30rpx; | ||
50 | +} | ||
51 | + | ||
52 | +.select-time-item.select { | ||
53 | + color: #ff4a00; | ||
54 | +} | ||
55 | + | ||
56 | +/* .time { | ||
57 | + | ||
58 | + line-height: 80rpx; | ||
59 | + border-bottom: 2px solid #eee; | ||
60 | +} */ | ||
61 | + | ||
62 | +i { | ||
63 | + float: right; | ||
64 | + font-size: 30rpx; | ||
65 | + color: #ff4a00; | ||
66 | + margin-top: 26rpx; | ||
67 | +} |
images/youhuiquan.png
0 → 100644
11.9 KB
1 | -.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} | ||
1 | +.van-ellipsis { | ||
2 | + overflow: hidden; | ||
3 | + white-space: nowrap; | ||
4 | + text-overflow: ellipsis; | ||
5 | + /* color: #939496; */ | ||
6 | +} | ||
7 | + | ||
8 | +.van-multi-ellipsis--l2 { | ||
9 | + -webkit-line-clamp: 2 | ||
10 | +} | ||
11 | + | ||
12 | +.van-multi-ellipsis--l2, | ||
13 | +.van-multi-ellipsis--l3 { | ||
14 | + display: -webkit-box; | ||
15 | + overflow: hidden; | ||
16 | + text-overflow: ellipsis; | ||
17 | + -webkit-box-orient: vertical | ||
18 | +} | ||
19 | + | ||
20 | +.van-multi-ellipsis--l3 { | ||
21 | + -webkit-line-clamp: 3 | ||
22 | +} | ||
23 | + | ||
24 | +.van-clearfix:after { | ||
25 | + display: table; | ||
26 | + clear: both; | ||
27 | + content: "" | ||
28 | +} | ||
29 | + | ||
30 | +.van-hairline, | ||
31 | +.van-hairline--bottom, | ||
32 | +.van-hairline--left, | ||
33 | +.van-hairline--right, | ||
34 | +.van-hairline--surround, | ||
35 | +.van-hairline--top, | ||
36 | +.van-hairline--top-bottom { | ||
37 | + position: relative | ||
38 | +} | ||
39 | + | ||
40 | +.van-hairline--bottom:after, | ||
41 | +.van-hairline--left:after, | ||
42 | +.van-hairline--right:after, | ||
43 | +.van-hairline--surround:after, | ||
44 | +.van-hairline--top-bottom:after, | ||
45 | +.van-hairline--top:after, | ||
46 | +.van-hairline:after { | ||
47 | + position: absolute; | ||
48 | + box-sizing: border-box; | ||
49 | + -webkit-transform-origin: center; | ||
50 | + transform-origin: center; | ||
51 | + content: " "; | ||
52 | + pointer-events: none; | ||
53 | + top: -50%; | ||
54 | + right: -50%; | ||
55 | + bottom: -50%; | ||
56 | + left: -50%; | ||
57 | + border: 0 solid #ebedf0; | ||
58 | + -webkit-transform: scale(.5); | ||
59 | + transform: scale(.5) | ||
60 | +} | ||
61 | + | ||
62 | +.van-hairline--top:after { | ||
63 | + border-top-width: 1px | ||
64 | +} | ||
65 | + | ||
66 | +.van-hairline--left:after { | ||
67 | + border-left-width: 1px | ||
68 | +} | ||
69 | + | ||
70 | +.van-hairline--right:after { | ||
71 | + border-right-width: 1px | ||
72 | +} | ||
73 | + | ||
74 | +.van-hairline--bottom:after { | ||
75 | + border-bottom-width: 1px | ||
76 | +} | ||
77 | + | ||
78 | +.van-hairline--top-bottom:after { | ||
79 | + border-width: 1px 0 | ||
80 | +} | ||
81 | + | ||
82 | +.van-hairline--surround:after { | ||
83 | + border-width: 1px | ||
84 | +} |
1 | -@import '../common/index.wxss';.van-search{-webkit-align-items:center;align-items:center;box-sizing:border-box;padding:10px 12px;padding:var(--search-padding,10px 12px)}.van-search,.van-search__content{display:-webkit-flex;display:flex}.van-search__content{-webkit-flex:1;flex:1;padding-left:8px;padding-left:var(--padding-xs,8px);border-radius:2px;border-radius:var(--border-radius-sm,2px);background-color:#f7f8fa;background-color:var(--search-background-color,#f7f8fa)}.van-search__content--round{border-radius:17px;border-radius:calc(var(--search-input-height, 34px)/2)}.van-search__label{padding:0 5px;padding:var(--search-label-padding,0 5px);font-size:14px;font-size:var(--search-label-font-size,14px);line-height:34px;line-height:var(--search-input-height,34px);color:#323233;color:var(--search-label-color,#323233)}.van-search__field{-webkit-flex:1;flex:1}.van-search__field__left-icon{color:#969799;color:var(--search-left-icon-color,#969799)}.van-search--withaction{padding-right:0}.van-search__action{padding:0 8px;padding:var(--search-action-padding,0 8px);font-size:14px;font-size:var(--search-action-font-size,14px);line-height:34px;line-height:var(--search-input-height,34px);color:#323233;color:var(--search-action-text-color,#323233)}.van-search__action--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)} | ||
1 | +@import '../common/index.wxss'; | ||
2 | + | ||
3 | +.van-search { | ||
4 | + -webkit-align-items: center; | ||
5 | + align-items: center; | ||
6 | + box-sizing: border-box; | ||
7 | + padding: 10px 12px; | ||
8 | + padding: var(--search-padding, 10px 12px) | ||
9 | +} | ||
10 | + | ||
11 | +.van-search, | ||
12 | +.van-search__content { | ||
13 | + display: -webkit-flex; | ||
14 | + display: flex | ||
15 | +} | ||
16 | + | ||
17 | +.van-search__content { | ||
18 | + -webkit-flex: 1; | ||
19 | + flex: 1; | ||
20 | + padding-left: 8px; | ||
21 | + padding-left: var(--padding-xs, 8px); | ||
22 | + border-radius: 2px; | ||
23 | + border-radius: var(--border-radius-sm, 2px); | ||
24 | + background-color: #f7f8fa; | ||
25 | + background-color: var(--search-background-color, #f7f8fa) | ||
26 | +} | ||
27 | + | ||
28 | +.van-search__content--round { | ||
29 | + border-radius: 17px; | ||
30 | + border-radius: calc(var(--search-input-height, 34px)/2) | ||
31 | +} | ||
32 | + | ||
33 | +.van-search__label { | ||
34 | + padding: 0 5px; | ||
35 | + padding: var(--search-label-padding, 0 5px); | ||
36 | + font-size: 14px; | ||
37 | + font-size: var(--search-label-font-size, 16px); | ||
38 | + line-height: 34px; | ||
39 | + line-height: var(--search-input-height, 34px); | ||
40 | + color: #323233; | ||
41 | + color: var(--search-label-color, #323233) | ||
42 | +} | ||
43 | + | ||
44 | +.van-search__field { | ||
45 | + -webkit-flex: 1; | ||
46 | + flex: 1 | ||
47 | +} | ||
48 | + | ||
49 | +.van-search__field__left-icon { | ||
50 | + color: #969799; | ||
51 | + color: var(--search-left-icon-color, #969799) | ||
52 | +} | ||
53 | + | ||
54 | +.van-search--withaction { | ||
55 | + padding-right: 0 | ||
56 | +} | ||
57 | + | ||
58 | +.van-search__action { | ||
59 | + padding: 0 8px; | ||
60 | + padding: var(--search-action-padding, 0 8px); | ||
61 | + font-size: 16px; | ||
62 | + font-size: var(--search-action-font-size, 16px); | ||
63 | + line-height: 34px; | ||
64 | + line-height: var(--search-input-height, 34px); | ||
65 | + color: #323233; | ||
66 | + color: var(--search-action-text-color, #323233) | ||
67 | +} | ||
68 | + | ||
69 | +.van-search__action--hover { | ||
70 | + background-color: #f2f3f5; | ||
71 | + background-color: var(--active-color, #f2f3f5) | ||
72 | +} |
1 | -@import '../common/index.wxss';.van-sidebar-item{display:block;box-sizing:border-box;overflow:hidden;word-wrap:break-word;border-left:3px solid transparent;-webkit-user-select:none;user-select:none;padding:20px 12px 20px 8px;padding:var(--sidebar-padding,20px 12px 20px 8px);font-size:14px;font-size:var(--sidebar-font-size,14px);line-height:20px;line-height:var(--sidebar-line-height,20px);color:#323233;color:var(--sidebar-text-color,#323233);background-color:#f7f8fa;background-color:var(--sidebar-background-color,#f7f8fa)}.van-sidebar-item__text{position:relative;display:inline-block}.van-sidebar-item--hover:not(.van-sidebar-item--disabled){background-color:#f2f3f5;background-color:var(--sidebar-active-color,#f2f3f5)}.van-sidebar-item:after{border-bottom-width:1px}.van-sidebar-item--selected{color:#323233;color:var(--sidebar-selected-text-color,#323233);font-weight:500;font-weight:var(--sidebar-selected-font-weight,500);border-color:#ee0a24;border-color:var(--sidebar-selected-border-color,#ee0a24)}.van-sidebar-item--selected:after{border-right-width:1px}.van-sidebar-item--selected,.van-sidebar-item--selected.van-sidebar-item--hover{background-color:#fff;background-color:var(--sidebar-selected-background-color,#fff)}.van-sidebar-item--disabled{color:#c8c9cc;color:var(--sidebar-disabled-text-color,#c8c9cc)} | ||
1 | +@import '../common/index.wxss'; | ||
2 | + | ||
3 | +.van-sidebar-item { | ||
4 | + display: block; | ||
5 | + box-sizing: border-box; | ||
6 | + overflow: hidden; | ||
7 | + word-wrap: break-word; | ||
8 | + border-left: 3px solid transparent; | ||
9 | + -webkit-user-select: none; | ||
10 | + user-select: none; | ||
11 | + padding: 20px 12px 20px 8px; | ||
12 | + padding: var(--sidebar-padding, 20px 12px 20px 8px); | ||
13 | + font-size: 14px; | ||
14 | + font-size: var(--sidebar-font-size, 14px); | ||
15 | + line-height: 20px; | ||
16 | + line-height: var(--sidebar-line-height, 20px); | ||
17 | + color: #323233; | ||
18 | + color: var(--sidebar-text-color, #7d7e80); | ||
19 | + background-color: #f7f8fa; | ||
20 | + background-color: var(--sidebar-background-color, #f7f8fa) | ||
21 | +} | ||
22 | + | ||
23 | +.van-sidebar-item__text { | ||
24 | + position: relative; | ||
25 | + display: inline-block | ||
26 | +} | ||
27 | + | ||
28 | +.van-sidebar-item--hover:not(.van-sidebar-item--disabled) { | ||
29 | + background-color: #f2f3f5; | ||
30 | + background-color: var(--sidebar-active-color, #f2f3f5) | ||
31 | +} | ||
32 | + | ||
33 | +.van-sidebar-item:after { | ||
34 | + border-bottom-width: 1px | ||
35 | +} | ||
36 | + | ||
37 | +.van-sidebar-item--selected { | ||
38 | + color: #323233; | ||
39 | + color: var(--sidebar-selected-text-color, #323233); | ||
40 | + font-weight: 500; | ||
41 | + font-weight: var(--sidebar-selected-font-weight, 500); | ||
42 | + border-color: #ee0a24; | ||
43 | + border-color: var(--sidebar-selected-border-color, #ee0a24) | ||
44 | +} | ||
45 | + | ||
46 | +.van-sidebar-item--selected:after { | ||
47 | + border-right-width: 1px | ||
48 | +} | ||
49 | + | ||
50 | +.van-sidebar-item--selected, | ||
51 | +.van-sidebar-item--selected.van-sidebar-item--hover { | ||
52 | + background-color: #fff; | ||
53 | + background-color: var(--sidebar-selected-background-color, #fff) | ||
54 | +} | ||
55 | + | ||
56 | +.van-sidebar-item--disabled { | ||
57 | + color: #c8c9cc; | ||
58 | + color: var(--sidebar-disabled-text-color, #c8c9cc) | ||
59 | +} |
1 | -@import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{display:-webkit-flex;display:flex;overflow:hidden}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__wrap--scrollable .van-tab--complete{-webkit-flex:1 0 auto!important;flex:1 0 auto!important;padding:0 12px}.van-tabs__wrap--scrollable .van-tabs__nav--complete{padding-right:8px;padding-left:8px}.van-tabs__scroll{background-color:#fff;background-color:var(--tabs-nav-background-color,#fff)}.van-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.van-tabs__scroll--card{margin:0 16px;margin:0 var(--padding-md,16px)}.van-tabs__scroll::-webkit-scrollbar{display:none}.van-tabs__nav{position:relative;display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none}.van-tabs__nav--card{box-sizing:border-box;height:30px;height:var(--tabs-card-height,30px);border:1px solid #ee0a24;border:var(--border-width-base,1px) solid var(--tabs-default-color,#ee0a24);border-radius:2px;border-radius:var(--border-radius-sm,2px)}.van-tabs__nav--card .van-tab{color:#ee0a24;color:var(--tabs-default-color,#ee0a24);line-height:28px;line-height:calc(var(--tabs-card-height, 30px) - var(--border-width-base, 1px)*2);border-right:1px solid #ee0a24;border-right:var(--border-width-base,1px) solid var(--tabs-default-color,#ee0a24)}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;color:var(--white,#fff);background-color:#ee0a24;background-color:var(--tabs-default-color,#ee0a24)}.van-tabs__nav--card .van-tab--disabled{color:#c8c9cc;color:var(--tab-disabled-text-color,#c8c9cc)}.van-tabs__line{position:absolute;bottom:0;left:0;z-index:1;height:3px;height:var(--tabs-bottom-bar-height,3px);border-radius:3px;border-radius:var(--tabs-bottom-bar-height,3px);background-color:#ee0a24;background-color:var(--tabs-bottom-bar-color,#ee0a24)}.van-tabs__track{position:relative;width:100%;height:100%}.van-tabs__track--animated{display:-webkit-flex;display:flex;transition-property:left}.van-tabs__content{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:44px;height:var(--tabs-line-height,44px)}.van-tabs--card .van-tabs__wrap{height:30px;height:var(--tabs-card-height,30px)}.van-tab{position:relative;-webkit-flex:1;flex:1;box-sizing:border-box;min-width:0;padding:0 5px;text-align:center;cursor:pointer;color:#646566;color:var(--tab-text-color,#646566);font-size:14px;font-size:var(--tab-font-size,14px);line-height:44px;line-height:var(--tabs-line-height,44px)}.van-tab--active{font-weight:500;font-weight:var(--font-weight-bold,500);color:#323233;color:var(--tab-active-text-color,#323233)}.van-tab--disabled{color:#c8c9cc;color:var(--tab-disabled-text-color,#c8c9cc)}.van-tab__title__info{position:relative!important;top:-1px!important;display:inline-block;-webkit-transform:translateX(0)!important;transform:translateX(0)!important} | ||
1 | +@import '../common/index.wxss'; | ||
2 | + | ||
3 | +.van-tabs { | ||
4 | + position: relative; | ||
5 | + -webkit-tap-highlight-color: transparent | ||
6 | +} | ||
7 | + | ||
8 | +.van-tabs__wrap { | ||
9 | + display: -webkit-flex; | ||
10 | + display: flex; | ||
11 | + overflow: hidden | ||
12 | +} | ||
13 | + | ||
14 | +.van-tabs__wrap--scrollable .van-tab { | ||
15 | + -webkit-flex: 0 0 22%; | ||
16 | + flex: 0 0 22% | ||
17 | +} | ||
18 | + | ||
19 | +.van-tabs__wrap--scrollable .van-tab--complete { | ||
20 | + -webkit-flex: 1 0 auto !important; | ||
21 | + flex: 1 0 auto !important; | ||
22 | + padding: 0 12px | ||
23 | +} | ||
24 | + | ||
25 | +.van-tabs__wrap--scrollable .van-tabs__nav--complete { | ||
26 | + padding-right: 8px; | ||
27 | + padding-left: 8px | ||
28 | +} | ||
29 | + | ||
30 | +.van-tabs__scroll { | ||
31 | + background-color: #fff; | ||
32 | + background-color: var(--tabs-nav-background-color, #fff) | ||
33 | +} | ||
34 | + | ||
35 | +.van-tabs__scroll--line { | ||
36 | + box-sizing: initial; | ||
37 | + height: calc(100% + 15px) | ||
38 | +} | ||
39 | + | ||
40 | +.van-tabs__scroll--card { | ||
41 | + margin: 0 16px; | ||
42 | + margin: 0 var(--padding-md, 16px) | ||
43 | +} | ||
44 | + | ||
45 | +.van-tabs__scroll::-webkit-scrollbar { | ||
46 | + display: none | ||
47 | +} | ||
48 | + | ||
49 | +.van-tabs__nav { | ||
50 | + position: relative; | ||
51 | + display: -webkit-flex; | ||
52 | + display: flex; | ||
53 | + -webkit-user-select: none; | ||
54 | + user-select: none | ||
55 | +} | ||
56 | + | ||
57 | +.van-tabs__nav--card { | ||
58 | + box-sizing: border-box; | ||
59 | + height: 30px; | ||
60 | + height: var(--tabs-card-height, 30px); | ||
61 | + border: 1px solid #ee0a24; | ||
62 | + border: var(--border-width-base, 1px) solid var(--tabs-default-color, #ee0a24); | ||
63 | + border-radius: 2px; | ||
64 | + border-radius: var(--border-radius-sm, 2px) | ||
65 | +} | ||
66 | + | ||
67 | +.van-tabs__nav--card .van-tab { | ||
68 | + color: #ee0a24; | ||
69 | + color: var(--tabs-default-color, #ee0a24); | ||
70 | + line-height: 28px; | ||
71 | + line-height: calc(var(--tabs-card-height, 30px) - var(--border-width-base, 1px)*2); | ||
72 | + border-right: 1px solid #ee0a24; | ||
73 | + border-right: var(--border-width-base, 1px) solid var(--tabs-default-color, #ee0a24) | ||
74 | +} | ||
75 | + | ||
76 | +.van-tabs__nav--card .van-tab:last-child { | ||
77 | + border-right: none | ||
78 | +} | ||
79 | + | ||
80 | +.van-tabs__nav--card .van-tab.van-tab--active { | ||
81 | + color: #fff; | ||
82 | + color: var(--white, #fff); | ||
83 | + background-color: #ee0a24; | ||
84 | + background-color: var(--tabs-default-color, #ee0a24) | ||
85 | +} | ||
86 | + | ||
87 | +.van-tabs__nav--card .van-tab--disabled { | ||
88 | + color: #c8c9cc; | ||
89 | + color: var(--tab-disabled-text-color, #c8c9cc) | ||
90 | +} | ||
91 | + | ||
92 | +.van-tabs__line { | ||
93 | + position: absolute; | ||
94 | + bottom: 0; | ||
95 | + left: 0; | ||
96 | + z-index: 1; | ||
97 | + height: 3px; | ||
98 | + height: var(--tabs-bottom-bar-height, 3px); | ||
99 | + border-radius: 3px; | ||
100 | + border-radius: var(--tabs-bottom-bar-height, 3px); | ||
101 | + background-color: #ee0a24; | ||
102 | + background-color: var(--tabs-bottom-bar-color, #ee0a24) | ||
103 | +} | ||
104 | + | ||
105 | +.van-tabs__track { | ||
106 | + position: relative; | ||
107 | + width: 100%; | ||
108 | + height: 100% | ||
109 | +} | ||
110 | + | ||
111 | +.van-tabs__track--animated { | ||
112 | + display: -webkit-flex; | ||
113 | + display: flex; | ||
114 | + transition-property: left | ||
115 | +} | ||
116 | + | ||
117 | +.van-tabs__content { | ||
118 | + overflow: hidden | ||
119 | +} | ||
120 | + | ||
121 | +.van-tabs--line .van-tabs__wrap { | ||
122 | + height: 44px; | ||
123 | + height: var(--tabs-line-height, 44px) | ||
124 | +} | ||
125 | + | ||
126 | +.van-tabs--card .van-tabs__wrap { | ||
127 | + height: 30px; | ||
128 | + height: var(--tabs-card-height, 30px) | ||
129 | +} | ||
130 | + | ||
131 | +.van-tab { | ||
132 | + position: relative; | ||
133 | + -webkit-flex: 1; | ||
134 | + flex: 1; | ||
135 | + box-sizing: border-box; | ||
136 | + min-width: 0; | ||
137 | + padding: 0 5px; | ||
138 | + text-align: center; | ||
139 | + cursor: pointer; | ||
140 | + color: #646566; | ||
141 | + color: var(--tab-text-color, #939496); | ||
142 | + font-size: 14px; | ||
143 | + font-size: var(--tab-font-size, 14px); | ||
144 | + line-height: 44px; | ||
145 | + line-height: var(--tabs-line-height, 44px) | ||
146 | +} | ||
147 | + | ||
148 | +.van-tab--active { | ||
149 | + font-weight: 500; | ||
150 | + font-weight: var(--font-weight-bold, 500); | ||
151 | + color: #323233; | ||
152 | + color: var(--tab-active-text-color, #323233) | ||
153 | +} | ||
154 | + | ||
155 | +.van-tab--disabled { | ||
156 | + color: #c8c9cc; | ||
157 | + color: var(--tab-disabled-text-color, #c8c9cc) | ||
158 | +} | ||
159 | + | ||
160 | +.van-tab__title__info { | ||
161 | + position: relative !important; | ||
162 | + top: -1px !important; | ||
163 | + display: inline-block; | ||
164 | + -webkit-transform: translateX(0) !important; | ||
165 | + transform: translateX(0) !important | ||
166 | +} |
@@ -40,65 +40,39 @@ Page({ | @@ -40,65 +40,39 @@ Page({ | ||
40 | payment: '' | 40 | payment: '' |
41 | }, | 41 | }, |
42 | //选择时间 | 42 | //选择时间 |
43 | - showPopupTwo() { | ||
44 | - this.setData({ | ||
45 | - show: true | ||
46 | - }); | ||
47 | - }, | ||
48 | - showPopup() { | ||
49 | - this.setData({ | ||
50 | - show: true | ||
51 | - }); | 43 | + selectTime(e) { |
44 | + if (e.detail.deliveryTime && e.detail.deliveryTime !== this.data.storePickupTime) { | ||
45 | + this.setData({ | ||
46 | + storePickupTime: e.detail.deliveryTime, | ||
47 | + showTime: false | ||
48 | + }) | ||
49 | + } | ||
52 | }, | 50 | }, |
53 | onClose() { | 51 | onClose() { |
54 | this.setData({ | 52 | this.setData({ |
55 | - show: false | ||
56 | - }); | ||
57 | - }, | ||
58 | - onInput(e) { | ||
59 | - this.setData({ | ||
60 | - currentDate: e.detail, | ||
61 | - }); | ||
62 | - }, | ||
63 | - onInputTwo(e) { | ||
64 | - this.setData({ | ||
65 | - currentDateTwo: e.detail, | ||
66 | - }); | ||
67 | - }, | ||
68 | - cancel() { | ||
69 | - this.setData({ | ||
70 | - show: false | ||
71 | - }); | ||
72 | - }, | ||
73 | - confirm() { | ||
74 | - this.setData({ | ||
75 | - show: false | 53 | + showTime: false |
76 | }); | 54 | }); |
77 | }, | 55 | }, |
78 | - cancelTwo() { | ||
79 | - this.setData({ | ||
80 | - show: false | ||
81 | - }); | 56 | + onReady() { |
57 | + this.timepicker = this.selectComponent('#aaa') | ||
82 | }, | 58 | }, |
83 | - confirmTwo() { | 59 | + chooseTime() { |
84 | this.setData({ | 60 | this.setData({ |
85 | - show: false | ||
86 | - }); | 61 | + showTime: true |
62 | + }) | ||
63 | + // this.timepicker.getDliveryTime(); | ||
87 | }, | 64 | }, |
88 | - //配送时间 | ||
89 | - bindDateChange: function (e) { | 65 | + onClickButton() { |
90 | this.setData({ | 66 | this.setData({ |
91 | - date: e.detail.value | 67 | + showModal: true |
92 | }) | 68 | }) |
93 | }, | 69 | }, |
94 | - //获取当天时间 | ||
95 | getDayTime() { | 70 | getDayTime() { |
96 | var myDate = new Date(); | 71 | var myDate = new Date(); |
97 | var year = myDate.getFullYear(); | 72 | var year = myDate.getFullYear(); |
98 | var month = myDate.getMonth(); | 73 | var month = myDate.getMonth(); |
99 | var day = myDate.getDate(); | 74 | var day = myDate.getDate(); |
100 | var dayNow = year + '-' + (month + 1) + "-" + day; | 75 | var dayNow = year + '-' + (month + 1) + "-" + day; |
101 | - console.log(dayNow, 'daynow') | ||
102 | this.setData({ | 76 | this.setData({ |
103 | startTime: dayNow | 77 | startTime: dayNow |
104 | }) | 78 | }) |
@@ -240,7 +214,7 @@ Page({ | @@ -240,7 +214,7 @@ Page({ | ||
240 | let postData = { | 214 | let postData = { |
241 | addressId: this.data.userData.id, | 215 | addressId: this.data.userData.id, |
242 | couponId: this.data.couponId, | 216 | couponId: this.data.couponId, |
243 | - deliveryTime: this.data.date, | 217 | + deliveryTime: this.data.storePickupTime, |
244 | note: this.data.leavaWord, | 218 | note: this.data.leavaWord, |
245 | num: this.data.count, | 219 | num: this.data.count, |
246 | skuId: this.data.skuId | 220 | skuId: this.data.skuId |
1 | { | 1 | { |
2 | "usingComponents": { | 2 | "usingComponents": { |
3 | - "van-datetime-picker": "@vant/weapp/datetime-picker/index", | 3 | + "timepicker":"../../components/timepicker/timepicker", |
4 | "van-popup": "@vant/weapp/popup/index" | 4 | "van-popup": "@vant/weapp/popup/index" |
5 | }, | 5 | }, |
6 | "navigationBarTitleText": "确认订单" | 6 | "navigationBarTitleText": "确认订单" |
1 | <!--pages/affirm-order/affirm-order.wxml--> | 1 | <!--pages/affirm-order/affirm-order.wxml--> |
2 | <view class="container"> | 2 | <view class="container"> |
3 | <!-- 地址 --> | 3 | <!-- 地址 --> |
4 | - <view class="address" catchtap="selectAdd" > | ||
5 | - <view wx:if="{{userData!==''}}"> | 4 | + <view class="address" catchtap="selectAdd"> |
5 | + <view wx:if="{{userData!==''}}" style="width:95%"> | ||
6 | <view class="userName">{{userData.name}}</view> | 6 | <view class="userName">{{userData.name}}</view> |
7 | <view class="userTell">{{userData.phone}}</view> | 7 | <view class="userTell">{{userData.phone}}</view> |
8 | <view class="default" wx:if="{{userData.delFlag==1}}">默认</view> | 8 | <view class="default" wx:if="{{userData.delFlag==1}}">默认</view> |
@@ -19,17 +19,21 @@ | @@ -19,17 +19,21 @@ | ||
19 | 19 | ||
20 | <!-- 配送时间 --> | 20 | <!-- 配送时间 --> |
21 | <view class="timeBox"> | 21 | <view class="timeBox"> |
22 | - <view class="calendar "> | ||
23 | - <image src="/images/04-01/rili.png"></image> | 22 | + <view style="width:95%;display:flex"> |
23 | + <view class="calendar " bindtap='chooseTime'> | ||
24 | + <!-- <image src="/images/04-01/rili.png"></image> --> | ||
25 | + 请选择配送时间: | ||
26 | + </view> | ||
27 | + <view class="selectText">{{storePickupTime}}</view> | ||
28 | + | ||
29 | + </view> | ||
30 | + <view class="arrow"> | ||
31 | + <image src="/images/04-01/arrow.png"></image> | ||
24 | </view> | 32 | </view> |
25 | - <!-- <view class="timeTitle">配送时间:</view> | ||
26 | - <view class="selectTime">{{}}</view> --> | ||
27 | <view class="section"> | 33 | <view class="section"> |
28 | - <picker mode="date" value="{{date}}" start="{{startTime}}" bindchange="bindDateChange"> | ||
29 | - <view class="picker"> | ||
30 | - 配送时间: {{date}} | ||
31 | - </view> | ||
32 | - </picker> | 34 | + <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom"> |
35 | + <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="aaa"></timepicker> | ||
36 | + </van-popup> | ||
33 | </view> | 37 | </view> |
34 | </view> | 38 | </view> |
35 | <!-- 商品列表 --> | 39 | <!-- 商品列表 --> |
@@ -90,76 +90,55 @@ page { | @@ -90,76 +90,55 @@ page { | ||
90 | } | 90 | } |
91 | 91 | ||
92 | /* 配送时间 */ | 92 | /* 配送时间 */ |
93 | -/* .timeBox { | ||
94 | - width: 686rpx; | ||
95 | - height: 104rpx; | ||
96 | - background-color: #ffffff; | ||
97 | - display: flex; | ||
98 | - justify-content: space-between; | ||
99 | - align-items: center; | ||
100 | - margin: 0 auto; | ||
101 | - margin-top: 24rpx; | ||
102 | - padding: 0 24rpx; | 93 | +.container { |
94 | + padding-top: 34rpx; | ||
95 | + width: 750rpx; | ||
96 | + height: 1440rpx; | ||
97 | + background-color: #f1f2f4; | ||
103 | box-sizing: border-box; | 98 | box-sizing: border-box; |
104 | - border-radius: 16px; | ||
105 | -} | ||
106 | -.timeArrow{ | ||
107 | - width: 20rpx; | ||
108 | - height: 20rpx; | 99 | + margin-bottom: 130rpx; |
109 | } | 100 | } |
110 | -.timeArrow image{ | ||
111 | - width: 22rpx; | ||
112 | - height: 24rpx; | 101 | + |
102 | +.calendar { | ||
103 | + font-size: 28rpx; | ||
104 | + font-weight: 400; | ||
105 | + text-align: left; | ||
106 | + color: #323233; | ||
107 | + width: 224rpx; | ||
113 | } | 108 | } |
114 | -.startTime,.endTime{ | ||
115 | - display: inline-block; | 109 | +.selectText{ |
110 | + font-size: 28rpx; | ||
111 | + color: #323233; | ||
116 | } | 112 | } |
117 | -.picker{ | ||
118 | - width: 340rpx; | 113 | +.arrow{ |
114 | + width: 5%; | ||
119 | } | 115 | } |
120 | -.pickerEndTime{ | ||
121 | - width: 200rpx; | ||
122 | -} */ | ||
123 | -/* 配送时间 */ | ||
124 | -.picker { | ||
125 | - width: 600rpx; | 116 | +.arrow image{ |
117 | + width: 24rpx; | ||
118 | + height: 32rpx; | ||
126 | } | 119 | } |
127 | - | ||
128 | .timeBox { | 120 | .timeBox { |
129 | width: 686rpx; | 121 | width: 686rpx; |
130 | height: 104rpx; | 122 | height: 104rpx; |
131 | - margin: 0 auto; | ||
132 | - margin-top: 24rpx; | ||
133 | background-color: #ffffff; | 123 | background-color: #ffffff; |
134 | display: flex; | 124 | display: flex; |
125 | + justify-content: space-between; | ||
135 | align-items: center; | 126 | align-items: center; |
136 | - padding: 32rpx 24rpx; | 127 | + margin: 0 auto; |
128 | + margin-top: 24rpx; | ||
129 | + padding: 0 28rpx; | ||
137 | box-sizing: border-box; | 130 | box-sizing: border-box; |
138 | - border-radius: 16rpx; | ||
139 | -} | ||
140 | - | ||
141 | -.calendar { | ||
142 | - width: 32rpx; | ||
143 | - height: 32rpx; | ||
144 | - margin-right: 12rpx; | ||
145 | -} | ||
146 | - | ||
147 | -.calendar image { | ||
148 | - width: 32rpx; | ||
149 | - height: 32rpx; | 131 | + border-radius: 16px; |
150 | } | 132 | } |
151 | 133 | ||
152 | -.timeTitle, | ||
153 | -.selectTime { | ||
154 | - font-size: 28rpx; | ||
155 | - font-weight: 400; | ||
156 | - text-align: left; | ||
157 | - color: #323233; | ||
158 | - line-height: 40rpx; | 134 | +.timeArrow { |
135 | + width: 20rpx; | ||
136 | + height: 20rpx; | ||
159 | } | 137 | } |
160 | 138 | ||
161 | -.selectTime { | ||
162 | - margin-left: 16rpx; | 139 | +.timeArrow image { |
140 | + width: 22rpx; | ||
141 | + height: 24rpx; | ||
163 | } | 142 | } |
164 | 143 | ||
165 | 144 | ||
@@ -171,6 +150,7 @@ page { | @@ -171,6 +150,7 @@ page { | ||
171 | background-color: #ffffff; | 150 | background-color: #ffffff; |
172 | margin-top: 24rpx; | 151 | margin-top: 24rpx; |
173 | padding-bottom: 32rpx; | 152 | padding-bottom: 32rpx; |
153 | + border-radius: 16rpx; | ||
174 | } | 154 | } |
175 | 155 | ||
176 | .cartListItem { | 156 | .cartListItem { |
@@ -3,12 +3,14 @@ let method = require("../../utils/reuqest.js"); | @@ -3,12 +3,14 @@ let method = require("../../utils/reuqest.js"); | ||
3 | const util = require("../../utils/util.js"); | 3 | const util = require("../../utils/util.js"); |
4 | Page({ | 4 | Page({ |
5 | data: { | 5 | data: { |
6 | - userData:"", | 6 | + userData: "", |
7 | addressId: '', | 7 | addressId: '', |
8 | startTime: '', | 8 | startTime: '', |
9 | cartList: [], //商品列表 | 9 | cartList: [], //商品列表 |
10 | goodsData: '', | 10 | goodsData: '', |
11 | goodsList: '', | 11 | goodsList: '', |
12 | + showTime: false , //配送时间 | ||
13 | + storePickupTime: '', | ||
12 | show: false, | 14 | show: false, |
13 | currentDate: '12:00', | 15 | currentDate: '12:00', |
14 | currentDateTwo: '13:00', | 16 | currentDateTwo: '13:00', |
@@ -70,84 +72,44 @@ Page({ | @@ -70,84 +72,44 @@ Page({ | ||
70 | }) | 72 | }) |
71 | }, | 73 | }, |
72 | //选择时间 | 74 | //选择时间 |
73 | - //配送时间 | ||
74 | - bindDateChange: function (e) { | 75 | + //配送时间 |
76 | + selectTime(e) { | ||
77 | + if (e.detail.deliveryTime && e.detail.deliveryTime !== this.data.storePickupTime) { | ||
75 | this.setData({ | 78 | this.setData({ |
76 | - date: e.detail.value | 79 | + storePickupTime: e.detail.deliveryTime, |
80 | + showTime: false | ||
77 | }) | 81 | }) |
78 | - }, | ||
79 | - //获取当天时间 | ||
80 | - getDayTime() { | ||
81 | - var myDate = new Date(); | ||
82 | - var year = myDate.getFullYear(); | ||
83 | - var month = myDate.getMonth(); | ||
84 | - var day = myDate.getDate(); | ||
85 | - var dayNow = year + '-' + (month + 1) + "-" + day; | ||
86 | - console.log(dayNow, 'daynow') | ||
87 | - this.setData({ | ||
88 | - startTime: dayNow | ||
89 | - }) | ||
90 | - }, | ||
91 | - showPopupTwo() { | ||
92 | - this.setData({ | ||
93 | - show: true | ||
94 | - }); | ||
95 | - }, | ||
96 | - showPopup() { | ||
97 | - this.setData({ | ||
98 | - show: true | ||
99 | - }); | ||
100 | - }, | ||
101 | - onClose() { | ||
102 | - this.setData({ | ||
103 | - show: false | ||
104 | - }); | ||
105 | - }, | ||
106 | - onInput(e) { | ||
107 | - this.setData({ | ||
108 | - currentDate: e.detail, | ||
109 | - }); | ||
110 | - }, | ||
111 | - onInputTwo(e) { | ||
112 | - this.setData({ | ||
113 | - currentDateTwo: e.detail, | ||
114 | - }); | ||
115 | - }, | ||
116 | - cancel() { | ||
117 | - this.setData({ | ||
118 | - show: false | ||
119 | - }); | ||
120 | - }, | ||
121 | - confirm() { | ||
122 | - this.setData({ | ||
123 | - show: false | ||
124 | - }); | ||
125 | - }, | ||
126 | - cancelTwo() { | ||
127 | - this.setData({ | ||
128 | - show: false | ||
129 | - }); | ||
130 | - }, | ||
131 | - confirmTwo() { | ||
132 | - this.setData({ | ||
133 | - show: false | ||
134 | - }); | ||
135 | - }, | ||
136 | - | ||
137 | - //选择时间 | ||
138 | - selectTime() { | ||
139 | - this.bindStartTimeChange() | ||
140 | - }, | ||
141 | - bindStartTimeChange: function (e) { | ||
142 | - this.setData({ | ||
143 | - startTime: e.detail.value | ||
144 | - }) | ||
145 | - }, | ||
146 | - bindEndTimeChange: function (e) { | ||
147 | - this.setData({ | ||
148 | - endTime: e.detail.value | ||
149 | - }) | ||
150 | - }, | 82 | + } |
83 | +}, | ||
84 | +onClose() { | ||
85 | + this.setData({ | ||
86 | + showTime: false | ||
87 | + }); | ||
88 | +}, | ||
89 | +onReady() { | ||
90 | + this.timepicker = this.selectComponent('#aaa') | ||
91 | +}, | ||
92 | +chooseTime() { | ||
93 | + this.setData({ | ||
94 | + showTime: true | ||
95 | + }) | ||
96 | + // this.timepicker.getDliveryTime(); | ||
97 | +}, | ||
98 | +onClickButton() { | ||
99 | + this.setData({ | ||
100 | + showModal: true | ||
101 | + }) | ||
102 | +}, | ||
103 | +getDayTime() { | ||
104 | + var myDate = new Date(); | ||
105 | + var year = myDate.getFullYear(); | ||
106 | + var month = myDate.getMonth(); | ||
107 | + var day = myDate.getDate(); | ||
108 | + var dayNow = year + '-' + (month + 1) + "-" + day; | ||
109 | + this.setData({ | ||
110 | + startTime: dayNow | ||
111 | + }) | ||
112 | +}, | ||
151 | //点击减少 | 113 | //点击减少 |
152 | dec() { | 114 | dec() { |
153 | let that = this | 115 | let that = this |
@@ -256,8 +218,7 @@ Page({ | @@ -256,8 +218,7 @@ Page({ | ||
256 | if (data.statusCode == 0) { | 218 | if (data.statusCode == 0) { |
257 | this.payment(); | 219 | this.payment(); |
258 | wx.setStorageSync('cardAmount', "") | 220 | wx.setStorageSync('cardAmount', "") |
259 | - }else{ | ||
260 | - } | 221 | + } else {} |
261 | }) | 222 | }) |
262 | }, | 223 | }, |
263 | //支付 | 224 | //支付 |
1 | { | 1 | { |
2 | "usingComponents": { | 2 | "usingComponents": { |
3 | - "van-datetime-picker": "@vant/weapp/datetime-picker/index", | 3 | + "timepicker":"../../components/timepicker/timepicker", |
4 | "van-popup": "@vant/weapp/popup/index" | 4 | "van-popup": "@vant/weapp/popup/index" |
5 | }, | 5 | }, |
6 | "navigationBarTitleText": "确认订单" | 6 | "navigationBarTitleText": "确认订单" |
@@ -2,29 +2,31 @@ | @@ -2,29 +2,31 @@ | ||
2 | <view class="container"> | 2 | <view class="container"> |
3 | <!-- 地址 --> | 3 | <!-- 地址 --> |
4 | <view class="address" bindtap="emit"> | 4 | <view class="address" bindtap="emit"> |
5 | - <view wx:if="{{userData!==''}}"> | 5 | + <view wx:if="{{userData!==''}}" style="width:95%"> |
6 | <view class="userName">{{userData.name}}</view> | 6 | <view class="userName">{{userData.name}}</view> |
7 | <view class="userTell">{{userData.phone}}</view> | 7 | <view class="userTell">{{userData.phone}}</view> |
8 | <view class="default" wx:if="{{userData.delFlag==1}}">默认</view> | 8 | <view class="default" wx:if="{{userData.delFlag==1}}">默认</view> |
9 | <view class="userAddress">{{userData.area}}{{userData.address}}</view> | 9 | <view class="userAddress">{{userData.area}}{{userData.address}}</view> |
10 | </view> | 10 | </view> |
11 | <view wx:if="{{userData==''}}" class="noAdd"> | 11 | <view wx:if="{{userData==''}}" class="noAdd"> |
12 | - 请选择收货地址 | 12 | + 请选择收货地址 |
13 | </view> | 13 | </view> |
14 | <view class="arrow"> | 14 | <view class="arrow"> |
15 | <image src="/images/04-01/arrow.png"></image> | 15 | <image src="/images/04-01/arrow.png"></image> |
16 | </view> | 16 | </view> |
17 | </view> | 17 | </view> |
18 | <!-- 配送时间 --> | 18 | <!-- 配送时间 --> |
19 | - <view class="timeBox"> | ||
20 | - <view class="section"> | ||
21 | - <picker mode="date" value="{{date}}" start="{{startTime}}" bindchange="bindDateChange"> | ||
22 | - <view class="picker"> | ||
23 | - 配送时间: {{date}} | ||
24 | - </view> | ||
25 | - </picker> | ||
26 | - </view> | ||
27 | - </view> | 19 | + <view class="timeBox" bindtap='chooseTime'> |
20 | + <view class="calendar " > | ||
21 | + <!-- <image src="/images/04-01/rili.png"></image> --> | ||
22 | + </view> | ||
23 | + {{storePickupTime}} | ||
24 | + <view class="section"> | ||
25 | + <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom" > | ||
26 | + <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="aaa"></timepicker> | ||
27 | + </van-popup> | ||
28 | + </view> | ||
29 | + </view> | ||
28 | <!-- 商品列表 --> | 30 | <!-- 商品列表 --> |
29 | <view class="cartList"> | 31 | <view class="cartList"> |
30 | <view class="cartListItem" wx:for="{{cartList}}"> | 32 | <view class="cartListItem" wx:for="{{cartList}}"> |
@@ -62,7 +62,7 @@ Page({ | @@ -62,7 +62,7 @@ Page({ | ||
62 | method.getRequest("/goods/geocoder/v1/" + str, data => { | 62 | method.getRequest("/goods/geocoder/v1/" + str, data => { |
63 | if (data.statusCode == 0) { | 63 | if (data.statusCode == 0) { |
64 | that.setData({ | 64 | that.setData({ |
65 | - location: data.data.address | 65 | + location: data.data.address.split('市')[1] |
66 | }) | 66 | }) |
67 | } | 67 | } |
68 | }) | 68 | }) |
@@ -93,7 +93,7 @@ | @@ -93,7 +93,7 @@ | ||
93 | </view> | 93 | </view> |
94 | </view> | 94 | </view> |
95 | <!-- tabbar --> | 95 | <!-- tabbar --> |
96 | -<view class="tabbarBox"> | 96 | +<!-- <view class="tabbarBox"> |
97 | <ul> | 97 | <ul> |
98 | <li> | 98 | <li> |
99 | <view class="tabbarPic" bindtap="toHome"> | 99 | <view class="tabbarPic" bindtap="toHome"> |
@@ -120,4 +120,4 @@ | @@ -120,4 +120,4 @@ | ||
120 | <text bindtap="toUser">我的</text> | 120 | <text bindtap="toUser">我的</text> |
121 | </li> | 121 | </li> |
122 | </ul> | 122 | </ul> |
123 | -</view> | ||
123 | +</view> --> |
@@ -136,7 +136,7 @@ page { | @@ -136,7 +136,7 @@ page { | ||
136 | 136 | ||
137 | .navContent { | 137 | .navContent { |
138 | background-color: #fff; | 138 | background-color: #fff; |
139 | - margin-bottom: 100rpx; | 139 | + /* margin-bottom: 100rpx; */ |
140 | } | 140 | } |
141 | 141 | ||
142 | .scroll-view { | 142 | .scroll-view { |
@@ -252,6 +252,7 @@ page { | @@ -252,6 +252,7 @@ page { | ||
252 | display: flex; | 252 | display: flex; |
253 | justify-content: center; | 253 | justify-content: center; |
254 | background-color: #f1f2f4; | 254 | background-color: #f1f2f4; |
255 | + margin-bottom: 250rpx; | ||
255 | } | 256 | } |
256 | 257 | ||
257 | /* 购物车弹框 */ | 258 | /* 购物车弹框 */ |
1 | <!--pages/discount-card/discount-card.wxml--> | 1 | <!--pages/discount-card/discount-card.wxml--> |
2 | <view class="container"> | 2 | <view class="container"> |
3 | - <view class="picBox" wx:for="{{cardList}}" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}" data-amount="{{item.fullAmount}}"data-cardamount="{{item.amount}}"> | ||
4 | - <view class="left"> | ||
5 | - <view class="price">¥{{item.amount}}</view> | ||
6 | - <view wx:if="{{item.fullAmount==undefined}}">无门槛使用</view> | ||
7 | - <view wx:if="{{item.fullAmount!==undefined}}">满{{item.fullAmount}}可用</view> | ||
8 | - </view> | ||
9 | - <view class="right"> | ||
10 | - <view>{{item.name}}</view> | ||
11 | - <view class="time">{{startTime}}-{{endTime}}</view> | ||
12 | - <view class="time">{{item.time}}</view> | ||
13 | - </view> | ||
14 | - <view class="topCircle"></view> | ||
15 | - <view class="bottomCircle"></view> | ||
16 | - </view> | ||
17 | - <view class="bottomHint" wx:if="{{bottomHint}}"> | ||
18 | - 我是有底线的~ | ||
19 | -</view> | ||
20 | - <view class="listBlank" wx:if="{{cardList.length==0}}"> | ||
21 | - 暂无可用优惠券~ | ||
22 | - </view> | ||
23 | -</view> | 3 | + <view style="position:relative"> |
4 | + <view class="picBox" wx:for="{{cardList}}" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}" | ||
5 | + data-amount="{{item.fullAmount}}" data-cardamount="{{item.amount}}"> | ||
6 | + <view class="left"> | ||
7 | + <view class="price">¥{{item.amount}}</view> | ||
8 | + <view wx:if="{{item.fullAmount==undefined}}">无门槛使用</view> | ||
9 | + <view wx:if="{{item.fullAmount!==undefined}}">满{{item.fullAmount}}可用</view> | ||
10 | + </view> | ||
11 | + <view class="right"> | ||
12 | + <view>{{item.name}}</view> | ||
13 | + <view class="time">{{startTime}}-{{endTime}}</view> | ||
14 | + <view class="time">{{item.time}}</view> | ||
15 | + </view> | ||
16 | + <view class="topCircle"></view> | ||
17 | + <view class="bottomCircle"></view> | ||
24 | 18 | ||
19 | + </view> | ||
20 | + <!-- <view class="bgPic"> | ||
21 | + <image src="/images/youhuiquan.png"></image> | ||
22 | + </view> --> | ||
23 | + </view> | ||
24 | + <view class="bottomHint" wx:if="{{bottomHint}}"> | ||
25 | + 我是有底线的~ | ||
26 | + </view> | ||
27 | + <view class="listBlank" wx:if="{{cardList.length==0}}"> | ||
28 | + 暂无可用优惠券~ | ||
29 | + </view> | ||
30 | +</view> |
@@ -6,7 +6,16 @@ | @@ -6,7 +6,16 @@ | ||
6 | padding-top: 16rpx; | 6 | padding-top: 16rpx; |
7 | box-sizing: border-box; | 7 | box-sizing: border-box; |
8 | } | 8 | } |
9 | - | 9 | +.bgPic{ |
10 | + position: absolute; | ||
11 | + top: 0; | ||
12 | + left: 0; | ||
13 | + z-index: -6; | ||
14 | +} | ||
15 | +.bgPic image{ | ||
16 | + width: 686rpx; | ||
17 | + height: 246rpx; | ||
18 | +} | ||
10 | .picBox { | 19 | .picBox { |
11 | width: 686rpx; | 20 | width: 686rpx; |
12 | height: 246rpx; | 21 | height: 246rpx; |
@@ -20,7 +29,8 @@ | @@ -20,7 +29,8 @@ | ||
20 | .picBox .left { | 29 | .picBox .left { |
21 | width: 200rpx; | 30 | width: 200rpx; |
22 | height: 244rpx; | 31 | height: 244rpx; |
23 | - background: linear-gradient(270deg, #fb7900 -100%, #ff4903); | 32 | + background: linear-gradient(270deg, #f09c4d -70%, #ff4903); |
33 | + /* background: linear-gradient(270deg, #fb7900 -100%, #ff4903); */ | ||
24 | padding-top: 48rpx; | 34 | padding-top: 48rpx; |
25 | padding-bottom: 48rpx; | 35 | padding-bottom: 48rpx; |
26 | box-sizing: border-box; | 36 | box-sizing: border-box; |
@@ -146,7 +146,6 @@ Page({ | @@ -146,7 +146,6 @@ Page({ | ||
146 | endTimess: endTime | 146 | endTimess: endTime |
147 | }) | 147 | }) |
148 | date = (Number(endTime) - Number(startTime)); | 148 | date = (Number(endTime) - Number(startTime)); |
149 | - console.log(date,'666') | ||
150 | if (date<=0) { | 149 | if (date<=0) { |
151 | this.setData({ | 150 | this.setData({ |
152 | countDownShow: false | 151 | countDownShow: false |
@@ -6,6 +6,7 @@ | @@ -6,6 +6,7 @@ | ||
6 | "van-popup": "@vant/weapp/popup/index", | 6 | "van-popup": "@vant/weapp/popup/index", |
7 | "van-count-down": "@vant/weapp/count-down/index" | 7 | "van-count-down": "@vant/weapp/count-down/index" |
8 | }, | 8 | }, |
9 | - "navigationBarTitleText": "首页" | 9 | + "navigationBarTitleText": "首页", |
10 | + "navigationStyle": "custom" | ||
10 | 11 | ||
11 | } | 12 | } |
1 | <!--pages/home/home.wxml--> | 1 | <!--pages/home/home.wxml--> |
2 | +<image src="/images/homeBj.png" class="topImage"></image> | ||
3 | +<view class="pageTitle1 "></view> | ||
4 | +<view class="pageTitle">世纪华联</view> | ||
2 | <view class="contenter"> | 5 | <view class="contenter"> |
3 | <!-- 搜索框 --> | 6 | <!-- 搜索框 --> |
4 | - <view> | ||
5 | - <view class="search_center" catchtap="goSearch"> | 7 | + <view class="searchBox"> |
8 | + <!-- <view class="search_center" catchtap="goSearch"> | ||
6 | <view class="real_search_center"> | 9 | <view class="real_search_center"> |
7 | <view class="iconfont icon-sousuo"></view> | 10 | <view class="iconfont icon-sousuo"></view> |
8 | <input placeholder='搜索' placeholder-class="placeholder" disabled /> | 11 | <input placeholder='搜索' placeholder-class="placeholder" disabled /> |
9 | </view> | 12 | </view> |
10 | - </view> | 13 | + </view> --> |
14 | + <van-search value="{{ value }}" shape="round" background='linear-gradient(137deg,#5b8eff, #2e55ff 92%)' | ||
15 | + placeholder="搜索" bind:focus="goSearch"/> | ||
11 | </view> | 16 | </view> |
12 | <!-- 轮播图 --> | 17 | <!-- 轮播图 --> |
13 | - <view> | 18 | + <view style="margin-top:60rpx"> |
14 | <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000"> | 19 | <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000"> |
15 | <block wx:for="{{swiperArray}}" wx:for-index="idx"> | 20 | <block wx:for="{{swiperArray}}" wx:for-index="idx"> |
16 | <swiper-item bindtap="goBannnerDetail" data-url="{{item.url}}" data-index="{{index}}"> | 21 | <swiper-item bindtap="goBannnerDetail" data-url="{{item.url}}" data-index="{{index}}"> |
@@ -154,12 +159,12 @@ | @@ -154,12 +159,12 @@ | ||
154 | </view> | 159 | </view> |
155 | </van-popup> | 160 | </van-popup> |
156 | <view class="bottomHint" wx:if="{{bottomHint}}"> | 161 | <view class="bottomHint" wx:if="{{bottomHint}}"> |
157 | - 我是有底线的~ | ||
158 | -</view> | 162 | + 我是有底线的~ |
163 | + </view> | ||
159 | </view> | 164 | </view> |
160 | 165 | ||
161 | <!-- tabbar --> | 166 | <!-- tabbar --> |
162 | -<view class="tabbarBox" > | 167 | +<!-- <view class="tabbarBox" > |
163 | <ul> | 168 | <ul> |
164 | <li> | 169 | <li> |
165 | <view class="tabbarPic"> | 170 | <view class="tabbarPic"> |
@@ -186,4 +191,4 @@ | @@ -186,4 +191,4 @@ | ||
186 | <text>我的</text> | 191 | <text>我的</text> |
187 | </li> | 192 | </li> |
188 | </ul> | 193 | </ul> |
189 | -</view> | ||
194 | +</view> --> |
1 | /* pages/home/home.wxss */ | 1 | /* pages/home/home.wxss */ |
2 | -.contenter { | ||
3 | - margin-bottom: 100rpx; | 2 | +.topImage { |
3 | + width: 100%; | ||
4 | + position: fixed; | ||
5 | + top: 0; | ||
6 | + left: 0; | ||
4 | } | 7 | } |
5 | -page{ | ||
6 | - padding: 24rpx 32rpx 0 32rpx; | 8 | + |
9 | +.pageTitle1 { | ||
10 | + width: 100%; | ||
11 | + height: 88rpx; | ||
12 | + font-size: 34rpx; | ||
13 | + font-weight: 500; | ||
14 | + text-align: center; | ||
15 | + color: #ffffff; | ||
16 | + line-height: 24px; | ||
17 | + position: fixed; | ||
18 | + top: 0rpx; | ||
19 | + display: flex; | ||
20 | + align-items: center; | ||
21 | + justify-content: center; | ||
22 | + background: linear-gradient(137deg,#5b8eff, #2e55ff 92%); | ||
23 | + z-index: 66; | ||
24 | +} | ||
25 | +.pageTitle { | ||
26 | + width: 100%; | ||
27 | + height: 88rpx; | ||
28 | + font-size: 34rpx; | ||
29 | + font-weight: 500; | ||
30 | + text-align: center; | ||
31 | + color: #ffffff; | ||
32 | + line-height: 24px; | ||
33 | + position: fixed; | ||
34 | + top: 88rpx; | ||
35 | + display: flex; | ||
36 | + align-items: center; | ||
37 | + justify-content: center; | ||
38 | + background: linear-gradient(137deg,#5b8eff, #2e55ff 92%); | ||
39 | + z-index: 66; | ||
40 | +} | ||
41 | +.van-tabs{ | ||
42 | + background: #f1f2f4; | ||
43 | +} | ||
44 | +.contenter { | ||
45 | + /* margin-bottom: 100rpx; */ | ||
46 | + padding: 47rpx 32rpx 0 32rpx; | ||
7 | box-sizing: border-box; | 47 | box-sizing: border-box; |
48 | + position: relative; | ||
49 | + top: 176rpx; | ||
50 | +} | ||
51 | + | ||
52 | +page { | ||
53 | + /* padding: 24rpx 32rpx 0 32rpx; | ||
54 | + box-sizing: border-box; */ | ||
8 | } | 55 | } |
9 | 56 | ||
10 | /* 搜索框 */ | 57 | /* 搜索框 */ |
58 | +.searchBox { | ||
59 | + width: 100%; | ||
60 | + height: 88rpx; | ||
61 | + background: linear-gradient(137deg, #5b8eff, #2e55ff 92%); | ||
62 | + position: fixed; | ||
63 | + top: 176rpx; | ||
64 | + left: 0; | ||
65 | + z-index: 66; | ||
66 | + box-sizing: border-box; | ||
67 | +} | ||
11 | 68 | ||
12 | .search_center { | 69 | .search_center { |
13 | height: 68rpx; | 70 | height: 68rpx; |
@@ -57,7 +114,7 @@ page{ | @@ -57,7 +114,7 @@ page{ | ||
57 | 114 | ||
58 | /* 轮播图 */ | 115 | /* 轮播图 */ |
59 | .swiper { | 116 | .swiper { |
60 | - height: 306rpx; | 117 | + height: 320rpx; |
61 | width: 100%; | 118 | width: 100%; |
62 | /* background-color: aquamarine; */ | 119 | /* background-color: aquamarine; */ |
63 | } | 120 | } |
@@ -130,13 +187,14 @@ page{ | @@ -130,13 +187,14 @@ page{ | ||
130 | } | 187 | } |
131 | 188 | ||
132 | .countTime { | 189 | .countTime { |
133 | - display:flex; | 190 | + display: flex; |
134 | /* width: 192rpx; */ | 191 | /* width: 192rpx; */ |
135 | /* background-color: #9b74fb; */ | 192 | /* background-color: #9b74fb; */ |
136 | height: 40rpx; | 193 | height: 40rpx; |
137 | margin-left: -20rpx; | 194 | margin-left: -20rpx; |
138 | } | 195 | } |
139 | -.countTime .maohao{ | 196 | + |
197 | +.countTime .maohao { | ||
140 | color: #ff593c; | 198 | color: #ff593c; |
141 | width: 20rpx; | 199 | width: 20rpx; |
142 | display: flex; | 200 | display: flex; |
@@ -144,6 +202,7 @@ page{ | @@ -144,6 +202,7 @@ page{ | ||
144 | justify-content: center; | 202 | justify-content: center; |
145 | padding-bottom: 10rpx; | 203 | padding-bottom: 10rpx; |
146 | } | 204 | } |
205 | + | ||
147 | .countTime .textss { | 206 | .countTime .textss { |
148 | width: 40rpx; | 207 | width: 40rpx; |
149 | height: 40rpx; | 208 | height: 40rpx; |
@@ -306,6 +365,7 @@ page{ | @@ -306,6 +365,7 @@ page{ | ||
306 | 365 | ||
307 | .dayPriceTime { | 366 | .dayPriceTime { |
308 | display: inline-block; | 367 | display: inline-block; |
368 | + margin-left: 10rpx; | ||
309 | } | 369 | } |
310 | 370 | ||
311 | .morePrice { | 371 | .morePrice { |
@@ -381,6 +441,7 @@ page{ | @@ -381,6 +441,7 @@ page{ | ||
381 | break-inside: avoid; | 441 | break-inside: avoid; |
382 | margin-right: 10rpx; | 442 | margin-right: 10rpx; |
383 | margin-left: 10rpx; | 443 | margin-left: 10rpx; |
444 | + border-radius: 16rpx; | ||
384 | } | 445 | } |
385 | 446 | ||
386 | .pickPic { | 447 | .pickPic { |
@@ -391,6 +452,7 @@ page{ | @@ -391,6 +452,7 @@ page{ | ||
391 | .pickPic image { | 452 | .pickPic image { |
392 | width: 312rpx; | 453 | width: 312rpx; |
393 | height: 328rpx; | 454 | height: 328rpx; |
455 | + border-radius: 16rpx; | ||
394 | } | 456 | } |
395 | 457 | ||
396 | .pickTitle { | 458 | .pickTitle { |
@@ -558,10 +620,12 @@ page{ | @@ -558,10 +620,12 @@ page{ | ||
558 | color: #ffffff; | 620 | color: #ffffff; |
559 | margin-top: 24rpx; | 621 | margin-top: 24rpx; |
560 | } | 622 | } |
561 | -.discountBox{ | 623 | + |
624 | +.discountBox { | ||
562 | max-height: 350rpx; | 625 | max-height: 350rpx; |
563 | overflow: auto; | 626 | overflow: auto; |
564 | } | 627 | } |
628 | + | ||
565 | .popupImg { | 629 | .popupImg { |
566 | width: 540rpx; | 630 | width: 540rpx; |
567 | height: 148rpx; | 631 | height: 148rpx; |
@@ -631,7 +695,8 @@ page{ | @@ -631,7 +695,8 @@ page{ | ||
631 | align-items: center; | 695 | align-items: center; |
632 | margin-top: 24rpx; | 696 | margin-top: 24rpx; |
633 | } | 697 | } |
634 | -.bottomHint{ | 698 | + |
699 | +.bottomHint { | ||
635 | background-color: #f1f2f4; | 700 | background-color: #f1f2f4; |
636 | font-size: 24rpx; | 701 | font-size: 24rpx; |
637 | color: gray; | 702 | color: gray; |
@@ -639,8 +704,9 @@ page{ | @@ -639,8 +704,9 @@ page{ | ||
639 | justify-content: center; | 704 | justify-content: center; |
640 | padding: 8rpx; | 705 | padding: 8rpx; |
641 | } | 706 | } |
707 | + | ||
642 | /* tabbar */ | 708 | /* tabbar */ |
643 | -.tabbarBox{ | 709 | +.tabbarBox { |
644 | width: 100%; | 710 | width: 100%; |
645 | height: 98rpx; | 711 | height: 98rpx; |
646 | background-color: #fff; | 712 | background-color: #fff; |
@@ -651,29 +717,35 @@ page{ | @@ -651,29 +717,35 @@ page{ | ||
651 | padding-top: 12rpx; | 717 | padding-top: 12rpx; |
652 | box-sizing: border-box; | 718 | box-sizing: border-box; |
653 | } | 719 | } |
654 | -.tabbarPic{ | 720 | + |
721 | +.tabbarPic { | ||
655 | display: flex; | 722 | display: flex; |
656 | justify-content: center; | 723 | justify-content: center; |
657 | } | 724 | } |
658 | -.tabbarBox ul{ | 725 | + |
726 | +.tabbarBox ul { | ||
659 | width: 100%; | 727 | width: 100%; |
660 | display: flex; | 728 | display: flex; |
661 | } | 729 | } |
662 | -ul>li{ | 730 | + |
731 | +ul>li { | ||
663 | width: 25%; | 732 | width: 25%; |
664 | } | 733 | } |
665 | -li text{ | 734 | + |
735 | +li text { | ||
666 | display: block; | 736 | display: block; |
667 | - display: flex; | ||
668 | - justify-content: center; | ||
669 | - font-size: 18rpx; | ||
670 | - font-weight: 400; | ||
671 | - color: #bdc4ce; | 737 | + display: flex; |
738 | + justify-content: center; | ||
739 | + font-size: 18rpx; | ||
740 | + font-weight: 400; | ||
741 | + color: #bdc4ce; | ||
672 | } | 742 | } |
673 | -.check{ | 743 | + |
744 | +.check { | ||
674 | color: #355DFF; | 745 | color: #355DFF; |
675 | } | 746 | } |
676 | -.tabbarPic image{ | ||
677 | - width:48rpx; | 747 | + |
748 | +.tabbarPic image { | ||
749 | + width: 48rpx; | ||
678 | height: 48rpx; | 750 | height: 48rpx; |
679 | } | 751 | } |
@@ -3,6 +3,8 @@ let method = require("../../utils/reuqest.js"); | @@ -3,6 +3,8 @@ let method = require("../../utils/reuqest.js"); | ||
3 | const util = require("../../utils/util.js"); | 3 | const util = require("../../utils/util.js"); |
4 | Page({ | 4 | Page({ |
5 | data: { | 5 | data: { |
6 | + showTime: false , //配送时间 | ||
7 | + storePickupTime: '', | ||
6 | userData: "", | 8 | userData: "", |
7 | data: '', //配送时间 | 9 | data: '', //配送时间 |
8 | startTime: '', | 10 | startTime: '', |
@@ -28,59 +30,39 @@ Page({ | @@ -28,59 +30,39 @@ Page({ | ||
28 | stockNum: '' | 30 | stockNum: '' |
29 | }, | 31 | }, |
30 | //选择时间 | 32 | //选择时间 |
31 | - showPopupTwo() { | ||
32 | - this.setData({ | ||
33 | - show: true | ||
34 | - }); | ||
35 | - }, | ||
36 | - showPopup() { | ||
37 | - this.setData({ | ||
38 | - show: true | ||
39 | - }); | 33 | + selectTime(e) { |
34 | + if (e.detail.deliveryTime && e.detail.deliveryTime !== this.data.storePickupTime) { | ||
35 | + this.setData({ | ||
36 | + storePickupTime: e.detail.deliveryTime, | ||
37 | + showTime: false | ||
38 | + }) | ||
39 | + } | ||
40 | }, | 40 | }, |
41 | onClose() { | 41 | onClose() { |
42 | this.setData({ | 42 | this.setData({ |
43 | - show: false | 43 | + showTime: false |
44 | }); | 44 | }); |
45 | }, | 45 | }, |
46 | - onInput(e) { | ||
47 | - this.setData({ | ||
48 | - currentDate: e.detail, | ||
49 | - }); | ||
50 | - }, | ||
51 | - onInputTwo(e) { | ||
52 | - this.setData({ | ||
53 | - currentDateTwo: e.detail, | ||
54 | - }); | 46 | + onReady() { |
47 | + this.timepicker = this.selectComponent('#aaa') | ||
55 | }, | 48 | }, |
56 | - cancel() { | 49 | + chooseTime() { |
57 | this.setData({ | 50 | this.setData({ |
58 | - show: false | ||
59 | - }); | ||
60 | - }, | ||
61 | - confirm() { | ||
62 | - this.setData({ | ||
63 | - show: false | ||
64 | - }); | ||
65 | - }, | ||
66 | - cancelTwo() { | ||
67 | - this.setData({ | ||
68 | - show: false | ||
69 | - }); | 51 | + showTime: true |
52 | + }) | ||
53 | + // this.timepicker.getDliveryTime(); | ||
70 | }, | 54 | }, |
71 | - confirmTwo() { | 55 | + onClickButton() { |
72 | this.setData({ | 56 | this.setData({ |
73 | - show: false | ||
74 | - }); | 57 | + showModal: true |
58 | + }) | ||
75 | }, | 59 | }, |
76 | - //获取当天时间 | ||
77 | getDayTime() { | 60 | getDayTime() { |
78 | var myDate = new Date(); | 61 | var myDate = new Date(); |
79 | var year = myDate.getFullYear(); | 62 | var year = myDate.getFullYear(); |
80 | var month = myDate.getMonth(); | 63 | var month = myDate.getMonth(); |
81 | var day = myDate.getDate(); | 64 | var day = myDate.getDate(); |
82 | var dayNow = year + '-' + (month + 1) + "-" + day; | 65 | var dayNow = year + '-' + (month + 1) + "-" + day; |
83 | - console.log(dayNow, 'daynow') | ||
84 | this.setData({ | 66 | this.setData({ |
85 | startTime: dayNow | 67 | startTime: dayNow |
86 | }) | 68 | }) |
@@ -105,24 +87,24 @@ Page({ | @@ -105,24 +87,24 @@ Page({ | ||
105 | }, | 87 | }, |
106 | //选择时间 | 88 | //选择时间 |
107 | //配送时间 | 89 | //配送时间 |
108 | - bindDateChange: function (e) { | ||
109 | - this.setData({ | ||
110 | - date: e.detail.value | ||
111 | - }) | ||
112 | - }, | ||
113 | - selectTime() { | ||
114 | - this.bindStartTimeChange() | ||
115 | - }, | ||
116 | - bindStartTimeChange: function (e) { | ||
117 | - this.setData({ | ||
118 | - startTime: e.detail.value | ||
119 | - }) | ||
120 | - }, | ||
121 | - bindEndTimeChange: function (e) { | ||
122 | - this.setData({ | ||
123 | - endTime: e.detail.value | ||
124 | - }) | ||
125 | - }, | 90 | + // bindDateChange: function (e) { |
91 | + // this.setData({ | ||
92 | + // date: e.detail.value | ||
93 | + // }) | ||
94 | + // }, | ||
95 | + // selectTime() { | ||
96 | + // this.bindStartTimeChange() | ||
97 | + // }, | ||
98 | + // bindStartTimeChange: function (e) { | ||
99 | + // this.setData({ | ||
100 | + // startTime: e.detail.value | ||
101 | + // }) | ||
102 | + // }, | ||
103 | + // bindEndTimeChange: function (e) { | ||
104 | + // this.setData({ | ||
105 | + // endTime: e.detail.value | ||
106 | + // }) | ||
107 | + // }, | ||
126 | //商品信息 | 108 | //商品信息 |
127 | getList(defaultSku) { | 109 | getList(defaultSku) { |
128 | let postData = { | 110 | let postData = { |
@@ -201,7 +183,7 @@ Page({ | @@ -201,7 +183,7 @@ Page({ | ||
201 | let postData = { | 183 | let postData = { |
202 | addressId: this.data.userData.id, | 184 | addressId: this.data.userData.id, |
203 | couponId: "", | 185 | couponId: "", |
204 | - deliveryTime: this.data.date, | 186 | + deliveryTime: this.data.storePickupTime, |
205 | note: this.data.leavaWord, | 187 | note: this.data.leavaWord, |
206 | num: 1, | 188 | num: 1, |
207 | skuId: this.data.skuId | 189 | skuId: this.data.skuId |
1 | { | 1 | { |
2 | "usingComponents": { | 2 | "usingComponents": { |
3 | - "van-datetime-picker": "@vant/weapp/datetime-picker/index", | 3 | + "timepicker":"../../components/timepicker/timepicker", |
4 | "van-popup": "@vant/weapp/popup/index" | 4 | "van-popup": "@vant/weapp/popup/index" |
5 | }, | 5 | }, |
6 | "navigationBarTitleText": "确认订单" | 6 | "navigationBarTitleText": "确认订单" |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <view class="container"> | 2 | <view class="container"> |
3 | <!-- 地址 --> | 3 | <!-- 地址 --> |
4 | <view class="address" bindtap="emit"> | 4 | <view class="address" bindtap="emit"> |
5 | - <view class="address_content_left"> | 5 | + <view class="address_content_left" style="width:92%"> |
6 | <view> | 6 | <view> |
7 | <view class="userName">{{userData.name}}</view> | 7 | <view class="userName">{{userData.name}}</view> |
8 | <view class="userTell">{{userData.phone}}</view> | 8 | <view class="userTell">{{userData.phone}}</view> |
@@ -18,15 +18,22 @@ | @@ -18,15 +18,22 @@ | ||
18 | </view> | 18 | </view> |
19 | </view> | 19 | </view> |
20 | <!-- 配送时间 --> | 20 | <!-- 配送时间 --> |
21 | - <view class="timeBox"> | ||
22 | - <view class="section"> | ||
23 | - <picker mode="date" value="{{date}}" start="{{startTime}}" bindchange="bindDateChange"> | ||
24 | - <view class="picker"> | ||
25 | - 配送时间: {{date}} | ||
26 | - </view> | ||
27 | - </picker> | 21 | + <view class="timeBox" > |
22 | + <view style="width:95%;display:flex" bindtap='chooseTime'> | ||
23 | + <view class="calendar " > | ||
24 | + 请选择配送时间: | ||
28 | </view> | 25 | </view> |
26 | + <view class="selectText">{{storePickupTime}}</view> | ||
29 | </view> | 27 | </view> |
28 | + <view class="arrow" bindtap='chooseTime'> | ||
29 | + <image src="/images/04-01/arrow.png"></image> | ||
30 | + </view> | ||
31 | + <view class="section"> | ||
32 | + <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom" > | ||
33 | + <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="aaa"></timepicker> | ||
34 | + </van-popup> | ||
35 | + </view> | ||
36 | + </view> | ||
30 | <!-- 商品列表 --> | 37 | <!-- 商品列表 --> |
31 | <view class="cartList"> | 38 | <view class="cartList"> |
32 | <!-- <view class="cartListItem" wx:for="{{cartList}}"> --> | 39 | <!-- <view class="cartListItem" wx:for="{{cartList}}"> --> |
1 | /* pages/integral-order/integral-order.wxss */ | 1 | /* pages/integral-order/integral-order.wxss */ |
2 | /* pages/affirm-order/affirm-order.wxss */ | 2 | /* pages/affirm-order/affirm-order.wxss */ |
3 | +page { | ||
4 | + background-color: #f1f2f4; | ||
5 | +} | ||
6 | + | ||
3 | .container { | 7 | .container { |
4 | padding-top: 34rpx; | 8 | padding-top: 34rpx; |
5 | width: 750rpx; | 9 | width: 750rpx; |
6 | - height: 1440rpx; | ||
7 | background-color: #f1f2f4; | 10 | background-color: #f1f2f4; |
8 | box-sizing: border-box; | 11 | box-sizing: border-box; |
9 | margin-bottom: 130rpx; | 12 | margin-bottom: 130rpx; |
10 | } | 13 | } |
11 | 14 | ||
15 | +.calendar { | ||
16 | + font-size: 28rpx; | ||
17 | + font-weight: 400; | ||
18 | + text-align: left; | ||
19 | + color: #323233; | ||
20 | + width: 204rpx; | ||
21 | +} | ||
22 | + | ||
23 | +.selectText { | ||
24 | + font-size: 28rpx; | ||
25 | + color: #323233; | ||
26 | + flex: 1; | ||
27 | +} | ||
28 | + | ||
29 | +.arrow { | ||
30 | + width: 5%; | ||
31 | +} | ||
32 | + | ||
33 | +.arrow image { | ||
34 | + width: 32rpx; | ||
35 | + height: 32rpx; | ||
36 | +} | ||
12 | 37 | ||
13 | /* 地址 */ | 38 | /* 地址 */ |
14 | .noAdd { | 39 | .noAdd { |
@@ -21,8 +46,8 @@ | @@ -21,8 +46,8 @@ | ||
21 | } | 46 | } |
22 | 47 | ||
23 | .address { | 48 | .address { |
24 | - width: 90%; | ||
25 | - margin-left: 5%; | 49 | + width: 92%; |
50 | + margin-left: 4%; | ||
26 | background: #fff; | 51 | background: #fff; |
27 | border-radius: 16rpx; | 52 | border-radius: 16rpx; |
28 | display: flex; | 53 | display: flex; |
@@ -79,7 +104,7 @@ | @@ -79,7 +104,7 @@ | ||
79 | } | 104 | } |
80 | 105 | ||
81 | .arrow { | 106 | .arrow { |
82 | - width: 15%; | 107 | + width: 5%; |
83 | display: flex; | 108 | display: flex; |
84 | align-items: center; | 109 | align-items: center; |
85 | justify-content: center; | 110 | justify-content: center; |
@@ -136,6 +161,7 @@ | @@ -136,6 +161,7 @@ | ||
136 | background-color: #ffffff; | 161 | background-color: #ffffff; |
137 | margin-top: 24rpx; | 162 | margin-top: 24rpx; |
138 | padding-bottom: 32rpx; | 163 | padding-bottom: 32rpx; |
164 | + border-radius: 16rpx; | ||
139 | } | 165 | } |
140 | 166 | ||
141 | .cartListItem { | 167 | .cartListItem { |
@@ -201,12 +227,16 @@ | @@ -201,12 +227,16 @@ | ||
201 | 227 | ||
202 | .productDetail { | 228 | .productDetail { |
203 | width: 304rpx; | 229 | width: 304rpx; |
230 | + height: 36rpx; | ||
204 | font-size: 24rpx; | 231 | font-size: 24rpx; |
205 | font-weight: 400; | 232 | font-weight: 400; |
206 | text-align: left; | 233 | text-align: left; |
207 | color: #999999; | 234 | color: #999999; |
208 | line-height: 36rpx; | 235 | line-height: 36rpx; |
209 | margin-bottom: 40rpx; | 236 | margin-bottom: 40rpx; |
237 | + overflow: hidden; | ||
238 | + white-space: nowrap; | ||
239 | + text-overflow: ellipsis; | ||
210 | } | 240 | } |
211 | 241 | ||
212 | .productPrice { | 242 | .productPrice { |
@@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
81 | </view> | 81 | </view> |
82 | <view class="time orderPublic innerPublic"> | 82 | <view class="time orderPublic innerPublic"> |
83 | <view class="title ">配送时间 :</view> | 83 | <view class="title ">配送时间 :</view> |
84 | - <view class="content">{{requestData.deliveryTime}}</view> | 84 | + <view class="content">{{requestData.createTime}}</view> |
85 | </view> | 85 | </view> |
86 | <view class="mainMoney innerPublic"> | 86 | <view class="mainMoney innerPublic"> |
87 | <view class="title ">商品总额 :</view> | 87 | <view class="title ">商品总额 :</view> |
@@ -9,12 +9,13 @@ Page({ | @@ -9,12 +9,13 @@ Page({ | ||
9 | swiperArray: [{ | 9 | swiperArray: [{ |
10 | url: '/images/1.jpg' | 10 | url: '/images/1.jpg' |
11 | }], | 11 | }], |
12 | + countDownShow: '', | ||
12 | time: '', //倒计时 | 13 | time: '', //倒计时 |
13 | timeData: '', | 14 | timeData: '', |
14 | hour: "", | 15 | hour: "", |
15 | minute: "", | 16 | minute: "", |
16 | second: "", | 17 | second: "", |
17 | - endTimess:'', | 18 | + endTimess: '', |
18 | goodsData: '', | 19 | goodsData: '', |
19 | productName: '三好龙虾 招牌泼油小龙虾', | 20 | productName: '三好龙虾 招牌泼油小龙虾', |
20 | price: '¥688.00', | 21 | price: '¥688.00', |
@@ -54,7 +55,7 @@ Page({ | @@ -54,7 +55,7 @@ Page({ | ||
54 | endTime = Date.parse(data.data.endDate); | 55 | endTime = Date.parse(data.data.endDate); |
55 | date = (Number(endTime) - Number(startTime)); | 56 | date = (Number(endTime) - Number(startTime)); |
56 | this.setData({ | 57 | this.setData({ |
57 | - endTimess:endTime, | 58 | + endTimess: endTime, |
58 | time: date | 59 | time: date |
59 | }) | 60 | }) |
60 | var str2 = toString(date / 1000 / 3600); | 61 | var str2 = toString(date / 1000 / 3600); |
@@ -76,11 +77,18 @@ Page({ | @@ -76,11 +77,18 @@ Page({ | ||
76 | var hour = parseInt(downTime / 1000 / 60 / 60) < 10 ? "0" + parseInt(downTime / 1000 / 60 / 60) : parseInt(downTime / 1000 / 60 / 60); | 77 | var hour = parseInt(downTime / 1000 / 60 / 60) < 10 ? "0" + parseInt(downTime / 1000 / 60 / 60) : parseInt(downTime / 1000 / 60 / 60); |
77 | var minute = parseInt(downTime / 1000 / 60 % 60) < 10 ? "0" + parseInt(downTime / 1000 / 60 % 60) : parseInt(downTime / 1000 / 60 % 60) | 78 | var minute = parseInt(downTime / 1000 / 60 % 60) < 10 ? "0" + parseInt(downTime / 1000 / 60 % 60) : parseInt(downTime / 1000 / 60 % 60) |
78 | var second = parseInt(downTime / 1000 % 60) < 10 ? "0" + parseInt(downTime / 1000 % 60) : parseInt(downTime / 1000 % 60) | 79 | var second = parseInt(downTime / 1000 % 60) < 10 ? "0" + parseInt(downTime / 1000 % 60) : parseInt(downTime / 1000 % 60) |
79 | - this.setData({ | ||
80 | - hour: hour, | ||
81 | - minute: minute, | ||
82 | - second: second | ||
83 | - }) | 80 | + if (date <= 0) { |
81 | + this.setData({ | ||
82 | + countDownShow: false | ||
83 | + }) | ||
84 | + } else { | ||
85 | + this.setData({ | ||
86 | + countDownShow: true, | ||
87 | + hour: hour, | ||
88 | + minute: minute, | ||
89 | + second: second | ||
90 | + }) | ||
91 | + } | ||
84 | }, 1000) | 92 | }, 1000) |
85 | }) | 93 | }) |
86 | }, | 94 | }, |
@@ -140,7 +148,7 @@ Page({ | @@ -140,7 +148,7 @@ Page({ | ||
140 | // flag: !this.data.flag | 148 | // flag: !this.data.flag |
141 | // }) | 149 | // }) |
142 | wx.navigateTo({ | 150 | wx.navigateTo({ |
143 | - url: '/pages/all-evaluate/all-evaluate?goodsid='+this.data.goodsId, | 151 | + url: '/pages/all-evaluate/all-evaluate?goodsid=' + this.data.goodsId, |
144 | }) | 152 | }) |
145 | }, | 153 | }, |
146 | //进入购物车 | 154 | //进入购物车 |
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | </block> | 12 | </block> |
13 | </swiper> | 13 | </swiper> |
14 | </view> | 14 | </view> |
15 | - <view class="countDown" wx:if="{{goodsData.youHui}}"> | 15 | + <view class="countDown" wx:if="{{countDownShow}}"> |
16 | <text class="countDownTxt">距结束仅剩</text> | 16 | <text class="countDownTxt">距结束仅剩</text> |
17 | <!-- 倒计时 --> | 17 | <!-- 倒计时 --> |
18 | <view class="countTime"> | 18 | <view class="countTime"> |
@@ -13,31 +13,14 @@ Page({ | @@ -13,31 +13,14 @@ Page({ | ||
13 | title: '香蕉' | 13 | title: '香蕉' |
14 | }], | 14 | }], |
15 | title: '猜你喜欢', | 15 | title: '猜你喜欢', |
16 | - list: [{ | ||
17 | - url: '/images/1.jpg', | ||
18 | - title: '商品名称较好的GV接口给大家GV看积极的股份', | ||
19 | - num: "2004的缴费人简单缸发动机电话缸发动机的花费更多", | ||
20 | - goodsPrice: 20000 | ||
21 | - }, { | ||
22 | - url: '/images/1.jpg', | ||
23 | - title: '商品名称', | ||
24 | - num: 'jhjkghvjgfjkvgi接收到该附件国' | ||
25 | - }, { | ||
26 | - url: '/images/1.jpg', | ||
27 | - title: '商品名称', | ||
28 | - num: 200 | ||
29 | - }, { | ||
30 | - url: '/images/1.jpg', | ||
31 | - title: '商品名称', | ||
32 | - num: 200 | ||
33 | - }] | 16 | + list: [] |
34 | }, | 17 | }, |
35 | //获取输入的关键字 | 18 | //获取输入的关键字 |
36 | - getKeyWord(e) { | 19 | + onChange(e) { |
37 | this.setData({ | 20 | this.setData({ |
38 | - keyWord: e.detail.value | 21 | + keyWord: e.detail |
39 | }) | 22 | }) |
40 | - | 23 | + console.log(this.data.keyWord, 'keys') |
41 | }, | 24 | }, |
42 | //搜索 | 25 | //搜索 |
43 | search() { | 26 | search() { |
@@ -45,6 +28,11 @@ Page({ | @@ -45,6 +28,11 @@ Page({ | ||
45 | url: '/pages/searchRequest/searchRequest?keyword=' + this.data.keyWord, | 28 | url: '/pages/searchRequest/searchRequest?keyword=' + this.data.keyWord, |
46 | }); | 29 | }); |
47 | }, | 30 | }, |
31 | + onCancel() { | ||
32 | + wx.switchTab({ | ||
33 | + url: '/pages/home/home', | ||
34 | + }) | ||
35 | + }, | ||
48 | //取消文本框输入 | 36 | //取消文本框输入 |
49 | cancel() { | 37 | cancel() { |
50 | this.setData({ | 38 | this.setData({ |
@@ -57,7 +45,7 @@ Page({ | @@ -57,7 +45,7 @@ Page({ | ||
57 | url: '/pages/home/home', | 45 | url: '/pages/home/home', |
58 | }) | 46 | }) |
59 | }, | 47 | }, |
60 | - //搜索记录 | 48 | + //搜索历史 |
61 | searchHistory() { | 49 | searchHistory() { |
62 | method.getRequest("/coupon/historySearch", data => { | 50 | method.getRequest("/coupon/historySearch", data => { |
63 | if (data.statusCode == 0) { | 51 | if (data.statusCode == 0) { |
@@ -67,10 +55,36 @@ Page({ | @@ -67,10 +55,36 @@ Page({ | ||
67 | } | 55 | } |
68 | }) | 56 | }) |
69 | }, | 57 | }, |
70 | - //删除搜索历史 | ||
71 | delSearch() { | 58 | delSearch() { |
72 | - this.setData({ | ||
73 | - labelArray: [] | 59 | + let that=this; |
60 | + wx.showModal({ | ||
61 | + title: '提示', | ||
62 | + content: '确认删除所有历史记录吗?', | ||
63 | + success (res) { | ||
64 | + if (res.confirm) { | ||
65 | + method.deleteRequest("/coupon/deleteHistory",data=>{ | ||
66 | + if(data.statusCode==0){ | ||
67 | + that.setData({ | ||
68 | + labelArray:[] | ||
69 | + }) | ||
70 | + } | ||
71 | + }) | ||
72 | + } else if (res.cancel) { | ||
73 | + console.log('用户点击取消') | ||
74 | + } | ||
75 | + } | ||
76 | + }) | ||
77 | + }, | ||
78 | + historyClick(e) { | ||
79 | + console.log(e, 'e') | ||
80 | + let idx = e.currentTarget.dataset.index; | ||
81 | + let list = this.data.labelArray; | ||
82 | + list.forEach((item, index) => { | ||
83 | + if (idx == index) { | ||
84 | + this.setData({ | ||
85 | + keyWord: list[idx] | ||
86 | + }) | ||
87 | + } | ||
74 | }) | 88 | }) |
75 | }, | 89 | }, |
76 | // 猜你喜欢 | 90 | // 猜你喜欢 |
1 | <!--pages/search/search.wxml--> | 1 | <!--pages/search/search.wxml--> |
2 | <view class="container"> | 2 | <view class="container"> |
3 | <view class="search_center" catchtap="goSearch"> | 3 | <view class="search_center" catchtap="goSearch"> |
4 | - <view class="real_search_center"> | 4 | + <!-- <view class="real_search_center"> |
5 | <view class="searchIcon"> | 5 | <view class="searchIcon"> |
6 | <image src="/images/01-02/sousuo.png"></image> | 6 | <image src="/images/01-02/sousuo.png"></image> |
7 | </view> | 7 | </view> |
@@ -10,7 +10,8 @@ | @@ -10,7 +10,8 @@ | ||
10 | <image src="/images/01-02/quxiao.png"></image> | 10 | <image src="/images/01-02/quxiao.png"></image> |
11 | </view> | 11 | </view> |
12 | </view> | 12 | </view> |
13 | - <view class="search_right" catchtap="unsearch">取消</view> | 13 | + <view class="search_right" catchtap="unsearch">取消</view> --> |
14 | + <van-search value="{{keyWord}}" placeholder="请输入搜索关键词" shape="round" show-action bind:search="search" bind:cancel="onCancel" bind:change="onChange"/> | ||
14 | </view> | 15 | </view> |
15 | 16 | ||
16 | <!-- 搜索历史 --> | 17 | <!-- 搜索历史 --> |
@@ -25,7 +26,7 @@ | @@ -25,7 +26,7 @@ | ||
25 | </view> | 26 | </view> |
26 | </view> | 27 | </view> |
27 | <view class="searchLable"> | 28 | <view class="searchLable"> |
28 | - <view wx:for="{{labelArray}}" class="lableBox"> | 29 | + <view wx:for="{{labelArray}}" class="lableBox" catchtap="historyClick" data-index="{{index}}"> |
29 | {{item}} | 30 | {{item}} |
30 | </view> | 31 | </view> |
31 | </view> | 32 | </view> |
@@ -5,10 +5,8 @@ | @@ -5,10 +5,8 @@ | ||
5 | background: linear-gradient(180deg, #ffffff, #ebedf0); | 5 | background: linear-gradient(180deg, #ffffff, #ebedf0); |
6 | } | 6 | } |
7 | /* 搜索框 */ | 7 | /* 搜索框 */ |
8 | - | ||
9 | .search_center { | 8 | .search_center { |
10 | height: 68rpx; | 9 | height: 68rpx; |
11 | - display: flex; | ||
12 | margin-bottom: 24rpx; | 10 | margin-bottom: 24rpx; |
13 | width:750rpx; | 11 | width:750rpx; |
14 | } | 12 | } |
@@ -3,9 +3,21 @@ let method = require("../../utils/reuqest.js") | @@ -3,9 +3,21 @@ let method = require("../../utils/reuqest.js") | ||
3 | Page({ | 3 | Page({ |
4 | data: { | 4 | data: { |
5 | list: [], | 5 | list: [], |
6 | - keyword: '' | 6 | + keyword: '', |
7 | + bottomHint:false //触底提示 | ||
7 | }, | 8 | }, |
8 | //获取搜索结果 | 9 | //获取搜索结果 |
10 | + onChange(e) { | ||
11 | + this.setData({ | ||
12 | + keyword: e.detail, | ||
13 | + }); | ||
14 | + }, | ||
15 | + onSearch() { | ||
16 | + this.getSearchResult(); | ||
17 | + }, | ||
18 | + onClick() { | ||
19 | + this.getSearchResult(); | ||
20 | + }, | ||
9 | getSearchResult() { | 21 | getSearchResult() { |
10 | let postData = { | 22 | let postData = { |
11 | keyword: this.data.keyword, | 23 | keyword: this.data.keyword, |
@@ -31,7 +43,7 @@ Page({ | @@ -31,7 +43,7 @@ Page({ | ||
31 | * 生命周期函数--监听页面加载 | 43 | * 生命周期函数--监听页面加载 |
32 | */ | 44 | */ |
33 | onLoad: function (options) { | 45 | onLoad: function (options) { |
34 | - // console.log(options, 'options') | 46 | + console.log(options, 'options') |
35 | this.setData({ | 47 | this.setData({ |
36 | keyword: options.keyword | 48 | keyword: options.keyword |
37 | }) | 49 | }) |
@@ -78,7 +90,14 @@ Page({ | @@ -78,7 +90,14 @@ Page({ | ||
78 | * 页面上拉触底事件的处理函数 | 90 | * 页面上拉触底事件的处理函数 |
79 | */ | 91 | */ |
80 | onReachBottom: function () { | 92 | onReachBottom: function () { |
81 | - | 93 | + this.setData({ |
94 | + bottomHint: true | ||
95 | + }) | ||
96 | + setTimeout(() => { | ||
97 | + this.setData({ | ||
98 | + bottomHint: false | ||
99 | + }) | ||
100 | + }, 2000) | ||
82 | }, | 101 | }, |
83 | 102 | ||
84 | /** | 103 | /** |
1 | <!--pages/searchRequest/searchRequest.wxml--> | 1 | <!--pages/searchRequest/searchRequest.wxml--> |
2 | <!-- 搜索 --> | 2 | <!-- 搜索 --> |
3 | <view class="search_center" catchtap="goSearch"> | 3 | <view class="search_center" catchtap="goSearch"> |
4 | - <view class="real_search_center"> | ||
5 | - <input class="weui-input" auto-focus placeholder="{{keyword}}" bindinput="getKeyWord" | ||
6 | - placeholder-class="placeholder" /> | ||
7 | - <view class="search_right" catchtap="search"> | ||
8 | - 取消 | ||
9 | - </view> | ||
10 | - </view> | ||
11 | - <!-- <view class="search_right" catchtap="search">搜索</view> --> | 4 | + <van-search value="{{keyword}}" placeholder="请输入搜索关键词" use-action-slot shape="round" bind:change="onChange" |
5 | + bind:search="onSearch"> | ||
6 | + <view slot="action" bind:tap="onClick">搜索</view> | ||
7 | + </van-search> | ||
12 | </view> | 8 | </view> |
13 | <!-- 商品列表 --> | 9 | <!-- 商品列表 --> |
14 | <view class="productList" wx:if="{{list.length==0}}"> | 10 | <view class="productList" wx:if="{{list.length==0}}"> |
@@ -30,4 +26,7 @@ | @@ -30,4 +26,7 @@ | ||
30 | </view> | 26 | </view> |
31 | </view> | 27 | </view> |
32 | </view> | 28 | </view> |
33 | -</view> | ||
29 | +</view> | ||
30 | +<view class="bottomHint" wx:if="{{bottomHint}}"> | ||
31 | + 我是有底线的~ | ||
32 | + </view> |
@@ -7,13 +7,11 @@ page{ | @@ -7,13 +7,11 @@ page{ | ||
7 | .search_center { | 7 | .search_center { |
8 | height: 90rpx; | 8 | height: 90rpx; |
9 | width: 750rpx; | 9 | width: 750rpx; |
10 | - display: flex; | ||
11 | margin-bottom: 24rpx; | 10 | margin-bottom: 24rpx; |
12 | position: fixed; | 11 | position: fixed; |
13 | - top: 0; | 12 | + top: 2rpx; |
14 | left: 0; | 13 | left: 0; |
15 | background-color: #f1f2f4; | 14 | background-color: #f1f2f4; |
16 | - padding-top: 20rpx; | ||
17 | } | 15 | } |
18 | 16 | ||
19 | .real_search_center { | 17 | .real_search_center { |
@@ -102,9 +100,8 @@ page{ | @@ -102,9 +100,8 @@ page{ | ||
102 | color: rgb(206, 208, 209); | 100 | color: rgb(206, 208, 209); |
103 | } | 101 | } |
104 | .listBox{ | 102 | .listBox{ |
105 | - width: 750rpx; | ||
106 | display: flex; | 103 | display: flex; |
107 | - margin-top: 90rpx; | 104 | + margin-top: 108rpx; |
108 | padding: 0 26rpx; | 105 | padding: 0 26rpx; |
109 | box-sizing: border-box; | 106 | box-sizing: border-box; |
110 | } | 107 | } |
@@ -134,6 +131,7 @@ page{ | @@ -134,6 +131,7 @@ page{ | ||
134 | background-color: #ffffff; | 131 | background-color: #ffffff; |
135 | margin-bottom: 16rpx; | 132 | margin-bottom: 16rpx; |
136 | break-inside: avoid; | 133 | break-inside: avoid; |
134 | + border-radius: 16rpx; | ||
137 | } | 135 | } |
138 | 136 | ||
139 | .pickPic { | 137 | .pickPic { |
@@ -191,3 +189,11 @@ page{ | @@ -191,3 +189,11 @@ page{ | ||
191 | .collectIcon>view { | 189 | .collectIcon>view { |
192 | margin-left: 8rpx; | 190 | margin-left: 8rpx; |
193 | } | 191 | } |
192 | +.bottomHint { | ||
193 | + background-color: #f1f2f4; | ||
194 | + font-size: 24rpx; | ||
195 | + color: gray; | ||
196 | + display: flex; | ||
197 | + justify-content: center; | ||
198 | + padding-bottom:16rpx; | ||
199 | +} |
@@ -3,6 +3,8 @@ let method = require("../../utils/reuqest.js") | @@ -3,6 +3,8 @@ let method = require("../../utils/reuqest.js") | ||
3 | const util = require("../../utils/util.js") | 3 | const util = require("../../utils/util.js") |
4 | Page({ | 4 | Page({ |
5 | data: { | 5 | data: { |
6 | + showTime: false , //配送时间 | ||
7 | + storePickupTime: '', | ||
6 | checkType: 1, | 8 | checkType: 1, |
7 | userData: "", | 9 | userData: "", |
8 | addHint: false, //判断有没有地址 | 10 | addHint: false, //判断有没有地址 |
@@ -97,12 +99,33 @@ Page({ | @@ -97,12 +99,33 @@ Page({ | ||
97 | 99 | ||
98 | }, | 100 | }, |
99 | //配送时间 | 101 | //配送时间 |
100 | - bindDateChange: function (e) { | 102 | + selectTime(e) { |
103 | + if (e.detail.deliveryTime && e.detail.deliveryTime !== this.data.storePickupTime) { | ||
104 | + this.setData({ | ||
105 | + storePickupTime: e.detail.deliveryTime, | ||
106 | + showTime: false | ||
107 | + }) | ||
108 | + } | ||
109 | + }, | ||
110 | + onClose() { | ||
111 | + this.setData({ | ||
112 | + showTime: false | ||
113 | + }); | ||
114 | + }, | ||
115 | + onReady() { | ||
116 | + this.timepicker = this.selectComponent('#aaa') | ||
117 | + }, | ||
118 | + chooseTime() { | ||
119 | + this.setData({ | ||
120 | + showTime: true | ||
121 | + }) | ||
122 | + // this.timepicker.getDliveryTime(); | ||
123 | + }, | ||
124 | + onClickButton() { | ||
101 | this.setData({ | 125 | this.setData({ |
102 | - date: e.detail.value | 126 | + showModal: true |
103 | }) | 127 | }) |
104 | }, | 128 | }, |
105 | - //获取当天时间 | ||
106 | getDayTime() { | 129 | getDayTime() { |
107 | var myDate = new Date(); | 130 | var myDate = new Date(); |
108 | var year = myDate.getFullYear(); | 131 | var year = myDate.getFullYear(); |
@@ -2,10 +2,6 @@ | @@ -2,10 +2,6 @@ | ||
2 | <view class="container"> | 2 | <view class="container"> |
3 | <!-- 地址 --> | 3 | <!-- 地址 --> |
4 | <view class="userInfo" bindtap="goAddress1"> | 4 | <view class="userInfo" bindtap="goAddress1"> |
5 | - <!-- <view class="addHint" wx:if="{{addHint==false}}"> | ||
6 | - <view class="addItem1">暂未获取到收获地址</view> | ||
7 | - <view class="addItem2"> 请选择收货地址</view> | ||
8 | - </view> --> | ||
9 | <view> | 5 | <view> |
10 | <view wx:if="{{userData!==''}}"> | 6 | <view wx:if="{{userData!==''}}"> |
11 | <view class="userName">{{userData.name}}</view> | 7 | <view class="userName">{{userData.name}}</view> |
@@ -23,15 +19,14 @@ | @@ -23,15 +19,14 @@ | ||
23 | </view> | 19 | </view> |
24 | <!-- 配送时间 --> | 20 | <!-- 配送时间 --> |
25 | <view class="timeBox"> | 21 | <view class="timeBox"> |
26 | - <view class="calendar "> | 22 | + <view class="calendar " bindtap='chooseTime'> |
27 | <image src="/images/04-01/rili.png"></image> | 23 | <image src="/images/04-01/rili.png"></image> |
28 | </view> | 24 | </view> |
25 | + {{storePickupTime}} | ||
29 | <view class="section"> | 26 | <view class="section"> |
30 | - <picker mode="date" value="{{date}}" bindchange="bindDateChange" start="{{startTime}}"> | ||
31 | - <view class="picker"> | ||
32 | - 配送时间: {{date}} | ||
33 | - </view> | ||
34 | - </picker> | 27 | + <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom" > |
28 | + <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="aaa"></timepicker> | ||
29 | + </van-popup> | ||
35 | </view> | 30 | </view> |
36 | </view> | 31 | </view> |
37 | 32 | ||
@@ -57,11 +52,11 @@ | @@ -57,11 +52,11 @@ | ||
57 | <text class="cart-count-add" catchtap="addCount" data-index="{{index}}" | 52 | <text class="cart-count-add" catchtap="addCount" data-index="{{index}}" |
58 | data-goodSkuId="{{item.goodsSkuId}}">+</text> | 53 | data-goodSkuId="{{item.goodsSkuId}}">+</text> |
59 | </view> | 54 | </view> |
60 | - </view> | 55 | + </view> |
61 | </view> | 56 | </view> |
62 | <view class="bottomHint" wx:if="{{bottomHint}}"> | 57 | <view class="bottomHint" wx:if="{{bottomHint}}"> |
63 | - 我是有底线的~ | ||
64 | - </view> | 58 | + 我是有底线的~ |
59 | + </view> | ||
65 | </view> | 60 | </view> |
66 | <!-- <view wx:if="{{carts.length==0}}"> --> | 61 | <!-- <view wx:if="{{carts.length==0}}"> --> |
67 | <view wx:if="{{cartnoData}}"> | 62 | <view wx:if="{{cartnoData}}"> |
@@ -69,7 +64,7 @@ | @@ -69,7 +64,7 @@ | ||
69 | <view class="cart-no-data-btn" bindtap="goHome">去逛逛</view> | 64 | <view class="cart-no-data-btn" bindtap="goHome">去逛逛</view> |
70 | </view> | 65 | </view> |
71 | </view> | 66 | </view> |
72 | - | 67 | + |
73 | <!-- 立即购买 --> | 68 | <!-- 立即购买 --> |
74 | <view class="bottom"> | 69 | <view class="bottom"> |
75 | <!-- <view class="checkPic"> | 70 | <!-- <view class="checkPic"> |
@@ -89,7 +84,7 @@ | @@ -89,7 +84,7 @@ | ||
89 | </view> | 84 | </view> |
90 | </view> | 85 | </view> |
91 | <!-- tabbar --> | 86 | <!-- tabbar --> |
92 | -<view class="tabbarBox" > | 87 | +<!-- <view class="tabbarBox" > |
93 | <ul> | 88 | <ul> |
94 | <li> | 89 | <li> |
95 | <view class="tabbarPic" bindtap="toHome"> | 90 | <view class="tabbarPic" bindtap="toHome"> |
@@ -116,4 +111,4 @@ | @@ -116,4 +111,4 @@ | ||
116 | <text bindtap="toUser">我的</text> | 111 | <text bindtap="toUser">我的</text> |
117 | </li> | 112 | </li> |
118 | </ul> | 113 | </ul> |
119 | -</view> | ||
114 | +</view> --> |
@@ -77,7 +77,7 @@ page { | @@ -77,7 +77,7 @@ page { | ||
77 | font-size: 28prx; | 77 | font-size: 28prx; |
78 | font-weight: 400; | 78 | font-weight: 400; |
79 | text-align: left; | 79 | text-align: left; |
80 | - color: #6c6c6d; | 80 | + color: #323233; |
81 | line-height: 40rpx; | 81 | line-height: 40rpx; |
82 | margin-top: 16rpx; | 82 | margin-top: 16rpx; |
83 | height: 84rpx; | 83 | height: 84rpx; |
@@ -275,7 +275,7 @@ page { | @@ -275,7 +275,7 @@ page { | ||
275 | /* padding-bottom: 120rpx; */ | 275 | /* padding-bottom: 120rpx; */ |
276 | } | 276 | } |
277 | .main{ | 277 | .main{ |
278 | - margin-bottom: 120rpx; | 278 | + margin-bottom: 20rpx; |
279 | } | 279 | } |
280 | .cart-list { | 280 | .cart-list { |
281 | position: relative; | 281 | position: relative; |
@@ -446,7 +446,7 @@ page { | @@ -446,7 +446,7 @@ page { | ||
446 | display: flex; | 446 | display: flex; |
447 | align-items: center; | 447 | align-items: center; |
448 | position: fixed; | 448 | position: fixed; |
449 | - bottom: 98rpx; | 449 | + bottom: 0rpx; |
450 | left: 0; | 450 | left: 0; |
451 | background-color: #ffffff; | 451 | background-color: #ffffff; |
452 | padding-left: 28rpx; | 452 | padding-left: 28rpx; |
pages/timedmo/timedmo.js
0 → 100644
1 | +const app = getApp() | ||
2 | +// var numeral = require('numeral'); | ||
3 | +Page({ | ||
4 | + | ||
5 | + /** | ||
6 | + * 页面的初始数据 | ||
7 | + */ | ||
8 | + data: { | ||
9 | + showTime: false , | ||
10 | + storePickupTime: '' | ||
11 | + }, | ||
12 | + selectTime(e) { | ||
13 | + if (e.detail.deliveryTime && e.detail.deliveryTime !== this.data.storePickupTime) { | ||
14 | + this.setData({ | ||
15 | + storePickupTime: e.detail.deliveryTime, | ||
16 | + showTime: false | ||
17 | + }) | ||
18 | + } | ||
19 | + }, | ||
20 | + onClose() { | ||
21 | + this.setData({ | ||
22 | + showTime: false | ||
23 | + }); | ||
24 | + }, | ||
25 | + onReady(){ | ||
26 | + this.timepicker=this.selectComponent('#aaa') | ||
27 | + }, | ||
28 | + chooseTime() { | ||
29 | + this.setData({ | ||
30 | + showTime: true | ||
31 | + }) | ||
32 | + // this.timepicker.getDliveryTime(); | ||
33 | + }, | ||
34 | + onClickButton() { | ||
35 | + this.setData({ | ||
36 | + showModal: true | ||
37 | + }) | ||
38 | + }, | ||
39 | +}) |
pages/timedmo/timedmo.json
0 → 100644
pages/timedmo/timedmo.wxml
0 → 100644
1 | +<!--pages/timedmo/timedmo.wxml--> | ||
2 | + <view bindtap='chooseTime'> 自提时间{{storePickupTime}}</view> | ||
3 | +<van-popup show="{{ showTime }}" bind:close="onClose" position="bottom" style="display:{{showTime ? 'vilative' : 'none'}}"> | ||
4 | + <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="aaa"></timepicker> | ||
5 | +</van-popup> |
pages/timedmo/timedmo.wxss
0 → 100644
1 | +/* pages/timedmo/timedmo.wxss */ |
@@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
58 | </view> | 58 | </view> |
59 | </view> | 59 | </view> |
60 | <!-- tabbar --> | 60 | <!-- tabbar --> |
61 | -<view class="tabbarBox" > | 61 | +<!-- <view class="tabbarBox" > |
62 | <ul> | 62 | <ul> |
63 | <li> | 63 | <li> |
64 | <view class="tabbarPic" bindtap="toHome"> | 64 | <view class="tabbarPic" bindtap="toHome"> |
@@ -85,4 +85,4 @@ | @@ -85,4 +85,4 @@ | ||
85 | <text class="check">我的</text> | 85 | <text class="check">我的</text> |
86 | </li> | 86 | </li> |
87 | </ul> | 87 | </ul> |
88 | -</view> | ||
88 | +</view> --> |
@@ -264,6 +264,12 @@ | @@ -264,6 +264,12 @@ | ||
264 | "pathName": "pages/all-evaluate/all-evaluate", | 264 | "pathName": "pages/all-evaluate/all-evaluate", |
265 | "query": "", | 265 | "query": "", |
266 | "scene": null | 266 | "scene": null |
267 | + }, | ||
268 | + { | ||
269 | + "id": -1, | ||
270 | + "name": "pages/timedmo/timedmo", | ||
271 | + "pathName": "pages/timedmo/timedmo", | ||
272 | + "scene": null | ||
267 | } | 273 | } |
268 | ] | 274 | ] |
269 | } | 275 | } |
@@ -14,7 +14,36 @@ const formatNumber = n => { | @@ -14,7 +14,36 @@ const formatNumber = n => { | ||
14 | return n[1] ? n : '0' + n | 14 | return n[1] ? n : '0' + n |
15 | } | 15 | } |
16 | 16 | ||
17 | - | 17 | +//获取时间 |
18 | +//获取d当前时间多少天后的日期和对应星期 | ||
19 | +function getDates(days, todate = new Date() ) { //todate默认参数是当前日期,可以传入对应时间 | ||
20 | +// function getDates(days, todate =getCurrentMonthFirst()) { //todate默认参数是当前日期,可以传入对应时间 | ||
21 | + var dateArry = []; | ||
22 | + for (var i = 0; i < days-3; i++) { | ||
23 | + var dateObj = dateLater(todate, i); | ||
24 | + console.log(dateObj) | ||
25 | + dateArry.push(dateObj) | ||
26 | + } | ||
27 | + return dateArry; | ||
28 | +} | ||
29 | +/** | ||
30 | + * 传入时间后几天 | ||
31 | + * param:传入时间:dates:"2018-04-02",later:往后多少天 | ||
32 | + */ | ||
33 | +function dateLater(dates, later) { | ||
34 | + let dateObj = {}; | ||
35 | + let show_day = new Array('周日', '周一', '周二', '周三', '周四', '周五', '周六'); | ||
36 | + let date = new Date(dates); | ||
37 | + date.setDate(date.getDate() + later); | ||
38 | + let day = date.getDay(); | ||
39 | + dateObj.year = date.getFullYear(); | ||
40 | + dateObj.month = date.getMonth() + 1 | ||
41 | + // dateObj.month = ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth() + 1); | ||
42 | + dateObj.day = date.getDate() | ||
43 | + // dateObj.day = (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate()); | ||
44 | + dateObj.week = show_day[day]; | ||
45 | + return dateObj; | ||
46 | +} | ||
18 | //获取页数 | 47 | //获取页数 |
19 | function onReachListData(page, pagenum, data, doFunction) { | 48 | function onReachListData(page, pagenum, data, doFunction) { |
20 | var that = page; | 49 | var that = page; |
@@ -33,12 +62,13 @@ function onReachListData(page, pagenum, data, doFunction) { | @@ -33,12 +62,13 @@ function onReachListData(page, pagenum, data, doFunction) { | ||
33 | } | 62 | } |
34 | //获取登录信息 | 63 | //获取登录信息 |
35 | function getUser(msg) { | 64 | function getUser(msg) { |
36 | - wx.navigateTo({ | ||
37 | - url: '/pages/index/index', | ||
38 | -}) | 65 | + wx.navigateTo({ |
66 | + url: '/pages/index/index', | ||
67 | + }) | ||
39 | } | 68 | } |
40 | module.exports = { | 69 | module.exports = { |
41 | formatTime: formatTime, | 70 | formatTime: formatTime, |
42 | onReachListData: onReachListData, | 71 | onReachListData: onReachListData, |
43 | - getUser: getUser | 72 | + getUser: getUser, |
73 | + getDates:getDates | ||
44 | } | 74 | } |
-
请 注册 或 登录 后发表评论