Commit 5614b819 authored by 秦海涛's avatar 秦海涛

update

parent 26cfb9a5
<dialog-wrap <dialog-wrap
title="中奖信息" title="中奖信息"
visible="{{false}}" visible="{{visible}}"
onClose="onCloseDialog" onClose="onCloseDialog"
width="800" width="1000"
> >
<view class="rank-dialog-wrap"> <view class="rank-dialog-wrap">
<!-- <view class="other-winner-list"> <!-- <view class="other-winner-list">
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
key="{{item.key}}" key="{{item.key}}"
> --> > -->
<view class="now-winner-list"> <view class="now-winner-list">
<button type="primary">导出中奖名单</button> <button type="primary" onTap="exportWinnerList">导出中奖名单</button>
</view> </view>
<table dataSource="{{dataSource}}"> <table dataSource="{{list}}">
<table-column a:for="{{columns}}" a:key="*this" title="{{item.title}}" dataIndex="{{item.prop}}"/> <table-column a:for="{{columns}}" a:key="*this" title="{{item.title}}" dataIndex="{{item.prop}}" width="{{item.width}}"/>
</table> </table>
<view class="rank-pagination"> <view class="rank-pagination">
<text class="rank-pagination-text">共{{pageInfo.total}}条</text> <text class="rank-pagination-text">共{{list.length}}条</text>
<pagination shape="arrow-only" hideOnlyOnePage="true" defaultCurrent="1" current="{{pageInfo.pageNo}}" pageSize="{{pageInfo.pageSize}}" onChange="changePagination" pageShowCount="100" total="{{pageInfo.total}}" /> <pagination shape="arrow-only" hideOnlyOnePage="true" defaultCurrent="1" current="{{pageInfo.pageNo}}" pageSize="{{pageInfo.pageSize}}" onChange="changePagination" pageShowCount="100" total="{{pageInfo.total}}" />
</view> </view>
<!-- </tab-item> <!-- </tab-item>
......
...@@ -41,20 +41,22 @@ Component({ ...@@ -41,20 +41,22 @@ Component({
columns: [ columns: [
{ title: '排名', prop: 'rank' }, { title: '排名', prop: 'rank' },
{ title: '用户昵称', prop: 'userNick' }, { title: '用户昵称', prop: 'userNick' },
{ title: '奖品类型', prop: 'type' }, { title: '奖品类型', prop: 'typeName' },
{ title: '奖品名称', prop: 'name' }, { title: '奖品名称', prop: 'prizeName' },
{ title: '收货人', prop: 'receiveName' }, { title: '收货人', prop: 'receiveName' },
{ title: '联系方式', prop: 'phone' }, { title: '联系方式', prop: 'phone' },
{ title: '收货地址', prop: 'address' } { title: '收货地址', prop: 'address', width: 240 }
], ],
pageInfo: { pageInfo: {
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
total: 0 total: 0
} },
}, },
props: { props: {
avtivityId: '', onClose: () => {},
list: [],
selectedItem: {},
}, },
didMount() {}, didMount() {},
didUpdate() {}, didUpdate() {},
...@@ -71,20 +73,27 @@ Component({ ...@@ -71,20 +73,27 @@ Component({
}) })
}, },
onCloseDialog() {
this.props.onClose && this.props.onClose();
},
// 导出中奖名单 // 导出中奖名单
async exportWinnerList(evt) { async exportWinnerList(evt) {
const { avtivityId } = this.props; const { activityId, title } = this.props.selectedItem;
const { type } = evt.target.dataset; const { type } = evt.target.dataset;
my.showLoading({ content: "生成文件中..." }); my.showLoading({ content: "生成文件中..." });
try { try {
const { success, data, message } = await uploadDataCreateFile({ const { success, data, message } = await uploadDataCreateFile({
activityId, activityId,
isObject: false, title
}); });
my.hideLoading(); my.hideLoading();
if (success) { if (success) {
await setClipboard({ text: data.url.replace(/amp;/g, "") }); await setClipboard({ text: data.url.replace(/amp;/g, "") });
my.showToast({
type: 'success',
content: '下载链接复制成功,请在浏览器中打开下载'
});
this.setData({ this.setData({
exportDialogVisible: true, exportDialogVisible: true,
exportUrl: data.url.replace(/amp;/g, "") exportUrl: data.url.replace(/amp;/g, "")
......
...@@ -6,12 +6,7 @@ Component({ ...@@ -6,12 +6,7 @@ Component({
props: { props: {
visible: false, visible: false,
onClose: () => {}, onClose: () => {},
list: [ list: [],
{
rank: '1-3',
winnerDetailList: []
}
],
selectedItem: {} selectedItem: {}
}, },
didMount() {}, didMount() {},
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
onClose="onCloseConfirmDialog" onClose="onCloseConfirmDialog"
onConfirm="onConfirmDelete" onConfirm="onConfirmDelete"
/> />
<winner-list-dialog visible="{{winnerListDialogVisible}}" onClose="onCloseWinnerListDialog" list="{{winnerList}}" selectedItem="{{selectedItem}}"/>
<rank-dialog /> <rank-dialog visible="{{winnerListDialogVisible}}" onClose="onCloseWinnerListDialog" list="{{winnerList}}" selectedItem="{{selectedItem}}"/>
\ No newline at end of file \ No newline at end of file
...@@ -97,7 +97,12 @@ Component({ ...@@ -97,7 +97,12 @@ Component({
if (success) { if (success) {
this.setData({ this.setData({
winnerListDialogVisible: true, winnerListDialogVisible: true,
winnerList: data, winnerList: data.map(v => {
return {
...v,
typeName: v.type == 1 ? '优惠券': '实物'
}
}),
selectedItem: evt.target.dataset.x.record selectedItem: evt.target.dataset.x.record
}) })
} }
......
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