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

master
Tuisku 3 years ago
commit e1055fa68e

@ -24,7 +24,8 @@ Component({
* 组件的初始数据
*/
data: {
tags:Array
tags:Array,
cdn:getApp().globalData.cdn,
},
/**
@ -32,7 +33,9 @@ Component({
*/
methods: {
//跳转详情
detail(){
detail(e){
console.log(e)
wx.setStorageSync('info', e.currentTarget.dataset.cycle_id)
wx.navigateTo({
url:"/pages/index/subpage/brand/brandDetails/brandDetails?type=3"
})

@ -1,11 +1,15 @@
<!--components/spu-preview/index.wxml-->
<!-- <wxs src="../../wxs/price.wxs" module="p"></wxs> //这里是将折扣前后价格的逻辑放在了price.wxs内部 -->
<view class="card" bindtap="detail">
<view class="type">{{data.type === 1 ? '视频' : '文章'}}</view>
<view class="card" bindtap="detail" data-cycle_id="{{data}}">
<!-- <view class="type">{{data.type === 1 ? '视频' : '文章'}}</view> -->
<view class="type" wx:if="{{data.type === 1}}">视频</view>
<view class="type" wx:if="{{data.type === 2}}">图片</view>
<view class="type" wx:if="{{data.type === 3}}">文章</view>
<!-- <view></view> -->
<image style="width: 334rpx;height: 250rpx;background: linear-gradient(180deg, #599FFF 0%, #C4DDFF 100%);border-radius: 16rpx 16rpx 0rpx 0rpx;" src="../../pages/index/shortimage/img_xingtue@2x.png"></image>
<image style="width: 334rpx;height: 250rpx;border-radius: 16rpx 16rpx 0rpx 0rpx;" src="{{cdn+(data.cover)}}"></image>
<view class="tip">
<image wx:if="{{data.type === 1 ? '视频' : '文章'}}" style="width: 16rpx;height: 18rpx;margin-right: 5rpx;" src="../../pages/index/shortimage/img_xingtue@2x.png"></image>
<!-- <image wx:if="{{data.type === 1 ? '视频' : '文章'}}" style="width: 16rpx;height: 18rpx;margin-right: 5rpx;" src="../../pages/index/shortimage/img_xingtue@2x.png"></image> -->
<!-- {{data.count}} -->
<!-- <view class="crad_right_num">
{{data.type === 1 ? data.num+'次播放' : data.num+'次阅读'}}{{item.duration}}

@ -1,9 +1,11 @@
// index.js
// 获取应用实例
import {http} from '../../utils/util'
import {cdn}from '../../utils/config'
const app = getApp()
Page({
data: {
cdn:getApp().globalData.cdn,
toplist: [{
url: '/images/ic_bofang@3x.png',
title: '总播放量',
@ -91,7 +93,7 @@ Page({
console.log(e)
wx.setStorageSync('info', e.currentTarget.dataset.cycle_id)
wx.navigateTo({
url:"/pages/index/subpage/brand/brandDetails/brandDetails?type=3"
url:"/pages/index/subpage/brand/brandDetails/brandDetails"
})
},

@ -23,17 +23,18 @@
<view class="brand_top">
<view class="brand_title">品牌动态</view>
<view class="brand_tip">
<view bindtap="to" data-url="/pages/index/subpage/brand/brand">查看全部</view>
<view bindtap="to" data-url="/pages/index/subpage/brand/brand?type=">查看全部</view>
<l-icon name="right" size="24" color="#999999"></l-icon>
</view>
</view>
<view class="brand_mes">
<view wx:for="{{records}}" wx:key="url" data-cycle_id="{{item}}" class="brand_card" bindtap="detail">
<view class="brand_voa_type">
{{item.type === 1 ? '视频' : '文章'}}
</view>
<view wx:for="{{records}}" wx:key="index" wx:if="{{index < 4}}" data-cycle_id="{{item}}" class="brand_card" bindtap="detail">
<view class="brand_voa_type" wx:if="{{item.type === 1}}">视频</view>
<view class="brand_voa_type" wx:if="{{item.type === 2}}">图片</view>
<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="./shortimage/img_xingtue@2x.png"></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+'次阅读'}} -->

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

@ -1,7 +1,7 @@
/* pages/index/subpage/brand/brand.wxss */
.body{
width: 100%;
height: 1000rpx;
min-height: 100vh;
background-color: #F9F9F9;
}
.top_tip {

@ -1,11 +1,14 @@
// pages/quest/quest.js
import {http} from '../../../../../utils/util'
// import {DownloadSaveFile,downloadFile
// } from '../../../../../utils/downloadSaveFile.js'
Page({
/**
* 页面的初始数据
*/
data: {
cdn:getApp().globalData.cdn,
type:0,
// questes: [
// {
@ -69,7 +72,8 @@ Page({
records:[],
questes:[],
infoObject:{},
isClick:false
isClick:false,
// imageUrl:"/pages/index/shortimage/img_xingtue@2x.png"
},
back(){
@ -90,30 +94,34 @@ to(e) {
console.log(e)
wx.setStorageSync('info', e.currentTarget.dataset.cycle_id)
wx.navigateTo({
url:"/pages/index/subpage/brand/brandDetails/brandDetails?type=3"
url:"/pages/index/subpage/brand/brandDetails/brandDetails"
})
},
getcollection(){
},
//收藏
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)
// wx.navigateTo({
// url:"/pages/user/subpage/newest/newest"
// })
http("/userReference/add", "post", {userId,referenceId
}).then(res =>{
this.setData({
// userId:e.currentTarget.dataset.cycle_id,
// referenceId:this.id
if(!isClick){
that.setData({
isClick:true
})
})
wx.showToast({
title: '收藏成功',
icon: 'none'
})
http("/userReference/add", "post", {userId,referenceId
}).then(res =>{
this.setData({
// userId:e.currentTarget.dataset.cycle_id,
// referenceId:this.id
})
})
}
},
/**
@ -129,7 +137,11 @@ to(e) {
infoObject:wx.getStorageSync('info')
})
this.getrecordslist()
this.getcollection()
// var htmls =
// <dib><h1>解析</h1></dib>
// var that = this
// WxParse.wxParse('htmls','html',htmls,that,5);
},
getrecordslist(){
@ -187,32 +199,74 @@ to(e) {
* 用户点击右上角分享
*/
onShareAppMessage:function() {
// if (res.from === 'button') { // 来自页面内分享按钮
// console.log(e)
// }
var that = this
return {
title:this.data.infoObject.title,
path:"pages/index/subpage/brand/brandDetails/brandDetails?type=3",
imageUrl:"/pages/index/shortimage/img_xingtusi@2x.png",
title:that.data.infoObject.title,
path:"pages/index/subpage/brand/brandDetails/brandDetails",
// imageUrl:that.cdn+infoObject.cover,
}
},
//保存
preserve(){
// if(type=1){
// 视频
wx.saveVideoToPhotosAlbum({
filePath: 'wxfile://xxx',
success (res) {
console.log(res.errMsg)
}
})
// }else{
//图片
wx.saveImageToPhotosAlbum({
filePath:"../../../shortimage/img_xingtue@2x.png",
success(res) { }
})
// 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('用户点击取消')
}
}
})
// }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();
// }
// })
// }
// }
// })
// }
},
// downloadSaveFile(e) {
// let url = e.currentTarget.dataset.url;
// // 保存到相册
// DownloadSaveFile.downloadFile('video', url); //video或image
// }
}
})

@ -1,11 +1,16 @@
<!--pages/index/subpage/brand/brandDetails/brandDetails.wxml-->
<view class="video" wx:if="{{type==1}}">
<video style="width: 100%; " initial-time='0.01' muted autoplay object-fit="cover" src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400">
<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" />
</video>
</view>
<view class="video" wx:if="{{type==3}}">
<image src="../../../shortimage/img_xingtue@2x.png" style="width: 100%;height: 100%;">
<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>
</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" />
</image>
</view>
@ -15,9 +20,9 @@
<view class="card_time">{{infoObject.creatAt}}</view>
<!-- <view class="card_time">285w次播放 </view> -->
</view>
<view wx:if="{{type==3}}">
<text class="title_text">{{infoObject.content}}</text>
<view wx:if="{{infoObject.type===3}}">
<rich-text nodes="{{infoObject.content}}"></rich-text>
<!-- <text class="title_text">{{infoObject.content}}</text> -->
</view>
</view>
<view class="data_tup">
@ -30,7 +35,7 @@
</view>
<view class="d-flex-list" bindtap="collection">
<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 class="d-flex-list" bindtap="preserve">
<image src="../brandDetails/images/ic_baocun@3x.png" style="width: 48rpx;height: 48rpx;vertical-align: middle;margin-right: 10rpx;"></image>
@ -47,15 +52,18 @@
<view class="crad_left_top">
<view class="card_title">{{item.title}}</view>
<view class="crad_text">{{item.content}}</view>
<!-- <rich-text class="crad_text" nodes="{{item.content}}"></rich-text> -->
<view class="card_time">{{item.creatAt}}</view>
</view>
<!-- <view class="crad_image"></view> -->
<view class="crad_right">
<view class="crad_right_type"> {{item.type === 1 ? '视频' : '文章'}}</view>
<view class="crad_right_type" wx:if="{{item.type === 1}}">视频</view>
<view class="crad_right_type" wx:if="{{item.type === 2}}">图片</view>
<view class="crad_right_type" wx:if="{{item.type === 3}}">文章</view>
<view class="crad_right_num">
<!-- {{item.type === 1 ? item.num+'次播放' : item.num+'次阅读'}}{{item.duration}} -->
</view>
<image class="crad_image" src="/pages/quest/subpage/detail/image/short/img_xtuone@2x.png"></image>
<image class="crad_image" src="{{cdn+(item.cover)}}"></image>
</view>
</view>
<!-- </view> -->

@ -45,7 +45,7 @@ text {
line-height: 84rpx;
}
.quest {
padding: 24rpx 33rpx 0;
padding: 24rpx 33rpx;
/* margin-top:20rpx */
}
@ -69,7 +69,7 @@ text {
.card_time {
height: 50rpx;
font-size: 20rpx;
font-size: 20rpx!important;
font-family: MiSans-Regular, MiSans;
font-weight: 400;
color: #999999;
@ -110,7 +110,8 @@ text {
display: flex;
justify-content: space-between;
background: #f9f9f9;
padding: 10rpxrpx;
padding: 22rpx 20rpx;
margin: 20rpx 0;
}
.crad_left_top {
@ -119,7 +120,7 @@ text {
}
.crad_right {
width: 240rpx;
width: 280rpx;
height: 160rpx;
@ -153,7 +154,7 @@ text {
font-size: 22rpx;
color: white;
margin-top: 130rpx;
margin-left: 40rpx;
/* margin-left: 40rpx; */
display: flex;
/* align-items: center; */
}
@ -165,9 +166,7 @@ text {
margin: 10rpx 0;
line-height: 50rpx;
}
.data_tupp{
}
.d-flex{
padding:30rpx;
background: #fff;

Loading…
Cancel
Save