758584ce by simon

no message

1 parent d1e9e01c
{
"pages": [
"pages/index/index",
"pages/user-center/user-center",
"pages/gift-shop/gift-shop",
"pages/index/index",
"pages/gift-detail/gift-detail",
"pages/scan-result/scan-result",
"pages/contact/contact",
......
......@@ -6,7 +6,7 @@ Component({
// 这里定义了innerText属性,属性值可以在组件使用时指定
innerText: {
type: String,
value: 'default value',
value: '这里空空如也~',
},
emptyVisible: {
type: Boolean,
......
<view class="empty-tips" >
<view class="tips">
<span class="iconfont iconempty"></span>
<view class="tips">这里空空如也~</view>
<view class="tips">{{innerText}}</view>
</view>
</view>
......
......@@ -18,6 +18,10 @@ Component({
innerButton: {
type: String,
value: '确定',
},
item: {
type: Object,
value: {}
}
},
data: {
......
......@@ -2,16 +2,16 @@
<view class="cspace"></view>
<view class="cont">
<view class="tit tit1">在190701-190714周期中</view>
<view class="tit tit2">推广积分排行第一名</view>
<view class="tit tit3">恭喜获得88元现金红包</view>
<view class="tit tit2">{{item.activityName}}</view>
<view class="tit tit3">{{item.prizeName}}</view>
<!-- 红包 -->
<!-- <block>
<block wx:if="{{item.prizeType == 'packet'}}">
<image class="prize" mode="aspectFit" src="../../image/prize/prize-red-package.png" />
<view></view>
<text class="tips">经后台审核通过后,红包将通过公众号消息或微信服务消息发放,届时请及时领取!</text>
</block> -->
</block>
<!-- 积分 -->
<block>
<block wx:else>
<image class="prize" mode="aspectFit" src="../../image/prize/prize-integral.png" />
<view></view>
<text class="tips">后台审核通过后,积分将会直接派送到您的账户上,可在积分明细中查看!</text>
......
......@@ -43,7 +43,7 @@
<view class="border focus">
<image bindtap="onPreviewImageHandler" class="qrcode" mode="widthFix" src="{{qrcodeUrl}}" />
<view class="tips">更多讯息,欢迎关注我们的公众号</view>
<view bindtap="onPreviewImageHandler" class="btn">一键关注</view>
<!-- <view bindtap="onPreviewImageHandler" class="btn">一键关注</view> -->
</view>
</view>
</view>
......@@ -51,3 +51,4 @@
<van-popup show="{{ authorizeVisible }}">
<authorize-comp bind:evtcomp="evtcomp"></authorize-comp>
</van-popup>
......
......@@ -100,21 +100,24 @@ Page({
success(res) {
// 扫码结果
let result = res.result;
console.log("res:", res);
wx.showToast({
title: "res:" + res.result,
icon: "none"
})
let {
qrCodeCode,
memberCode
} = result;
// wx.showToast({
// title: "res:" + res.result,
// icon: "none"
// })
},
fail(err) {
console.log("err:", err);
wx.showToast({
title: "err:" + res.result,
icon: "none"
})
}
})
},
//
hideMask() {
this.setData({
productDetailVisible: false
......
......@@ -95,6 +95,7 @@
</view>
</view>
<empty-tips wx:if="{{dataList.length <= 0}}"></empty-tips>
</view>
</view>
<van-popup show="{{ authorizeVisible }}">
......
......@@ -18,6 +18,7 @@ Page({
},
initData() {
this.queryMember().then((result) => {
});
},
/**
......@@ -29,13 +30,15 @@ Page({
url: app.api.member,
data: {}
}).then((result) => {
let userInfo = result
this.setData({
userInfo: result
userInfo
})
let tlMemberCode = userInfo.memberCode;
// 设置二维码
let qrSize = this.setCanvasSize(440);
let codeContent = "xxx";
let codeContent = `tlMemberCode=${tlMemberCode}`
this.createQrCode(codeContent, 'qrcanvas', qrSize.w, qrSize.h);
resolve();
......
......@@ -9,7 +9,7 @@
<view class="nickname">{{userInfo.nickname}}</view>
<!-- <image class="qrcode" mode="widthFix" src="../../image/icon/icon-default-qrcode.png" /> -->
<image wx:if="{{qrImagePath}}" class="qrcode" mode="widthFix" src="{{qrImagePath}}" />
<canvas wx:else class="qrcode" canvas-id="qrcanvas" />
<canvas wx:else class="qrcode" style="visibility: hidden;" canvas-id="qrcanvas" />
<view class="t1">深士照明</view>
<view class="t1 t2">扫码即获专属积分,兑换超值奖品</view>
</view>
......
import {
getBindtapData
} from '../../utils/util';
let app = getApp();
Page({
data: {
authorizeVisible: false,
giftRankTipsCompVisible: true,
giftRankTipsCompVisible: false,
total: 0,
page: 1,
size: 10,
dataList: [],
item: {}
},
onShareAppMessage() {},
showAuth() {
......@@ -10,7 +19,78 @@ Page({
authorizeVisible: true
})
},
onLoad(options) {},
onLoad(options) {
this.initData();
},
initData() {
this.queryActivityPrize();
},
// 到达底部
onReachBottom() {
if (this.data.dataList.length < this.data.total) {
this.setData({
page: this.data.page + 1
});
this.queryOrder();
}
},
// 重置页面列表 点击搜索条件时需要
resetPage() {
this.setData({
page: 1,
dataList: []
})
},
/**
* 排行奖励明细
*/
queryActivityPrize() {
return new Promise((resolve, reject) => {
app.post({
url: app.api.activityPrize,
data: {
page: this.data.page,
size: this.data.size,
}
}).then((result) => {
let dataList = result.list;
dataList = this.data.dataList.concat(dataList);
this.setData({
dataList: dataList,
total: result.total
})
resolve();
})
});
},
/**
* 领取奖励
* @param {*} evt
*/
onReceiveHandler(evt) {
let curData = getBindtapData(evt);
let curIndex = getBindtapData(evt, "index");
let dataList = this.data.dataList;
app.post({
url: app.api.activityPrizeGet,
data: {
activityCode: curData.activityCode
}
}).then((result) => {
dataList[curIndex].acceptType = 1;
this.setData({
dataList: dataList,
item: curData,
giftRankTipsCompVisible: true
})
})
},
// 隐藏蒙层
hideMask() {
this.setData({
......
......@@ -69,6 +69,10 @@ $contentWidth:690px;
@include cb(120px, 60px);
margin-right: 20px;
}
.disable{
background-color: #999999;
}
}
}
}
......
......@@ -5,7 +5,20 @@
<view class="top-space"></view>
<view class="content">
<view class="gift">
<view class="border gift-item">
<view wx:for="{{dataList}}" wx:key="{{index}}" class="border gift-item">
<view class="prize">
<image wx:if="{{item.prizeType == 'packet'}}" class="image" mode="aspectFit" src="../../image/icon/icon-gift-red-package.png" />
<image wx:else class="image" mode="aspectFit" src="../../image/icon/icon-gift-integral.png" />
</view>
<view class="cont">
<view class="t1">{{item.prizeName}}</view>
<view class="t1 t2">190701-190714</view>
<view class="t1 t3">{{item.activityName}}</view>
</view>
<view bindtap="onReceiveHandler" wx:if="{{item.acceptType == 0}}" data-data="{{item}}" data-index="{{index}}" class="btn">领取</view>
<view wx:if="{{item.acceptType == 1}}" class="btn">已领取</view>
</view>
<!-- <view class="border gift-item">
<view class="prize">
<image class="image" mode="aspectFit" src="../../image/icon/icon-gift-red-package.png" />
</view>
......@@ -25,15 +38,16 @@
<view class="t1 t2">190701-190714</view>
<view class="t1 t3">推广积分排行第一名</view>
</view>
<view class="btn">领取</view>
</view>
<view class="btn disable">已领取</view>
</view> -->
</view>
</view>
<empty-tips inner-text="还没活动奖励哦~" wx:if="{{dataList.length <= 0}}"></empty-tips>
</view>
</view>
<van-popup show="{{ authorizeVisible }}">
<authorize-comp bind:evtcomp="evtcomp"></authorize-comp>
</van-popup>
<van-popup show="{{ giftRankTipsCompVisible }}">
<gift-rank-tips-comp bind:evtcomp="evtcomp"></gift-rank-tips-comp>
<gift-rank-tips-comp bind:evtcomp="evtcomp" item="{{item}}"></gift-rank-tips-comp>
</van-popup>
......
......@@ -7,6 +7,12 @@ Page({
data: {
authorizeVisible: false,
navIndex: 0,
status: "promotion",
turnsIndex: 0, //轮次 0:本轮 1:历史
rankInfo: {},
historyRankInfoList: [],
historyIndex: 0,
},
onShareAppMessage() {},
showAuth() {
......@@ -14,9 +20,100 @@ Page({
authorizeVisible: true
})
},
onLoad(options) {},
onLoad(options) {
this.initData();
},
initData() {
this.refreshStatus();
},
/**
* 推广积分排行
*/
queryActivity() {
return new Promise((resolve, reject) => {
this.setData({
rankInfo: {}
})
let status = this.data.status;
app.post({
url: app.api.activity,
data: {
key: status
}
}).then((result) => {
let rankInfo = this.formatRankInfo(result, status);
this.setData({
rankInfo: rankInfo
})
resolve();
})
});
},
/**
* 推广积分排行
*/
queryActivityHistory() {
return new Promise((resolve, reject) => {
this.setData({
rankInfo: {}
})
let status = this.data.status;
app.post({
url: app.api.activityHistory,
data: {
page: 1,
size: 999999,
key: this.data.status
}
}).then((result) => {
let historyRankInfoList = result.list;
this.setData({
historyRankInfoList: historyRankInfoList
})
console.log("historyRankInfoList:", historyRankInfoList);
this.setHistory();
resolve();
})
});
},
/**
* 格式化
*/
formatRankInfo(val, status) {
let rankInfo = val;
if (status == "promotion") {
rankInfo.myMember.rank = rankInfo.myMember.promotionNo;
rankInfo.myMember.points = rankInfo.myMember.promotionPoints;
rankInfo.memberList.forEach(element => {
element.rank = element.promotionNo;
element.points = element.promotionPoints;
});
} else {
rankInfo.myMember.rank = rankInfo.myMember.rankNo;
rankInfo.myMember.points = rankInfo.myMember.rankPoints;
rankInfo.memberList.forEach(element => {
element.rank = element.rankNo;
element.points = element.rankPoints;
});
}
return rankInfo;
},
/**
* 设置
*/
setHistory() {
let index = this.data.historyIndex;
let status = this.data.status;
let historyRankInfoList = this.data.historyRankInfoList
let rankInfo = this.formatRankInfo(historyRankInfoList[index], status);
this.setData({
rankInfo
})
console.log("rankInfo:", rankInfo);
},
/**
......@@ -28,11 +125,66 @@ Page({
let curIndex = getBindtapData(evt, "index");
if (navIndex != curIndex) {
this.setData({
navIndex: curIndex
navIndex: curIndex,
turnsIndex: 0,
historyIndex: 0,
})
}
this.refreshStatus();
},
// 选择轮次 历史/本轮
onChangeTurnsHandler(evt) {
let turnsIndex = this.data.turnsIndex;
let curIndex = getBindtapData(evt, "index");
if (turnsIndex != curIndex) {
this.setData({
turnsIndex: curIndex
});
this.queryActivityHistory();
}
},
/**
* 拾取历史活动
*/
bindHistoryChange(e) {
let index = e.detail.value;
this.setData({
historyIndex: index,
})
this.setHistory()
},
/**
* 刷新状态重新请求
*/
refreshStatus() {
let status = "";
let navIndex = this.data.navIndex + "";
switch (navIndex) {
// 全部
case "0":
status = "promotion";
break;
// 购买积分
case "1":
status = "rank";
break;
default:
break;
}
this.setData({
status: status
})
// this.resetPage();
this.queryActivity();
},
/**
* 排行榜奖励
* @param {*} evt
......
......@@ -79,29 +79,53 @@ $contentWidth:690px;
&-item {
width: 50%;
// .pubish {
display: flex;
align-items: center;
flex-wrap: wrap;
.t1 {
color: #666666;
font-size: 24px;
padding: 5px 0;
}
.t2 {}
// 本轮排行
.pubish {
display: flex;
align-items: center;
flex-wrap: wrap;
.func {
@extend .fcc;
height: 80px;
font-size: 32px;
color: #3680EB;
background: #F5F8FE;
border-radius: 8px;
@extend .bb;
padding: 0 12px;
.icon {
width: 32px;
height: 32px;
margin: 0 8px;
}
.arrow {
width: 12px;
height: 8px;
margin: 0 8px;
}
}
.t1 {
color: #666666;
font-size: 24px;
padding: 5px 0;
}
.t2 {}
.c1 {
color: #FF7900;
}
.c2 {
color: #3680EB;
}
.c1 {
color: #FF7900;
}
.c2 {
color: #3680EB;
}
// }
.mode {
width: 220px;
height: 56px;
......@@ -136,7 +160,7 @@ $contentWidth:690px;
}
.t2 {
margin-left: 172px;
margin-left: 150px;
}
.t3 {
......@@ -178,7 +202,7 @@ $contentWidth:690px;
.no {
width: 72px;
padding-right: 76px;
padding-right: 54px;
@extend .fcc;
// text-align: center;
// height: $itemHeight;
......@@ -191,15 +215,19 @@ $contentWidth:690px;
}
.user {
flex: 1;
display: flex;
align-items: center;
font-size: 32px;
width: 300px;
// background-color: wheat;
@include no-wrap();
overflow-x: hidden;
.avatar {
width: 72px;
height: 72px;
margin-right: 12px;
border-radius: 36px;
}
}
......@@ -225,7 +253,7 @@ $contentWidth:690px;
// 按钮容器
.btn-wrap {
position: relative;
margin: 20px auto 0;
margin: 36px auto 0;
.btn {
position: relative;
......
<view class="page">
<view class="app__bgc bgc"></view>
<!-- <view class="app__bg bg"></view> -->
<image class="bg" mode="widthFix" src="../../image/rank/rank-c1.png" />
<view class="app__content main">
<view class="top-space"></view>
......@@ -11,7 +10,7 @@
<view class="tit">推广积分排行</view>
<view class="line"></view>
</view>
<view bindtap="onNavSelectHandler" data-index="1" class="nav-item {{navIndex == 1 ? 'nav-item-act':''}}">
<view bindtap="onNavSelectHandler" data-index="1" class="nav-item {{navIndex == 1 ? 'nav-item-act':''}}">
<view class="tit">总积分排行</view>
<view class="line"></view>
</view>
......@@ -21,24 +20,39 @@
<!-- 功能区 -->
<view class="rank-func">
<view class="rank-func-item">
<view class="pubish">
<view wx:if="{{turnsIndex == 0}}" class="pubish">
<view class="t1">
本轮周期:
<span>7.1-7.14</span>
<span>{{rankInfo.activityName}}</span>
</view>
<!-- <view class="t1 t2">
<view wx:if="{{status == 'promotion'}}" class="t1 t2">
本轮奖品:
<span class="c1">88元红包</span>
</view> -->
<view class="t1 t2">
<span class="c1">{{rankInfo.prizeName}}</span>
</view>
<view wx:if="{{status == 'rank'}}" class="t1 t2">
我的名次:
<span class="c2">12</span>
<span class="c2">{{rankInfo.myMember.rank || '-'}}</span>
</view>
</view>
<view wx:else class="pubish">
<picker value="{{historyIndex}}" range="{{historyRankInfoList}}" range-key="activityName" bindchange="bindHistoryChange">
<view class="func">
<image class="icon" mode="aspectFit" src="../../image/icon/icon-sign-record.png" />
{{rankInfo.activityName}}
<image class="arrow" mode="aspectFit" src="../../image/icon/icon-filter-down-on.png" />
{{dateStart}}
</view>
</picker>
</view>
</view>
<view class="rank-func-item pubish fje">
<view class="mode">查看历史排行</view>
<view wx:if="{{turnsIndex == 0}}" data-index="1" bindtap="onChangeTurnsHandler" class="mode">
查看历史排行
</view>
<view wx:if="{{turnsIndex == 1}}" data-index="0" bindtap="onChangeTurnsHandler" class="mode">
返回本轮排行
</view>
</view>
</view>
<!-- 标题 -->
......@@ -49,63 +63,16 @@
</view>
<!-- 排行item -->
<scroll-view bindscrolltolower="onRankScrolltolower" scroll-y="{{true}}" class="item-wrap">
<view class="rank-item rank-item-first">
<view wx:for="{{rankInfo.memberList}}" wx:key="{{index}}" class="rank-item {{item.rank == '1' ? 'rank-item-first':''}}">
<view class="no">
<image class="medal" mode="aspectFit" src="../../image/icon/icon-medal.png" />
</view>
<view class="user">
<image class="avatar" mode="widthFix" src="../../image/icon/icon-default-avatar.png" />
nickname
</view>
<view class="integral">1000</view>
</view>
<view class="rank-item">
<view class="no">2</view>
<view class="user">
<image class="avatar" mode="widthFix" src="../../image/icon/icon-default-avatar.png" />
nickname
</view>
<view class="integral">1000</view>
</view>
<view class="rank-item">
<view class="no">2</view>
<view class="user">
<image class="avatar" mode="widthFix" src="../../image/icon/icon-default-avatar.png" />
nickname
<image wx:if="{{item.rank == '1'}}" class="medal" mode="aspectFit" src="../../image/icon/icon-medal.png" />
<span wx:else>{{item.rank}}</span>
</view>
<view class="integral">1000</view>
</view>
<view class="rank-item">
<view class="no">2</view>
<view class="user">
<image class="avatar" mode="widthFix" src="../../image/icon/icon-default-avatar.png" />
nickname
</view>
<view class="integral">1000</view>
</view>
<view class="rank-item">
<view class="no">2</view>
<view class="user">
<image class="avatar" mode="widthFix" src="../../image/icon/icon-default-avatar.png" />
nickname
</view>
<view class="integral">1000</view>
</view>
<view class="rank-item">
<view class="no">2</view>
<view class="user">
<image class="avatar" mode="widthFix" src="../../image/icon/icon-default-avatar.png" />
nickname
</view>
<view class="integral">1000</view>
</view>
<view class="rank-item">
<view class="no">2</view>
<view class="user">
<image class="avatar" mode="widthFix" src="../../image/icon/icon-default-avatar.png" />
nickname
<image class="avatar" mode="widthFix" src="{{item.avatar}}" />
{{item.nickname}}
</view>
<view class="integral">1000</view>
<view class="integral">{{item.points}}</view>
</view>
</scroll-view>
<!-- 省略号 -->
......@@ -114,19 +81,19 @@
<view class="my-rank">
<view class="rank-item">
<view class="no">
1
<!-- <image class="medal" mode="aspectFit" src="../../image/icon/icon-medal.png" /> -->
<image wx:if="{{rankInfo.myMember.rank == 1}}" class="medal" mode="aspectFit" src="../../image/icon/icon-medal.png" />
<span wx:else>{{rankInfo.myMember.rank || '-'}}</span>
</view>
<view class="user">
<image class="avatar" mode="widthFix" src="../../image/icon/icon-default-avatar.png" />
nickname
<image class="avatar" mode="widthFix" src="{{rankInfo.myMember.avatar}}" />
{{rankInfo.myMember.nickname}}
</view>
<view class="integral">300</view>
<view class="integral">{{rankInfo.myMember.points}}</view>
</view>
</view>
</view>
<!-- 我的奖励按钮 -->
<view class="btn-wrap">
<view wx:if="{{status == 'promotion'}}" class="btn-wrap">
<view bindtap="onRankGiftHandler" class="btn">
<image class="integral" mode="aspectFit" src="../../image/icon/icon-rank-rewrad.png" />
我的奖励
......
......@@ -45,11 +45,13 @@ Page({
toast: false,
url: app.api.sign,
}).then((result) => {
this.querySignInfo().then((result2) => {
// 签到成功
this.setData({
signPrize: result2,
giftSignTipsCompVisible: true
this.queryMember().then((result) => {
this.querySignInfo().then((result2) => {
// 签到成功
this.setData({
signPrize: result2,
giftSignTipsCompVisible: true
})
})
})
}).catch((err) => {
......