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_type" wx:if="{{item.type === 3}}">文章</view>
<!-- <view class="brand_voa"></view> --> <!-- <view class="brand_voa"></view> -->
<!-- <image class="brand_voa" src="./shortimage/img_xingtue@2x.png"></image> --> <!-- <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"> <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> <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+'次阅读'}} --> <!-- {{item.type === 1 ? item.num+'次播放' : item.num+'次阅读'}} -->

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

@ -1,121 +1,64 @@
// pages/quest/quest.js import {
import {http} from '../../../../../utils/util' http
// import {DownloadSaveFile,downloadFile } from '../../../../../utils/util'
// } from '../../../../../utils/downloadSaveFile.js' import {
cdn
} from '../../../../../utils/config'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
cdn:getApp().globalData.cdn, cdn: getApp().globalData.cdn,
type:0, type: 0,
// questes: [ records: [],
// { infoObject: {},
// time: '2022-3-182022-5-18', isClick: false,
// 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,
// imageUrl:"/pages/index/shortimage/img_xingtue@2x.png" // imageUrl:"/pages/index/shortimage/img_xingtue@2x.png"
}, },
back() {
back(){
wx.navigateBack({ wx.navigateBack({
delta: 1 delta: 1
}) })
}, },
to(e) { to(e) {
console.log(e.target.dataset.url) console.log(e.target.dataset.url)
wx.navigateTo({ wx.navigateTo({
url: e.target.dataset.url url: e.target.dataset.url
}) })
}, },
//跳转详情 //跳转详情
detail(e){ detail(e) {
console.log(e) console.log(e)
wx.setStorageSync('info', e.currentTarget.dataset.cycle_id) wx.setStorageSync('info', e.currentTarget.dataset.cycle_id)
wx.navigateTo({ wx.navigateTo({
url:"/pages/index/subpage/brand/brandDetails/brandDetails" url: "/pages/index/subpage/brand/brandDetails/brandDetails"
}) })
}, },
//收藏 //收藏
collection(e){ collection(e) {
var that = this var that = this
let userId = this.data.infoObject.id let userId = this.data.infoObject.id
let referenceId = this.data.infoObject.id let referenceId = this.data.infoObject.id
// let referenceId = wx.getStorageSync('referenceId') // let referenceId = wx.getStorageSync('referenceId')
let isClick = this.data.isClick let isClick = this.data.isClick
console.log(e) console.log(e)
if(!isClick){ if (!isClick) {
that.setData({ that.setData({
isClick:true isClick: true
}) })
wx.showToast({ wx.showToast({
title: '收藏成功', title: '收藏成功',
icon: 'none' icon: 'none'
}) })
http("/userReference/add", "post", {userId,referenceId http("/userReference/add", "post", {
}).then(res =>{ userId,
referenceId
}).then(res => {
this.setData({ this.setData({
// userId:e.currentTarget.dataset.cycle_id, // userId:e.currentTarget.dataset.cycle_id,
// referenceId:this.id // referenceId:this.id
@ -123,30 +66,22 @@ to(e) {
}) })
} }
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '任务中心', title: '动态详情',
success: function (res) {} success: function (res) {}
}) })
this.setData({ this.setData({
type:options.type, type: options.type,
infoObject:wx.getStorageSync('info') infoObject: wx.getStorageSync('info')
}) })
this.getrecordslist() this.getrecordslist()
// var htmls =
// <dib><h1>解析</h1></dib>
// var that = this
// WxParse.wxParse('htmls','html',htmls,that,5);
}, },
getrecordslist(){ getrecordslist() {
http("/topicActivity/list", "post", { http("/topicActivity/list", "post", {}).then(res => {
}).then(res =>{
this.setData({ this.setData({
records: res.data.records, records: res.data.records,
}) })
@ -198,75 +133,104 @@ to(e) {
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage:function() { onShareAppMessage: function () {
var that = this var that = this
return { return {
title:that.data.infoObject.title, title: that.data.infoObject.title,
path:"pages/index/subpage/brand/brandDetails/brandDetails", path: "pages/index/subpage/brand/brandDetails/brandDetails",
// imageUrl:that.cdn+infoObject.cover, // imageUrl:that.cdn+infoObject.cover,
} }
}, },
//保存 //保存
preserve(){ preserve: function (e) {
// if(){ console.log(this.data.infoObject.content)
wx.showModal({ wx.getImageInfo({
title: '提示', src: cdn + this.data.infoObject.content, //这里放你要下载图片的数组(多张) 或 字符串(一张) 下面代码不用改动
content: '确定要保存吗?', success: function (ret) {
success: function (res) { var path = ret.path
if (res.confirm) { wx.saveImageToPhotosAlbum({
console.log('用户点击确定') filePath: path,
wx.getImageInfo({ success(result) {
src: '/pages/index/shortimage/img_xingtue@2x.png', console.log("成功");
success: function (res) { wx.hideLoading();
console.log(res); wx.showToast({
var path = res.path; title: '下载图片成功',
wx.saveImageToPhotosAlbum({ duration: 2000,
filePath: path, mask: true,
success: function (res) { });
console.log('已保存'); },
}, fail(result) {
fail: function (res) { console.log("失败,你取消了" + JSON.stringify(result))
console.log('保存失败'); console.log(path);
} wx.openSetting({
}) success: (res) => {
} console.log(res);
});
} else if (res.cancel) {
console.log('用户点击取消')
} }
})
} }
}) });
// }else{ }
// wx.showLoading({ });
// title: '下载中...', },
// }) //保存视频
// wx.downloadFile({ handleDownload(e) {
// //视频信息的Url let link = e.currentTarget.dataset.link;
// url: app.serverUrl + me.data.videoInfo.videoPath, let fileName = new Date().valueOf();
// success: function (res) { wx.downloadFile({
// // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容 url: link,
// if (res.statusCode === 200) { filePath: wx.env.USER_DATA_PATH + '/' + fileName + '.mp4',
// console.log(res.tempFilePath); success: res => {
console.log(res);
// wx.saveVideoToPhotosAlbum({ let filePath = res.filePath;
// filePath: res.tempFilePath, wx.saveVideoToPhotosAlbum({
// success:function(res) { filePath,
// console.log(res.errMsg) success: file => {
// wx.hideLoading(); 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": {}, "usingComponents": {}
"navigationStyle": "custom"
} }

@ -1,17 +1,17 @@
<!--pages/index/subpage/brand/brandDetails/brandDetails.wxml--> <!--pages/index/subpage/brand/brandDetails/brandDetails.wxml-->
<view class="video" wx:if="{{infoObject.type===1}}"> <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)}}"> <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> </video>
</view> </view>
<view class="video" wx:if="{{infoObject.type===2}}"> <view class="video" wx:if="{{infoObject.type===2}}">
<image src="{{cdn+(infoObject.cover)}}" style="width: 100%;height: 100%;"> <image mode="widthFix" src="{{cdn+(infoObject.cover)}}" style="width: 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> </image>
</view> </view>
<view class="video" wx:if="{{infoObject.type===3}}"> <view class="video" wx:if="{{infoObject.type===3}}">
<image src="{{cdn+(infoObject.cover)}}" style="width: 100%;height: 100%;"> <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> </image>
</view> </view>
<view class="main"> <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> <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> <text style="width: 48rpx;height: 48rpx;">{{isClick?'已收藏': '收藏'}}</text>
</view> </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> <image src="../brandDetails/images/ic_baocun@3x.png" style="width: 48rpx;height: 48rpx;vertical-align: middle;margin-right: 10rpx;"></image>
<text>保存</text> <text>保存</text>
</view> </view>

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

Loading…
Cancel
Save