作者 wumengyu

优化最高最低人数可以相等,修改餐票title地点人名,倒计时文字不换行,添加推荐页,优化订单取消完成的权限,

... ... @@ -39,7 +39,7 @@ App({
return new Promise(function (resolve, reject) {
wx.getUserInfo({
success: function (user) {
console.log('获取用户信息',user);// gender:性别 0:未知、1:男、2:女
console.log('获取用户信息', user);// gender:性别 0:未知、1:男、2:女
// 登录
let url = '/portal/Login/getToken';
wx.login({
... ... @@ -182,22 +182,20 @@ App({
return H;
},
//获取截止时间的前几个小时
preTime(over_time,n) {
var nowDate = new Date(over_time),
nowDate = nowDate.setHours(nowDate.getHours() - n),
nowDate = new Date(nowDate),
y = nowDate.getFullYear(),
m = nowDate.getMonth() + 1,
d = nowDate.getDate(),
h = nowDate.getHours(),
mi = nowDate.getMinutes();
console.log('nowDate',nowDate,new Date(over_time))
preTime(over_time, n) {
console.log('over_time', over_time);
var time = new Date(new Date(over_time).getTime() - n * 60 * 60 * 1000);
console.log('time', time);
var y = time.getFullYear(),
m = time.getMonth() + 1,
d = time.getDate(),
h = time.getHours(),
mi = time.getMinutes();
m = m < 10 ? '0' + m : m;
d = d < 10 ? '0' + d : d;
h = h < 10 ? '0' + h : h;
mi = mi < 10 ? '0' + mi : mi;
console.log('截止时间',y,over_time, m, d, h,mi);
// return y + over_time + m + over_time + d + ' ' + h + ':' + mi;
console.log('截止时间', time, m, d, h, mi);
return y + '-' + m + '-' + d + ' ' + h + ':' + mi;
},
timeFormat(param) { //小于10的格式化函数
... ...
... ... @@ -25,7 +25,8 @@
"pages/order/complain/complain",
"pages/order/order-detail/order-detail",
"pages/comment/comment",
"pages/index/city-list/city-list"
"pages/index/city-list/city-list",
"pages/index/recommend-list/recommend-list"
],
"window": {
"backgroundTextStyle": "light",
... ...
... ... @@ -56,7 +56,7 @@ Page({
},
//输入最高人数失去焦点时
maxNumBlur() {
if(+this.data.min_num >= +this.data.max_num) {
if(+this.data.min_num > +this.data.max_num) {
wx.showToast({title:'最高人数要大于最低人数',icon:'none'});
this.setData({max_num:''});
}
... ... @@ -100,6 +100,7 @@ Page({
let end_time = app.preTime(this.data.date + ' ' +this.data.time, this.data.over_time);//截止时间
let endTime = new Date(end_time).getTime(); //截止时间戳
// console.log('newTime', 'endTime', 'end_time', endTime - newTime >=0,newTime, endTime, end_time,this.data.date + ' ' +this.data.time);
console.log('开始时间和截止时间',this.data.date + ' ' +this.data.time,end_time);
if (endTime - newTime <= 0) { //不可发布目前时间到截止小时內的订单
wx.showToast({title:'截止时间无效',icon:'none'});
this.setData({over_time:''})
... ...
... ... @@ -69,12 +69,9 @@
<view class="title-box">
<view class="title">{{detail.title}}</view>
<view class="over-time">
<text class='' wx:if="{{detail.time[0].day !== '00'}}">
{{detail.time[0].day}}天{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}
</text>
<text class='' wx:else="">{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}
</text>
后结束
<text class='' wx:if="{{detail.time[0].day !== '00'}}">{{detail.time[0].day}}天{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>
<text class='' wx:else="">{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>
<text class="text">后结束</text>
</view>
<!--<view>-->
<!--<text class=''>{{detail.time[0].hou}}</text>-->
... ...
... ... @@ -159,9 +159,11 @@ swiper {
font-size: 28rpx;
}
.area-box .title-box .over-time {
/* width: 34%; */
color: #999999;
font-size: 22rpx;
width: 40%;
text-align: right;
display: flex;
align-items: center;
justify-content: flex-end;
}
.area-box .title-box .over-time text {
text-align: right;
... ... @@ -169,6 +171,10 @@ swiper {
font-size: 24rpx;
margin-right: 18rpx;
}
.area-box .title-box .over-time .text {
color: #999999;
font-size: 20rpx;
}
.area-content {
color: #666666;
font-size: 24rpx;
... ... @@ -212,7 +218,7 @@ swiper {
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
justify-content: flex-start;
overflow-x: scroll;
/* display: -webkit-box; */
-webkit-overflow-scrolling: touch;
... ... @@ -223,7 +229,7 @@ swiper {
flex-direction: column;
align-items: center;
justify-content: center;
/* margin-right: 60rpx; */
margin-right: 30rpx;
}
.people:nth-last-child(1){
margin-right: 0;
... ...
{
"navigationBarTitleText": "专题页",
"usingComponents": {}
}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<view class="content">
<image src="{{pic}}" class="banner" mode="widthFix"></image>
<view class='content_box'>
<view class="no-data" wx:if="{{list.length === 0}}">暂无活动</view>
<!-- <view class="no-data" wx:if="{{list.length === 0}}">暂无活动</view> -->
<view class='content_item' wx:for='{{list}}' wx:key="index" wx:if="{{list.length>0}}"
bindtap='goPostDetail' data-id="{{item.id}}" data-type="{{item.type}}">
<!--<image src="http://pk86rwhci.bkt.clouddn.com/activity_img@2x.png"></image>-->
... ...
// pages/index/recommend-list/recommend-list.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "推荐页",
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/index/recommend-list/recommend-list.wxml-->
<view class="content">
<image src="../../../images/long-img.jpg" mode="widthFix" class="image"></image>
</view>
\ No newline at end of file
... ...
/* pages/index/recommend-list/recommend-list.wxss */
.content {
padding: 20rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.image {
width: 100%;
height: auto;
}
\ No newline at end of file
... ...
... ... @@ -65,11 +65,9 @@
<view class="title-box">
<view class="title">{{detail.title}}</view>
<view class="over-time">
<text class='' wx:if="{{detail.time[0].day !== '00'}}">
{{detail.time[0].day}}天{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}
</text>
<text class='' wx:if="{{detail.time[0].day !== '00'}}">{{detail.time[0].day}}天{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>
<text class='' wx:else="">{{detail.time[0].hou}}:{{detail.time[0].min}}:{{detail.time[0].sec}}</text>
后结束
<text class="text">后结束</text>
</view>
<!--<view>-->
<!--<text class=''>{{detail.time[0].hou}}</text>-->
... ...
... ... @@ -153,22 +153,23 @@ swiper {
justify-content: space-between;
margin-bottom: 26rpx;
}
.area-box .title-box .title {
width:55%;
color: #333333;
font-size: 28rpx;
}
.area-box .title-box .over-time {
/* width:34%; */
color: #999999;
font-size: 22rpx;
/* flex:1; */
width: 40%;
text-align: right;
display: flex;
align-items: center;
justify-content: flex-end;
}
.area-box .title-box .over-time text {
text-align: right;
color:#DA4F2A;
font-size: 24rpx;
margin-right: 18rpx;
}
.area-box .title-box .over-time .text {
color: #999999;
font-size: 20rpx;
}
.area-content {
color: #666666;
font-size: 24rpx;
... ... @@ -245,7 +246,7 @@ swiper {
align-items: center;
}
.people-num .name {
/* width:100rpx; */
max-width:100rpx;
margin-right:10rpx;
text-align: center;
/* margin-right: 10rpx; */
... ...
... ... @@ -53,7 +53,7 @@ Page({
//输入最高人数失去焦点时
maxNumBlur() {
console.log('最低人数-最高人数',+this.data.min_num, +this.data.max_num,this.data.min_num>this.data.max_num,+this.data.min_num>+this.data.max_num);
if(+this.data.min_num >= +this.data.max_num) {
if(+this.data.min_num > +this.data.max_num) {
wx.showToast({title:'最高人数要大于最低人数',icon:'none'});
this.setData({max_num:''});
}
... ... @@ -293,9 +293,9 @@ Page({
this.setData({over_time:''});
}else {
let newTime = new Date().getTime();//当前时间戳
let end_time = app.preTime(this.data.date + ' ' +this.data.time, this.data.over_time);//截止时间
let end_time = app.preTime(this.data.date + ' ' +this.data.time, +this.data.over_time);//截止时间
let endTime = new Date(end_time).getTime(); //截止时间戳
// console.log('newTime', 'endTime', 'end_time', newTime, endTime, end_time,this.data.date + ' ' +this.data.time);
console.log('开始时间和截止时间',this.data.date + ' ' +this.data.time,end_time);
if (endTime - newTime <= 0) { //不可发布目前时间到截止小时內的订单
wx.showToast({title:'截止时间无效',icon:'none'});
this.setData({over_time:''})
... ...
... ... @@ -32,7 +32,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({nickName:app.globalData.userInfo.nickName})
},
/**
... ...
... ... @@ -9,14 +9,14 @@
<image src="../../../images/quxiao@2x.png" wx:if="{{item.status === 10}}" class="flag-img"></image>
<view class="detail {{item.status === 6?'change-color':''}}">
<view class="area">
<text class="addr">{{item.addr}}</text>
<text>{{item.userName}}</text>
<text class="addr">{{item.title}}</text>
<text>{{nickName}}</text>
</view>
<view class="time">
<text>时间:{{item.time}}</text>
</view>
<view class="address">
<text class="addr">地址:{{item.address}}</text>
<text class="addr">地点:{{item.addr}}</text>
<text>{{item.number}}人</text>
</view>
</view>
... ...
... ... @@ -92,6 +92,7 @@ Page({
console.log('完成订单', res);
if (+res.code === 1) {
wx.showToast({title:'订单已完成',icon:'none'});
self.getOrderDetail();
// self.setData({
// detail: res.data,
// });
... ...
... ... @@ -53,16 +53,20 @@
<text class="cancel-btn" wx:if="{{detail.status === 2}}" bindtap="cancel">取消订单</text>
<text class="cancel-btn gray" wx:if="{{detail.status === 2}}">待拼成</text>
<!--<text class="cancel-btn gray" wx:if="{{detail.status === 8}}">已拼成</text>-->
<text class="confirm-btn" wx:if="{{detail.status === 4}}" bindtap="confirm">完成</text>
<text class="confirm-btn gray" wx:if="{{detail.status === 4}}">待完成</text>
<!--1发布人,2拼餐/拼活动人-->
<block wx:if="{{detail.sonType === 1}}">
<text class="confirm-btn" wx:if="{{detail.status === 8}}" bindtap="cancel">取消订单</text>
<text class="confirm-btn" wx:if="{{detail.status === 3 || detail.status === 8}}" bindtap="cancel">取消订单</text><!--开始前6小时内不能取消-->
<text class="cancel-btn gray" wx:if="{{detail.status === 8}}">待完成</text>
<text class="cancel-btn gray" wx:if="{{detail.status === 3}}">未拼成</text>
<text class="confirm-btn add-width" wx:if="{{detail.status === 4}}" bindtap="confirm">完成</text><!--待完成时并且活动时间已开始,发布人可点击完成,发布人只显示完成按钮-->
<text class="confirm-btn add-width gray" wx:if="{{detail.status === 6}}">已完成</text>
</block>
<block wx:if="{{detail.sonType === 2}}">
<text class="cancel-btn gray border" wx:if="{{detail.status === 8}}">取消订单</text>
<text class="cancel-btn gray" wx:if="{{detail.status === 8}}">待完成</text>
<!--<text class="cancel-btn gray border" wx:if="{{detail.status === 8}}">取消订单</text>-->
<text class="cancel-btn gray add-width" wx:if="{{detail.status === 8}}">待完成</text>
<text class="confirm-btn gray add-width" wx:if="{{detail.status === 3}}">未拼成</text>
<text class="confirm-btn gray add-width" wx:if="{{detail.status === 4}}">待完成</text>
<text class="confirm-btn add-width gray" wx:if="{{detail.status === 6}}">已完成</text>
</block>
</view>
</view>
... ...
... ... @@ -150,6 +150,9 @@
color: #E1C8AF;
border:0;
}
.bottom .add-width {
width: 100%;
}
.bottom .border {
border-right: 1rpx solid #fff;
}
... ...
... ... @@ -17,7 +17,7 @@
<!--<image src="../../images/lishi@2x.png" class="thumb"></image>-->
<image src="{{item.pic}}" class="thumb" mode="aspectFill"></image>
<view class="lish-right">
<!--(0全部,2待拼成,3人数不足未拼成,4已拼成,5已取消(未拼成取消),6已完成,7已评价,8已拼成(活动未结束),9删除,10已取消(发起人已拼成后取消)-->
<!--(0全部,2待拼成,3人数不足未拼成,4已拼成,5已取消(未拼成取消),6已完成,7已评价,8已拼成(活动未结束),9删除,10已取消(发起人已拼成后取消),11已过期-->
<view class="title-box">
<view class="title">{{item.title}}</view>
<text wx:if="{{item.status === 2}}" class="state">待拼成</text>
... ... @@ -47,8 +47,8 @@
<block wx:if="{{item.type === 1}}">
<text wx:if="{{item.status === 11 || item.status === 5 || item.status === 10 || item.status === 6 || item.status === 3 || item.status === 7}}"
catchtap="del" data-id="{{item.id}}">删除</text>
<text wx:if="{{item.status === 4}}" catchtap="complete" data-id="{{item.id}}">完成</text>
</block>
<text wx:if="{{item.status === 4}}" catchtap="complete" data-id="{{item.id}}">完成</text>
</view>
</view>
</view>
... ...