Commit fb953241 by jscat

nyx weapp: 页面更新 & 功能更新

1. 活动创建改为switcTab
2. 添加开始结束日期功能
parent 6d9e52ae
//app.js
//app.js
......@@ -55,6 +55,8 @@ App({
photoTitle: "",
photoContent: "",
photoProduct: [],
startDatetime: "",
endDatetime: "",
},
......
//config.js API全局域名配置
//config.js API全局域名配置
//config.js API全局域名配置
var prod = 0; //阿里云服务器生产版本
var local = 1; //本地java测试,需要启动java 后台
var test = 0; //阿里云服务器测试版本
var local = 0; //本地java测试,需要启动java 后台
var test = 1; //阿里云服务器测试版本
var debug = 0; //是否打印调试信息
var host_key = "https://fun.hisuhong.com";
......
// pages/member/activity-post/activity-edit/activity-edit.js
// pages/member/activity-post/activity-edit/activity-edit.js
......@@ -11,15 +11,20 @@ Page({
product_listData: [],
attributeArray: ['活动类别', '价格', '库存'],
startDate: '',
endDate: '',
startTime: "",
endTime: "",
},
onLoad: function () {
var that = this;
var _this = this;
wx.getSystemInfo({
success: function (res) {
var a = res.windowHeight;
that.setData({
_this.setData({
scrollTop: a-200
})
}
......@@ -27,12 +32,31 @@ Page({
var product_listData = [{ desc: "", price: 0, stock: 0, }]
_this.setData({
product_listData: product_listData,
});
var dateNow = new Date();
var year = dateNow.getFullYear();
var month = dateNow.getMonth() + 1;
month = month.toString().length==1 ? '0'+month : month
var day = dateNow.getDate()
day = day.toString().length==1 ? '0'+day : day
this.setData({
product_listData: product_listData,
var date = year + "-" + month + "-" + day
var startTime = "19:30"
var endTime = "23:30"
_this.setData({
startDate: date,
endDate: date,
startTime: startTime,
endTime: endTime,
});
//设置全局变量
app.globalData.postData.startDatetime = date + " " + startTime + ":00"
app.globalData.postData.endDatetime = date + " " + endTime + ":00"
},
onReady: function (e) {
},
......@@ -112,5 +136,49 @@ Page({
},
// 点击开始日期组件确定事件
bindDateStartChange: function (e) {
var _this = this;
var startTime = _this.data.startTime
var startDate = e.detail.value
_this.setData({
startDate: startDate
})
app.globalData.postData.startDatetime = startDate + " " + startTime + ":00"
},
// 点击结束日期组件确定事件
bindDateEndChange: function (e) {
var _this = this;
var endTime = _this.data.endTime
var endDate = e.detail.value
_this.setData({
endDate: e.detail.value
})
app.globalData.postData.endDatetime = endDate + " " + endTime + ":00"
},
// 点击时间组件确定事件
bindTimeStartChange: function (e) {
var _this = this;
var startDate = _this.data.startDate
var startTime = e.detail.value
_this.setData({
startTime: e.detail.value
})
app.globalData.postData.startDatetime = startDate + " " + startTime + ":00"
},
// 点击时间组件确定事件
bindTimeEndChange: function (e) {
var _this = this;
var endDate = _this.data.endDate
var endTime = e.detail.value
_this.setData({
endTime: e.detail.value
})
app.globalData.postData.endDatetime = endDate + " " + endTime + ":00"
},
})
<!-- /page/post/edit/edit 添加分类的标签,以及自定义标签 -->
<!-- /page/post/edit/edit 添加分类的标签,以及自定义标签 -->
......@@ -22,6 +22,40 @@
</view>
</view>
<view style="display:flex; flex-direction: row;">
<view class="section" style="background: #fff;margin-top:32rpx;padding:32rpx;width:55%">
<picker mode="date" value="{{startDate}}" bindchange="bindDateStartChange">
<view class="picker">
开始日期: {{startDate}}
</view>
</picker>
</view>
<view class="section" style="background: #fff;margin-top:32rpx;padding:32rpx;width:45%">
<picker mode="time" value="{{startTime}}" start="08:00" end="23:30" bindchange="bindTimeStartChange">
<view class="picker">
时间: {{startTime}}
</view>
</picker>
</view>
</view>
<view style="display:flex; flex-direction: row;">
<view class="section" style="background: #fff;margin-top:32rpx;padding:32rpx;width:55%">
<picker mode="date" value="{{endDate}}" bindchange="bindDateEndChange">
<view class="picker">
结束日期: {{endDate}}
</view>
</picker>
</view>
<view class="section" style="background: #fff;margin-top:32rpx;padding:32rpx;width:45%">
<picker mode="time" value="{{endTime}}" start="08:00" end="23:30" bindchange="bindTimeEndChange">
<view class="picker">
时间: {{endTime}}
</view>
</picker>
</view>
</view>
<view class="weui-cells__title">#添加活动类别</view>
<!-- 添加表格: 序号, 类别描述, 价格, 个数 -->
<view class='table'>
......@@ -50,21 +84,21 @@
<!-- 类别 -->
<view class='td'>
<view class='table_Text_last_class'>
<input bindinput="bindKeyText" placeholder="请输入类别" id="{{index}}" data-id="desc" ></input>
<input style="text-align: center" bindinput="bindKeyText" placeholder="请输入类别" id="{{index}}" data-id="desc" ></input>
</view>
</view>
<!-- 价格 -->
<view class='td'>
<view class='table_Text_last_class'>
<input bindinput="bindKeyText" placeholder="请输入价格" id="{{index}}" data-id="price" ></input>
<input style="text-align: center" bindinput="bindKeyText" placeholder="请输入价格" id="{{index}}" data-id="price" ></input>
</view>
</view>
<!-- 库存 -->
<view class='td'>
<view class='table_Text_last_class'>
<input bindinput="bindKeyText" placeholder="请输入库存" id="{{index}}" data-id="stock" ></input>
<input style="text-align: center" bindinput="bindKeyText" placeholder="请输入库存" id="{{index}}" data-id="stock" ></input>
</view>
</view>
......
page{
page{
......@@ -43,7 +43,7 @@ page{
overflow-x: auto;
}
.cell_label{
font-size: 26rpx;
font-size: 32rpx;
color: rgba(74, 74, 74, 1);
}
.cell_date_label{
......
// pages/member/activity-post/activity-submit/activity-submit.js
// pages/member/activity-post/activity-submit/activity-submit.js
......@@ -238,7 +238,7 @@ Page({
},
//上传照片(阿里云)
uploadAli: function (tag, title, content, photoArr, product) {
uploadAli: function (tag, title, content, photoArr, product, startDatetime, endDatetime) {
var _this = this;
console.log("===uploadAli_data_tag: ",tag)
console.log("===uploadAli_data_title: ",title)
......@@ -297,7 +297,7 @@ Page({
}
var callback_param = {
'callbackUrl': strUrl,
'callbackBody': 'filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}&tag=' + encodeURI(encodeURI(tag)) + '&title=' + encodeURI(encodeURI(title)) + '&content=' + encodeURI(encodeURI(content)) + '&image=' + image + '&userId=' + user_id + '&memberId=' + member_id + '&addressId=' + address_id + encodeURI(encodeURI(strParam)),
'callbackBody': 'filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}&tag=' + encodeURI(encodeURI(tag)) + '&title=' + encodeURI(encodeURI(title)) + '&content=' + encodeURI(encodeURI(content)) + '&image=' + image + '&userId=' + user_id + '&memberId=' + member_id + '&addressId=' + address_id + encodeURI (encodeURI(strParam)) + '&startDatetime=' + startDatetime + '&endDatetime=' + endDatetime,
'callbackBodyType': "application/x-www-form-urlencoded",
}
var base64_callback_body = base64.encode(JSON.stringify(callback_param));
......@@ -340,6 +340,8 @@ Page({
var photoArr = app.globalData.postData.photoArray;
var tag = app.globalData.postData.photoTag
var product = app.globalData.postData.photoProduct
var startDatetime = app.globalData.postData.startDatetime
var endDatetime = app.globalData.postData.endDatetime
//时间戳
var expire = this.data.oss[config.user_dir].expire;
......@@ -353,13 +355,13 @@ Page({
promise_oss.then(
function (value) {
console.log("===enter promise_oss user_dir then_pass")
_this.uploadAli(tag, title, content, photoArr, product)
_this.uploadAli(tag, title, content, photoArr, product, startDatetime, endDatetime)
});
}
else
{
_this.uploadAli(tag, title, content, photoArr, product)
_this.uploadAli(tag, title, content, photoArr, product, startDatetime, endDatetime)
}
},
......
// pages/my/my-member/my-member.js
// pages/my/my-member/my-member.js
......@@ -92,6 +92,10 @@ Page({
},
// 用户自定义函数
onSwitchTab: function() {
wx.switchTab({
url: "/pages/member/activity-post/activity-post"
})
}
})
\ No newline at end of file
<!--pages/my/my-members/my-members.wxml-->
<!--pages/my/my-members/my-members.wxml-->
......@@ -7,16 +7,10 @@
<text class="title">活动</text>
<view class="list">
<view class="items">
<navigator url="/pages/member/activity-post/activity-post">
<view bindtap="onSwitchTab">
<image src="/icon/my/activity.png"></image>
</navigator>
<text>活动创建</text>
</view>
<view class="items">
<navigator url="/pages/member/quiz-post/quiz-post">
<image src="/icon/member/quiz.png"></image>
</navigator>
<text>竞答创建</text>
<text>活动创建</text>
</view>
<view class="items">
<navigator url="/pages/member/schedule/schedule">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论