注册登录修改

master
Tuisku 3 years ago
parent 5bd3a35176
commit e088ca415d

@ -24,7 +24,8 @@
"pages/user/subpage/newRel/newRel",
"pages/lookup/labelsearch/brand/brandsearch",
"pages/lookup/labelsearch/tag/tagsearch",
"pages/quest/subpage/detail/subpage/shougan/shougan"
"pages/quest/subpage/detail/subpage/shougan/shougan",
"pages/lookup/lookfile/lookfile"
],
"tabBar": {
"borderStyle": "white",
@ -76,7 +77,6 @@
"l-collapse-item": "/miniprogram_npm/lin-ui/collapse-item/index",
"pic-show": "/components/picshow/picshow",
"waterf": "/components/waterf/index",
"l-calendar": "/miniprogram_npm/lin-ui/calendar/index",
"l-mask": "/miniprogram_npm/lin-ui/mask/index",
"l-badge": "/miniprogram_npm/lin-ui/badge/index"

@ -9,7 +9,8 @@
<image class="shouca" src="/images/ic_shouc@2x.png" wx:if="{{data.isCollected}}"></image>
<image class="shouca" src="" wx:else="{{true}}"></image>
<image mode="widthFix" lazy-load="{{true}}" style="width: 334rpx;border-radius:16rpx;background: linear-gradient(180deg, #599FFF 0%, #C4DDFF 100%);" src="{{data.type===1?cdn+data.coverUrl:cdn+data.fileUrl}}" data-item="{{data}}" bindtap="to" bindload="time"></image>
<image wx:if="{{!data.fileUrlSmall}}" mode="widthFix" lazy-load="{{true}}" style="width: 334rpx;border-radius:16rpx;background: linear-gradient(180deg, #599FFF 0%, #C4DDFF 100%);" src="{{data.type===1?cdn+data.coverUrl:cdn+data.fileUrl}}" data-item="{{data}}" bindtap="to" bindload="time"></image>
<image wx:if="{{data.fileUrlSmall}}" mode="widthFix" lazy-load="{{true}}" style="width: 334rpx;border-radius:16rpx;background: linear-gradient(180deg, #599FFF 0%, #C4DDFF 100%);" src="{{data.type===1?cdn+data.coverUrl:cdn+data.fileUrlSmall}}" data-item="{{data}}" bindtap="to" bindload="time"></image>
<view class="bofang" wx:if="{{data.type === 1}}">
<l-icon name="more" color="#FFFFFF"></l-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

@ -51,7 +51,7 @@ Page({
records: [],
disranking: [{
url: '/images/img_diyi@3x.png',
name: '',
name: '-',
add: ''
}, {
url: '/images/img_dier@3x.png',

@ -1,5 +1,5 @@
<!--index.wxml-->
<view style="background-color: #F9F9F9;">
<view style="background-color: #F9F9F9;min-height: 100vh;">
<!-- <view class="nav_image">
</view> -->
<!-- 顶部菜单 -->

@ -94,7 +94,7 @@
.brand_mes {
padding: 32rpx;
margin: 24rpx 32rpx 0rpx 32rpx;
height: 600rpx;
/* height: 600rpx; */
border-radius: 15rpx;
background-color: white;
display: flex;

@ -0,0 +1,235 @@
// pages/lookup/lookimg/img.js
import {
http,
matchType
} from '../../../utils/util'
Page({
/**
* 页面的初始数据
*/
data: {
data: {},
cdn: getApp().globalData.cdn,
shou: true
},
//用户点击右上角分享朋友圈
onShareTimeline() {
return {
title: this.data.data.title,
query: 'value=' + JSON.stringify(this.data.data),
imageUrl: this.data.data.fileUrl ? this.data.cdn + this.data.data.fileUrl : this.data.cdn + this.data.data.teachRefeFileUrl
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.setNavigationBarTitle({
title: '文件查看',
})
wx.setNavigationBarColor({
// frontColor: '#ffffff',
// backgroundColor: '#000000',
animation: {
duration: 400,
timingFunc: 'easeIn'
}
})
// wx.setBackgroundColor({
// backgroundColor: '#000000',
// })
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
// 获取当前场景值 以适应单页面模式
// 1154 为单页面模式的场景值
var pathData = wx.getLaunchOptionsSync()
if (pathData.scene == 1154) {
console.log(options)
var value = JSON.parse(options.value)
this.setData({
data: JSON.parse(options.value),
shou: false
})
} else {
let that = this
wx.getStorage({
key: 'file',
success(res) {
let a = matchType(res.data.fileUrl)
that.setData({
data: res.data,
'data.filetype': a
})
},
fail: {}
})
}
},
downloadfile(e) {
wx.showLoading({
title: '正在下载',
mask: true
})
console.log(e)
var url = this.data.data.fileUrl;
//下载文件,生成临时地址
wx.downloadFile({
url: this.data.cdn + url,
success(res) {
console.log(res)
//保存到本地
wx.getFileSystemManager().saveFile({
tempFilePath: res.tempFilePath,
success: function (res) {
console.log(res)
console.log('保存到本地', res)
},
fail: function (err) {
wx.showToast({
title: '保存失败',
duration: 2000,
mask: true,
});
console.log('保存失败:', err)
},
complete(res) {
wx.hideLoading();
console.log(res)
}
});
}
})
},
seefile(e) {
wx.showLoading({
title: '正在加载',
mask: true
})
var url = this.data.data.fileUrl;
//下载文件,生成临时地址
wx.downloadFile({
url: this.data.cdn + url,
success(res) {
console.log(res)
wx.openDocument({
filePath: res.tempFilePath,
showMenu: true,
success(re) {
wx.showToast({
title: '加载成功',
duration: 2000,
mask: true,
});
},
fail(re) {
wx.showToast({
title: '加载失败',
duration: 2000,
mask: true,
});
},
complete(re) {
wx.hideLoading();
}
})
}
})
},
add() {
http("/userReference/add", "post", {
referenceId: this.data.data.id
}).then(re => {
wx.showToast({
title: re.data,
icon: 'none',
duration: 2000
}).then(res => {
if (re.code === 200) {
this.setData({
'data.isCollected': 1
})
}
})
})
},
del() {
http("/userReference/del", "post", {
referenceId: this.data.data.id
}).then(re => {
wx.showToast({
title: re.data,
icon: 'none',
duration: 2000
}).then(res => {
if (re.code === 200) {
this.setData({
'data.isCollected': 0
})
}
})
})
},
to(e) {
console.log(e)
if (e.currentTarget.dataset.type === '1') {
wx.navigateTo({
url: '/pages/lookup/labelsearch/brand/brandsearch?id=' + e.currentTarget.dataset.mes.id + '&name=' + e.currentTarget.dataset.mes.name,
})
} else if (e.currentTarget.dataset.type === '2') {
wx.navigateTo({
url: '/pages/lookup/labelsearch/tag/tagsearch?id=' + e.currentTarget.dataset.mes.id + '&name=' + e.currentTarget.dataset.mes.title,
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,35 @@
<!--pages/lookup/lookfile/lookfile.wxml-->
<!--pages/lookup/lookimg/img.wxml-->
<!--utils/video/video.wxml-->
<view class="main">
<image bindtap="seefile" wx:if="{{data.filetype==='word'}}" mode="widthFix" style="width: 750rpx;" src="../../../images/img_word@2x.png"></image>
<image bindtap="seefile" wx:if="{{data.filetype==='excel'}}" mode="widthFix" style="width: 750rpx;" src="../../../images/img_excel@2x.png"></image>
<image bindtap="seefile" wx:if="{{data.filetype==='pdf'}}" mode="widthFix" style="width: 750rpx;" src="../../../images/img_pdf@2x.png"></image>
<image bindtap="seefile" wx:if="{{data.filetype==='ppt'}}" mode="widthFix" style="width: 750rpx;" src="../../../images/img_ppt@2x.png"></image>
<view class="bottom">
<view class="title">{{data.title}}</view>
<view class="cards">
<view class="card" wx:for="{{data.brandList}}" wx:key="index" data-type="1" data-mes="{{item}}" bindtap="to">{{item.name}}</view>
<view class="card" wx:for="{{data.tagList}}" wx:key="index" data-type="2" data-mes="{{item}}" bindtap="to">{{item.title}}</view>
</view>
<view class="operation" wx:if="{{shou}}">
<button class="one" plain="{{true}}" open-type="share">
<image style="width: 48rpx;height: 48rpx;" src="/images/ic_fx_bs@2x.png"></image>
分享
</button>
<button class="one" wx:if="{{data.isCollected===0}}" plain="{{true}}" bindtap="add">
<image style="width: 48rpx;height: 48rpx;" src="/images/ic_sc_bs@2x.png"></image>
收藏
</button>
<button class="one" wx:if="{{data.isCollected}}" plain="{{true}}" bindtap="del">
<image style="width: 48rpx;height: 48rpx;" src="/images/ic_shouc@2x.png"></image>
取消收藏
</button>
<button class="one" plain="{{true}}" data-url="{{data.fileUrl?cdn+data.fileUrl:cdn+data.teachRefeFileUrl}}" bindtap="downloadfile">
<image style="width: 48rpx;height: 48rpx;" src="/images/ic_bc_bs@2x.png"></image>
保存
</button>
</view>
</view>
</view>

@ -0,0 +1,75 @@
/* pages/lookup/lookimg/img.wxss */
/* utils/video/video.wxss */
.main {
background-color: black;
width: 750rpx;
min-height: 90vh;
padding-bottom: 10vh;
display: flex;
justify-content: center;
align-items: center;
display: flex;
flex-direction: column;
}
.bottom {
width: 750rpx;
position: fixed;
bottom: 70rpx;
}
.title {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 32rpx;
padding: 32rpx;
padding-bottom: 0rpx;
}
.card {
/* width: 144rpx; */
height: 56rpx;
padding: 0rpx 10rpx;
border-radius: 4rpx;
border: 1px solid #FFB17C;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FF8B3C;
line-height: 24rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 16rpx;
margin-bottom: 20rpx;
}
.cards {
display: flex;
width: 750rpx;
padding: 32rpx;
flex-wrap: wrap;
}
.one {
font-size: 20rpx!important;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF!important;
line-height: 20rpx!important;
display: flex;
flex-direction: column;
align-items: center;
width: auto!important;
border: none!important;
margin: 0rpx!important;
/* padding: 0rpx!important; */
}
.operation {
display: flex;
justify-content: space-around;
margin-top: 50rpx;
}

@ -43,6 +43,10 @@ Page({
title: '已完成',
is: false,
id: 2
}, {
title: '已结束',
is: false,
id: 3
}]
}, {
id: 1,
@ -158,6 +162,9 @@ Page({
})
},
getdata() {
if (this.data.status){
console.log(1)
}
http("/task/list", "post", {
pageNum: this.data.page,
status: this.data.status,

@ -24,7 +24,7 @@
<view class="quest_crad" wx:for="{{questes}}" wx:key="index" data-url="/pages/quest/subpage/detail/detail" data-quest="{{item.id}}" bindtap="to">
<view class="card_top">
<view class="card_time">{{item.start}}-{{item.end}}</view>
<view class="card_status" style="color:{{item.status === 2 ? '#999999' : item.status === 0 ? '#999999' : item.isReceived === 0 ? '#FF8B3C' : '#006BFF'}};">{{item.status === 2 ? '已完成' : item.status === 0 ? '未开始' : item.isReceived === 0 ? '待领取' : '进行中'}}</view>
<view class="card_status" style="color:{{item.status === 2 ? '#999999' : item.status === 0 ? '#999999' : item.isReceived === 0 ? '#FF8B3C' : '#006BFF'}};">{{item.status === 2 ? item.isReceived === 0 ? '已结束' : '已完成' : item.status === 0 ? '未开始' : item.isReceived === 0 ? '待领取' : '进行中'}}</view>
</view>
<view class="card_main">
<view class="crad_left">

@ -48,9 +48,17 @@
</view>
<view class="image">
<block wx:for="{{data.teachRefeList}}" wx:key="index">
<image wx:if="{{item.teachRefeType === 2}}" mode="aspectFill" class="img" data-look="{{item}}" bindtap="lookup" src="{{cdn + item.teachRefeFileUrl}}">
<image wx:if="{{item.filetype === 'image'}}" mode="aspectFill" class="img" data-look="{{item}}" bindtap="lookup" src="{{cdn + item.teachRefeFileUrl}}">
</image>
<video wx:if="{{item.filetype === 'video'}}" mode="aspectFill" muted="{{true}}" controls="{{false}}" class="img" data-look="{{item}}" bindtap="lookup" src="{{cdn+item.teachRefeFileUrl}}"></video>
<image wx:if="{{item.filetype === 'word'}}" mode="aspectFill" class="img" data-look="{{item}}" bindtap="lookup" src="../../../../../../images/img_word@2x.png">
</image>
<image wx:if="{{item.filetype === 'excel'}}" mode="aspectFill" class="img" data-look="{{item}}" bindtap="lookup" src="../../../../../../images/img_excel@2x.png">
</image>
<image wx:if="{{item.filetype === 'pdf'}}" mode="aspectFill" class="img" data-look="{{item}}" bindtap="lookup" src="../../../../../../images/img_pdf@2x.png">
</image>
<image wx:if="{{item.filetype === 'ppt'}}" mode="aspectFill" class="img" data-look="{{item}}" bindtap="lookup" src="../../../../../../images/img_ppt@2x.png">
</image>
<video wx:if="{{item.teachRefeType === 1}}" mode="aspectFill" muted="{{true}}" controls="{{false}}" class="img" data-look="{{item}}" bindtap="lookup" src="{{cdn+item.teachRefeFileUrl}}"></video>
</block>
</view>
</view>

@ -1,6 +1,6 @@
// pages/quest/subpage/detail/detail.js
import {
http
http,matchType
} from '../../../../utils/util'
Page({
/**
@ -59,8 +59,18 @@ Page({
}).then(res => {
this.setData({
data: res.data,
table: res.data.rewardRuleList
table: res.data.rewardRuleList,
})
if (this.data.data.teachRefeList.length!==0){
for (let index = 0; index < this.data.data.teachRefeList.length; index++) {
const element = this.data.data.teachRefeList[index];
console.log(matchType(this.data.data.teachRefeList[index].teachRefeFileUrl))
this.data.data.teachRefeList[index].filetype = matchType(this.data.data.teachRefeList[index].teachRefeFileUrl)
}
this.setData({
'data.teachRefeList':this.data.data.teachRefeList
})
}
this.setData({
'data.start': res.data.start.slice(0, 10),
'data.end': res.data.end.slice(0, 10)

@ -30,11 +30,7 @@ Page({
rank: [{
title: '全部状态',
is: true,
id: ''
}, {
title: '待领取',
is: false,
id: 0
id: 4
}, {
title: '进行中',
is: false,
@ -102,7 +98,7 @@ Page({
maxpage: 1,
page: 1,
cdn: getApp().globalData.cdn,
status: '',
status: 4,
month: '',
tagIdList: [],
brandIdList: [],
@ -117,7 +113,7 @@ Page({
*/
onLoad: function (options) {
wx.setNavigationBarTitle({
title: '任务中心',
title: '我的任务',
success: function (res) {}
})
http("/brand/list", "post", {}).then(res => {

@ -24,7 +24,7 @@
<view class="quest_crad" wx:for="{{questes}}" wx:key="index" data-url="/pages/quest/subpage/detail/detail" data-quest="{{item.id}}" bindtap="to">
<view class="card_top">
<view class="card_time">{{item.start}}-{{item.end}}</view>
<view class="card_status" style="color:{{item.status === 2 ? '#999999' : item.status === 0 ? '#999999' : item.isReceived === 0 ? '#FF8B3C' : '#006BFF'}};">{{item.status === 2 ? '已完成' : item.status === 0 ? '未开始' : item.isReceived === 0 ? '待领取' : '进行中'}}</view>
<view class="card_status" style="color:{{item.status === 2 ? '#999999' : item.status === 0 ? '#999999' : item.isReceived === 0 ? '#FF8B3C' : '#006BFF'}};">{{item.status === 2 ? item.isReceived === 0 ? '已结束' : '已完成' : item.status === 0 ? '未开始' : item.isReceived === 0 ? '待领取' : '进行中'}}</view>
</view>
<view class="card_main">
<view class="crad_left">

@ -23,7 +23,7 @@ Page({
},
getdata() {
http("/userMessage/list", "post", {
pageNum: 0,
pageNum: this.data.page,
pageSzie: 10
}).then(res => {
let array = res.data.records
@ -31,7 +31,7 @@ Page({
array[index].createDate = array[index].createDate.replace('T', ' ')
}
this.setData({
list: res.data.records,
list: this.data.list.concat(res.data.records),
max: res.data.pages
})
})

@ -1,5 +1,5 @@
// pages/user/subpage/tutorial/tutorial.js
import {http,lookup,time} from '../../../../utils/util'
import {http,lookup,time,matchType} from '../../../../utils/util'
Page({
/**
@ -27,14 +27,15 @@ Page({
}).then(res => {
let array = res.data.records
for (let index = 0; index < array.length; index++) {
console.log(matchType(array[index].fileUrl))
array[index].filetype = matchType(array[index].fileUrl)
if (array[index].type === 1){
array[index].time = time(array[index].duration)
}
}
this.setData({
max: res.data.pages,
records: array,
page: this.data.page + 1
records: array.concat(this.data.records)
})
})
},

@ -1,13 +1,17 @@
<!--pages/user/subpage/tutorial/tutorial.wxml-->
<view class="main">
<view class="card" wx:for="{{records}}" wx:key="index">
<view class="card" wx:for="{{records}}" wx:key="index" data-item="{{item}}" bindtap="to">
<view class="left">
<view class="title">{{item.title}}</view>
<view class="tip">{{item.creatAt}}</view>
</view>
<view class="show" data-item="{{item}}" bindtap="to">
<video wx:if="{{item.type===1}}" style="width: 192rpx;height: 192rpx;border-radius: 8rpx;" src="{{cdn+item.fileUrl}}" controls="{{false}}" show-center-play-btn="{{false}}"></video>
<image wx:else="{{true}}" mode="aspectFill" style="width: 192rpx;height: 192rpx;border-radius: 8rpx;" src="{{cdn+item.fileUrl}}"></image>
<view class="show">
<video wx:if="{{item.filetype==='video'}}" style="width: 192rpx;height: 192rpx;border-radius: 8rpx;" src="{{cdn+item.fileUrl}}" controls="{{false}}" show-center-play-btn="{{false}}"></video>
<image wx:if="{{item.filetype==='image'}}" mode="aspectFill" style="width: 192rpx;height: 192rpx;border-radius: 8rpx;" src="{{cdn+item.fileUrl}}"></image>
<image wx:if="{{item.filetype==='word'}}" mode="aspectFill" style="width: 192rpx;height: 192rpx;border-radius: 8rpx;" src="../../../../images/img_word@2x.png"></image>
<image wx:if="{{item.filetype==='excel'}}" mode="aspectFill" style="width: 192rpx;height: 192rpx;border-radius: 8rpx;" src="../../../../images/img_excel@2x.png"></image>
<image wx:if="{{item.filetype==='pdf'}}" mode="aspectFill" style="width: 192rpx;height: 192rpx;border-radius: 8rpx;" src="../../../../images/img_pdf@2x.png"></image>
<image wx:if="{{item.filetype==='ppt'}}" mode="aspectFill" style="width: 192rpx;height: 192rpx;border-radius: 8rpx;" src="../../../../images/img_ppt@2x.png"></image>
<view class="time" wx:if="{{item.type===1}}">
<image style="width: 16rpx;height: 18rpx;margin-right: 5rpx;" src="/images/img_bofang@2x.png"></image>{{item.time}}
</view>

@ -12,6 +12,7 @@
border-radius: 16rpx;
display: flex;
justify-content: space-between;
margin-bottom: 12rpx;
}
.title {

@ -140,12 +140,15 @@ Page({
code: res.code
}).then(res => {
if (res.msg === "未注册!") {
let that = this
wx.getSystemInfo({
success(res) {
if (res.environment) {
console.log('企业微信环境')
// 企业微信环境
this.getUserProfile()
that.getUserProfile()
} else {
console.log('普通微信环境')
// 微信·环境
wx.showToast({
title: '初次打开请在企业微信中',
@ -153,6 +156,7 @@ Page({
duration: 3000
})
}
// that.getUserProfile()
}
})
} else {

@ -1,5 +1,6 @@
import {
host
host,
cdn
} from './config'
const formatTime = (date) => {
@ -71,7 +72,7 @@ const http = (url, method, data, isLoading = true) => {
success(res) {
if (res.environment) {
// 企业微信环境
this.getUserProfile()
// this.getUserProfile()
} else {
// 微信·环境
wx.showToast({
@ -144,10 +145,10 @@ const http = (url, method, data, isLoading = true) => {
}
})
}
http(url, method, data, isLoading = true).then(res => {
console.log(res)
})
}
http(url, method, data, isLoading = true).then(res => {
console.log(res)
})
})
}
})
@ -180,7 +181,7 @@ const lookup = (e) => {
key: 'video',
data: e
})
} else {
} else if (e.type === 2 || e.teachRefeType === 2) {
wx.navigateTo({
url: '/pages/lookup/lookimg/img',
})
@ -188,7 +189,174 @@ const lookup = (e) => {
key: 'article',
data: e
})
} else {
// wx.navigateTo({
// url: '/pages/lookup/lookfile/lookfile',
// })
// wx.setStorage({
// key: 'file',
// data: e
// })
wx.showLoading({
title: '正在加载',
mask: true
})
var url = e.fileUrl?e.fileUrl:e.teachRefeFileUrl;
//下载文件,生成临时地址
wx.downloadFile({
url: cdn + url,
success(res) {
console.log(res)
wx.openDocument({
filePath: res.tempFilePath,
showMenu: true,
success(re) {
wx.showToast({
title: '加载成功',
duration: 2000,
mask: true,
});
},
fail(re) {
wx.showToast({
title: '加载失败',
duration: 2000,
mask: true,
});
},
complete(re) {
wx.hideLoading();
}
})
//保存到本地
// wx.saveFile({
// tempFilePath: res.tempFilePath,
// success: function (res) {
// console.log(res)
// console.log('保存到本地', res)
// wx.saveImageToPhotosAlbum({
// filePath: res.savedFilePath,
// complete(res) {
// wx.hideLoading();
// wx.showToast({
// title: '下载图片成功',
// duration: 2000,
// mask: true,
// });
// console.log('保存到相册', res)
// }
// })
// },
// fail: function (err) {
// wx.hideLoading();
// wx.showToast({
// title: '保存失败',
// duration: 2000,
// mask: true,
// });
// console.log('保存失败:', err)
// },
// complete(res) {
// console.log(res)
// }
// });
}
})
}
}
const matchType = (fileName) => {
// 后缀获取
var suffix = '';
// 获取类型结果
var result = '';
try {
var flieArr = fileName.split('.');
suffix = flieArr[flieArr.length - 1];
} catch (err) {
suffix = '';
}
// fileName无后缀返回 false
if (!suffix) {
result = false;
return result;
}
// 图片格式
var imglist = ['png', 'jpg', 'jpeg', 'bmp', 'gif'];
// 进行图片匹配
result = imglist.some(function (item) {
return item == suffix;
});
if (result) {
result = 'image';
return result;
};
// 匹配txt
var txtlist = ['txt'];
result = txtlist.some(function (item) {
return item == suffix;
});
if (result) {
result = 'txt';
return result;
};
// 匹配 excel
var excelist = ['xls', 'xlsx'];
result = excelist.some(function (item) {
return item == suffix;
});
if (result) {
result = 'excel';
return result;
};
// 匹配 word
var wordlist = ['doc', 'docx'];
result = wordlist.some(function (item) {
return item == suffix;
});
if (result) {
result = 'word';
return result;
};
// 匹配 pdf
var pdflist = ['pdf'];
result = pdflist.some(function (item) {
return item == suffix;
});
if (result) {
result = 'pdf';
return result;
};
// 匹配 ppt
var pptlist = ['ppt', 'pptx'];
result = pptlist.some(function (item) {
return item == suffix;
});
if (result) {
result = 'ppt';
return result;
};
// 匹配 视频
var videolist = ['mp4', 'm2v', 'mkv'];
result = videolist.some(function (item) {
return item == suffix;
});
if (result) {
result = 'video';
return result;
};
// 匹配 音频
var radiolist = ['mp3', 'wav', 'wmv'];
result = radiolist.some(function (item) {
return item == suffix;
});
if (result) {
result = 'radio';
return result;
}
// 其他 文件类型
result = 'other';
return result;
}
module.exports = {
@ -196,5 +364,6 @@ module.exports = {
http,
lookup,
formatNumber,
time
time,
matchType
}
Loading…
Cancel
Save