删减图片以及文档视频调试
4
app.json
|
@ -77,13 +77,13 @@
|
|||
"pagePath": "pages/material/index",
|
||||
"iconPath": "images/ziyuan.png",
|
||||
"selectedIconPath": "images/ziyuan1.png",
|
||||
"text": "资源下载"
|
||||
"text": "资料下载"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/article/index",
|
||||
"iconPath": "images/news.png",
|
||||
"selectedIconPath": "images/news1.png",
|
||||
"text": "新闻咨询"
|
||||
"text": "新闻资讯"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/my/index",
|
||||
|
|
After Width: | Height: | Size: 24 KiB |
BIN
images/data.png
Before Width: | Height: | Size: 2.9 KiB |
BIN
images/datac.png
Before Width: | Height: | Size: 2.7 KiB |
BIN
images/homec.png
Before Width: | Height: | Size: 4.3 KiB |
BIN
images/me.png
Before Width: | Height: | Size: 10 KiB |
BIN
images/mec.png
Before Width: | Height: | Size: 6.9 KiB |
BIN
images/newsc.png
Before Width: | Height: | Size: 2.6 KiB |
BIN
images/play.png
Before Width: | Height: | Size: 5.3 KiB |
BIN
images/playc.png
Before Width: | Height: | Size: 5.6 KiB |
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="16px" height="16.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#1296db" d="M752 939.2c-9.6 0-20.8-3.2-30.4-8l-208-104L304 931.2c-20.8 11.2-48 9.6-67.2-4.8-19.2-14.4-30.4-40-25.6-64l43.2-224-164.8-153.6c-17.6-17.6-24-44.8-17.6-67.2 8-24 27.2-41.6 52.8-44.8l228.8-41.6 102.4-208c11.2-22.4 33.6-36.8 57.6-36.8s48 14.4 57.6 36.8l102.4 208 228.8 40c24 3.2 44.8 20.8 51.2 44.8 8 24 1.6 49.6-16 67.2l-164.8 155.2 41.6 224c4.8 25.6-6.4 49.6-25.6 64-9.6 8-22.4 12.8-36.8 12.8z" /></svg>
|
Before Width: | Height: | Size: 683 B |
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1583994425314" class="icon" viewBox="0 0 1050 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2813" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.40625" height="16"><defs><style type="text/css"></style></defs><path d="M808.070737 1000.825263c-11.371789 0-24.629895-3.772632-36.001684-9.377684l-246.298948-122.071579-248.185263 122.071579c-24.629895 13.123368-56.858947 11.264-79.575579-5.658947-22.743579-16.896-36.001684-46.942316-30.315789-75.102316l51.146105-262.871579L23.713684 467.536842c-20.830316-20.641684-28.429474-52.547368-20.830316-78.848 9.458526-28.16 32.202105-48.828632 62.517895-52.574316L336.303158 287.258947l121.263158-244.089263C470.824421 16.896 497.367579 0 525.770105 0c28.429474 0 56.858947 16.896 68.20379 43.196632l121.263158 244.089263 270.928842 46.942316c28.402526 3.772632 53.032421 24.414316 60.631579 52.574315a76.072421 76.072421 0 0 1-18.944 78.874948l-195.152842 182.16421 49.259789 262.844632c5.658947 30.046316-7.572211 58.206316-30.315789 75.129263a67.907368 67.907368 0 0 1-43.573895 15.009684z" fill="#226DC2" p-id="2814"></path></svg>
|
Before Width: | Height: | Size: 1.2 KiB |
BIN
images/video.png
Before Width: | Height: | Size: 1013 B After Width: | Height: | Size: 3.1 KiB |
BIN
images/wave.png
Before Width: | Height: | Size: 7.5 KiB |
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="64px" height="64.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#333333" d="M773.12 998.4c-10.24 0-23.04-2.56-33.28-10.24L512 870.4l-230.4 117.76c-23.04 12.8-53.76 10.24-74.24-5.12-20.48-15.36-33.28-46.08-28.16-74.24l46.08-256-181.76-174.08c-20.48-20.48-25.6-51.2-20.48-76.8 7.68-28.16 30.72-48.64 58.88-51.2l250.88-48.64 112.64-238.08C460.8 40.96 486.4 25.6 512 25.6s53.76 15.36 64 40.96l112.64 238.08 250.88 46.08c25.6 2.56 48.64 23.04 56.32 51.2 7.68 28.16 2.56 56.32-17.92 76.8l-181.76 176.64 46.08 256c5.12 28.16-7.68 56.32-28.16 74.24-10.24 7.68-25.6 12.8-40.96 12.8z" /></svg>
|
Before Width: | Height: | Size: 788 B |
|
@ -42,7 +42,8 @@ Page({
|
|||
let that = this;
|
||||
let userinfo = wx.getStorageSync('userinfo');
|
||||
that.setData({
|
||||
userinfo: userinfo
|
||||
userinfo: userinfo,
|
||||
search: that.search.bind(that)
|
||||
})
|
||||
api.request('/examtest/banner/', 'GET').then(res => {
|
||||
if(res.data.length>0){
|
||||
|
@ -289,7 +290,6 @@ Page({
|
|||
})
|
||||
},
|
||||
search: function (value) {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
api.request('/question/question/', 'GET', {search:value,page:1,limit:20}).then(res => {
|
||||
if(res.data && res.data.results){
|
||||
|
@ -305,7 +305,6 @@ Page({
|
|||
})
|
||||
},
|
||||
selectResult: function (e) {
|
||||
console.log(e.detail)
|
||||
wx.navigateTo({
|
||||
url: `/pages/question/detail?id=${e.detail.item.id}`,
|
||||
})
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<view class="page">
|
||||
<view style="background-color: #ffffff;position: fixed;top: 0;left: 0;z-index: 10;width: 100%;">
|
||||
<!-- <input class="weui-input searchInput" maxlength="10" bindinput="search" placeholder="搜题"/> -->
|
||||
<mp-searchbar class="searchWrap" bindselectresult="selectResult" search="{{search}}" placeholder="搜题"></mp-searchbar>
|
||||
</view>
|
||||
<!-- 轮播图 -->
|
||||
|
@ -50,7 +51,7 @@
|
|||
</a> -->
|
||||
|
||||
<!-- -->
|
||||
<view class="listItemsWrap">
|
||||
<view class="listItemsWrap" >
|
||||
<view class="listItemsTitle"> 人员考试</view>
|
||||
<view wx:if="{{userinfo && userinfo.name}}">
|
||||
<a class="topItem" bindtap="goYati">
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
.page{
|
||||
padding-top: 111rpx;
|
||||
background: #f1f1f1;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.searchWrap .weui-search-bar__form{
|
||||
border-radius: 50rpx;
|
||||
|
@ -20,7 +21,7 @@
|
|||
padding-top: 20rpx;
|
||||
}
|
||||
.topItemImg{
|
||||
width: 50rpx;
|
||||
width: 80rpx;
|
||||
}
|
||||
.topItemText{
|
||||
height: 40rpx;
|
||||
|
@ -67,8 +68,8 @@
|
|||
}
|
||||
.listItemsWrap{
|
||||
width: 96%;
|
||||
margin-top: 20rpx;
|
||||
margin: 10rpx auto;
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
background: #ffffff;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
const api = require("../../utils/request.js");
|
||||
Page({
|
||||
|
||||
|
@ -19,15 +18,31 @@ Page({
|
|||
}
|
||||
},
|
||||
onLoad: function () {
|
||||
var that = this
|
||||
// that.getList(that.data.query)
|
||||
|
||||
},
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
onShow: function () {
|
||||
var that = this
|
||||
that.getList(that.data.query)
|
||||
},
|
||||
bindKeyInput(e){
|
||||
// debugger;
|
||||
let that = this
|
||||
console.log(e.detail.value)
|
||||
that.setData({
|
||||
['query.search']:e.detail.value
|
||||
})
|
||||
that.getList(that.data.query)
|
||||
},
|
||||
searchFile(){
|
||||
let that = this;
|
||||
this.setData({
|
||||
['query.search']:''
|
||||
})
|
||||
that.getList(that.data.query)
|
||||
},
|
||||
bindKeyInput(){},
|
||||
typeChange(e){
|
||||
this.setData({
|
||||
active:e.target.dataset.type
|
||||
|
@ -100,8 +115,9 @@ Page({
|
|||
title: '正在下载...',
|
||||
})
|
||||
api.request('/cms/material/'+e.currentTarget.dataset.id+'/down/', 'GET').then(res => {
|
||||
that.data.results[e.currentTarget.dataset.index].down_count = res.data.down_count
|
||||
var fileurl = getApp().globalData.host + res.data.path
|
||||
that.data.results[e.currentTarget.dataset.index].down_count = res.data.down_count;
|
||||
let hostUrl = getApp().globalData.host.slice(0,-4);
|
||||
var fileurl = hostUrl + res.data.path;
|
||||
wx.downloadFile({
|
||||
url: fileurl,
|
||||
success(res) {
|
||||
|
|
|
@ -1,24 +1,43 @@
|
|||
<wxs module="activeImage">
|
||||
function type(e) {
|
||||
var str = '';
|
||||
if (e.indexOf('.pdf')!=-1) {
|
||||
str = 'pdf'
|
||||
} else if (e.indexOf('.doc')!=-1 || e.indexOf('.docx')!=-1) {
|
||||
str = 'word'
|
||||
}else if(e.indexOf('.ppt')!=-1 || e.indexOf('.pptx')!=-1){
|
||||
str = 'ppt'
|
||||
}else{
|
||||
str = 'file'
|
||||
}
|
||||
return str
|
||||
}
|
||||
module.exports = {
|
||||
type: type,
|
||||
}
|
||||
</wxs>
|
||||
|
||||
<view class="page">
|
||||
<view class="weui-flex searchWrap" style="background-color: #ffffff;">
|
||||
<input class="weui-input searchInput" maxlength="10" bindinput="bindKeyInput" placeholder="搜索文档名称"/>
|
||||
<view class="searchBtn">搜索</view>
|
||||
<!-- <view class="searchBtn">搜索</view> -->
|
||||
</view>
|
||||
<view class="weui-flex" style="height: 100%;">
|
||||
<view style="flex-shrink:0;width:200rpx;border-right: 1rpx solid #eeeeee;">
|
||||
<view class="tabItem {{ active==0?'activeType':'' }}" bindtap="typeChange" data-type="0">
|
||||
<view class="activeLine" wx:if="{{active==0}}"></view>标准文件
|
||||
</view>
|
||||
<view class="tabItem {{ active==1?'activeType':'' }}" bindtap="typeChange" data-type="1">
|
||||
<!-- <view class="tabItem {{ active==1?'activeType':'' }}" bindtap="typeChange" data-type="1">
|
||||
<view wx:if="{{active==1}}" class="activeLine"></view>其他资料
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="listWrap">
|
||||
<block wx:for="{{results}}" wx:key="unique">
|
||||
<view class="listItemWrap" bindtap="itemClick" data-id="{{item.id}}" data-name="{{item.name}}">
|
||||
<view class="listItemImg">
|
||||
<image wx:if="{{item.path.indexOf('.pdf')!=-1}}" mode="widthFix" class="itemImg" src="/images/pdf.svg"></image>
|
||||
<image wx:elif="{{item.path.indexOf('.doc')!=-1 || item.path.indexOf('.docx')!=-1}}" mode="widthFix" class=itemImg" src="/images/word.svg"></image>
|
||||
<image wx:elif="{{item.path.indexOf('.ppt')!=-1 || item.path.indexOf('.pptx')!=-1}}" mode="widthFix" class="itemImg" src="/images/ppt.svg"></image>
|
||||
<image wx:if="{{activeImage.type(item.path)=='pdf'}}" mode="widthFix" class="itemImg" src="/images/pdf.svg"></image>
|
||||
<image wx:if="{{activeImage.type(item.path)=='word'}}" mode="widthFix" class=itemImg" src="/images/word.svg"></image>
|
||||
<image wx:elif="{{activeImage.type(item.path)=='ppt'}}" mode="widthFix" class="itemImg" src="/images/ppt.svg"></image>
|
||||
<image wx:else class="itemImg" mode="widthFix" src="/images/file.svg"></image>
|
||||
</view>
|
||||
<view class="listItemText">
|
||||
|
|
|
@ -1,71 +1,40 @@
|
|||
// pages/lianxi/index.js
|
||||
const api = require("../../utils/request.js");
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
results: [],
|
||||
query: {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
type:'视频'
|
||||
}
|
||||
},
|
||||
isAutoPlay:false
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function () {
|
||||
// onLoad: function () {
|
||||
// var that = this
|
||||
// that.getList(that.data.query)
|
||||
// },
|
||||
onShow: function () {
|
||||
var that = this
|
||||
that.getList(that.data.query)
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
},
|
||||
getList: function () {
|
||||
var that = this
|
||||
api.request('/cms/material/', 'GET', that.data.query).then(res => {
|
||||
for(var i=0;i<res.data.results.length;i++){
|
||||
res.data.results[i].showTitle=true
|
||||
}
|
||||
// for(var i=0;i<res.data.results.length;i++){
|
||||
// res.data.results[i].showTitle=true
|
||||
// }
|
||||
if (that.data.query.page == 1) {
|
||||
that.data.results = res.data.results
|
||||
} else {
|
||||
that.data.results = that.data.results.concat(res.data.results)
|
||||
}
|
||||
|
||||
that.setData({
|
||||
results: that.data.results,
|
||||
count: res.data.count
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
|
@ -92,17 +61,10 @@ Page({
|
|||
that.getList()
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
},
|
||||
play:function(e){
|
||||
let index = e.currentTarget.dataset.index
|
||||
this.data.results[index].showTitle=false
|
||||
// this.data.results[index].showTitle=false
|
||||
this.setData({
|
||||
results:this.data.results
|
||||
})
|
||||
|
@ -112,7 +74,7 @@ Page({
|
|||
},
|
||||
pause:function(e){
|
||||
let index = e.currentTarget.dataset.index
|
||||
this.data.results[index].showTitle=true
|
||||
// this.data.results[index].showTitle=true
|
||||
this.setData({
|
||||
results:this.data.results
|
||||
})
|
||||
|
|
|
@ -1,21 +1,17 @@
|
|||
<view style="text-align:center" wx:if="{{count==0}}">暂无视频资源</view>
|
||||
<block wx:for="{{results}}" wx:key="unique">
|
||||
<view class="weui-panel">
|
||||
<txv-video
|
||||
vid="{{item.vid}}"
|
||||
playerid="txv1"
|
||||
bindplay="play"
|
||||
bindpause="pause"
|
||||
bindended="pause"
|
||||
data-index = "{{index}}"
|
||||
data-id="{{item.id}}"
|
||||
>
|
||||
<view class='txv-video-slot' wx:if="{{item.showTitle}}">
|
||||
<span style="margin-left:6px">{{item.name}}</span>
|
||||
</view>
|
||||
</txv-video>
|
||||
<view style="color:darkblue;">
|
||||
<span style="margin-left:6px">{{item.name}}</span>
|
||||
<view class="page" style="padding: 20rpx;">
|
||||
<view style="text-align:center" wx:if="{{count==0}}">暂无视频资源</view>
|
||||
<block wx:for="{{results}}" wx:key="unique">
|
||||
<view style="background-color: #ffffff;box-shadow: 0 0 10rpx 10rpx #dddddd;border-radius: 10rpx;overflow: hidden;margin-bottom: 20rpx;">
|
||||
<txv-video
|
||||
vid="{{item.vid}}"
|
||||
playerid="txv1"
|
||||
autoplay="{{isAutoPlay}}"
|
||||
>
|
||||
</txv-video>
|
||||
<view style="display: flex;justify-content: space-between;padding: 5rpx 15rpx;">
|
||||
<view>{{item.name}}</view>
|
||||
<view style="font-size: 26rpx;color: #aaaaaa;"> {{item.description}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
|
@ -4,8 +4,8 @@
|
|||
<view class="absoluteContentWrap">
|
||||
<view class="userImgWrap" bindtap="register">
|
||||
<view class="userImg">
|
||||
<!-- <image src="userInfo.avatarUrl"></image> -->
|
||||
<open-data type="userAvatarUrl"></open-data>
|
||||
<image src="/images/autar.png"></image>
|
||||
<!-- <open-data type="userAvatarUrl"></open-data> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="infoContent" bindtap="register">
|
||||
|
@ -52,7 +52,7 @@
|
|||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="totalStatic">
|
||||
<!-- <view class="totalStatic">
|
||||
<view style="padding-left: 20rpx;"><text class="boldLine"></text>管理员操作台</view>
|
||||
<view class="weui-cells weui-cells_after-title" style="padding:20rpx;box-sizing:border-box">
|
||||
<navigator url="/pages/admin/login" class="weui-cell weui-cell_access">
|
||||
|
@ -64,7 +64,7 @@
|
|||
<view class="weui-cell__ft weui-cell__ft_in-access" style="color:red"></view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- <view class="page__bd">
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
/* 第一版——end */
|
||||
/* 第二版——start */
|
||||
.page{
|
||||
height: 100%;
|
||||
background: #f1f1f1;
|
||||
}
|
||||
.blueBack{
|
||||
|
|
|
@ -90,6 +90,13 @@
|
|||
"query": "",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"name": "pages/material/video",
|
||||
"pathName": "pages/material/video",
|
||||
"query": "",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|