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

update

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