作者 wumengyu

修改客户提出的问题

... ... @@ -9,7 +9,7 @@ App({
if (res.authSetting['scope.userInfo']) {
console.log('授权过到首页');
self.globalData.isLogin = true;
wx.setStorageSync('isLogin',true)
wx.setStorageSync('isLogin', true)
// wx.redirectTo({
// url: '/pages/index/index', //跳转到授权页面
// });
... ... @@ -136,7 +136,7 @@ App({
content: res.data.message,
showCancel: false,
});
resolve(res.data.data);
resolve(res.data);
reject(res.data)
}
setTimeout(function () {
... ... @@ -168,30 +168,47 @@ App({
// let new_time = time.join(' ');
return time;
},
//获取当前时间(时分)
nowTime() {
let date = new Date();
let hours = date.getHours();
let minutes = date.getMinutes();
let H = (hours > 9 ? hours : ('0' + hours)) + ':' + (minutes > 9 ? minutes : ('0' + minutes));
// let time = [];
// time.push(H);
console.log('time', H);
// let new_time = time.join(' ');
return H;
},
//获取截止时间的前几个小时
nextTime(over_time, hour_num) {
let over = new Date(over_time); //转成标准时间
let month = over.getMonth() + 1;
let day = over.getDate();
let hours = over.getHours();//获取截止时间的小时
let minutes = over.getMinutes();
let Y = over.getFullYear() + '.' + (month > 9 ? month : ('0' + month)) + '.' + (day > 9 ? day : ('0' + day));
let H = (hours > 9 ? hours - hour_num : ('0' + hours - hour_num)) + ':' + (minutes > 9 ? minutes : ('0' + minutes));
let time = [];
// console.log('Y,H,month', Y, H,month);
time.push(Y, H);
let new_time = time.join(' ');
return new_time;
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))
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;
return y + '-' + m + '-' + d + ' ' + h + ':' + mi;
},
timeFormat(param) { //小于10的格式化函数
return param < 10 ? '0' + param : param;
},
//秒数转成时分秒
//秒数转成时分秒
initTime(value) {
let secondTime = value;// 秒
let minuteTime = 0;// 分
let hourTime = 0;// 小时
if (secondTime > 60) {//如果秒数大于60,将秒数转换成整数
let dayTime = 0;// 天
if (secondTime > 60) { //如果秒数大于60,将秒数转换成整数
//获取分钟,除以60取整数,得到整数分钟
minuteTime = parseInt(secondTime / 60);
//获取秒数,秒数取佘,得到整数秒数
... ... @@ -202,11 +219,17 @@ App({
hourTime = parseInt(minuteTime / 60);
//获取小时后取佘的分,获取分钟除以60取佘的分
minuteTime = parseInt(minuteTime % 60);
//如果小时大于24,将小时转换成天
if (hourTime > 24) {
dayTime = parseInt(hourTime / 24);
hourTime = parseInt(hourTime % 24); //算出有多分钟
}
}
}
let result = [];
let obj = null;
obj = {
day: this.timeFormat(dayTime),
hou: this.timeFormat(hourTime),
min: this.timeFormat(minuteTime),
sec: this.timeFormat(secondTime)
... ...
... ... @@ -9,7 +9,8 @@ Page({
images: [],
images_params:[],
type_picker_list:[],
start_time:app.nowDate(),
start_date:app.nowDate(),
start_time:'',
title:'',
content:'',
min_num:'',
... ... @@ -50,6 +51,9 @@ Page({
//输入最高人数
inputMaxNum(e) {
this.setData({max_num:e.detail.value});
},
//输入最高人数失去焦点时
maxNumBlur() {
if(this.data.min_num>this.data.max_num) {
wx.showToast({title:'最低人数不能高于最高人数',icon:'none'});
this.setData({max_num:''});
... ... @@ -89,8 +93,17 @@ Page({
if(this.data.over_time.indexOf('.') !== -1) {
wx.showToast({title:'截止时间为整数',icon:'none'});
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 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);
if (endTime - newTime <= 0) { //不可发布目前时间到截止小时內的订单
wx.showToast({title:'截止时间无效',icon:'none'});
this.setData({over_time:''})
}
}
console.log(this.data.over_time.indexOf('.') !== -1);
// console.log(this.data.over_time.indexOf('.') !== -1);
},
//获取分类
getType() {
... ... @@ -106,7 +119,7 @@ Page({
},
//确定发布
confirmRelease(e) {
console.log('e', e,e.detail.formId);
console.log('e', e,e.detail.formId,'最高人数',this.data.max_num);
if(this.data.title === '') {
wx.showToast({title:'请填写标题',icon:'none'})
}else if(this.data.content === '') {
... ... @@ -282,12 +295,17 @@ Page({
//选择时间
bindTimeChange(e) {
this.setData({time:e.detail.value,hour:e.detail.value.split(':')[0],minute: e.detail.value.split(':')[1]})
console.log(e.detail.value.split(':'),e.detail.value.split(':')[0],e.detail.value.split(':')[1]);
// console.log(e.detail.value.split(':'),e.detail.value.split(':')[0],e.detail.value.split(':')[1]);
},
//选择日期
bindDateChange(e) {
this.setData({date:e.detail.value,month:e.detail.value.split('-')[1],day: e.detail.value.split('-')[2]})
console.log(e.detail.value.split('-'),e.detail.value.split('-')[1],e.detail.value.split('-')[2]);
this.setData({is_choose_date:true,date:e.detail.value,month:e.detail.value.split('-')[1],day: e.detail.value.split('-')[2]})
// console.log(e.detail.value.split('-'),e.detail.value.split('-')[1],e.detail.value.split('-')[2]);
if(this.data.is_choose_date && (this.data.date === this.data.start_date[0])) { //如果是当天,开始时间要控制在当前时间以后
this.setData({start_time:app.nowTime()})
}else {
this.setData({start_time:'00:00'})
}
},
/**
* 生命周期函数--监听页面加载
... ...
... ... @@ -30,7 +30,7 @@
</view>
<view class="min-num">
<text class="title">最高人数</text>
<input type="number" bindinput="inputMaxNum" class="input"/>
<input type="number" bindinput="inputMaxNum" class="input" bindblur="maxNumBlur" value="{{max_num}}"/>
<text class="iconfont icon-xiangxia min-icon"></text>
</view>
<view class="min-num">
... ... @@ -47,7 +47,7 @@
</view>
<view class="time-box">
<text class="time-title">时间</text>
<picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_time}}"
<picker mode='date' bindchange="bindDateChange" value='{{date}}' start="{{start_date}}"
end='2060-01-01'>
<view class='select'>
<view class="picker">{{month}}
... ... @@ -63,7 +63,7 @@
</picker>
<picker mode="time"
value="{{time}}"
start="00:00"
start="{{start_time}}"
end="24:00"
bindchange="bindTimeChange">
<view class='select'>
... ...
... ... @@ -20,7 +20,26 @@ Page({
is_reply:false,
placeholder:'输入您的留言',
is_showRelease_modal:false,
is_join:false,
img_heights: [], //图片宽度
img_width: 750, //默认
},
//获取图片真实宽度
imageLoad: function (e) {
var img_width = e.detail.width,
img_height = e.detail.height,
//宽高比
ratio = img_width / img_height;
console.log(img_width, img_height);
//计算的高度值
var viewHeight = 750 / ratio;
var img_height = viewHeight;
var img_heights = this.data.img_heights;
//把每一张图片的对应的高度记录到数组里
img_heights[e.target.dataset.id] = img_height;
this.setData({
img_heights: img_heights
})
},
//查看我的订单
goMyOrder() {
... ... @@ -269,8 +288,9 @@ Page({
// console.log('surplus', this.data.detail.surplus);
// t = setTimeout(this.countDown, 1000);
const time = app.initTime(this.data.detail.surplus);
// console.log('time', time);
console.log('time', time);
obj = {
day: time[0].day,
hou: time[0].hou,
min: time[0].min,
sec: time[0].sec
... ... @@ -345,11 +365,13 @@ Page({
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('确认拼', res);
console.log('确认拼活动', res);
if (+res.code === 1) {
// wx.showToast({title: '拼餐成功', icon: 'success'});
self.setData({is_showRelease_modal:true,order_id:+res.data.orderId});
// wx.showToast({title: '拼活动成功', icon: 'success'});
self.setData({is_showRelease_modal:true,order_id:+res.data.orderId,is_join:true});
self.getDetail();
}else if(+res.code === 0) { //参与失败按钮还是确认拼活动
self.setData({is_join:false});
}
})
}
... ...
... ... @@ -32,11 +32,11 @@
</view>
</view>
<swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange"
autoplay="{{true}}" interval="3000" duration="1000">
autoplay="{{true}}" interval="3000" duration="1000" style="height:{{img_heights[current_swiper]}}rpx;">
<block wx:for="{{detail.banner}}" wx:key="index">
<navigator url="{{item}}" hover-class="navigator-hover">
<swiper-item>
<image src="{{item}}" class="slide-image" mode="aspectFill"/>
<image src="{{item}}" data-id='{{index}}' class="slide-image" mode="widthFix" bindload="imageLoad"/>
<!--<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"></image>-->
</swiper-item>
</navigator>
... ... @@ -54,7 +54,8 @@
<view class="title-box">
<view class="title">{{detail.title}}</view>
<view class="over-time">
<text class=''>{{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>
后停止拼餐
</view>
<!--<view>-->
... ... @@ -171,8 +172,12 @@
<view class='iconfont icon-jia1' bindtap='addCount'></view>
</view>
</view>
<button class="confirm-join-btn" form-type="submit">
<text>确认拼活动</text>
<!--(0全部,2待处理,4已拼成,5已取消,6已完成-->
<button class="confirm-join-btn {{is_join || detail.status === 5 || detail.status === 6?'gray':''}}" form-type="submit">
<text wx:if="{{is_join}}">待拼成</text>
<text wx:if="{{!is_join && detail.status === 2}}">确认拼活动</text>
<text wx:if="{{detail.status === 5}}">已取消</text>
<text wx:if="{{detail.status === 6}}">已完成</text>
</button>
</view>
... ...
... ... @@ -154,11 +154,12 @@ swiper {
margin-bottom: 26rpx;
}
.area-box .title-box .title {
width:55%;
color: #333333;
font-size: 28rpx;
}
.area-box .title-box .over-time {
width: 34%;
/* width: 34%; */
color: #999999;
font-size: 22rpx;
}
... ... @@ -406,6 +407,10 @@ swiper {
.confirm-join-btn::after {
border:0;
}
.gray {
background-color: #CCCCCC;
color: #ffffff;
}
.input_box {
display: flex;
align-items: center;
... ...
... ... @@ -3,5 +3,24 @@ Component({
item: {
type: Object
}
},
methods: {
//获取图片真实宽度
imageLoad: function (e) {
var img_width = e.detail.width,
img_height = e.detail.height,
//宽高比
ratio = img_width / img_height;
console.log('图片组件',img_width, img_height);
//计算的高度值
var viewHeight = 750 / ratio;
var img_height = viewHeight;
var img_heights = this.data.img_heights;
//把每一张图片的对应的高度记录到数组里
img_heights[e.target.dataset.id] = img_height;
this.setData({
img_heights: img_heights
})
},
}
})
\ No newline at end of file
... ...
<view class="img-box" data-index="{{index}}">
<view class="img-border">
<image src="{{item.pic}}" mode="aspectFill"></image>
<image src="{{item.pic}}" mode="widthFix" data-id='{{index}}' style="height:{{img_heights[current_swiper]}}rpx;" bindload="imageLoad"></image>
<view class="area">
<text class="name">{{item.address}}</text>
<text class="num">还差{{item.people}}人</text>
<text class="name">{{item.title}}</text>
<text class="num">距最低人数{{item.people}}人</text>
</view>
<!--<text>2018.4.28—4.30</text>-->
<text>{{item.time}}</text>
<view class="bottom">
<image src="{{item.pic}}" class="avatar" mode="aspectFill"></image>
<text>{{item.time}}</text>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -32,6 +32,20 @@
color: #666666;
font-size: 24rpx;
}
.bottom {
display: flex;
align-items: center;
justify-content: space-between;
}
.img-box .bottom .avatar{
width: 30rpx;
height: 30rpx;
border-radius: 50%;
}
/*.bottom .avatar image {*/
/*width: 100%;*/
/*height: 100%;*/
/*}*/
/*.img-box text{*/
/*font-size: 28rpx;*/
/*line-height: 1;*/
... ...
... ... @@ -9,15 +9,15 @@
display: flex;
flex-direction: column;
}
.masonry-item1:nth-child(odd) image{
height: 420rpx;
}
.masonry-item1:nth-child(even) image{
height: 336rpx;
}
.masonry-item2:nth-child(odd) image{
height: 336rpx;
}
.masonry-item2:nth-child(even) image{
height: 420rpx;
}
\ No newline at end of file
/*.masonry-item1:nth-child(odd) image{*/
/*height: 420rpx;*/
/*}*/
/*.masonry-item1:nth-child(even) image{*/
/*height: 336rpx;*/
/*}*/
/*.masonry-item2:nth-child(odd) image{*/
/*height: 336rpx;*/
/*}*/
/*.masonry-item2:nth-child(even) image{*/
/*height: 420rpx;*/
/*}*/
\ No newline at end of file
... ...
... ... @@ -9,6 +9,7 @@ Page({
current_que: 0,
current_answer: 0,
choose: false,
// questionList:[{title:'周末去哪玩',content:[{answer:'都行你看着吧'},{answer:'去市里'}],}]
},
clickQuestion(e) {
// console.log('e', e);
... ...
... ... @@ -19,9 +19,7 @@
<radio-group class="section" bindchange="radioChange" data-pindex="{{idx}}">
<label class="radio" wx:for="{{item.content}}" wx:key="index" bindtap="chooseAnswer"
data-score="{{item.score}}" data-sindex="{{index}}" data-pindex="{{idx}}">
<text class="{{item.checked?'active':''}}">{{index+1 === 1?'A':index+1 === 2?'B':index+1 ===
3?'C':'D'}}. {{item.answer}}{{item.checked}}
</text>
<text class="{{item.checked?'active':''}}">{{index+1 === 1?'A':index+1 === 2?'B':index+1 === 3?'C':index+1 === 4?'D':index+1 === 5?'E':index+1 === 6?'F':index+1 === 7?'G':'H'}}. {{item.answer}}</text>
<radio value="{{index}}" checked="{{item.checked}}" color='#fff'/>
</label>
</radio-group>
... ...
... ... @@ -36,6 +36,7 @@
font-size: 30rpx;
color: #333333;
font-weight: bold;
margin-bottom:18rpx;
}
.question-item .section {
display: flex;
... ...
... ... @@ -10,7 +10,7 @@ Page({
slide: [],
cate: [],
meal_banner: [],
currentBannerIndex: 0,
currentBannerIndex: 1,
tabcurrent: {tab: 0, bubble: ''},
noticeList: [],
is_showAnswer: false,
... ... @@ -22,6 +22,8 @@ Page({
page_number: 1,
cityList: [],
addr:'', //切换地址
img_heights: [], //图片宽度
img_width: 750, //默认
motto: 'Hello World',
userInfo: {},
... ... @@ -157,7 +159,7 @@ Page({
})
},
bannerChange(e) {
// console.log(e,'current', current);
console.log(e,'current', current);
const current = e.detail.current;
this.setData({currentBannerIndex: current})
},
... ... @@ -227,6 +229,10 @@ Page({
release(e) {
console.log('发布',app.globalData.isLogin);
const self = this;
// self.setData({
// is_showAnswer: true, //弹出 去答题弹框
// is_showRelease:false,
// });
if(!app.globalData.isLogin) {
wx.showToast({title: '还没登录,先去登录吧~', icon: 'none',
success:function () {
... ... @@ -241,7 +247,7 @@ Page({
is_showUserInfo: true //弹出 去填写个人信息弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true, //弹出 去答题弹框
is_showRelease:false,
... ...
... ... @@ -92,14 +92,14 @@
<!--</view>-->
<!--</view>-->
<!--</scroll-view>-->
<swiper class="bannerBox" autoplay="true" interval="3000" duration="2000"
previous-margin="50rpx" next-margin="50rpx" bindchange="bannerChange" current="{{index}}">
<swiper class="bannerBox" autoplay="{{false}}" interval="3000" duration="2000" circular="{{true}}"
previous-margin="50rpx" next-margin="50rpx" bindchange="bannerChange" current="{{currentBannerIndex}}">
<block wx:for="{{meal_banner}}" wx:key="index">
<swiper-item>
<view class="fix pl5 pr5 box_bb" bindtap="goMealDetail" data-id="{{item.id}}">
<!--<navigator url="">-->
<image class="banner mt10 {{currentBannerIndex==index?'active':''}}" src="{{item.pic}}" mode="aspectFill" />
<text>{{item.address}} {{item.time}}</text>
<text>{{item.title}} {{item.time}}</text>
<!--</navigator>-->
</view>
</swiper-item>
... ...
... ... @@ -316,6 +316,9 @@ swiper {
text-align: left;
color:#333333;
font-size: 24rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.banner{
overflow: hidden;
... ... @@ -324,7 +327,7 @@ swiper {
transition: transform 500ms;
transform: scale(0.95,0.9); /* 因为非主图看不清,所以可以变形处理 */
border-radius: 8px;
box-shadow: 0px 6px 10px 0px rgba(179,154,139,1);
box-shadow: 2rpx 8rpx 20rpx rgba(89, 89, 89, 0.44);
}
.banner.active{
transform: scale(1,1);
... ... @@ -362,6 +365,10 @@ swiper {
padding-right: 5px;
}
.box_bb {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
... ...
... ... @@ -18,7 +18,28 @@ Page({
content:'',
is_ask:false,
is_reply:false,
placeholder:'输入您的留言'
placeholder:'输入您的留言',
is_join:false,
img_heights: [], //图片宽度
img_width: 750, //默认
},
//获取图片真实宽度
imageLoad: function (e) {
var img_width = e.detail.width,
img_height = e.detail.height,
//宽高比
ratio = img_width / img_height;
console.log(img_width, img_height);
//计算的高度值
var viewHeight = 750 / ratio;
var img_height = viewHeight;
var img_heights = this.data.img_heights;
//把每一张图片的对应的高度记录到数组里
img_heights[e.target.dataset.id] = img_height;
console.log('img_heights',img_heights);
this.setData({
img_heights: img_heights
})
},
//查看我的订单
goMyRelease() {
... ... @@ -265,8 +286,10 @@ Page({
console.log('确认拼餐', res);
if (+res.code === 1) {
// wx.showToast({title:'拼餐成功',icon:'success'});
self.setData({is_showRelease_modal:true,order_id:+res.data.orderId});
self.setData({is_showRelease_modal:true,order_id:+res.data.orderId,is_join:true});
self.getDetail();
}else if(+res.code === 0) { //参与失败按钮还是确认拼活动
self.setData({is_join:false});
}
})
},
... ... @@ -290,8 +313,9 @@ Page({
// console.log('surplus', this.data.detail.surplus);
// t = setTimeout(this.countDown, 1000);
const time = app.initTime(this.data.detail.surplus);
// console.log('time', time);
console.log('time', time);
obj = {
day: time[0].day,
hou: time[0].hou,
min: time[0].min,
sec: time[0].sec
... ...
... ... @@ -31,12 +31,12 @@
</button>
</view>
</view>
<swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange"
<swiper indicator-dots="{{false}}" current="{{current}}" bindchange="swiperChange" style="height:{{img_heights[current_swiper]}}rpx;"
autoplay="{{true}}" interval="3000" duration="1000">
<block wx:for="{{detail.banner}}" wx:key="index">
<navigator url="{{item}}" hover-class="navigator-hover">
<swiper-item>
<image src="{{item}}" class="slide-image" mode="aspectFill"/>
<image src="{{item}}" data-id='{{index}}' class="slide-image" mode="widthFix" bindload="imageLoad"/>
<!--<image src="http://pk86rwhci.bkt.clouddn.com/banner.png" class="slide-image"></image>-->
</swiper-item>
</navigator>
... ... @@ -54,7 +54,8 @@
<view class="title-box">
<view class="title">{{detail.title}}</view>
<view class="over-time">
<text class=''>{{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>
后停止拼餐
</view>
<!--<view>-->
... ... @@ -177,8 +178,12 @@
<view class='iconfont icon-jia1' bindtap='addCount'></view>
</view>
</view>
<button class="confirm-join-btn" form-type="submit">
<text>确认拼餐</text>
<!--(0全部,2待处理,4已拼成,5已取消,6已完成-->
<button class="confirm-join-btn {{is_join || detail.status === 5 || detail.status === 6?'gray':''}}" form-type="submit">
<text wx:if="{{is_join}}">待拼成</text>
<text wx:if="{{!is_join && detail.status === 2}}">确认拼餐</text>
<text wx:if="{{detail.status === 5}}">已取消</text>
<text wx:if="{{detail.status === 6}}">已完成</text>
</button>
<!--<view class="confirm-join-btn" bindtap="confirmJoin">-->
<!--<text>确认拼餐</text>-->
... ...
... ... @@ -105,7 +105,7 @@ swiper {
}
.slide-image {
width: 100%;
height: 100%;
height: auto;
}
/*用来包裹所有的小圆点 */
... ... @@ -154,13 +154,15 @@ swiper {
margin-bottom: 26rpx;
}
.area-box .title-box .title {
width:55%;
color: #333333;
font-size: 28rpx;
}
.area-box .title-box .over-time {
width:34%;
/* width:34%; */
color: #999999;
font-size: 22rpx;
/* flex:1; */
}
.area-box .title-box .over-time text {
color:#DA4F2A;
... ... @@ -405,6 +407,10 @@ swiper {
.confirm-join-btn::after {
border:0;
}
.gray {
background-color: #CCCCCC;
color: #ffffff;
}
.input_box {
display: flex;
align-items: center;
... ...
... ... @@ -9,7 +9,8 @@ Page({
images: [],
images_params:[],
type_picker_list:[],
start_time:app.nowDate(),
start_date:app.nowDate(),
start_time:'',
title:'',
content:'',
min_num:'',
... ... @@ -73,14 +74,6 @@ Page({
// }
// })
},
//输入截止时间
inputOverTime(e) {
this.setData({over_time:e.detail.value});
if(this.data.over_time.indexOf('.') !== -1) {
wx.showToast({title:'截止时间为整数',icon:'none'});
this.setData({over_time:''});
}
},
//获取分类
getType() {
let url = '/portal/Send/select';
... ... @@ -264,12 +257,36 @@ Page({
//选择时间
bindTimeChange(e) {
this.setData({time:e.detail.value,hour:e.detail.value.split(':')[0],minute: e.detail.value.split(':')[1]})
console.log(e.detail.value.split(':'),e.detail.value.split(':')[0],e.detail.value.split(':')[1]);
// console.log('time',e.detail.value,e.detail.value.split(':'),e.detail.value.split(':')[0],e.detail.value.split(':')[1]);
},
//选择日期
bindDateChange(e) {
this.setData({date:e.detail.value,month:e.detail.value.split('-')[1],day: e.detail.value.split('-')[2]})
console.log(e.detail.value.split('-'),e.detail.value.split('-')[1],e.detail.value.split('-')[2]);
this.setData({is_choose_date:true,date:e.detail.value,month:e.detail.value.split('-')[1],day: e.detail.value.split('-')[2]})
// console.log(e.detail.value,this.data.start_date,);
if(this.data.is_choose_date && (this.data.date === this.data.start_date[0])) { //如果是当天,开始时间要控制在当前时间以后
this.setData({start_time:app.nowTime()})
}else {
this.setData({start_time:'00:00'})
}
// console.log(this.data.start_time);
},
//输入截止时间
inputOverTime(e) {
this.setData({over_time:e.detail.value});
if(this.data.over_time.indexOf('.') !== -1) {
wx.showToast({title:'截止时间为整数',icon:'none'});
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 endTime = new Date(end_time).getTime(); //截止时间戳
// console.log('newTime', 'endTime', 'end_time', newTime, endTime, end_time,this.data.date + ' ' +this.data.time);
if (endTime - newTime <= 0) { //不可发布目前时间到截止小时內的订单
wx.showToast({title:'截止时间无效',icon:'none'});
this.setData({over_time:''})
}
}
},
/**
* 生命周期函数--监听页面加载
... ...
... ... @@ -47,7 +47,7 @@
</view>
<view class="time-box">
<text class="time-title">时间</text>
<picker mode='date' bindchange="bindDateChange" value='{{date}}' end='{{today}}'>
<picker mode='date' bindchange="bindDateChange" value='{{date}}' end='{{today}}' start="{{start_date}}">
<view class='select'>
<view class="picker">{{month}}
<text class="iconfont icon-xiangxia min-icon"></text>
... ... @@ -62,7 +62,7 @@
</picker>
<picker mode="time"
value="{{time}}"
start="00:00"
start="{{start_time}}"
end="24:00"
bindchange="bindTimeChange">
<view class='select'>
... ...
... ... @@ -297,7 +297,7 @@ Page({
is_showUserInfo: true //弹出 去填写个人信息弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
});
... ...
... ... @@ -18,7 +18,7 @@
align-items: center;
padding: 0 32rpx;
margin-top: 30rpx;
margin-bottom: 100rpx;
padding-bottom: 100rpx;
}
.upload_img {
... ...
... ... @@ -192,7 +192,7 @@ Page({
is_showUserInfo: true //弹出 去填写个人信息弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
});
... ...
... ... @@ -321,7 +321,7 @@ Page({
is_showUserInfo: true //弹出 去填写个人信息弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_answer') === 2) { //已填写且不能发布=>去答题
self.setData({
is_showAnswer: true //弹出 去答题弹框
});
... ...
... ... @@ -245,6 +245,7 @@
box-sizing: border-box;
box-shadow: 2rpx 8rpx 38rpx rgba(89, 89, 89, 0.14);
border-radius: 8rpx;
margin-bottom:22rpx;
}
.content_item image {
width: 100%;
... ...
... ... @@ -10,7 +10,7 @@
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
border: 1rpx solid #EBEBEB;
/* border: 1rpx solid #EBEBEB; */
position: fixed;
bottom: 0;
left: 0;
... ...