Commit 1e42909d authored by lvtz's avatar lvtz

fix

parent 4468cbdf
......@@ -11,6 +11,19 @@ function formatDate (date) {
var minute = mi < 10 ? '0' + mi : mi;
return y + '-' + month + '-' + day + ' ' + hour + ':' + minute;
}
function formatDateRemoveYear (date) {
var time = getDate(date * 1000);
var y = time.getFullYear();
var m = time.getMonth() + 1;
var month = m < 10 ? '0' + m : m;
var d = time.getDate();
var day = d < 10 ? '0' + d : d;
var h = time.getHours();
var hour = h < 10 ? '0' + h : h;
var mi = time.getMinutes();
var minute = mi < 10 ? '0' + mi : mi;
return month + '-' + day + ' ' + hour + ':' + minute;
}
function formatDateToSecond (date) {
var time = getDate(date * 1000);
var y = time.getFullYear();
......@@ -38,7 +51,8 @@ function timeCompare (date) {
} else if (timestampCompare < oneDayTimestamp) { // 一小时到24小时之间
text = Math.round(timestampCompare / 1000 / 60 / 60) + '小时前';
} else { // 一天以外
text = formatDate(date);
// text = formatDate(date);
text = formatDateRemoveYear(date)
}
return text
}
......@@ -211,5 +225,6 @@ module.exports = {
inputMaxlengthResolve: inputMaxlengthResolve,
formatDateToSecond: formatDateToSecond,
calculateRate: calculateRate,
gifvideoPoster:gifvideoPoster
gifvideoPoster:gifvideoPoster,
formatDateRemoveYear:formatDateRemoveYear
}
\ No newline at end of file
......@@ -92,7 +92,7 @@
</button>
</form>
<view class="big-title" hover-class="none" hover-stop-propagation="false">{{themeSelect.title}}</view>
<view class="big-time" hover-class="none" hover-stop-propagation="false">{{themeSelect.created_at}}</view>
<!-- <view class="big-time" hover-class="none" hover-stop-propagation="false">{{themeSelect.created_at}}</view> -->
</view>
<view class="" hover-class="none" hover-stop-propagation="false"
wx:if="{{(!noUser && auditStatus == 3) || themeSelect.is_encrypt == 0}}">
......
......@@ -143,8 +143,7 @@
</form>
<view class="big-title" hover-class="none" hover-stop-propagation="false">{{themeSelect.title}}
</view>
<view class="big-time" hover-class="none" hover-stop-propagation="false">{{themeSelect.created_at}}
</view>
<!-- <view class="big-time" hover-class="none" hover-stop-propagation="false">{{themeSelect.created_at}}</view> -->
</view>
<view class="" hover-class="none" hover-stop-propagation="false"
wx:if="{{(!noUser && auditStatus == 3) || themeSelect.is_encrypt == 0}}">
......
......@@ -75,8 +75,7 @@
</button>
</form>
<view class="big-title" hover-class="none" hover-stop-propagation="false">{{themeSelect.title}}</view>
<view class="big-time" hover-class="none" hover-stop-propagation="false">{{themeSelect.created_at}}
</view>
<!-- <view class="big-time" hover-class="none" hover-stop-propagation="false">{{themeSelect.created_at}}</view> -->
</view>
<view class="" hover-class="none" hover-stop-propagation="false"
wx:if="{{(!noUser && auditStatus == 3) || themeSelect.is_encrypt == 0}}">
......
......@@ -210,6 +210,7 @@ Page({
consumer_id: visitor && visitor.id || 0
}).then((res) => {
const {data, code} = res;
console.log('用户信息',res)
if (code == 30005) {
this.setData({
noUserinfo: true
......@@ -217,7 +218,6 @@ Page({
}
if (code == 200) {
if (data) {
console.log(data)
this.setData({
userInfo: data,
noUserinfo: false,
......@@ -412,11 +412,27 @@ Page({
})
},
goMytask() {
if(this.data.noUserinfo){
wx.showToast({
title: '您还未加入该校区',
duration: 2000,
icon: 'none'
})
return
}
wx.navigateTo({
url: `/src/pages/mytask/index?sid=${this.data.sid}`,
})
},
goFeedback() {
if(this.data.noUserinfo){
wx.showToast({
title: '您还未加入该校区',
duration: 2000,
icon: 'none'
})
return
}
wx.navigateTo({
url: `/src/pages/feedback/index?sid=${this.data.sid}`,
})
......@@ -427,11 +443,27 @@ Page({
})
},
goScoreMall () {
if(this.data.noUserinfo){
wx.showToast({
title: '您还未加入该校区',
duration: 2000,
icon: 'none'
})
return
}
wx.navigateTo({
url: `/src/pages/mall/index?sid=${this.data.sid}`,
})
},
goMyScoreIndex () {
if(this.data.noUserinfo){
wx.showToast({
title: '您还未加入该校区',
duration: 2000,
icon: 'none'
})
return
}
wx.navigateTo({
url: `/src/pages/myscoreindex/index?sid=${this.data.sid}`,
})
......@@ -442,6 +474,14 @@ Page({
})
},
goMyAchievement () {
if(this.data.noUserinfo){
wx.showToast({
title: '您还未加入该校区',
duration: 2000,
icon: 'none'
})
return
}
const visitor = LocalStorage.getItem('visitor');
wx.navigateTo({
url: `/src/pages/myachievement/index?sid=${this.data.sid}&custormeId=${visitor && visitor.id || 0}`,
......@@ -449,18 +489,42 @@ Page({
},
// 积分排行榜
toPointsRankList () {
if(this.data.noUserinfo){
wx.showToast({
title: '您还未加入该校区',
duration: 2000,
icon: 'none'
})
return
}
wx.navigateTo({
url: `/src/pages/rankingList/index?sid=${this.data.sid}&tag=2`
})
},
// 消息
toMyNews () {
if(this.data.noUserinfo){
wx.showToast({
title: '您还未加入该校区',
duration: 2000,
icon: 'none'
})
return
}
wx.navigateTo({
url: `/src/pages/mynews/index?sid=${this.data.sid}`
})
},
// 成长记录
goGrowthRecord() {
if(this.data.noUserinfo){
wx.showToast({
title: '您还未加入该校区',
duration: 2000,
icon: 'none'
})
return
}
const visitor = LocalStorage.getItem('visitor');
const userInfo = this.data.userInfo
wx.navigateTo({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment