Merge branch 'dev' of git.oa00.com:SWS/EXEEED into hat

master
Tuisku 3 years ago
commit 0906f1cd30

@ -34,7 +34,7 @@
<view class="brand_voa_type" wx:if="{{item.type === 3}}">文章</view>
<!-- <view class="brand_voa"></view> -->
<!-- <image class="brand_voa" src="./shortimage/img_xingtue@2x.png"></image> -->
<image class="brand_voa" src="{{cdn+(item.cover)}}"></image>
<image class="brand_voa" src="{{cdn+(item.cover)}}"></image>
<view class="brand_voa_num">
<image wx:if="{{item.type === 1}}" style="width: 16rpx;height: 18rpx;margin-right: 5rpx;" src="/images/img_bofang@2x.png"></image>
<!-- {{item.type === 1 ? item.num+'次播放' : item.num+'次阅读'}} -->

@ -104,12 +104,13 @@
.brand_card{
height: 246rpx;
/* width: 320rpx; */
}
.brand_voa {
/* background-color: royalblue; */
height: 202rpx;
width: 304rpx;
width: 304rpx;
border-radius: 8rpx;
}

@ -1,121 +1,64 @@
// pages/quest/quest.js
import {http} from '../../../../../utils/util'
// import {DownloadSaveFile,downloadFile
// } from '../../../../../utils/downloadSaveFile.js'
import {
http
} from '../../../../../utils/util'
import {
cdn
} from '../../../../../utils/config'
Page({
/**
* 页面的初始数据
*/
data: {
cdn:getApp().globalData.cdn,
type:0,
// questes: [
// {
// time: '2022-3-182022-5-18',
// title: '星途揽月新款抖音视频需求需要马上贯彻落实',
// text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...',
// url: 'https://www.oa00.com/#/attendance/index',
// type: 1,
// num: '258w',
// duration: '02:32',
// },{
// time: '2022-3-182022-5-18',
// title: '星途揽月新款抖音视频需求需要马上贯彻落实',
// text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...',
// url: 'https://www.oa00.com/#/attendance/index',
// type: 1,
// num: '258w',
// duration: '02:32',
// },{
// time: '2022-3-182022-5-18',
// title: '星途揽月新款抖音视频需求需要马上贯彻落实',
// text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...',
// url: 'https://www.oa00.com/#/attendance/index',
// type: 1,
// num: '258w',
// duration: '02:32',
// },{
// time: '2022-3-182022-5-18',
// title: '星途揽月新款抖音视频需求需要马上贯彻落实',
// text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...',
// url: 'https://www.oa00.com/#/attendance/index',
// type: 1,
// num: '258w',
// duration: '02:32',
// },{
// time: '2022-3-182022-5-18',
// title: '星途揽月新款抖音视频需求需要马上贯彻落实',
// text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...',
// url: 'https://www.oa00.com/#/attendance/index',
// type: 1,
// num: '258w',
// duration: '02:32',
// },{
// time: '2022-3-182022-5-18',
// title: '星途揽月新款抖音视频需求需要马上贯彻落实',
// text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...',
// url: 'https://www.oa00.com/#/attendance/index',
// type: 1,
// num: '258w',
// duration: '02:32',
// },{
// time: '2022-3-182022-5-18',
// title: '星途揽月新款抖音视频需求需要马上贯彻落实',
// text: '以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上以一流的设计和领先的技术为基础以人工智能为差异化,从外观、性能上...',
// url: 'https://www.oa00.com/#/attendance/index',
// type: 1,
// num: '258w',
// duration: '02:32',
// },
// ],
records:[],
questes:[],
infoObject:{},
isClick:false,
cdn: getApp().globalData.cdn,
type: 0,
records: [],
infoObject: {},
isClick: false,
// imageUrl:"/pages/index/shortimage/img_xingtue@2x.png"
},
back(){
back() {
wx.navigateBack({
delta: 1
})
},
to(e) {
console.log(e.target.dataset.url)
wx.navigateTo({
url: e.target.dataset.url
})
to(e) {
console.log(e.target.dataset.url)
wx.navigateTo({
url: e.target.dataset.url
})
},
},
//跳转详情
detail(e){
detail(e) {
console.log(e)
wx.setStorageSync('info', e.currentTarget.dataset.cycle_id)
wx.navigateTo({
url:"/pages/index/subpage/brand/brandDetails/brandDetails"
url: "/pages/index/subpage/brand/brandDetails/brandDetails"
})
},
//收藏
collection(e){
collection(e) {
var that = this
let userId = this.data.infoObject.id
let referenceId = this.data.infoObject.id
// let referenceId = wx.getStorageSync('referenceId')
let isClick = this.data.isClick
console.log(e)
if(!isClick){
if (!isClick) {
that.setData({
isClick:true
isClick: true
})
wx.showToast({
title: '收藏成功',
icon: 'none'
})
http("/userReference/add", "post", {userId,referenceId
}).then(res =>{
http("/userReference/add", "post", {
userId,
referenceId
}).then(res => {
this.setData({
// userId:e.currentTarget.dataset.cycle_id,
// referenceId:this.id
@ -123,30 +66,22 @@ to(e) {
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.setNavigationBarTitle({
title: '任务中心',
title: '动态详情',
success: function (res) {}
})
this.setData({
type:options.type,
infoObject:wx.getStorageSync('info')
type: options.type,
infoObject: wx.getStorageSync('info')
})
this.getrecordslist()
// var htmls =
// <dib><h1>解析</h1></dib>
// var that = this
// WxParse.wxParse('htmls','html',htmls,that,5);
},
getrecordslist(){
http("/topicActivity/list", "post", {
}).then(res =>{
getrecordslist() {
http("/topicActivity/list", "post", {}).then(res => {
this.setData({
records: res.data.records,
})
@ -198,75 +133,104 @@ to(e) {
/**
* 用户点击右上角分享
*/
onShareAppMessage:function() {
onShareAppMessage: function () {
var that = this
return {
title:that.data.infoObject.title,
path:"pages/index/subpage/brand/brandDetails/brandDetails",
// imageUrl:that.cdn+infoObject.cover,
title: that.data.infoObject.title,
path: "pages/index/subpage/brand/brandDetails/brandDetails",
// imageUrl:that.cdn+infoObject.cover,
}
},
//保存
preserve(){
// if(){
wx.showModal({
title: '提示',
content: '确定要保存吗?',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
wx.getImageInfo({
src: '/pages/index/shortimage/img_xingtue@2x.png',
success: function (res) {
console.log(res);
var path = res.path;
wx.saveImageToPhotosAlbum({
filePath: path,
success: function (res) {
console.log('已保存');
},
fail: function (res) {
console.log('保存失败');
}
})
}
});
} else if (res.cancel) {
console.log('用户点击取消')
preserve: function (e) {
console.log(this.data.infoObject.content)
wx.getImageInfo({
src: cdn + this.data.infoObject.content, //这里放你要下载图片的数组(多张) 或 字符串(一张) 下面代码不用改动
success: function (ret) {
var path = ret.path
wx.saveImageToPhotosAlbum({
filePath: path,
success(result) {
console.log("成功");
wx.hideLoading();
wx.showToast({
title: '下载图片成功',
duration: 2000,
mask: true,
});
},
fail(result) {
console.log("失败,你取消了" + JSON.stringify(result))
console.log(path);
wx.openSetting({
success: (res) => {
console.log(res);
}
})
}
})
// }else{
// wx.showLoading({
// title: '下载中...',
// })
// wx.downloadFile({
// //视频信息的Url
// url: app.serverUrl + me.data.videoInfo.videoPath,
// success: function (res) {
// // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容
// if (res.statusCode === 200) {
// console.log(res.tempFilePath);
// wx.saveVideoToPhotosAlbum({
// filePath: res.tempFilePath,
// success:function(res) {
// console.log(res.errMsg)
// wx.hideLoading();
// }
// })
// }
// }
// })
// }
});
}
});
},
//保存视频
handleDownload(e) {
let link = e.currentTarget.dataset.link;
let fileName = new Date().valueOf();
wx.downloadFile({
url: link,
filePath: wx.env.USER_DATA_PATH + '/' + fileName + '.mp4',
success: res => {
console.log(res);
let filePath = res.filePath;
wx.saveVideoToPhotosAlbum({
filePath,
success: file => {
wx.showToast({
title: '下载视频成功',
duration: 2000,
mask: true,
});
let fileMgr = wx.getFileSystemManager();
fileMgr.unlink({
filePath: wx.env.USER_DATA_PATH + '/' + fileName + '.mp4',
success: function (r) {
},
})
},
fail: err => {
console.log(err)
if (err.errMsg === 'saveVideoToPhotosAlbum:fail auth deny') {
wx.showModal({
title: '提示',
content: '需要您授权保存相册',
showCancel: false,
success: data => {
wx.openSetting({
success(settingdata) {
if (settingdata.authSetting['scope.writePhotosAlbum']) {
wx.showModal({
title: '提示',
content: '获取权限成功,再次点击下载即可保存',
showCancel: false,
})
} else {
wx.showModal({
title: '提示',
content: '获取权限失败,将无法保存到相册哦~',
showCancel: false,
})
}
},
})
}
})
}
}
})
}
})
},
// downloadSaveFile(e) {
// let url = e.currentTarget.dataset.url;
// // 保存到相册
// DownloadSaveFile.downloadFile('video', url); //video或image
// }
})

@ -1,4 +1,3 @@
{
"usingComponents": {},
"navigationStyle": "custom"
"usingComponents": {}
}

@ -1,17 +1,17 @@
<!--pages/index/subpage/brand/brandDetails/brandDetails.wxml-->
<view class="video" wx:if="{{infoObject.type===1}}">
<video style="width: 100%; " initial-time='0.01' muted autoplay object-fit="cover" src="{{cdn+(infoObject.content)}}">
<l-icon name="left" color="black" size="48" class="back" bindtap="back" />
<!-- <l-icon name="left" color="black" size="48" class="back" bindtap="back" /> -->
</video>
</view>
<view class="video" wx:if="{{infoObject.type===2}}">
<image src="{{cdn+(infoObject.cover)}}" style="width: 100%;height: 100%;">
<l-icon name="left" color="black" size="48" class="back" bindtap="back" />
<image mode="widthFix" src="{{cdn+(infoObject.cover)}}" style="width: 100%;">
<!-- <l-icon name="left" color="black" size="48" class="back" bindtap="back" /> -->
</image>
</view>
<view class="video" wx:if="{{infoObject.type===3}}">
<image src="{{cdn+(infoObject.cover)}}" style="width: 100%;height: 100%;">
<l-icon name="left" color="black" size="48" class="back" bindtap="back" />
<!-- <l-icon name="left" color="black" size="48" class="back" bindtap="back" /> -->
</image>
</view>
<view class="main">
@ -37,7 +37,11 @@
<image src="../brandDetails/images/ic_shoucang@3x.png" style="width: 48rpx;height: 48rpx;vertical-align: middle;margin-right: 10rpx;"></image>
<text style="width: 48rpx;height: 48rpx;">{{isClick?'已收藏': '收藏'}}</text>
</view>
<view class="d-flex-list" bindtap="preserve">
<view class="d-flex-list" data-link="{{cdn+(infoObject.content)}}" bindtap="handleDownload" wx:if="{{infoObject.type===1}}">
<image src="../brandDetails/images/ic_baocun@3x.png" style="width: 48rpx;height: 48rpx;vertical-align: middle;margin-right: 10rpx;"></image>
<text>保存</text>
</view>
<view class="d-flex-list" bindtap="preserve" wx:else>
<image src="../brandDetails/images/ic_baocun@3x.png" style="width: 48rpx;height: 48rpx;vertical-align: middle;margin-right: 10rpx;"></image>
<text>保存</text>
</view>

@ -8,7 +8,8 @@
.video {
width: 100%;
height: 440rpx;
/* height: 440rpx; */
height: 100%;
}

Loading…
Cancel
Save