Commit f02bd7c6 by jscat

优化:

1. 活动发布页面(activity-submit.wxml)暂时取消content不能为""的限制, 以方便调试
2. 活动日历页面(calendar/index.wxml)取消todo-dot的标记
3. 活动日历页面(calendar/index.wxml)取消点击某日,则隐藏某日todoText的功能
4. 将setTodoLabels()在afterCalendarRender()之后自动添加

bug fix:
1. 解决个人页面(my.wxml)未登录时候,无用户头像的问题,添加到activity.js的onLoad()函数
parent 88bd8eb1
{ {
{ {
"pages": [ "pages": [
"pages/activity/activity", "pages/activity/activity",
"pages/my/my-members/my-members", "pages/my/my-members/my-members",
"pages/member/activity-post/activity-submit/activity-submit", "pages/member/activity-post/activity-submit/activity-submit",
"pages/member/activity-post/activity-edit/activity-edit", "pages/member/activity-post/activity-edit/activity-edit",
"pages/member/quiz-post/quiz-edit/quiz-edit", "pages/member/quiz-post/quiz-edit/quiz-edit",
"pages/member/schedule/schedule",
"pages/mall/order/order", "pages/mall/order/order",
"pages/member/schedule/schedule",
"pages/member/activity-post/activity-post", "pages/member/activity-post/activity-post",
"pages/activity/quiz-result/quiz-result", "pages/activity/quiz-result/quiz-result",
"pages/activity/quiz-info/quiz-info", "pages/activity/quiz-info/quiz-info",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<view class="flex b tb ac" wx:if="{{calendar}}"> <view class="flex b tb ac" wx:if="{{calendar}}">
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
{{item.lunar.Term || item.lunar.IDayCn}} {{item.lunar.Term || item.lunar.IDayCn}}
</view> </view>
<view <view
wx:if="{{item.showTodoLabel && !calendar.todoLabelCircle}}" wx:if="{{item.showTodoLabel}}"
class="{{item.todoText ? 'date-desc' : calendarConfig.theme + '_todo-dot todo-dot'}} {{calendarConfig.showLunar ? calendarConfig.theme + '_date-desc-lunar' : ''}} {{calendar.todoLabelPos === 'bottom' ? 'date-desc-bottom todo-dot-bottom' : 'date-desc-top todo-dot-top'}} {{calendar.showLabelAlways && item.choosed && calendar.todoLabelPos === 'bottom' ? 'date-desc-bottom-always todo-dot-bottom-always' : ''}} {{calendar.showLabelAlways && item.choosed && calendar.todoLabelPos === 'top' ? 'date-desc-top-always todo-dot-top-always' : ''}}" class="{{item.todoText ? 'date-desc' : ''}} {{calendarConfig.showLunar ? calendarConfig.theme + '_date-desc-lunar' : ''}} {{calendar.todoLabelPos === 'bottom' ? 'date-desc-bottom todo-dot-bottom' : 'date-desc-top todo-dot-top'}} {{calendar.showLabelAlways && item.choosed && calendar.todoLabelPos === 'bottom' ? 'date-desc-bottom-always todo-dot-bottom-always' : ''}} {{calendar.showLabelAlways && item.choosed && calendar.todoLabelPos === 'top' ? 'date-desc-top-always todo-dot-top-always' : ''}}"
style="background-color: {{item.todoText ? '' : item.color || calendar.todoLabelColor}}; color: {{item.color}}"> style="background-color: {{item.todoText ? '' : item.color || calendar.todoLabelColor}}; color: {{item.color}}">
<text style="writing-mode: vertical-lr;text-align:left">{{item.todoText}}</text> <text style="writing-mode: vertical-lr;text-align:left">{{item.todoText}}</text>
</view> </view>
......
// pages/activity/activity.js // pages/activity/activity.js
// pages/activity/activity.js // pages/activity/activity.js
const app = getApp() const app = getApp()
var config = wx.getStorageSync("config"); var config = wx.getStorageSync("config");
var util = require('./../../utils/util.js')
Page({ Page({
...@@ -68,7 +69,48 @@ Page({ ...@@ -68,7 +69,48 @@ Page({
onLoad: function (options) { onLoad: function (options) {
var _this = this; var _this = this;
// todo temp //入口页面,先确定nyxCode
/*step1 先确定用户信息 */
var nyxCode = wx.getStorageSync('nyxCode');
//不存在
if (!nyxCode)
{
//注册新用户
console.log("===onLoad_regUser")
wx.clearStorageSync('nyxCode');
nyxCode = "uid_" + util.wxuuid()
wx.setStorageSync('nyxCode', nyxCode);
app.globalData.nyxCode = nyxCode;
app.regUser(nyxCode);
}
else //存在
{
//更新用户信息
var strUrl = config.userinfo_query_url + "?userid=" + nyxCode
wx.setStorageSync('nyxCode', nyxCode);
app.globalData.nyxCode = nyxCode;
config.debug == 1 ? console.log("===getLatestUserInfo strUrl_" + strUrl) : 1
getData(strUrl, "").then(res => {
console.log(res.data)
if(res.data.length==0) //数据库不存在该用户(误删除或者测试数据已删除)
{
//以该id注册新用户
console.log("===onLoad_Update User Info")
app.regUser(nyxCode);
}
else
{
var list = res.data[0]
app.globalData.nyxCode = nyxCode;
wx.setStorageSync('nyxCode', nyxCode);
app.globalData.userInfo = list
wx.setStorageSync('userInfo', list)
console.log("==onLoad_userInfo success")
}
})
}
// todo temp 暂时设置所有用户为商家(可以查看个人->商家管理)
wx.setStorageSync('memberId', "mid_001") wx.setStorageSync('memberId', "mid_001")
var device = wx.getSystemInfoSync() var device = wx.getSystemInfoSync()
...@@ -485,3 +527,20 @@ Page({ ...@@ -485,3 +527,20 @@ Page({
}) })
//通过Promise方式为wx.request添加同步操作
const getData = (url, param) => {
return new Promise((resolve, reject) => {
wx.request({
url: url,
method: 'GET',
data: param,
success(res) {
resolve(res.data)
},
fail(err) {
reject(err)
}
})
})
}
// pages/member/activity-post/activity-submit/activity-submit.js // pages/member/activity-post/activity-submit/activity-submit.js
...@@ -43,7 +43,10 @@ Page({ ...@@ -43,7 +43,10 @@ Page({
var content = e.detail.value.inputContent;//获取content var content = e.detail.value.inputContent;//获取content
app.globalData.postData.title = title app.globalData.postData.title = title
app.globalData.postData.content = content app.globalData.postData.content = content
if (content != undefined && content != "") {
// todo jscat 20200815 测试版本不需要限定文本content是否为 ""
//if (content != undefined && content != "") {
if(1) {
//step1, 上传至oss-获取token,在onReady()提前准备 //step1, 上传至oss-获取token,在onReady()提前准备
//_this.oss(); //_this.oss();
......
// pages/schedule/schedule.js // pages/schedule/schedule.js
...@@ -44,6 +44,7 @@ Page({ ...@@ -44,6 +44,7 @@ Page({
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
...@@ -61,6 +62,8 @@ Page({ ...@@ -61,6 +62,8 @@ Page({
matchSeason: wx.getStorageSync('matchSeason'), matchSeason: wx.getStorageSync('matchSeason'),
}) })
} }
}, },
/** /**
...@@ -108,26 +111,7 @@ Page({ ...@@ -108,26 +111,7 @@ Page({
* 日历初次渲染完成后触发事件,如设置事件标记 * 日历初次渲染完成后触发事件,如设置事件标记
*/ */
afterCalendarRender(e) { afterCalendarRender(e) {
console.log('afterCalendarRender', e); console.log('===afterCalendarRender', e);
},
afterTapDay1 : function(options){
const selectedDay = this.calendar.getSelectedDay(options);
console.log("===="+selectedDay);
},
afterTapDay(e) {
const options = {
lunar: false // 在配置showLunar为false, 但需返回农历信息时使用该选项
}
const todoLabels = this.calendar.getTodoLabels(options);
console.log("todoLabels", todoLabels);
const selectedDay = this.calendar.getSelectedDay(options);
console.log("selectedDay", selectedDay);
console.log('afterTapDay', e.detail); // => { currentSelect: {}, allSelectedDays: [] }
this.calendar.setTodoLabels({ this.calendar.setTodoLabels({
// 待办点标记设置 // 待办点标记设置
...@@ -185,14 +169,31 @@ Page({ ...@@ -185,14 +169,31 @@ Page({
todoText: '红丹魄白丹魄', todoText: '红丹魄白丹魄',
color: '#f40' // 单独定义代办颜色 (标记点、文字) color: '#f40' // 单独定义代办颜色 (标记点、文字)
}, },
{
year: 2020,
month: 8,
day: 31,
todoText: '罗翌的酒市集',
color: '#f40' // 单独定义代办颜色 (标记点、文字)
},
]
});
},
afterTapDay(e) {
const options = {
lunar: false // 在配置showLunar为false, 但需返回农历信息时使用该选项
}
const todoLabels = this.calendar.getTodoLabels(options);
console.log("===todoLabels", todoLabels);
const selectedDay = this.calendar.getSelectedDay(options);
] console.log("===selectedDay", selectedDay);
}); console.log('===afterTapDay', e.detail); // => { currentSelect: {}, allSelectedDays: [] }
}, },
......
// pages/my/my.js // pages/my/my.js
...@@ -39,9 +39,9 @@ Page({ ...@@ -39,9 +39,9 @@ Page({
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '酒肆活动', title: '酒肆活动',
}); });
log.info("my_onLoad_nyxCode", _this.data.nyxCode) console.log("my_onLoad_nyxCode", _this.data.nyxCode)
log.info("my_onLoad_authStatus", _this.data.authStatus) console.log("my_onLoad_authStatus", _this.data.authStatus)
log.info("my_onLoad_userInfo", _this.data.userInfo) console.log("my_onLoad_userInfo", _this.data.userInfo)
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论