Commit a5a905b1 authored by Edwise's avatar Edwise 🍷

nice

parent fe271968
...@@ -44,6 +44,13 @@ Component({ ...@@ -44,6 +44,13 @@ Component({
for (let i = 0; i < data.list.length; i++) { for (let i = 0; i < data.list.length; i++) {
data.list[i].createTime = this.getTime1(parseInt(data.list[i].createTime)); data.list[i].createTime = this.getTime1(parseInt(data.list[i].createTime));
console.log(data.list[i].createTime) console.log(data.list[i].createTime)
let len = data.list[i].userNick.length;
let str = data.list[i].userNick;
if(len<=4){
data.list[i].userNick = str.substr(0,0)+this.changeStr+str.substr(len-1,len-1);
}else{
data.list[i].userNick = str.substr(0,Math.floor((len-3)/2))+this.changeStr+str.substr(len-Math.floor((len-3)/2)-1,len-1)
}
} }
console.log(data.list); console.log(data.list);
this.setData({ this.setData({
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
font-weight: bolder; font-weight: bolder;
} }
.task .task_item .task_award { .task .task_item .task_award {
width: 118rpx; width: 140rpx;
height: 24rpx; height: 24rpx;
opacity: 1; opacity: 1;
left: 138rpx; left: 138rpx;
......
...@@ -71,7 +71,8 @@ Component({ ...@@ -71,7 +71,8 @@ Component({
} = e.target.dataset; } = e.target.dataset;
const { const {
taskType, taskType,
sellerId sellerId,
rewards
} = item; } = item;
const { const {
success, success,
...@@ -101,12 +102,12 @@ Component({ ...@@ -101,12 +102,12 @@ Component({
// } // }
console.log('taskType', taskType) console.log('taskType', taskType)
if (taskType == 'invites') // if (taskType == 'invites')
str = `成功邀请${data.times}名好友,奖励为精力值+${data.energy}` str = `任务完成,增加${rewards}个温暖值`
commonToast(str || '领取成功'); commonToast(str || '领取成功');
} }
/**领取成功,增加温暖值 */ /**领取成功,增加温暖值 */
my.__updateWarms&&my.__updateWarms();
await this.getTaskList() await this.getTaskList()
flag = 0; flag = 0;
}, },
...@@ -137,7 +138,7 @@ Component({ ...@@ -137,7 +138,7 @@ Component({
setTimeout(() => { setTimeout(() => {
flag = 0; flag = 0;
}, 1000); }, 1000);
await this.handleGoFollow(sellerId); await this.handleGoFollow(3035493001);
await this.getTaskList(); await this.getTaskList();
break; break;
case 'sign': case 'sign':
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<image class="task_favoricon " a:if="{{item.taskType=='collectGoods'}}" src={{resList['a03d17c7-c4f0-42e0-9430-be61f5eb68d5'].url}} /> <image class="task_favoricon " a:if="{{item.taskType=='collectGoods'}}" src={{resList['a03d17c7-c4f0-42e0-9430-be61f5eb68d5'].url}} />
<label class="task_title " a:if="{{item.taskType!='sign'}}">{{item.title}}</label> <label class="task_title " a:if="{{item.taskType!='sign'}}">{{item.title}}</label>
<label class="task_title " a:if="{{item.taskType=='sign'}}">{{item.title}}({{item.todayCompleteTimes}}/{{item.times}})</label> <label class="task_title " a:if="{{item.taskType=='sign'||item.taskType=='collectGoods'}}">{{item.title}}({{item.todayCompleteTimes}}/{{item.times}})</label>
<label class="task_award ">温暖值 +{{item.rewards}}</label> <label class="task_award ">温暖值 +{{item.rewards}}</label>
<block> <block>
<!-- <label class="task_progress " a:if="{{item.taskType=='invites'}}">(不限次数)</label> <!-- <label class="task_progress " a:if="{{item.taskType=='invites'}}">(不限次数)</label>
......
...@@ -128,7 +128,7 @@ Component({ ...@@ -128,7 +128,7 @@ Component({
}, () => { }, () => {
if (this.data.usePercent >= 10) { if (this.data.usePercent >= 10) {
console.log(this.data.usePercent) console.log(this.data.usePercent)
this.props.onCompleteTask(taskType) this.props.onCompleteTask(taskType,1)
clearInterval(this.timer) clearInterval(this.timer)
} }
}) })
......
...@@ -198,7 +198,7 @@ Page({ ...@@ -198,7 +198,7 @@ Page({
// console.log('查询关注店铺状态失败', err); // console.log('查询关注店铺状态失败', err);
// }); // });
my.tb.checkShopFavoredStatus({ my.tb.checkShopFavoredStatus({
id: 702037595, id: 3035493001,
success: (res) => { success: (res) => {
if(res.isFavor){ if(res.isFavor){
this.favoredStatus = true this.favoredStatus = true
......
...@@ -85,6 +85,15 @@ Page({ ...@@ -85,6 +85,15 @@ Page({
// substr // substr
} }
let str = data.myRankInfo.userNick;
let len = str.length;
if(len<=4){
data.myRankInfo.userNick = str.substr(0,0)+this.changeStr+str.substr(len-1,len-1);
}else{
data.myRankInfo.userNick = str.substr(0,Math.floor((len-3)/2))+this.changeStr+str.substr(len-Math.floor((len-3)/2)-1,len-1)
}
this.setData({ this.setData({
rankList: data.list, rankList: data.list,
myRankInfo: data.myRankInfo, myRankInfo: data.myRankInfo,
......
This diff is collapsed.
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