``
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title" @tap='clickHandler'>导出</text>
</view>
</view>
</template>
<script>
let doExport = require('@/js_sdk/exportExcel/exportExcel.js');
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
clickHandler(){
var Excel_list = []
Excel_list.push([
{content: '序号',width: '200px',height: '25px',},
{content: '批次',width: '200px',height: '25px',},
{content: '发生日期',width: '200px',height: '25px',},
{content: '客户名称',width: '200px',height: '25px',},
{content: '店员',width: '200px',height: '25px',},
{content: '款号',width: '200px',height: '25px',},
{content: '名称',width: '200px',height: '25px',},
{content: '颜色',width: '200px',height: '25px',},
{content: '尺码',width: '200px',height: '25px',},
{content: '数量',width: '200px',height: '25px',},
{content: '发货情况',width: '200px',height: '25px',},
{content: '品牌',width: '200px',height: '25px',},
])
doExport('销售报表',Excel_list,this.ExportCall)
},
ExportCall(e){
var url = ''
if(plus.os.name == 'Android'){
url = '/storage/emulated/0'
}else if(plus.os.name == 'iOS'){
url = 'file://'
}
console.log(url+e);
uni.openDocument({
filePath:url+e,
success(res) {
console.log(res);
},
fail(e) {
console.log(e);
}
})
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>
``