Compare commits

..

5 Commits

45 changed files with 895 additions and 2236 deletions

1
app.js
View File

@ -30,6 +30,5 @@ App({
token: '', token: '',
userId: '', userId: '',
showUserId: '', //当前浏览的人的ID showUserId: '', //当前浏览的人的ID
currentUserId: '', //当前登录人的UserID
}, },
}) })

View File

@ -4162,347 +4162,6 @@ l .text-depblack {
} }
/* 自定义 */ /* 自定义 */
/* 单文本评论框 */
.comment-line-box {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
background-color: #ffffff;
width: 100%;
padding: 15rpx;
}
.comment-line-input-box {
color: #000000;
border-radius: 5rpx;
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 15rpx;
background-color: #ffffff;
}
.comment-line-input-box text {
display: block;
visibility: hidden;
word-break: break-all;
word-wrap: break-word;
font-size: 28rpx;
color: #000000;
}
.comment-line-input-box .weui-textarea {
height: 180rpx;
width: 80%;
text-align: left;
padding: 15rpx;
background-color: #f2f2f2;
border-radius: 10rpx;
}
.comment-line-input {
flex-grow: 0.8;
background-color: #f0f0f0;
padding: 15rpx;
font-size: 28rpx;
line-height: 70rpx;
text-align: left;
height: 70rpx;
}
.comment-line-btn {
background-color: #E6B980;
color: #ffffff;
font-size: 28rpx;
padding: 15rpx;
text-align: center;
margin-left: 15rpx;
width: 20%;
border-radius: 5rpx;
}
/*多媒体 评论发布框 */
.comment-box {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
background-color: #ffffff;
width: 100%;
}
/* 评论输入框按钮 */
.comment-box .input {
background-color: #f0f0f0;
border-radius: 15rpx;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 15rpx 0rpx;
flex: 6;
}
.click-white {
background-color: #ffffff;
}
/* 评论输入框 */
.comment-content-box {
display: flex;
flex-direction: row;
justify-content: center;
align-items: flex-end;
width: 100%;
padding: 15rpx;
}
.comment-content-box .btn {
font-size: 32rpx;
color: #ff0000;
text-align: center;
flex-grow: 0.1;
}
.comment-content-input {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
min-height: 200rpx;
background-color: #f0f0f0;
padding: 15rpx;
font-size: 28rpx;
flex-grow: 0.9;
border-radius: 10rpx;
}
.comment-content-input textarea {
font-size: 28rpx;
height: 180rpx;
width: 100%;
}
.comment-content-funcs {
display: flex;
width: 100%;
flex-direction: row;
justify-content: flex-end;
align-items: center;
padding: 0rpx 15rpx 15rpx 15rpx;
}
.comment-comment-funcs .icons {
font-size: 50rpx;
padding: 0rpx 15rpx;
}
.icon-comment {
font-size: 50rpx;
flex: 2;
text-align: center;
}
.icon-comment:nth-child(1) {
margin-left: 15rpx;
}
.comment-list-box {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
width: 100%;
background-color: #ffffff;
padding: 15rpx;
min-height: 1000rpx;
margin-bottom: 100rpx;
margin-top: 15rpx;
}
.comment-list-title {
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
font-size: 32rpx;
color: #000000;
}
.comment-list-item-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
width: 100%;
margin: 15rpx 0rpx;
}
.comment-list-item-box:nth-child(1) {
margin: 25rpx 0rpx 15rpx 0rpx;
}
.comment-list-item-content {
font-size: 28rpx;
padding: 15rpx 0rpx 15rpx 0rpx;
margin-left: 64rpx;
width: 90%;
}
.comment-count {
background-color: #f0f0f0;
padding: 0rpx 15rpx 0rpx 15rpx;
border-radius: 10rpx;
font-size: 24rpx;
}
/* 评论的回复 */
.restore-content-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
padding: 0rpx 15rpx 15rpx 15rpx;
border-bottom: 1rpx solid #f3f3f3;
}
.line {
width: 100%;
height: 1rpx;
background-color: #f3f3f3;
padding: 0rpx 15rpx 0rpx 15rpx;
}
.restore-content-title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
width: 100%;
}
.restore-content-title text {
margin: 0rpx 0rpx 0rpx 15rpx;
color: #000000;
font-size: 32rpx;
}
.restore-content-title image {
width: 64rpx;
height: 64rpx;
border-radius: 50%;
}
.dialog-content {
width: 100%;
height: 50%;
}
.restore-content {
font-size: 28rpx;
padding: 15rpx 0rpx 15rpx 0rpx;
margin-left: 75rpx;
width: 90%;
}
.item-title-box {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 100%;
padding-right: 30rpx;
}
.restore-box {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
align-items: center;
padding: 15rpx 30rpx 15rpx 64rpx;
}
.comment-input {
width: 80%;
background-color: #f3f3f3;
line-height: 70rpx;
height: 70rpx;
text-align: left;
padding: 0rpx 15rpx 0rpx 15rpx;
border-radius: 5rpx;
}
.comment-item-title {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
width: 100%;
}
.comment-item-title image {
width: 48rpx;
height: 48rpx;
border-radius: 50%;
}
.comment-item-title .comment-user-name {
font-size: 28rpx;
color: #000000;
text-align: center;
line-height: 48rpx;
margin-left: 15rpx;
}
.func-items {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 15rpx;
}
.func-item {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
flex: 1;
color: #000;
width: 23%;
border-right: 1rpx solid #f8f8f8;
}
.func-item:last-child {
border-right: 0rpx;
}
.func-item:active {
background-color: #f3f3f3;
color: #dfdfdf;
}
.func-item image {
width: 48rpx;
height: 48rpx;
}
.func-item text {
margin-left: 10rpx;
text-align: center;
}
.tab { .tab {
position: fixed; position: fixed;
display: flex; display: flex;
@ -4686,7 +4345,7 @@ l .text-depblack {
} }
.line-gray-ssm { .line-gray-ssm {
background-color: #f8f8f8; background-color: rgb(243, 243, 243);
height: 2rpx; height: 2rpx;
width: 95%; width: 95%;
align-self: center; align-self: center;

BIN
images/ic_collect_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 810 B

BIN
images/ic_comment_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

BIN
images/ic_favour.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

BIN
images/ic_unfavour.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
images/ic_wechat_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

View File

@ -242,12 +242,6 @@ Page({
} else { } else {
area[i]['templateAreaFontStyle'] = 'italic' area[i]['templateAreaFontStyle'] = 'italic'
} }
// if (area[i].templateAreaServerLink == '1') {
// if (area[i].templateAreaFontValue.length > area[i].templateAreaFontLength) {
// area[i].templateAreaFontValue = area[i].templateAreaFontValue.substring(area[i].templateAreaFontLength, -1)
// }
// }
// area[i].templateAreaFontSize = Math.floor(() + 'rpx'
area[i].templateAreaFontSize = area[i].templateAreaFontSize / scale + 'px' area[i].templateAreaFontSize = area[i].templateAreaFontSize / scale + 'px'
area[i].templateAreaHeight = area[i].templateAreaHeight / scale area[i].templateAreaHeight = area[i].templateAreaHeight / scale
area[i].templateAreaWidth = area[i].templateAreaWidth / scale area[i].templateAreaWidth = area[i].templateAreaWidth / scale

View File

@ -11,7 +11,7 @@
<view <view
class="area-box {{item.templateAreaFontCenter == 'left' ? 'wrap-line' :''}} {{item.templateAreaFontCenter == 'center' ? 'wrap-center' :''}} {{item.templateAreaFontCenter == 'right' ? 'wrap-line' :''}} " class="area-box {{item.templateAreaFontCenter == 'left' ? 'wrap-line' :''}} {{item.templateAreaFontCenter == 'center' ? 'wrap-center' :''}} {{item.templateAreaFontCenter == 'right' ? 'wrap-line' :''}} "
wx:for="{{areaList}}" data-cur="{{index}}" catchtap="giveFocus" wx:key="index" wx:for="{{areaList}}" data-cur="{{index}}" catchtap="giveFocus" wx:key="index"
style="position:absolute;top: {{(item.templateAreaTop / cardInfo.picturesTemplateHeight) * 100 + '%'}};left:{{(item.templateAreaLeft / cardInfo.picturesTemplateWidth) * 100 + '%'}};color:{{item.templateAreaFontColor}};;width:{{item.templateAreaWidth }}px;height:{{item.templateAreaHeight}}px;font-size:{{item.templateAreaFontSize}};font-style:{{item.templateAreaFontStyle}};font-weight:{{item.templateAreaFontBold}};text-align:{{item.templateAreaFontCenter}};" style="position:absolute;top: {{(item.templateAreaTop / cardInfo.picturesTemplateHeight) * 100 + '%'}};left:{{(item.templateAreaLeft / cardInfo.picturesTemplateWidth) * 100 + '%'}};color:{{item.templateAreaFontColor}};;width:{{item.templateAreaWidth }}px;height:{{item.templateAreaHeight}}px;font-size:{{item.templateAreaFontSize}};font-style:{{item.templateAreaFontStyle}};font-weight:{{item.templateAreaFontBold}};text-align:{{item.templateAreaFontCenter}};line-height:{{item.templateAreaHeight}}px;"
wx:if="{{item.templateAreaServerLink == '1' && item.templateAreaType != '1'}}"> wx:if="{{item.templateAreaServerLink == '1' && item.templateAreaType != '1'}}">
{{item.templateAreaFontValue}} {{item.templateAreaFontValue}}
</view> </view>

View File

@ -16,7 +16,6 @@
} }
.area-box { .area-box {
white-space: nowrap;
background: none !important; background: none !important;
z-index: 111; z-index: 111;
} }
@ -212,7 +211,7 @@
/* 换行 */ /* 换行 */
.wrap-line { .wrap-line {
white-space: pre-line; overflow-wrap: break-word;
} }
/* 居中 */ /* 居中 */
@ -220,4 +219,5 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow-wrap: break-word;
} }

View File

@ -18,13 +18,17 @@ Page({
isRefresh: false, isRefresh: false,
isShowCodeInput: false, //测试true isShowCodeInput: false, //测试true
code: '', //邀请码 code: '', //邀请码
contentHeight: app.globalData.windowHeight conentHeight: 550, //滚动内容的高度
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
// this.getPayState() // this.getPayState()
//屏幕高度-标题的高度
this.setData({
conentHeight: app.globalData.windowHeight
})
}, },
onShow() { onShow() {
this.dorefreshList() this.dorefreshList()
@ -57,7 +61,8 @@ Page({
if (res.data.length > 0) { if (res.data.length > 0) {
_self.setData({ _self.setData({
optionsList: res.data, optionsList: res.data,
curTypeId: res.data[_self.data.currentIndex].dataId curTypeId: res.data[_self.data.currentIndex].dataId,
currentIndex: _self.data.currentIndex
}) })
//根据第一条获取数据 //根据第一条获取数据
_self.getList() _self.getList()
@ -80,9 +85,7 @@ Page({
token: app.globalData.token token: app.globalData.token
}, },
data: { data: {
templateType: self.data.curTypeId, templateType: self.data.curTypeId
page: '1',
rows: '2'
} }
}).then(res => { }).then(res => {
wx.hideLoading({}) wx.hideLoading({})
@ -216,9 +219,5 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: '/packagecard/paypage/paypage?price=' + _self.data.needPayPrice + '&teamprice=' + _self.data.needPayTeamPrice + '&displayTreaty=1&type=1', url: '/packagecard/paypage/paypage?price=' + _self.data.needPayPrice + '&teamprice=' + _self.data.needPayTeamPrice + '&displayTreaty=1&type=1',
}) })
},
//加载更多
loadMore() {
console.log('触底了')
} }
}) })

View File

@ -11,11 +11,9 @@
</block> </block>
</van-tabs> </van-tabs>
</view> </view>
<scroll-view style="margin-top: 70rpx;height: {{conentHeight}}px;" refresher-enabled="true"
<scroll-view style="height: {{contentHeight}}px;" refresher-enabled="true" enable-flex="{{true}}" lower-threshold="5rpx" refresher-threshold="{{50}}" refresher-background="#fff" enhanced="{{true}}" scroll-y
refresher-background="#fff" scroll-y bindscrolltolower="loadMore" bindrefresherrefresh="dorefreshList" bindrefresherrefresh="dorefreshList" refresher-triggered="{{isRefreshing}}">
refresher-triggered="{{isRefreshing}}">
<view style="height: 90rpx;"></view>
<block wx:if="{{cardList.length>0}}"> <block wx:if="{{cardList.length>0}}">
<view class="page-box"> <view class="page-box">
<block wx:for="{{cardList}}" wx:key="index"> <block wx:for="{{cardList}}" wx:key="index">

View File

@ -15,7 +15,7 @@ Page({
tabList: [{ tabList: [{
name: '营销模板', name: '营销模板',
}, { }, {
name: '发布历史' name: '我的海报'
}], }],
isRefreshing: false, //是否刷新中 isRefreshing: false, //是否刷新中
isLoadMore: false, //是否在加载中 isLoadMore: false, //是否在加载中
@ -28,7 +28,8 @@ Page({
isShowOptions: false, //是否显示选项 isShowOptions: false, //是否显示选项
curItemIndex: -1, //点击分享按钮弹出的 curItemIndex: -1, //点击分享按钮弹出的
curTypeName: '全部', curTypeName: '全部',
contentHeight: app.globalData.windowHeight contentHeight: 550, //内容区域的高度
shareTitle: '活动'
}, },
/** /**
@ -38,6 +39,19 @@ Page({
var _self = this var _self = this
//获取类型 //获取类型
_self.getOptionsList() _self.getOptionsList()
this.setData({
contentHeight: app.globalData.windowHeight
})
try {
var title = wx.getStorageSync('postertitle')
if (title) {
_self.setData({
shareTitle: title
})
}
} catch (error) {
}
}, },
//获取类型 //获取类型
getOptionsList() { getOptionsList() {
@ -173,14 +187,15 @@ Page({
}) })
var type = res.target.dataset.sharetype var type = res.target.dataset.sharetype
var img = _self.data.imgUrl + _self.data.posterHistoryList[_self.data.curItemIndex].cardTemplateUsePhotoUrl var img = _self.data.imgUrl + _self.data.posterHistoryList[_self.data.curItemIndex].cardTemplateUsePhotoUrl
var id = _self.data.posterHistoryList[_self.data.curItemIndex].cardTemplateUseId
var userId = _self.data.posterHistoryList[_self.data.curItemIndex].creator
if (type && type == '2') { if (type && type == '2') {
//转发个人动态 //转发个人动态
} else { } else {
var param = '/pages/index/index?posterId=' + img; var param = '/pages/index/index?cardTemplateUseId=' + id + '&userId=' + userId;
return { return {
title: '活动', title: _self.data.shareTitle,
path: param, path: param,
imageUrl: img imageUrl: img
} }
@ -468,11 +483,4 @@ Page({
isShowSel: false isShowSel: false
}) })
} }
//分享到朋友圈
// onShareTimeline(options) {
// var params = {}
// params['title'] = '分享朋友圈'
// params['imageUrl'] = 'https://img2.baidu.com/it/u=2645096297,1507428582&fm=26&fmt=auto&gp=0.jpg'
// return params
// }
}) })

View File

@ -29,10 +29,9 @@
</view> </view>
<!-- 模板 --> <!-- 模板 -->
<scroll-view style="height: {{contentHeight}}px;" refresher-enabled="true" refresher-threshold="{{50}}" <scroll-view style="margin-top: 70rpx;height: {{contentHeight}}px;" refresher-enabled="true"
wx:if="{{currentIndex == 0}}" refresher-background="#fff" enhanced="{{true}}" scroll-y refresher-threshold="{{50}}" wx:if="{{currentIndex == 0}}" refresher-background="#fff" enhanced="{{true}}" scroll-y
bindrefresherrefresh="dorefreshList" refresher-triggered="{{isRefreshing}}"> bindrefresherrefresh="dorefreshList" refresher-triggered="{{isRefreshing}}">
<view style="height: 90rpx;"></view>
<block wx:if="{{posterTempleteList.length>0}}"> <block wx:if="{{posterTempleteList.length>0}}">
<view class="img-box"> <view class="img-box">
<block wx:for="{{posterTempleteList}}" wx:key="index"> <block wx:for="{{posterTempleteList}}" wx:key="index">
@ -64,10 +63,9 @@
</view> </view>
</scroll-view> </scroll-view>
<!-- 发布历史 --> <!-- 发布历史 -->
<scroll-view style="height: {{contentHeight}}px;" refresher-enabled="true" refresher-threshold="{{50}}" <scroll-view style="margin-top: 70rpx;height: {{contentHeight}}px;" refresher-enabled="true"
refresher-background="#fff" enhanced="{{true}}" scroll-y bindrefresherrefresh="dorefreshList" refresher-threshold="{{50}}" refresher-background="#fff" enhanced="{{true}}" scroll-y
refresher-triggered="{{isRefreshing}}" wx:else> bindrefresherrefresh="dorefreshList" refresher-triggered="{{isRefreshing}}" wx:else>
<view style="height: 90rpx;"></view>
<block wx:if="{{posterHistoryList.length>0}}"> <block wx:if="{{posterHistoryList.length>0}}">
<view class="img-box"> <view class="img-box">
<block wx:for="{{posterHistoryList}}" wx:key="index"> <block wx:for="{{posterHistoryList}}" wx:key="index">

View File

@ -16,7 +16,6 @@
} }
.area-box { .area-box {
white-space: nowrap;
background: none !important; background: none !important;
z-index: 111; z-index: 111;
} }
@ -211,7 +210,7 @@
/* 换行 */ /* 换行 */
.wrap-line { .wrap-line {
white-space: pre-line; overflow-wrap: break-word;
} }
/* 居中 */ /* 居中 */
@ -219,4 +218,5 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow-wrap: break-word;
} }

View File

@ -2,72 +2,25 @@ const app = getApp()
var innerAudioContext = wx.createInnerAudioContext() var innerAudioContext = wx.createInnerAudioContext()
Page({ Page({
data: { data: {
actions: [{
className: 'dialog-content'
}],
dataList: [], dataList: [],
isShowCommentInput: false, //是否显示评论等
collectSwitch: '1', //收藏的开关默认关闭
likeSwitch: '1', //点赞的开关
commentSwitch: '1', //评论的开关
shareSwitch: '1', //转发的开关
speedStep: 5, //快进快退秒数 speedStep: 5, //快进快退秒数
waitFlag: false, waitFlag: false,
avatarUrl: app.globalData.userInfo.avatarUrl, avatarUrl: app.globalData.userInfo.avatarUrl,
imgUrl: app.urls.baseImgUrl, imgUrl: app.urls.baseImgUrl,
uId: '', uId: '',
columnId: '', columnId: '',
publishTime: '', publishTime: ''
isShowComment: false, //是否显示评论输入框
maxVideo: 1, //评论最大可以上传的视频数量
maxPhoto: 1, //评论最大可以上传的图片数量
commentValue: '', //评论输入的内容
mediaBean: null, //评论图片或视频bean {id:'',type:'video or image',coverPath:'图片路径'}
uploadCount: 0, //上传图片的次数
uploadVideoCount: 0, //上传视频的次数
maxDuration: 60, //上传视频时长限制
dataId: '', //当前评论Id
commentList: [], //评论列表
commentCount: 0,
currentPage: 1, //当前评论页数
curUserId: app.globalData.currentUserId,
isShowRestore: false,
restoreList: [],
currentCommentItem: undefined, //当前评论条目
currentType: 2, //当前评论类型
restorePage: 1, //当前回复的页数
restoreCount: 0,
likeStatus: false, //点赞
collectStatus: false, //收藏,
restoreLikeStatus: false, //评论点赞
contentHeight: app.globalData.windowHeight
}, },
onLoad(options) { onLoad(options) {
var _self = this var _self = this
this.setData({ this.setData({
uId: options.uId, uId: options.uId,
columnId: options.cId, columnId: options.cId
dataId: options.uId,
collectSwitch: options.collectSwitch, //收藏的开关
likeSwitch: options.likeSwitch, //点赞的开关
commentSwitch: options.commentSwitch, //评论的开关
shareSwitch: options.shareSwitch, //转发的开关
}) })
var isShow = options.collectSwitch == '3' || options.collectSwitch == '4' || options.likeSwitch == '3' && options.likeSwitch == '4' || options.shareSwitch == '3' || options.shareSwitch == '4' || options.commentSwitch == '3' || options.commentSwitch == '4'
if (isShow) {
_self.setData({
isShowCommentInput: true
})
} else {
_self.setData({
isShowCommentInput: false
})
}
_self.getMainMoment() _self.getMainMoment()
_self.getCommentList()
_self.getColumnContentHandle(this.data.uId, 2)
}, },
// 获取栏目内容
getMainMoment() { getMainMoment() {
wx.showLoading({ wx.showLoading({
title: '加载中...', title: '加载中...',
@ -91,66 +44,6 @@ Page({
console.log(err) console.log(err)
}) })
}, },
//获取栏目内容点赞 收藏 评论
getColumnContentHandle(ids, type) {
var _self = this
wx.showLoading({
title: '加载中...',
})
app.http.get(app.urls.getColumnContentHandle.format({
projectId: 'column',
businessIds: ids
}), {
header: {
token: app.globalData.token
}
})
.then(res => {
wx.hideLoading({})
if (res.data.length > 0) {
if (type == 2) {
//栏目
_self.setData({
likeStatus: res.data[0].likeStatus,
collectStatus: res.data[0].collectStatus
})
} else {
if (_self.data.currentType == 2) {
//评论
_self.data.commentList.forEach(it => {
res.data.forEach(item => {
if (it.contentCommentId == item.businessId) {
it.likeStatus = item.likeStatus
it.contentCommentLike = item.likeCount
it.contentCommentSubCount = item.commentCount
}
})
})
_self.setData({
commentList: _self.data.commentList
})
} else {
//回复
_self.data.restoreList.forEach(it => {
res.data.forEach(item => {
if (it.contentCommentId == item.businessId) {
it.likeStatus = item.likeStatus
it.contentCommentLike = item.likeCount
it.contentCommentSubCount = item.commentCount
}
})
})
_self.setData({
restoreList: _self.data.restoreList
})
}
}
}
})
.catch(err => {
})
},
//构建展示数据 //构建展示数据
buildDetail(data) { buildDetail(data) {
var _self = this var _self = this
@ -160,14 +53,7 @@ Page({
data.list.forEach(it => { data.list.forEach(it => {
switch (it.dataType) { switch (it.dataType) {
case '2': //图片 case '2': //图片
var photoIds = it.value.split('@') var items = it.value.split(',')
if (photoIds.length > 1) {
//展示方式
it.dataMode = photoIds[1]
} else {
it.dataMode = '1'
}
var items = photoIds[0].split(',')
var tempList = [] var tempList = []
items.forEach(item => { items.forEach(item => {
if (item.length > 0) { if (item.length > 0) {
@ -269,75 +155,7 @@ Page({
dataList: data.list dataList: data.list
}) })
}, },
//获取评论列表
getCommentList() {
var _self = this
app.http.get(app.urls.getCommentList.format({
projectId: 'column',
businessId: _self.data.dataId
}), {
header: {
token: app.globalData.token
},
data: {
page: _self.data.currentPage
}
})
.then(res => {
wx.hideLoading({})
var ids = ''
res.data.rows.forEach(it => {
it.likeStatus = false
ids += it.contentCommentId + ','
})
_self.data.commentList = _self.data.commentList.concat(res.data.rows)
_self.setData({
commentList: _self.data.commentList,
commentCount: res.data.total
})
if (ids.length > 0) {
_self.getColumnContentHandle(ids, 3)
}
})
.catch(err => {
console.log(res)
})
},
//获取评论的回复
getRestoreList() {
var _self = this
app.http.get(app.urls.getCommentList.format({
projectId: 'column',
businessId: _self.data.dataId
}), {
header: {
token: app.globalData.token
},
data: {
page: _self.data.restorePage
}
})
.then(res => {
wx.hideLoading({})
var ids = ''
res.data.rows.forEach(it => {
it.likeStatus = false
ids += it.contentCommentId + ','
})
_self.data.restoreList = _self.data.restoreList.concat(res.data.rows)
_self.setData({
restoreList: _self.data.restoreList,
restoreCount: res.data.total,
isShowRestore: true
})
if (ids.length > 0) {
_self.getColumnContentHandle(ids, 3)
}
})
.catch(err => {
console.log(res)
})
},
//预览图片 //预览图片
viewImg(e) { viewImg(e) {
wx.previewImage({ wx.previewImage({
@ -506,6 +324,302 @@ Page({
innerAudioContext.seek(e.detail.value) innerAudioContext.seek(e.detail.value)
} }
}, },
// 跳转模板列表
goList: function () {
wx.navigateTo({
url: 'packagecard/cardList/cardList',
})
},
// 获取个人简介
getPersonIntro: function () {
var self = this
app.restAjax.get(app.restAjax.path('{personIntroUrl}app/userexpand/get/' + app.globalData.userInfo.userId, [app.personIntroUrl]), {}, {
headers: {
token: app.globalData.token
}
}, function (code, data) {
self.setData({
personIntro: data
})
}, function (code, data) {
app.dialog.msg(data.msg);
});
},
// 获取用户信息
getUserInfo: function () {
var self = this
app.restAjax.get(app.restAjax.path('{loginUrl}app/user/get-app-user', [app.personIntroUrl]), {}, {
headers: {
token: app.globalData.token
}
}, function (code, data) {
app.globalData.userInfo = data
self.getList()
}, function (code, data) {
app.dialog.msg(data.msg);
});
},
// 获取默认名片
getDefault: function () {
var self = this
app.http.get(app.urls.getDefaultCard, {
header: {
token: app.globalData.token
},
data: {}
}).then(res => {
var area = res.data.areaList
for (let i = 0; i < area.length; i++) {
if (area[i].templateAreaFontCenter == '1') {
area[i].templateAreaFontCenter = 'left'
} else if (area[i].templateAreaFontCenter == '2') {
area[i].templateAreaFontCenter = 'center'
} else {
area[i].templateAreaFontCenter = 'right'
}
if (area[i].templateAreaFontBold == '0') {
area[i].templateAreaFontBold = 'normal'
} else if (area[i].templateAreaFontBold == '1') {
area[i].templateAreaFontBold = 'bold'
} else {
area[i]['templateAreaFontStyle'] = 'italic'
}
if (area[i].templateAreaSource == 'phone') {
self.setData({
phoneTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'wechat') {
self.setData({
wechatTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'email') {
self.setData({
emailTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'address') {
self.setData({
addressTxt: area[i].templateAreaFontValue
})
} else if (area[i].templateAreaSource == 'name') {
self.setData({
nameTxt: area[i].templateAreaFontValue
})
}
}
self.setData({
cardInfo: res.data,
areaList: area,
dataList: []
})
if (res.data) {
self.toSaveLocalImg(res.data.cardTemplateUseDispatchPhoto)
self.getBrowCardUserList(res.data.cardTemplateUseId)
self.getMainColumn(res.data.creator)
}
}).catch(res => {
})
},
//获取浏览当前名片的用户头像列表
getBrowCardUserList(id) {
var _self = this
app.http.get(app.urls.getCardBrowUserList, {
header: {
token: app.globalData.token
},
data: {
page: '1',
rows: '7',
cardTemplateUseId: id
}
})
.then(res => {
if (res.data) {
_self.setData({
browUserList: res.data.rows
})
}
})
.catch(err => {
console.log(err)
})
},
// 存入通讯录
addContact: function () {
var self = this
wx.addPhoneContact({
firstName: self.data.nameTxt,
mobilePhoneNumber: self.data.phoneNum
})
},
// 加入卡包
includedCard: function () {
var self = this
app.http.post(app.urls.includedCard, {
header: {
token: self.data.token
},
data: {
cardTemplateUseBagId: "",
cardTemplateUseId: self.data.cardInfo.cardTemplateUseId,
cardTemplateUseStar: "",
cardTemplateUseTag: "",
cardTemplateUseTop: ""
}
}).then(res => {
console.log(res.data)
if (res.statusCode == '200') {
wx.showToast({
title: '加入卡包成功!',
})
}
})
},
// 拨打电话
makeCall: function () {
var self = this
var phone = self.data.phoneTxt
if (phone) {
wx.makePhoneCall({
phoneNumber: phone,
})
}
},
// 获取浏览数
getViewCount: function () {
var self = this
app.restAjax.get(app.restAjax.path('{cardUrl}app/templateviewrecord/getByTemplateUseId/' + self.data.cardInfo.cardPersonId, [app.cardUrl]), {}, {
headers: {
token: app.globalData.token
}
}, function (code, data) {
self.setData({
viewInfo: data
})
}, function (code, data) {
if (data.msg) {
app.dialog.msg(data.msg);
}
});
},
// 获取转发数
getForwardCount: function () {
var self = this
app.restAjax.get(app.restAjax.path('{cardUrl}app/templateforwardingrecord/count', [app.cardUrl]), {
templateUseId: self.data.cardInfo.cardPersonId
}, {
headers: {
token: app.globalData.token
}
}, function (code, data) {
self.setData({
forwardCount: data.data
})
}, function (code, data) {
app.dialog.msg(data.msg);
});
},
// 复制文本
copyText: function (e) {
var self = this
var text = e.currentTarget.dataset.text
if (text) {
wx.setClipboardData({
data: text,
success: function () {}
})
}
},
// 获取头像
checkPermission() {
var _self = this
try {
var names = wx.getStorageSync('name')
var icon = wx.getStorageSync('userIcon')
if (names) {
this.setData({
name: names,
userIcon: icon
})
} else {
wx.showModal({
title: '提示',
content: '小程序需要您微信头像以及昵称用于展示,请授权.',
showCancel: false,
success(res) {
if (res.confirm) {
_self.getUserProfile(3)
}
}
})
}
} catch (error) {
wx.showToast({
title: '获取信息失败',
icon: 'error'
})
}
},
getUserProfile(e) {
let _self = this
wx.getUserProfile({
desc: '获取微信头像以及昵称用于展示',
success: (res) => {
wx.setStorage({
data: res.userInfo.nickName,
key: 'name',
})
wx.setStorage({
data: res.userInfo.avatarUrl,
key: 'userIcon',
})
_self.setData({
name: res.userInfo.nickName,
userIcon: res.userInfo.avatarUrl
})
app.globalData.userIcon = res.userInfo.avatarUrl
app.globalData.userInfo = res.userInfo
_self.selectComponent('#head').refreshCart()
},
fail(err) {
//判断是否绑定手机号
wx.showToast({
title: '获取个人信息失败',
icon: 'error',
})
}
})
},
// 生成随机id
buildId: function () {
var chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
var nums = "";
for (var i = 0; i < 36; i++) {
var id = parseInt(Math.random() * 61);
nums += chars[id];
}
return nums
},
// 展示名片码
showBarCode: function () {
this.setData({
isShowBarCode: true
})
wx.hideTabBar()
},
// 隐藏名片码
hideBarCode: function () {
this.setData({
isShowBarCode: false
})
wx.showTabBar()
},
// 转发记录 // 转发记录
shareRecord: function (cardTemplateDispatchId) { shareRecord: function (cardTemplateDispatchId) {
var self = this var self = this
@ -551,417 +665,4 @@ Page({
// // return返回 title 转发标题 path 路径 imageUrl 自定义图片,可以本地路径 代码包文件路径 支持png jpg 显示长宽比5:4 // // return返回 title 转发标题 path 路径 imageUrl 自定义图片,可以本地路径 代码包文件路径 支持png jpg 显示长宽比5:4
// } // }
// }, // },
inputWatch(e) {
this.setData({
commentValue: e.detail.value
})
},
delMedia() {
var _self = this
wx.showModal({
title: '警告',
content: '确定要删除该数据吗?',
success(res) {
if (res.confirm) {
_self.setData({
mediaBean: null
})
}
}
})
},
//删除评论
delComment(e) {
var _self = this
var id = e.currentTarget.dataset.id
var index = e.currentTarget.dataset.idx
wx.showModal({
title: '提示',
content: '确定要删除该评论吗?',
success(res) {
if (res.confirm) {
//删除评论,刷新列表
_self.doDelComment(id, index)
}
}
})
},
//删除评论或回复
doDelComment(id, index) {
var _self = this
wx.showLoading({
title: '删除中...',
})
app.http.delete(app.urls.doDelComment.format({
ids: id
}), {
header: {
token: app.globalData.token
}
})
.then(res => {
wx.hideLoading({})
wx.showToast({
title: '删除成功',
})
//删除成功 刷新列表
if (_self.data.currentType == 2) {
//评论
_self.data.commentList.splice(index, 1)
_self.setData({
commentList: _self.data.commentList
})
} else {
//回复
_self.data.restoreList.splice(index, 1)
_self.data.commentList.forEach(it => {
if (it.contentCommentId == _self.data.dataId) {
it.contentCommentSubCount--
}
})
_self.setData({
restoreList: _self.data.restoreList,
commentList: _self.data.commentList
})
}
})
.catch(err => {
})
},
//评论的评论
doCommentToComment(e) {
var _self = this
var id = e.currentTarget.dataset.id
var item = e.currentTarget.dataset.item
_self.setData({
dataId: id,
currentPage: 1,
restoreList: [],
currentCommentItem: item,
currentType: 3
})
_self.getRestoreList()
},
//显示评论输入框
showComment() {
this.setData({
isShowComment: true
})
},
//关闭评论输入框
onCloseDialog(e) {
this.setData({
isShowComment: false
})
},
onCloseRestore(e) {
var _self = this
_self.setData({
isShowRestore: false,
currentType: 2,
dataId: _self.data.uId,
restoreList: [],
currentCommentItem: undefined
})
},
//选择图片
chooseImg() {
var _self = this
wx.chooseImage({
count: _self.data.maxPhoto,
sourceType: ['album', 'camera'],
success: (res) => {
if (res.tempFilePaths.length > 0) {
_self.doUploadImg(res.tempFilePaths)
}
},
fail: (err) => {
}
})
},
doUploadImg(paths) {
wx.showLoading({
title: '上传中...',
})
let _self = this
app.http.upload(app.urls.doUploadImg, {
path: paths[0],
name: 'image',
header: {
token: app.globalData.token
}
})
.then(res => {
wx.hideLoading({})
//插入到集合中
var id = JSON.parse(res).data
var pathStr = app.urls.baseImgUrl + id
var item = {
id: id,
type: 'image',
coverPath: pathStr,
path: pathStr
}
_self.setData({
mediaBean: item
})
})
.catch(err => {
wx.hideLoading({})
_self.setData({
mediaBean: null
})
})
},
//选择视频
chooseVideo() {
var _self = this
wx.chooseMedia({
count: _self.data.maxVideo,
mediaType: ['video'],
sourceType: ['camera', 'album'],
maxDuration: 60,
success: (res) => {
console.log(res)
if (res.tempFiles.length > 0) {
if (res.tempFiles[0].duration <= _self.data.maxDuration) {
_self.doUploadVideo(res.tempFiles)
} else {
wx.showToast({
title: '视频最长60秒',
icon: 'none'
})
}
}
},
fail: (err) => {}
})
},
//上传视频
doUploadVideo(paths) {
wx.showLoading({
title: '上传中...',
})
let _self = this
app.http.upload(app.urls.doUploadVideo, {
path: paths[0].tempFilePath,
name: 'video',
header: {
token: app.globalData.token
}
})
.then(res => {
wx.hideLoading({})
var id = JSON.parse(res).data
var pathStr = app.urls.baseImgUrl + id
var item = {
id: id,
type: 'video',
coverPath: paths[0].thumbTempFilePath,
path: pathStr
}
_self.setData({
mediaBean: item
})
})
.catch(err => {
wx.hideLoading({})
_self.setData({
mediaBean: null
})
})
},
//校验评论参数
doSubmitComment(e) {
var _self = this
console.log(e)
var id = e.currentTarget.dataset.id
if (_self.data.commentValue.length > 0) {
_self.doSaveComment(id)
} else {
wx.showToast({
title: '请输入要发布的内容',
icon: 'none'
})
}
},
//保存评论
doSaveComment(id) {
var _self = this
wx.showLoading({
title: '保存中...',
})
app.http.post(app.urls.doSaveComment, {
header: {
token: app.globalData.token
},
data: {
businessId: id,
projectId: 'column',
contentCommentContent: _self.data.commentValue
}
})
.then(res => {
wx.hideLoading({})
wx.showToast({
title: '评论成功',
})
if (_self.data.currentType == 2) {
_self.setData({
commentValue: '',
isShowComment: false,
currentPage: 1, //重置评论列表
commentList: [],
commentCount: 0
})
//刷新列表
_self.getCommentList()
} else {
_self.data.commentList.forEach(it => {
if (it.contentCommentId == id) {
it.contentCommentSubCount++
}
})
_self.setData({
commentValue: '',
isShowComment: false,
restorePage: 1,
restoreList: [],
restoreCount: 0,
commentList: _self.data.commentList
})
_self.getRestoreList()
}
})
.catch(err => {
wx.hideLoading({})
_self.setData({
isShowComment: false
})
})
},
//点赞
doLike(e) {
var _self = this
var type = e.currentTarget.dataset.type //用来判断是栏目内容或评论与回复
var id = type == '2' ? _self.data.uId : e.currentTarget.dataset.id
var index = -1
if (type == '4') {
_self.data.commentList.forEach((item, idx) => {
if (item.contentCommentId == id) {
index = idx
}
})
} else {
index = e.currentTarget.dataset.idx //索引
}
var favor = type == '2' ? _self.data.likeStatus : e.currentTarget.dataset.like //当前的状态
var msg = ''
if (favor) {
msg = '取消中...'
} else {
msg = '保存中...'
}
wx.showLoading({
title: msg,
})
app.http.post(app.urls.doSaveLike, {
header: {
token: app.globalData.token
},
data: {
businessId: id,
projectId: 'column'
}
})
.then(res => {
wx.hideLoading({})
if (type == '2') {
//栏目
_self.setData({
likeStatus: !favor
})
} else {
//评论与回复
if (_self.data.currentType == 2) {
//评论
if (favor) {
_self.data.commentList[index].contentCommentLike--
_self.data.commentList[index].likeStatus = false
} else {
_self.data.commentList[index].contentCommentLike++
_self.data.commentList[index].likeStatus = true
}
_self.setData({
commentList: _self.data.commentList
})
} else {
if (type == '4') {
if (favor) {
_self.data.commentList[index].contentCommentLike--
_self.data.commentList[index].likeStatus = false
_self.data.currentCommentItem.likeStatus = false
} else {
_self.data.commentList[index].contentCommentLike++
_self.data.commentList[index].likeStatus = true
_self.data.currentCommentItem.likeStatus = true
}
_self.setData({
commentList: _self.data.commentList,
currentCommentItem: _self.data.currentCommentItem
})
} else {
//回复
if (favor) {
_self.data.restoreList[index].contentCommentLike--
_self.data.restoreList[index].likeStatus = false
} else {
_self.data.restoreList[index].contentCommentLike++
_self.data.restoreList[index].likeStatus = true
}
_self.setData({
restoreList: _self.data.restoreList
})
}
}
}
})
.catch(err => {})
},
//收藏
doCollect(e) {
var _self = this
var favor = _self.data.collectStatus
var msg = ''
if (favor) {
msg = '取消收藏...'
} else {
msg = '收藏中...'
}
wx.showLoading({
title: msg,
})
app.http.post(app.urls.doSaveCollect, {
header: {
token: app.globalData.token
},
data: {
businessId: _self.data.uId,
projectId: 'column'
}
})
.then(res => {
wx.hideLoading({})
_self.data.collectStatus = !_self.data.collectStatus
_self.setData({
collectStatus: _self.data.collectStatus
})
})
.catch(err => {})
}
}) })

View File

@ -1,7 +1,7 @@
<cu-custom id="head" isCustom="{{false}}" isBack="{{true}}" isIndex="{{false}}"> <cu-custom id="head" isCustom="{{false}}" isBack="{{true}}" isIndex="{{false}}">
<view slot="content">详情</view> <view slot="content">详情</view>
</cu-custom> </cu-custom>
<view class="page-box"> <view>
<view class="top-box"> <view class="top-box">
<view class="flex flex-direction"> <view class="flex flex-direction">
<view wx:if="{{dataList.length>0}}" style="background-color: #fff;border-radius: 5rpx;"> <view wx:if="{{dataList.length>0}}" style="background-color: #fff;border-radius: 5rpx;">
@ -31,8 +31,9 @@
<!-- 图片 --> <!-- 图片 -->
<view wx:if="{{child.dataType=='2' && child.valueList.length>0}}"> <view wx:if="{{child.dataType=='2' && child.valueList.length>0}}">
<!-- 九宫格 --> <!-- 九宫格 -->
<view wx:if="{{child.dataMode == '1'}}" class="cu-form-group"> <view wx:if="{{child.dataMode == '95bef6e2-0ab8-442f-b53d-b1f18130bae1'}}"
<view class="grid col-3 grid-square flex-sub"> class="cu-form-group">
<view class="grid grid-square flex-sub">
<view class="bg-img" wx:for="{{child.valueList}}" wx:key="d" wx:for-item="photo" <view class="bg-img" wx:for="{{child.valueList}}" wx:key="d" wx:for-item="photo"
catchtap="viewImg" data-url="{{photo.path}}"> catchtap="viewImg" data-url="{{photo.path}}">
<image src='{{photo.path}}' mode='scaleToFill'></image> <image src='{{photo.path}}' mode='scaleToFill'></image>
@ -40,9 +41,10 @@
</view> </view>
</view> </view>
<!-- 左右滑动 --> <!-- 左右滑动 -->
<view wx:elif="{{child.dataMode=='2' || child.dataMode=='3'}}"> <view
wx:elif="{{child.dataMode=='bae3d6c1-8f6e-4e27-bba2-e42860758db7' || child.dataMode=='179441e3-5ad1-485b-b5af-421bdc383b5e'}}">
<swiper style="width:100%;height:400rpx;background-color:#fff" indicator-dots="{{true}}" <swiper style="width:100%;height:400rpx;background-color:#fff" indicator-dots="{{true}}"
autoplay="{{child.dataMode=='3'}}"> autoplay="{{child.dataMode=='179441e3-5ad1-485b-b5af-421bdc383b5e'}}">
<block wx:for="{{child.valueList}}" wx:key="pIndex" wx:for-index="pIndex" <block wx:for="{{child.valueList}}" wx:key="pIndex" wx:for-index="pIndex"
wx:for-item="photo"> wx:for-item="photo">
<swiper-item style="width:100%;"> <swiper-item style="width:100%;">
@ -54,7 +56,8 @@
</swiper> </swiper>
</view> </view>
<!-- 上下 --> <!-- 上下 -->
<view wx:elif="{{child.dataMode=='4'}}" style="background-color:#fff"> <view wx:elif="{{child.dataMode=='121133b0-3596-46f4-a35f-7aaae79cf47a'}}"
style="background-color:#fff">
<block wx:for="{{child.valueList}}" wx:key="pIndex" wx:for-index="pIndex" <block wx:for="{{child.valueList}}" wx:key="pIndex" wx:for-index="pIndex"
wx:for-item="photo"> wx:for-item="photo">
<image style="width:100%;border-radius:5rpx;" src="{{photo.path}}" mode="widthFix"> <image style="width:100%;border-radius:5rpx;" src="{{photo.path}}" mode="widthFix">
@ -188,168 +191,13 @@
</view> </view>
</view> </view>
<!-- 评论信息 --> <!-- 评论信息 -->
<view class="comment-list-box" style="height: {{contentHeight}}px;"> <!-- <view class="comment-box">
<view class="comment-list-title"> <view>评论内容({{10}})</view>
<view>评论{{commentCount}}</view> <view class="comment-item">
</view> <image></image>
<block wx:if="{{commentList.length>0}}"> <view class="comment-content">
<view wx:for="{{commentList}}" wx:key="index" class="comment-list-item-box">
<view class="item-title-box">
<view class="comment-item-title">
<image src="{{item.contentCommentUserIcon}}"></image>
<view class="comment-user-name">{{item.contentCommentUserName}}</view>
</view>
<!-- 点赞 -->
<view catchtap="doLike" data-id="{{item.contentCommentId}}" data-idx="{{index}}" data-type="3"
data-like="{{item.likeStatus}}">
<text style="margin-right: 15rpx;">{{item.contentCommentLike}}</text>
<text
class="{{item.likeStatus ? 'cuIcon-appreciatefill line-yellowlight2' :'cuIcon-appreciate text-gray'}}"
style="font-size: 32rpx;"></text>
</view>
</view>
<!-- 评论内容 -->
<view class="comment-list-item-content">
{{item.contentCommentContent}}
</view>
<!-- 评论删除与回复 -->
<view class="restore-box">
<view class="comment-count" catchtap="doCommentToComment" data-id="{{item.contentCommentId}}"
data-item="{{item}}">
{{item.contentCommentSubCount}} 回复
</view>
<text class="cuIcon-close" style="font-size: 32rpx;color: #5d5d5d;" catchtap="delComment"
data-idx="{{index}}" data-id="{{item.contentCommentId}}"
wx:if="{{curUserId== item.creator}}"></text>
</view>
</view>
</block>
<view wx:else style="margin-top:200rpx;width:100%;">
<van-empty description="暂无评论" />
</view>
</view>
<!-- 评论底部输入 -->
<view class="foot bg-white" style="padding: 15rpx;" wx:if="{{isShowCommentInput}}">
<view class="comment-box">
<view class="input" hover-class="click-white" catchtap="showComment"
wx:if="{{commentSwitch != '1' && commentSwitch !='2'}}">
<text class="cuIcon-write"></text>
<text>写评论...</text>
</view>
<text wx:if="{{collectSwitch != '1' && collectSwitch != '2'}}"
class="icon-comment {{collectStatus ? 'cuIcon-favorfill line-yellowlight2': 'cuIcon-favor text-gray'}}"
catchtap="doCollect" style="font-size: 50rpx;"></text>
<text wx:if="{{likeSwitch != '1' && likeSwitch != '2'}}"
class="icon-comment {{likeStatus ? 'cuIcon-appreciatefill line-yellowlight2' :'cuIcon-appreciate text-gray'}}"
catchtap="doLike" data-type="2" style="font-size: 50rpx;"></text>
<button class="icon-comment" wx:if="{{shareSwitch != '1' && shareSwitch != '2'}}"
style="width: 0rpx;padding: 0rpx;background-color: #fff;line-height: 50rpx;margin:0rpx;">
<text class="cuIcon-share text-gray" style="font-size: 50rpx;"></text>
</button>
</view>
</view>
<!-- 评论回复底部输入 -->
<view class="foot bg-white" style="padding: 15rpx;z-index: 101;" wx:if="{{isShowRestore && isShowCommentInput}}">
<view class="comment-box">
<view class="input" hover-class="click-white" catchtap="showComment"
wx:if="{{commentSwitch != '1' && commentSwitch !='2'}}">
<text class="cuIcon-write"></text>
<text>写评论...</text>
</view>
<text wx:if="{{likeSwitch != '1' && likeSwitch != '2'}}"
class="icon-comment {{currentCommentItem.likeStatus ? 'cuIcon-appreciatefill line-yellowlight2' :'cuIcon-appreciate text-gray'}}"
style="font-size: 50rpx;" data-id="{{currentCommentItem.contentCommentId}}" data-type="4"
catchtap="doLike" data-like="{{currentCommentItem.likeStatus}}"></text>
<button class="icon-comment" wx:if="{{shareSwitch != '1' && shareSwitch != '2'}}"
style="width: 0rpx;padding: 0rpx;background-color: #fff;line-height: 50rpx;margin:0rpx;">
<text class="cuIcon-share text-gray" style="font-size: 50rpx;"></text>
</button>
</view> </view>
</view> </view>
</view> -->
</view> </view>
<!-- 单文本内容评论 -->
<van-action-sheet show="{{isShowComment}}" round="{{false}}" bind:close="onCloseDialog" z-index="102">
<view class="comment-line-input-box">
<input placeholder="请输入评论内容" cursor-spacing="100" value="{{commentValue}}" class="comment-input"
bindinput="inputWatch" />
<view class="comment-line-btn" catchtap="doSubmitComment" data-id="{{dataId}}">
发布
</view>
</view>
</van-action-sheet>
<!-- 评论的回复 -->
<van-action-sheet show="{{isShowRestore}}" round="{{true}}" bind:close="onCloseRestore"
title="{{restoreList.length}}条回复">
<!-- 楼主 -->
<view class="restore-content-box">
<view class="restore-content-title">
<image src="{{currentCommentItem.contentCommentUserIcon}}" mode="scaleToFill"></image>
<text>{{currentCommentItem.contentCommentUserName}}</text>
</view>
<view class="restore-content">{{currentCommentItem.contentCommentContent}}</view>
</view>
<!-- 回复的内容 -->
<block wx:if="{{restoreList.length>0}}">
<scroll-view style="height: 600rpx;width: 100%;padding: 15rpx;margin-bottom: 100rpx;" scroll-y>
<view style="padding: 15rpx 15rpx 25rpx 15rpx;color: #000000;font-size: 32rpx;">全部回复</view>
<block wx:if="{{restoreList.length>0}}">
<view wx:for="{{restoreList}}" wx:key="index" class="comment-list-item-box">
<view class="item-title-box">
<view class="comment-item-title">
<image src="{{item.contentCommentUserIcon}}"></image>
<view class="comment-user-name">{{item.contentCommentUserName}}</view>
</view>
<view catchtap="doLike" data-id="{{item.contentCommentId}}" data-idx="{{index}}" data-type="3"
data-like="{{item.likeStatus}}">
<text style="margin-right: 15rpx;">{{item.contentCommentLike}}</text>
<text
class="{{item.likeStatus ? 'cuIcon-appreciatefill line-yellowlight2' :'cuIcon-appreciate text-gray'}}"
style="font-size: 32rpx;"></text>
</view>
</view>
<view class="comment-list-item-content">
{{item.contentCommentContent}}
</view>
<view class="restore-box">
<view></view>
<text class="cuIcon-close" style="font-size: 32rpx;color: #5d5d5d;" catchtap="delComment"
data-idx="{{index}}" data-id="{{item.contentCommentId}}"
wx:if="{{curUserId== item.creator}}"></text>
</view>
</view>
</block>
</scroll-view>
</block>
<view wx:else style="height: 500rpx;width:100%;">
<van-empty description="暂无回复" />
</view>
</van-action-sheet>
<!-- 文本加多媒体评论内容 -->
<!-- <van-action-sheet show="{{isShowComment}}" round="{{false}}" bind:close="onCloseDialog">
<view class="comment-content-box">
<view class="comment-content-input">
<textarea placeholder="请输入评论内容" placeholder-style="font-size:28rpx;" cursor-spacing="200"
value="{{inputWatch}}" bindinput="inputWatch"></textarea>
<view wx:if="{{mediaBean != null}}"
style="display: flex;flex-direction: row;justify-content: center;align-items: center;width: 128rpx;height: 128rpx;position: relative;">
<image src="{{mediaBean.coverPath}}" mode="aspectFill" style="width: 100%;height: 100%;"></image>
<text class="cuIcon-close" catchtap="delMedia"
style="font-size: 38rpx;position: absolute;top:-15rpx;right:-15rpx;background:rgba(130,130,130, 0.8);border-radius: 50%;text-align: center;opacity: 0.8;color:#ffffff;"></text>
<image src="/images/ic_video_play.png" mode="scaleToFill" wx:if="{{mediaBean.type=='video'}}"
style="width: 30rpx;height: 30rpx;position: absolute;top: 40%;left: 40%;">
</image>
</view>
</view>
<view class="btn">
发布
</view>
</view>
<view class="comment-content-funcs">
<text class="cuIcon-pic" style="margin: 0rpx 30rpx;font-size: 50rpx;" catchtap="chooseImg"></text>
<text class="cuIcon-record" style="margin: 0rpx 30rpx;font-size: 50rpx;" catchtap="chooseVideo"></text>
</view>
</van-action-sheet> -->

View File

@ -395,7 +395,7 @@
} }
.top-box { .top-box {
width: 100%; padding: 15rpx 15rpx 20rpx 15rpx;
} }
.good { .good {
@ -645,6 +645,13 @@
line-height: 50rpx; line-height: 50rpx;
} }
.comment-box {
width: 95%;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.movie-item { .movie-item {
height: 280rpx; height: 280rpx;

View File

@ -49,17 +49,13 @@ Page({
curSelPhotoDisplay: '1', //图片的显示方式 1.九宫格 2.轮播 3.轮播(自动) 4.平铺 curSelPhotoDisplay: '1', //图片的显示方式 1.九宫格 2.轮播 3.轮播(自动) 4.平铺
curVideoDisplay: '1', //视频展示方式 1.九宫格 2.平铺 curVideoDisplay: '1', //视频展示方式 1.九宫格 2.平铺
curTextAlign: '1', //文字显示排列 1.居左 2.居中 3.居右 curTextAlign: '1', //文字显示排列 1.居左 2.居中 3.居右
curFieldTypeIndex: 0, //编辑选择的文件类型 curFieldType: '0', //编辑选择的文件类型
curFieldType: 'text', //编辑选择的文件类型
selDirection: '1', //选中的插入方向 1.插入到下面 2.插入的上面 selDirection: '1', //选中的插入方向 1.插入到下面 2.插入的上面
isInsert: false, //是否显示插入选项 isInsert: false, //是否显示插入选项
topBoxHeight: 100, //顶部类型选择框的高度 topBoxHeight: 100, //顶部类型选择框的高度
audioFile: null, //当前的录音文件 audioFile: null, //当前的录音文件
audioDuration: 0, //录音文件的时长 audioDuration: 0, //录音文件的时长
isRecording: false, //是否正在录音 isRecording: false, //是否正在录音
speedStep: 5, //快进快退的时间
sourceType: 'add', //用来标识是添加还是编辑 add添加 edit编辑 insert插入
insertIndex: -1, //插入的索引
optionsList: [{ optionsList: [{
id: '1', id: '1',
name: '选项一', name: '选项一',
@ -116,11 +112,7 @@ Page({
var tempItem = {} var tempItem = {}
tempItem['type'] = 'map' tempItem['type'] = 'map'
tempItem['value'] = item tempItem['value'] = item
if (_self.data.sourceType == 'add') {
_self.data.valueList.push(tempItem) _self.data.valueList.push(tempItem)
} else {
_self.data.valueList.splice(_self.data.currentIndex, _self.data.sourceType == 'edit' ? 1 : 0, tempItem)
}
_self.setData({ _self.setData({
valueList: _self.data.valueList valueList: _self.data.valueList
}) })
@ -274,10 +266,8 @@ Page({
}, },
//编辑选择出入的类型 //编辑选择出入的类型
chooseFieldType(e) { chooseFieldType(e) {
var idx = e.currentTarget.dataset.idx
var type = e.currentTarget.dataset.type var type = e.currentTarget.dataset.type
this.setData({ this.setData({
curFieldTypeIndex: idx,
curFieldType: type curFieldType: type
}) })
}, },
@ -296,11 +286,7 @@ Page({
tempPhoto['type'] = 'photo' tempPhoto['type'] = 'photo'
tempPhoto['valueList'] = tempList tempPhoto['valueList'] = tempList
tempPhoto['displayType'] = _self.data.curSelPhotoDisplay tempPhoto['displayType'] = _self.data.curSelPhotoDisplay
if (_self.data.sourceType == 'add') {
_self.data.valueList.push(tempPhoto) _self.data.valueList.push(tempPhoto)
} else {
_self.data.valueList.splice(_self.data.currentIndex, _self.data.sourceType == 'edit' ? 1 : 0, tempPhoto)
}
_self.setData({ _self.setData({
valueList: _self.data.valueList, valueList: _self.data.valueList,
photoList: [], photoList: [],
@ -329,18 +315,12 @@ Page({
tempVideo['type'] = 'video' tempVideo['type'] = 'video'
tempVideo['valueList'] = tempList tempVideo['valueList'] = tempList
tempVideo['displayType'] = _self.data.curVideoDisplay tempVideo['displayType'] = _self.data.curVideoDisplay
if (_self.data.sourceType == 'add') {
_self.data.valueList.push(tempVideo) _self.data.valueList.push(tempVideo)
} else {
_self.data.valueList.splice(_self.data.currentIndex, _self.data.sourceType == 'edit' ? 1 : 0, tempVideo)
}
_self.setData({ _self.setData({
valueList: _self.data.valueList, valueList: _self.data.valueList,
videoList: [], videoList: [],
curVideoDisplay: 1, curVideoDisplay: 1,
isShowVideo: false, isShowVideo: false
currentIndex: -1,
sourceType: 'add'
}) })
} else { } else {
wx.showToast({ wx.showToast({
@ -352,49 +332,6 @@ Page({
//确定插入数据 //确定插入数据
doInsert() { doInsert() {
//根据选择的类型与方向插入数据 //根据选择的类型与方向插入数据
var _self = this
var inIndex = -1
//selDirection 1是上面 2是下面
if (_self.data.selDirection == 1) {
inIndex = _self.data.currentIndex
} else {
inIndex = ++_self.data.currentIndex
}
_self.setData({
insertIndex: inIndex,
sourceType: 'insert',
isInsert: false,
})
switch (_self.data.curFieldType) {
case 'text':
case 'textarea': //文本域
this.setData({
isShowInput: true
})
break
case 'video': //视频
_self.chooseVideo()
break
case 'audio': //音频
_self.checkRecordPermission()
break
case 'photo': //图片
_self.chooseImg()
break
case 'map': //地图
_self.doChooseLocation()
break
case 'select': //选项
_self.setData({
isShowSelect: true
})
break
case 'link': //链接
_self.setData({
isShowLink: true
})
break
}
}, },
hideEditBox() { hideEditBox() {
//隐藏编辑框 //隐藏编辑框
@ -406,8 +343,7 @@ Page({
this.setData({ this.setData({
isShowInput: false, isShowInput: false,
isShowLink: false, isShowLink: false,
isShowSelect: false, isShowSelect: false
sourceType: 'add' //重置状态
}) })
}, },
//输入框监听 //输入框监听
@ -437,11 +373,7 @@ Page({
var tempText = {} var tempText = {}
tempText['type'] = 'link' tempText['type'] = 'link'
tempText['value'] = _self.data.curLinkText tempText['value'] = _self.data.curLinkText
if (_self.data.sourceType == 'add') {
_self.data.valueList.push(tempText) _self.data.valueList.push(tempText)
} else {
_self.data.valueList.splice(_self.data.currentIndex, _self.data.sourceType == 'edit' ? 1 : 0, tempText)
}
_self.setData({ _self.setData({
valueList: _self.data.valueList, valueList: _self.data.valueList,
curLinkText: '', curLinkText: '',
@ -463,6 +395,7 @@ Page({
tempText['type'] = 'text' tempText['type'] = 'text'
tempText['value'] = _self.data.curTextValue tempText['value'] = _self.data.curTextValue
var textAlign = 'left' var textAlign = 'left'
console.log(_self.data.curTextAlign)
switch (_self.data.curTextAlign) { switch (_self.data.curTextAlign) {
case '1': case '1':
textAlign = 'left' textAlign = 'left'
@ -475,16 +408,11 @@ Page({
break break
} }
tempText['textAlign'] = textAlign tempText['textAlign'] = textAlign
if (_self.data.sourceType == 'add') {
_self.data.valueList.push(tempText) _self.data.valueList.push(tempText)
} else {
_self.data.valueList.splice(_self.data.currentIndex, _self.data.sourceType == 'edit' ? 1 : 0, tempText)
}
_self.setData({ _self.setData({
valueList: _self.data.valueList, valueList: _self.data.valueList,
curTextValue: '', curTextValue: '',
isShowInput: false, isShowInput: false
curTextAlign: '1'
}) })
} }
}, },
@ -554,38 +482,12 @@ Page({
} }
}) })
}, },
//预览视频
viewVideo(e) {
var _self = this
var idx = e.currentTarget.dataset.idx
var index = e.currentTarget.dataset.index
var url = _self.data.valueList[index].valueList[idx].path
var tempItem = {}
tempItem['url'] = url
tempItem['type'] = 'video'
wx.previewMedia({
sources: [tempItem],
})
},
//删除视频
delVideo(e) {
var _self = this
var idx = e.currentTarget.dataset.index
wx.showModal({
title: '提示',
content: '确定要删除该视频吗?',
success(res) {
if (res.confirm) {
_self.data.videoList.splice(idx, 1)
_self.setData({
videoList: _self.data.videoList
})
}
}
})
},
//选择定位点 //选择定位点
doChooseLocation(e) { doChooseLocation(e) {
// var index = e.currentTarget.dataset.index
// this.setData({
// curMapIndex: index
// })
var curLoc = JSON.stringify(location) var curLoc = JSON.stringify(location)
wx.navigateTo({ wx.navigateTo({
url: `plugin://chooseLocation/index?key=${key}&referer=${referer}&location=${curLoc}&category=${category}` url: `plugin://chooseLocation/index?key=${key}&referer=${referer}&location=${curLoc}&category=${category}`
@ -593,60 +495,7 @@ Page({
}, },
//编辑条目 //编辑条目
editItem(e) { editItem(e) {
var _self = this
var idx = e.currentTarget.dataset.index
_self.setData({
sourceType: 'edit'
})
switch (_self.data.valueList[idx].type) {
case 'text':
case 'textarea': //文本域
var align = '1'
if (_self.data.valueList[idx].textAlign == 'left') {
align = '1'
} else if (_self.data.valueList[idx].textAlign == 'center') {
align = '2'
} else {
align = '3'
}
this.setData({
isShowInput: true,
curTextValue: _self.data.valueList[idx].value,
curTextAlign: align
})
break
case 'video': //视频
//构建视频数据
_self.setData({
curVideoDisplay: _self.data.valueList[idx].displayType,
videoList: _self.data.valueList[idx].valueList,
isShowVideo: true
})
break
case 'audio': //音频
_self.checkRecordPermission()
break
case 'photo': //图片
_self.setData({
curSelPhotoDisplay: _self.data.valueList[idx].displayType,
photoList: _self.data.valueList[idx].valueList,
isShowPhoto: true
})
break
case 'map': //地图
location.latitude = _self.data.valueList[idx].value.latitude
location.longitude = _self.data.valueList[idx].value.longitude
_self.doChooseLocation()
break
case 'select': //选项
break
case 'link': //链接
_self.setData({
curLinkText: _self.data.valueList[idx].value,
isShowLink: true
})
break
}
}, },
//插入条目 //插入条目
insertItem(e) { insertItem(e) {
@ -657,17 +506,12 @@ Page({
}, },
//删除条目 //删除条目
delItem(e) { delItem(e) {
var _self = this
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: '确定要删除该条数据吗?', content: '确定要删除该条数据吗?',
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
_self.data.valueList.splice(_self.data.currentIndex, 1)
_self.setData({
valueList: _self.data.valueList,
currentIndex: -1
})
} }
} }
}) })
@ -707,21 +551,10 @@ Page({
//确定音频 //确定音频
doConfirmAudio() { doConfirmAudio() {
var _self = this var _self = this
if (_self.data.audioFile.isPlay) {
innerAudioContext.stop()
}
var tempAudio = {} var tempAudio = {}
tempAudio['type'] = 'audio' tempAudio['type'] = 'audio'
tempAudio['value'] = _self.data.audioFile tempAudio['value'] = _self.data.audioFile
//重置文件的状态
_self.data.audioFile.curDurationStr = '00:00'
_self.data.audioFile.curDuration = 0
_self.data.audioFile.isPlay = false
if (_self.data.sourceType == 'add') {
_self.data.valueList.push(tempAudio) _self.data.valueList.push(tempAudio)
} else {
_self.data.valueList.splice(_self.data.currentIndex, _self.data.sourceType == 'edit' ? 1 : 0, tempAudio)
}
_self.setData({ _self.setData({
valueList: _self.data.valueList, valueList: _self.data.valueList,
audioFile: null, audioFile: null,
@ -838,9 +671,6 @@ Page({
var _self = this var _self = this
if (type && type == 'audio') { if (type && type == 'audio') {
if (_self.data.audioFile != null) { if (_self.data.audioFile != null) {
if (_self.data.audioFile.isPlay) {
innerAudioContext.stop()
}
wx.showModal({ wx.showModal({
title: '警告', title: '警告',
content: '关闭录音弹窗将清除当前录制的音频文件,确定要关闭吗?', content: '关闭录音弹窗将清除当前录制的音频文件,确定要关闭吗?',
@ -864,43 +694,21 @@ Page({
isShowEdit: false, isShowEdit: false,
isShowVideo: false, isShowVideo: false,
isShowSelect: false, isShowSelect: false,
sourceType: 'add'
}) })
}, },
//音频拖动 //音频拖动
slider4change(e) { slider4change(e) {
var _self = this var _self = this
var audio = e.currentTarget.dataset.item var audio = e.currentTarget.dataset.item
var type = e.currentTarget.dataset.type
var idx = e.currentTarget.dataset.idx
var time = Number.parseInt(e.detail.value)
if (audio.isPlay) { if (audio.isPlay) {
innerAudioContext.pause() innerAudioContext.seek(e.detail.value)
innerAudioContext.seek(time)
setTimeout(() => {
innerAudioContext.play()
}, 500)
if (type == 'record') {
_self.data.audioFile.curDuration = time
_self.data.audioFile.curDurationStr = '00:' + (time > 9 ? time : '0' + time)
console.log(_self.data.audioFile)
_self.setData({
audioFile: _self.data.audioFile
})
} else {
_self.data.valueList[idx].value.curDuration = time
_self.data.valueList[idx].value.curDurationStr = '00:' + (time > 9 ? time : '0' + time)
_self.setData({
valueList: _self.data.valueList
})
}
} }
}, },
play(e) { play(e) {
//进行播放 //进行播放
var audio = e.currentTarget.dataset.item var audio = e.currentTarget.dataset.item
var _self = this var _self = this
var type = e.currentTarget.dataset.type //show展示列表 record录音弹框 var type = e.currentTarget.dataset.type
var idx = e.currentTarget.dataset.idx var idx = e.currentTarget.dataset.idx
if (audio.isPlay) { if (audio.isPlay) {
innerAudioContext.stop() innerAudioContext.stop()
@ -913,68 +721,40 @@ Page({
} }
//先需要停止其他录音文件的播放 //先需要停止其他录音文件的播放
innerAudioContext.onPlay(() => { innerAudioContext.onPlay(() => {
if (type == 'record') {
_self.data.audioFile.isPlay = true _self.data.audioFile.isPlay = true
_self.setData({ _self.setData({
audioFile: _self.data.audioFile audioFile: _self.data.audioFile
}) })
} else {
_self.data.valueList[idx].value.isPlay = true
_self.setData({
valueList: _self.data.valueList
})
}
}); });
innerAudioContext.onStop((res) => { innerAudioContext.onStop((res) => {
console.log('停止播放')
//重置文件的状态 //重置文件的状态
if (type == 'record') {
_self.setAudioDefault() _self.setAudioDefault()
} else {
_self.setShowAudioDefault(idx)
}
}) })
innerAudioContext.onEnded((res) => { innerAudioContext.onEnded((res) => {
console.log('播放结束')
//重置文件的状态 //重置文件的状态
if (type == 'record') {
_self.setAudioDefault() _self.setAudioDefault()
} else {
_self.setShowAudioDefault(idx)
}
}) })
innerAudioContext.onError((res) => { innerAudioContext.onError((res) => {
wx.showToast({ wx.showToast({
title: '播放失败', title: '播放失败',
icon: 'error' icon: 'error'
}) })
if (type == 'record') {
_self.setAudioDefault() _self.setAudioDefault()
} else {
_self.setShowAudioDefault(idx)
}
}) })
innerAudioContext.onTimeUpdate(() => { innerAudioContext.onTimeUpdate(() => {
var curTime = innerAudioContext.currentTime _self.data.audioFile.curDuration = innerAudioContext.currentTime
if (type == 'record') {
_self.data.audioFile.curDuration = curTime
var time = Number.parseInt(_self.data.audioFile.curDuration) var time = Number.parseInt(_self.data.audioFile.curDuration)
_self.data.audioFile.curDurationStr = '00:' + (time > 9 ? time : '0' + time) _self.data.audioFile.curDurationStr = '00:' + (time > 9 ? time : '0' + time)
_self.setData({ _self.setData({
audioFile: _self.data.audioFile audioFile: _self.data.audioFile
}) })
} else {
_self.data.valueList[idx].value.curDuration = curTime
var timeTemp = Number.parseInt(_self.data.valueList[idx].value.curDuration)
_self.data.valueList[idx].value.curDurationStr = '00:' + (timeTemp > 9 ? time : '0' + timeTemp)
_self.setData({
valueList: _self.data.valueList
})
}
}) })
}, },
//设置录音文件恢复初始 //设置录音文件恢复初始
setAudioDefault() { setAudioDefault() {
var _self = this var _self = this
if (_self.data.audioFile != null) {
//重置文件的状态 //重置文件的状态
_self.data.audioFile.curDurationStr = '00:00' _self.data.audioFile.curDurationStr = '00:00'
_self.data.audioFile.curDuration = 0 _self.data.audioFile.curDuration = 0
@ -982,60 +762,35 @@ Page({
_self.setData({ _self.setData({
audioFile: _self.data.audioFile audioFile: _self.data.audioFile
}) })
}
},
//重置录音文件状态
setShowAudioDefault(idx) {
var _self = this
_self.data.valueList[idx].value.curDurationStr = '00:00'
_self.data.valueList[idx].value.curDuration = 0
_self.data.valueList[idx].value.isPlay = false
_self.setData({
valueList: _self.data.valueList
})
}, },
//倒退5秒 //倒退5秒
rewind(e) { rewind(e) {
var _self = this var _self = this
var index = e.currentTarget.dataset.index
var item = e.currentTarget.dataset.item var item = e.currentTarget.dataset.item
var idx = e.currentTarget.dataset.idx var idx = e.currentTarget.dataset.idx
var type = e.currentTarget.dataset.type var ix = e.currentTarget.dataset.i
if (item.isPlay) { if (item.isPlay) {
if (type == 'record') { _self.data.dataList[index].list[idx].valueList[ix].curDuration = _self.data.dataList[index].list[idx].valueList[ix].curDuration - _self.data.speedStep
_self.data.audioFile.curDuration = _self.data.audioFile.curDuration - _self.data.speedStep innerAudioContext.seek(_self.data.dataList[index].list[idx].valueList[ix].curDuration)
innerAudioContext.seek(_self.data.audioFile.curDuration)
_self.setData({ _self.setData({
audioFile: _self.data.audioFile dataList: _self.data.dataList
}) })
} else {
_self.data.valueList[idx].value.curDuration = _self.data.valueList[idx].value.curDuration - _self.data.speedStep
innerAudioContext.seek(_self.data.valueList[idx].value.curDuration)
_self.setData({
valueList: _self.data.valueList
})
}
} }
}, },
//快进5秒 //快进5秒
speed(e) { speed(e) {
var _self = this var _self = this
var index = e.currentTarget.dataset.index
var item = e.currentTarget.dataset.item var item = e.currentTarget.dataset.item
var idx = e.currentTarget.dataset.idx var idx = e.currentTarget.dataset.idx
var type = e.currentTarget.dataset.type var ix = e.currentTarget.dataset.i
if (item.isPlay) { if (item.isPlay) {
if (type == 'record') { _self.data.dataList[index].list[idx].valueList[ix].curDuration = _self.data.dataList[index].list[idx].valueList[ix].curDuration + _self.data.speedStep
_self.data.audioFile.curDuration = _self.data.audioFile.curDuration + _self.data.speedStep innerAudioContext.seek(_self.data.dataList[index].list[idx].valueList[ix].curDuration)
innerAudioContext.seek(_self.data.audioFile.curDuration)
_self.setData({ _self.setData({
audioFile: _self.data.audioFile dataList: _self.data.dataList
}) })
} else {
_self.data.valueList[idx].value.curDuration = _self.data.valueList[idx].value.curDuration + _self.data.speedStep
innerAudioContext.seek(_self.data.valueList[idx].value.curDuration)
_self.setData({
valueList: _self.data.valueList
})
}
} }
}, },
onUnload() { onUnload() {

View File

@ -47,14 +47,12 @@
<block wx:if="{{valueList.length>0}}"> <block wx:if="{{valueList.length>0}}">
<view wx:for="{{valueList}}" wx:key="index" style="margin-top: 15rpx;width: 100%;"> <view wx:for="{{valueList}}" wx:key="index" style="margin-top: 15rpx;width: 100%;">
<!-- 文本域 --> <!-- 文本域 -->
<view wx:if="{{item.type=='text' || item.type=='textarea'}}" catchtap="showEditBox" <view wx:if="{{item.type=='text' || item.type=='textarea'}}" catchtap="showEditBox" class="item-box"
class="item-box {{currentIndex==index ? 'sel-border':''}}" data-idx="{{index}}"> data-idx="{{index}}">
<view style="width: 100%;text-align: {{item.textAlign}};font-size: 32rpx;overflow-wrap: break-word;"> <view style="width: 100%;text-align: {{item.textAlign}};font-size: 32rpx;">{{item.value}}</view>
{{item.value}}</view>
</view> </view>
<!-- 图片 --> <!-- 图片 -->
<view wx:if="{{item.type=='photo'}}" catchtap="showEditBox" <view wx:if="{{item.type=='photo'}}" catchtap="showEditBox" class="item-box" data-idx="{{index}}">
class="item-box {{currentIndex==index ? 'sel-border':''}}" data-idx="{{index}}">
<!-- 九宫格 --> <!-- 九宫格 -->
<view class="grid col-3 grid-square flex-sub" wx:if="{{item.displayType=='1'}}" style="width: 100%;"> <view class="grid col-3 grid-square flex-sub" wx:if="{{item.displayType=='1'}}" style="width: 100%;">
<view class="bg-img" wx:for="{{item.valueList}}" wx:key="idx" wx:for-item="photo"> <view class="bg-img" wx:for="{{item.valueList}}" wx:key="idx" wx:for-item="photo">
@ -81,60 +79,52 @@
</view> </view>
</view> </view>
<!-- 视频 --> <!-- 视频 -->
<view wx:if="{{item.type=='video'}}" catchtap="showEditBox" <view wx:if="{{item.type=='video'}}" catchtap="showEditBox" class="item-box" data-idx="{{index}}">
class="item-box {{currentIndex==index ? 'sel-border':''}}" data-idx="{{index}}">
<!-- 九宫格 --> <!-- 九宫格 -->
<view class="grid col-3 grid-square flex-sub" wx:if="{{item.displayType=='1'}}" style="width: 100%;"> <view class="grid col-3 grid-square flex-sub" wx:if="{{item.displayType=='1'}}" style="width: 100%;">
<view class="bg-img" wx:for="{{item.valueList}}" wx:for-index="idx" wx:key="idx" <view class="bg-img" wx:for="{{item.valueList}}" wx:key="idx" wx:for-item="video">
wx:for-item="video">
<image src='{{video.coverPath}}' mode='aspectFill'></image> <image src='{{video.coverPath}}' mode='aspectFill'></image>
<image src="/images/ic_video_play.png" mode="scaleToFill" catchtap="viewVideo" <image src="/images/ic_video_play.png" mode="scaleToFill"
data-idx="{{idx}}" data-index="{{index}}"
style="width: 48rpx;height:48rpx;position: absolute;top:40%;left:40%;"> style="width: 48rpx;height:48rpx;position: absolute;top:40%;left:40%;">
</image> </image>
</view> </view>
</view> </view>
<block wx:if="{{item.displayType=='2'}}"> <block wx:if="{{item.displayType=='2'}}">
<view class="movie-box" wx:for="{{item.valueList}}" wx:for-index="idx" wx:key="idx" <view class="movie-box" wx:for="{{item.valueList}}" wx:key="index" wx:for-item="video">
wx:for-item="video">
<image src='{{video.coverPath}}' mode='scaleToFill'></image> <image src='{{video.coverPath}}' mode='scaleToFill'></image>
<view class="play-box-arrow-flex"> <view class="play-box-arrow-flex">
<image src="/images/ic_video_play.png" mode="scaleToFill" catchtap="viewVideo" <image src="/images/ic_video_play.png" mode="scaleToFill"
data-idx="{{idx}}" data-index="{{index}}" style="width: 96rpx;height:96rpx;"> style="width: 96rpx;height:96rpx;">
</image> </image>
</view> </view>
</view> </view>
</block> </block>
</view> </view>
<!-- 音频 --> <!-- 音频 -->
<view wx:if="{{item.type=='audio'}}" catchtap="showEditBox" <view wx:if="{{item.type=='audio'}}" catchtap="showEditBox" class="item-box" data-idx="{{index}}">
class="item-box {{currentIndex == index ? 'sel-border': ''}}" data-idx="{{index}}">
<view class="play-box-shadow-little"> <view class="play-box-shadow-little">
<view class="flex justify-between align-center" style="width:80%;"> <view class="flex justify-between align-center" style="width:80%;">
<text>{{item.value.curDurationStr}}</text> <text>{{item.value.curDurationStr}}</text>
<slider class="flex-sub" bindchange="slider4change" min="{{0}}" max="{{item.value.duration}}" <slider class="flex-sub" bindchange="slider4change" min="{{0}}" max="{{item.value.duration}}"
value="{{item.value.curDuration}}" backgroundColor="#cacaca" activeColor="#1296db" value="{{item.value.curDuration}}" backgroundColor="#cacaca" activeColor="#1296db"
data-type="show" block-size="14" data-item="{{item.value}}" block-color="#1296db" block-size="14" data-item="{{item.value}}" block-color="#1296db" data-idx="{{index}}" />
data-idx="{{index}}" />
<text>{{item.value.totalDurationStr}}</text> <text>{{item.value.totalDurationStr}}</text>
</view> </view>
<view class="flex justify-between" style="width:80%;"> <view class="flex justify-between" style="width:80%;">
<image src="/images/ic_audio_rewind.png" mode="scaleToFill" catchtap="rewind" data-type="show" <image src="/images/ic_audio_rewind.png" mode="scaleToFill" catchtap="rewind"
data-idx="{{index}}" data-item="{{item.value}}"> data-idx="{{index}}" data-item="{{item.value}}">
</image> </image>
<image src="{{item.value.isPlay ? '/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}" <image src="{{item.value.isPlay ? '/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"
data-type="show" data-idx="{{index}}" mode="scaleToFill" catchtap="play" data-idx="{{index}}" mode="scaleToFill" catchtap="play" data-item="{{item.value}}">
data-item="{{item.value}}">
</image> </image>
<image src="/images/ic_audio_speed.png" mode="scaleToFill" catchtap="speed" data-idx="{{index}}" <image src="/images/ic_audio_speed.png" mode="scaleToFill" catchtap="speed" data-idx="{{index}}"
data-type="show" data-item="{{item.value}}"> data-item="{{item.value}}">
</image> </image>
</view> </view>
</view> </view>
</view> </view>
<!-- 地图 --> <!-- 地图 -->
<view wx:if="{{item.type=='map'}}" catchtap="showEditBox" <view wx:if="{{item.type=='map'}}" catchtap="showEditBox" class="item-box" data-idx="{{index}}">
class="item-box {{currentIndex == index ? 'sel-border':''}}" data-idx="{{index}}">
<view class="flex flex-direction align-center bg-white radius item-padding"> <view class="flex flex-direction align-center bg-white radius item-padding">
<view style="width: 100%;"> <view style="width: 100%;">
<view class="flex justify-between"> <view class="flex justify-between">
@ -151,8 +141,7 @@
</view> </view>
</view> </view>
<!-- 链接 --> <!-- 链接 -->
<view wx:if="{{item.type=='link'}}" catchtap="showEditBox" <view wx:if="{{item.type=='link'}}" catchtap="showEditBox" class="item-box" data-idx="{{index}}">
class="item-box {{currentIndex == index ? 'sel-border':''}}" data-idx="{{index}}">
<view style="width: 100%;font-size: 32rpx;">{{item.value}}</view> <view style="width: 100%;font-size: 32rpx;">{{item.value}}</view>
</view> </view>
<!-- 选项 --> <!-- 选项 -->
@ -161,7 +150,7 @@
<view <view
style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center;flex-wrap: wrap;width: 100%;"> style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center;flex-wrap: wrap;width: 100%;">
<block wx:for="{{item.valueList}}" wx:key="index" wx:for-item="options"> <block wx:for="{{item.valueList}}" wx:key="index" wx:for-item="options">
<view class="cu-tag bg-blue"> <view class="cu-tag bg-blue" style="margin:15rpx 15rpx 0rpx 15rpx;">
{{options.name}} {{options.name}}
</view> </view>
</block> </block>
@ -169,8 +158,7 @@
</view> </view>
<view wx:if="{{currentIndex == index}}"> <view wx:if="{{currentIndex == index}}">
<view class="control-box"> <view class="control-box">
<view class="item" catchtap="editItem" data-index="{{index}}" data-type="{{item.type}}" <view class="item" catchtap="editItem" data-index="{{index}}" data-type="{{item.type}}">
wx:if="{{item.type != 'audio'}}">
<text class="cuIcon-edit bg-yellow-light"></text> <text class="cuIcon-edit bg-yellow-light"></text>
<text style="margin-left: 15rpx;">编辑</text> <text style="margin-left: 15rpx;">编辑</text>
</view> </view>
@ -190,19 +178,19 @@
<view class="dir-box"> <view class="dir-box">
<view class="cu-capsule radius" catchtap="chooseDirection" data-idx="1"> <view class="cu-capsule radius" catchtap="chooseDirection" data-idx="1">
<view class="cu-tag {{selDirection=='1' ? 'bg-yellowlight':'bg-grey'}}"> <view class="cu-tag {{selDirection=='1' ? 'bg-yellowlight':'bg-grey'}}">
<text class="{{selDirection=='1' ? 'cuIcon-radiobox':'cuIcon-round'}}"></text> <text class="{{selDirection=='1' ? 'cuIcon-apps':'cuIcon-apps'}}"></text>
</view> </view>
<view class="cu-tag {{selDirection=='1' ? 'line-yellowlight2':'line-black'}}"> <view class="cu-tag {{selDirection=='1' ? 'line-yellowlight2':'line-black'}}">
内容上 插入到下面
</view> </view>
</view> </view>
<view class="cu-capsule radius" style="margin-left: 15rpx;" catchtap="chooseDirection" <view class="cu-capsule radius" style="margin-left: 15rpx;" catchtap="chooseDirection"
data-idx="2"> data-idx="2">
<view class="cu-tag {{selDirection== '2' ? 'bg-yellowlight':'bg-grey'}}"> <view class="cu-tag {{selDirection== '2' ? 'bg-yellowlight':'bg-grey'}}">
<text class="{{selDirection== '2' ? 'cuIcon-radiobox':'cuIcon-round'}}"></text> <text class="{{selDirection== '2' ? 'cuIcon-apps':'cuIcon-apps'}}"></text>
</view> </view>
<view class="cu-tag {{selDirection=='2' ? 'line-yellowlight2':'line-black'}}"> <view class="cu-tag {{selDirection=='2' ? 'line-yellowlight2':'line-black'}}">
内容下 插入到上面
</view> </view>
</view> </view>
</view> </view>
@ -210,13 +198,12 @@
<view class="dir-parent-box"> <view class="dir-parent-box">
<view class="title">类型:</view> <view class="title">类型:</view>
<view class="choose-box"> <view class="choose-box">
<block wx:for="{{fieldList}}" wx:for-index="idx" wx:key="idx" wx:for-item="it"> <block wx:for="{{fieldList}}" wx:for-index="idx" wx:key="idx">
<view catchtap="chooseFieldType" data-type="{{it.type}}" data-idx="{{idx}}" <view catchtap="chooseFieldType" data-type="{{idx}}" class="item">
class="item">
<text <text
class="{{curFieldTypeIndex == idx ? 'bg-yellow-light cuIcon-roundcheck' : 'text-gray2 cuIcon-round'}}"></text> class="{{curFieldType == idx ? 'bg-yellow-light cuIcon-roundcheck' : 'text-gray2 cuIcon-round'}}"></text>
<text class="{{curFieldTypeIndex == idx ? 'bg-yellow-light' : 'text-gray2'}}" <text class="{{curFieldType == idx ? 'bg-yellow-light' : 'text-gray2'}}"
style="margin-left: 6rpx;">{{it.type}}</text> style="margin-left: 6rpx;">{{item.type}}</text>
</view> </view>
</block> </block>
</view> </view>
@ -262,8 +249,7 @@
<textarea placeholder="请输入内容" bindinput="inputWatch" value="{{curTextValue}}" <textarea placeholder="请输入内容" bindinput="inputWatch" value="{{curTextValue}}"
placeholder-style="color:#333333;"></textarea> placeholder-style="color:#333333;"></textarea>
<view style="width: 100%;margin-top: 15rpx;"> <view style="width: 100%;margin-top: 15rpx;">
<button class="cu-btn bg-blue" style="width:100%" bindtap="doConfirmInput" <button class="cu-btn bg-blue" style="width:100%" bindtap="doConfirmInput">确定</button>
data-type="{{sourceType}}">确定</button>
</view> </view>
</view> </view>
</van-popup> </van-popup>
@ -291,7 +277,7 @@
style="width:300rpx;height:300rpx;"></image> style="width:300rpx;height:300rpx;"></image>
<text>00:{{audioDuration > 9 ? audioDuration : '0'+ audioDuration}}</text> <text>00:{{audioDuration > 9 ? audioDuration : '0'+ audioDuration}}</text>
<view class="cu-btn bg-blue radius margin-top-sm" style="width:70%;" bindtouchstart="startRecord" <view class="cu-btn bg-blue radius margin-top-sm" style="width:70%;" bindtouchstart="startRecord"
bindtouchend="doEndRecord">{{isRecording ? '正在录音' : '长按录音'}}</view> bindtouchend="doEndRecord">长按录音</view>
</view> </view>
<!-- 存在录音文件 --> <!-- 存在录音文件 -->
<view style="width: 100%;display: flex;flex-direction: column;justify-content: center;align-items: center;" <view style="width: 100%;display: flex;flex-direction: column;justify-content: center;align-items: center;"
@ -301,17 +287,17 @@
<text>{{audioFile.curDurationStr}}</text> <text>{{audioFile.curDurationStr}}</text>
<slider class="flex-sub" bindchange="slider4change" min="{{0}}" max="{{audioFile.duration}}" <slider class="flex-sub" bindchange="slider4change" min="{{0}}" max="{{audioFile.duration}}"
value="{{audioFile.curDuration}}" backgroundColor="#cacaca" activeColor="#1296db" value="{{audioFile.curDuration}}" backgroundColor="#cacaca" activeColor="#1296db"
data-type="record" block-size="14" data-item="{{audioFile}}" block-color="#1296db" /> block-size="14" data-item="{{audioFile}}" block-color="#1296db" />
<text>{{audioFile.totalDurationStr}}</text> <text>{{audioFile.totalDurationStr}}</text>
</view> </view>
<view class="flex justify-between" style="width:80%;"> <view class="flex justify-between" style="width:80%;">
<image src="/images/ic_audio_rewind.png" mode="scaleToFill" bindtap="rewind" data-type="record" <image src="/images/ic_audio_rewind.png" mode="scaleToFill" bindtap="rewind"
data-item="{{audioFile}}"> data-item="{{audioFile}}">
</image> </image>
<image src="{{audioFile.isPlay ? '/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}" <image src="{{audioFile.isPlay ? '/images/ic_audio_playing.png':'/images/ic_audio_play.png'}}"
data-type="record" mode="scaleToFill" bindtap="play" data-item="{{audioFile}}"> mode="scaleToFill" bindtap="play" data-item="{{audioFile}}">
</image> </image>
<image src="/images/ic_audio_speed.png" mode="scaleToFill" bindtap="speed" data-type="record" <image src="/images/ic_audio_speed.png" mode="scaleToFill" bindtap="speed"
data-item="{{audioFile}}"> data-item="{{audioFile}}">
</image> </image>
</view> </view>
@ -409,7 +395,7 @@
<view class="grid col-3 grid-square flex-sub"> <view class="grid col-3 grid-square flex-sub">
<view class="bg-img" wx:for="{{videoList}}" wx:for-index="idx" wx:key="idx" wx:for-item="video"> <view class="bg-img" wx:for="{{videoList}}" wx:for-index="idx" wx:key="idx" wx:for-item="video">
<image src='{{video.coverPath}}' mode='aspectFill'></image> <image src='{{video.coverPath}}' mode='aspectFill'></image>
<view class="cu-tag bg-red" catchtap="delVideo" data-index="{{idx}}" data-itemIndex="{{index}}"> <view class="cu-tag bg-red" catchtap="delImg" data-index="{{idx}}" data-itemIndex="{{index}}">
<text class="cuIcon-close"></text> <text class="cuIcon-close"></text>
</view> </view>
</view> </view>

View File

@ -156,11 +156,6 @@ van-action-sheet .noline:active {
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 15rpx;
}
.movie-box:nth-child(1) {
margin-top: 0rpx;
} }
.movie-box image { .movie-box image {
@ -230,7 +225,7 @@ van-action-sheet .noline:active {
.sel-border { .sel-border {
border: 1rpx solid #E6B980; border: 1rpx solid #E6B980;
border-radius: 10rpx; border-radius: 10rpx;
padding: 15rpx; padding-bottom: 15rpx;
} }
/* 语音弹框 */ /* 语音弹框 */

View File

@ -994,13 +994,6 @@ Page({
isShowType: true isShowType: true
}) })
}, },
//图片展示方式
chooseDisplayType(e) {
var id = e.currentTarget.dataset.id
this.setData({
selDisplayType: id
})
},
showMutliSel(e) { showMutliSel(e) {
this.setData({ this.setData({
isShowTags: true, isShowTags: true,

View File

@ -36,24 +36,13 @@
<text>{{item.comment}}{{item.valueList.length}}/{{item.maxCount}}</text> <text>{{item.comment}}{{item.valueList.length}}/{{item.maxCount}}</text>
</view> </view>
</view> </view>
<view class="cu-bar bg-white"> <view class="cu-bar bg-white" catchtap="showDisplayType">
<block wx:for="{{displayType}}" wx:key="idx" wx:for-index="idx" wx:for-item="it"> <view style="font-size: 32rpx;color:#000; padding:0rpx 15rpx;">
<view class="cu-capsule radius" style="margin-left: 15rpx;" catchtap="chooseDisplayType"
data-id="{{it.id}}">
<view class="cu-tag {{selDisplayType == it.id ? 'bg-yellowlight':'bg-grey'}}">
<text class="{{selDisplayType == it.id ? 'cuIcon-radiobox':'cuIcon-round'}}"></text>
</view>
<view class="cu-tag {{selDisplayType == it.id ? 'line-yellowlight2':'line-black'}}">
{{it.name}}
</view>
</view>
</block>
<!-- <view style="font-size: 32rpx;color:#000; padding:0rpx 15rpx;">
{{displayTypeStr}} {{displayTypeStr}}
</view> </view>
<view class="action"> <view class="action">
<text class="cuIcon-right"></text> <text class="cuIcon-right"></text>
</view> --> </view>
</view> </view>
<view class="cu-form-group item-padding"> <view class="cu-form-group item-padding">
<view class="grid col-3 grid-square flex-sub"> <view class="grid col-3 grid-square flex-sub">

View File

@ -91,26 +91,7 @@ Page({
}, },
buildMainData(datas) { buildMainData(datas) {
var _self = this var _self = this
var ids = ''
datas.forEach(it => { datas.forEach(it => {
var options = _self.data.tabList[_self.data.currentIndex]
var isOpen = options.configColumnCollect == '2' || options.configColumnCollect == '4' || options.configColumnLike == '2' && options.configColumnLike == '4' || options.configColumnDispatch == '2' || options.configColumnDispatch == '4' || options.configColumnComment == '2' || options.configColumnComment == '4'
it.cId = _self.data.tabList[_self.data.currentIndex].configColumnId
it.collectSwitch = _self.data.tabList[_self.data.currentIndex].configColumnCollect //收藏开关
it.commentSwitch = _self.data.tabList[_self.data.currentIndex].configColumnComment //评论开关
it.shareSwitch = _self.data.tabList[_self.data.currentIndex].configColumnDispatch //转发开关
it.likeSwitch = _self.data.tabList[_self.data.currentIndex].configColumnLike //点赞开关
it.funcSwitch = isOpen
ids += it.uid + ','
// 初始化评论 点赞 收藏状态
it.collectCount = 0
it.collectStatus = false
it.commentCount = 0
it.dispatchCount = 0
it.likeCount = 0
it.likeStatus = false
it.scansCount = 0
it.list.forEach(iem => { it.list.forEach(iem => {
switch (iem.dataType) { switch (iem.dataType) {
case '2': //图片 case '2': //图片
@ -219,44 +200,6 @@ Page({
_self.setData({ _self.setData({
dataList: datas dataList: datas
}) })
_self.getColumnContentHandle(ids)
},
//获取栏目内容点赞 收藏 评论
getColumnContentHandle(ids) {
var _self = this
wx.showLoading({
title: '加载中...',
})
app.http.get(app.urls.getColumnContentHandle.format({
projectId: 'column',
businessIds: ids
}), {
header: {
token: app.globalData.token
}
})
.then(res => {
wx.hideLoading({})
res.data.forEach(it => {
_self.data.dataList.forEach(item => {
if (item.uid == it.businessId) {
item.collectCount = it.collectCount
item.collectStatus = it.collectStatus
item.commentCount = it.commentCount
item.dispatchCount = it.dispatchCount
item.likeCount = it.likeCount
item.likeStatus = it.likeStatus
item.scansCount = it.scansCount
}
})
})
_self.setData({
dataList: _self.data.dataList
})
})
.catch(err => {
})
}, },
//预览图片 //预览图片
viewImg(e) { viewImg(e) {
@ -418,102 +361,14 @@ Page({
innerAudioContext.stop() innerAudioContext.stop()
} }
}, },
// 显示详情
showDetail(e) { showDetail(e) {
if (this.data.currentTab.configColumnType.indexOf('dda5007c-5fb7-48f2-8537-3cb8ea298242') != -1) { if (this.data.currentTab.configColumnType.indexOf('dda5007c-5fb7-48f2-8537-3cb8ea298242') != -1) {
//需要跳详情 //需要跳详情
var cId = this.data.currentTab.configColumnId var cId = this.data.currentTab.configColumnId
var uId = e.currentTarget.dataset.uid var uId = e.currentTarget.dataset.uid
console.log(e)
wx.navigateTo({ wx.navigateTo({
url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId, url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId,
}) })
} }
},
//显示评论
showComment(e) {
//需要跳详情
var cId = e.currentTarget.dataset.cid
var uId = e.currentTarget.dataset.uid
var like = e.currentTarget.dataset.like
var collect = e.currentTarget.dataset.collect
var comment = e.currentTarget.dataset.comment
var share = e.currentTarget.dataset.share
var params = '&collectSwitch=' + collect + '&likeSwitch=' + like + '&commentSwitch=' + comment + '&shareSwitch=' + share
console.log(params)
wx.navigateTo({
url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId + params,
})
},
//点赞
doLike(e) {
var _self = this
var item = e.currentTarget.dataset.item
var index = e.currentTarget.dataset.index //栏目索引
var favor = item.likeStatus
var msg = ''
if (favor) {
msg = '取消中...'
} else {
msg = '保存中...'
}
wx.showLoading({
title: msg,
})
app.http.post(app.urls.doSaveLike, {
header: {
token: app.globalData.token
},
data: {
businessId: item.uid,
projectId: 'column'
}
})
.then(res => {
wx.hideLoading({})
_self.data.dataList[index].likeStatus = !item.likeStatus
if (item.likeStatus) {
--_self.data.dataList[index].likeCount
} else {
++_self.data.dataList[index].likeCount
}
_self.setData({
dataList: _self.data.dataList
})
})
.catch(err => {})
},
//收藏
doCollect(e) {
var _self = this
var item = e.currentTarget.dataset.item
var index = e.currentTarget.dataset.index //栏目索引
var favor = item.collectStatus
var msg = ''
if (favor) {
msg = '取消收藏...'
} else {
msg = '收藏中...'
}
wx.showLoading({
title: msg,
})
app.http.post(app.urls.doSaveCollect, {
header: {
token: app.globalData.token
},
data: {
businessId: item.uid,
projectId: 'column'
}
})
.then(res => {
wx.hideLoading({})
_self.data.dataList[index].collectStatus = !item.collectStatus
_self.setData({
dataList: _self.data.dataList
})
})
.catch(err => {})
} }
}) })

View File

@ -23,10 +23,7 @@
<view wx:for="{{item.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="it" <view wx:for="{{item.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="it"
class="column-box-row"> class="column-box-row">
<view wx:for="{{it.list}}" wx:for-index="i" wx:for-item="child" wx:key="i" bindtap="showDetail" <view wx:for="{{it.list}}" wx:for-index="i" wx:for-item="child" wx:key="i" bindtap="showDetail"
data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}" data-ctype="{{item.type}}" data-cid="{{item.cId}}" data-id="{{it.uid}}">
data-collect="{{item.collectSwitch}}" data-comment="{{item.commentSwitch}}"
data-ctype="{{item.type}}" data-ctype="{{item.type}}" data-cid="{{item.cId}}"
data-id="{{it.uid}}">
<!-- 文本 --> <!-- 文本 -->
<view wx:if="{{child.dataType=='1' && child.displayList}}" class="align-center"> <view wx:if="{{child.dataType=='1' && child.displayList}}" class="align-center">
<view class="bg-white"> <view class="bg-white">
@ -62,15 +59,11 @@
<view class="column-box"> <view class="column-box">
<!-- 栏目数据 --> <!-- 栏目数据 -->
<view wx:for="{{item.list}}" wx:for-index="i" wx:for-item="child" wx:key="i" data-item="{{child}}" <view wx:for="{{item.list}}" wx:for-index="i" wx:for-item="child" wx:key="i" data-item="{{child}}"
data-uid="{{item.uid}}" bindtap="showDetail" data-like="{{item.likeSwitch}}" data-uid="{{item.uid}}" bindtap="showDetail"
data-share="{{item.shareSwitch}}" data-collect="{{item.collectSwitch}}"
data-comment="{{item.commentSwitch}}" data-ctype="{{item.type}}" data-ctype="{{item.type}}"
data-cid="{{item.cId}}" data-id="{{item.uid}}"
class="{{child.valueList.length>0 || child.value.length>0 ? 'column-item' : ''}}"> class="{{child.valueList.length>0 || child.value.length>0 ? 'column-item' : ''}}">
<!-- 具体数据 --> <!-- 具体数据 -->
<!-- 文本 --> <!-- 文本 -->
<view wx:if="{{child.dataType=='1' && child.displayList && child.value.length>0}}" <view wx:if="{{child.dataType=='1' && child.displayList}}" class="align-center">
class="align-center">
<view class="bg-white"> <view class="bg-white">
<view class="cu-form-group"> <view class="cu-form-group">
<view id="content" style="line-height:40rpx;"> <view id="content" style="line-height:40rpx;">
@ -227,45 +220,6 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 评论 收藏 点赞 -->
<view class="func-box" wx:if="{{item.funcSwitch}}">
<view class="line-gray-ssm">
</view>
<view class="func-items">
<!-- 转发 -->
<button class="func-item" open-type="share" data-sharetype="2" data-item="{{item}}"
data-index="{{index}}" wx:if="{{item.shareSwitch != '1' && item.shareSwitch != '3'}}"
style="font-size: 28rpx;font-weight: normal;text-align: center;background-color: #ffffff;width: 0rpx;margin: 0rpx;padding: 0rpx;border-radius: 0rpx;">
<text class="cuIcon-share text-gray" style="font-size: 38rpx;"></text>
<text style="text-align: center;line-height:28rpx;">转发</text>
</button>
<!-- 收藏 -->
<view class="func-item" wx:if="{{item.collectSwitch != '1' && item.collectSwitch != '3'}}"
data-item="{{item}}" data-index="{{index}}" catchtap="doCollect">
<text
class="{{item.collectStatus ? 'cuIcon-favorfill line-yellowlight2': 'cuIcon-favor text-gray'}}"
style="font-size: 38rpx;"></text>
<text>收藏</text>
</view>
<!-- 评论 -->
<view class="func-item" wx:if="{{item.commentSwitch != '1' && item.commentSwitch != '3'}}"
catchtap="showComment" data-uid="{{item.uid}}" data-cid="{{item.cId}}"
data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}"
data-collect="{{item.collectSwitch}}" data-comment="{{item.commentSwitch}}">
<text class="cuIcon-comment text-gray" style="font-size: 38rpx;"></text>
<text style="font-size: 30rpx;">{{item.commentCount>1000 ?
'1000+':item.commentCount}}</text>
</view>
<!-- 点赞 -->
<view class="func-item" wx:if="{{item.likeSwitch != '1' && item.likeSwitch != '3'}}"
catchtap="doLike" data-item="{{item}}" data-index="{{index}}">
<text
class="{{item.likeStatus ? 'cuIcon-appreciatefill line-yellowlight2' :'cuIcon-appreciate text-gray'}}"
style="font-size: 38rpx;"></text>
<text style="font-size:30rpx;">{{item.likeCount>1000? '1000+':item.likeCount}}</text>
</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -156,7 +156,6 @@
letter-spacing: 2rpx; letter-spacing: 2rpx;
position: relative; position: relative;
} }
.column-item { .column-item {
margin: 0rpx; margin: 0rpx;
padding: 7.5rpx 15rpx 7.5rpx 15rpx; padding: 7.5rpx 15rpx 7.5rpx 15rpx;
@ -182,7 +181,6 @@
.img-item:last-child { .img-item:last-child {
padding: 7.5rpx 0rpx 7.5rpx 0rpx; padding: 7.5rpx 0rpx 7.5rpx 0rpx;
} }
.movie-box { .movie-box {
display: flex; display: flex;
width: 100%; width: 100%;

View File

@ -36,6 +36,8 @@ Page({
selTypeIndex: 0, //当前选中的类型列表 selTypeIndex: 0, //当前选中的类型列表
selTypeId: '', //当前选中的类型id selTypeId: '', //当前选中的类型id
selType: '', //选中的类型type selType: '', //选中的类型type
isShowContrast: false, //是否显示版本对比
contrastId: '', //版本对比图片ID
}, },
/** /**
@ -122,7 +124,8 @@ Page({
this.setData({ this.setData({
isShowUseDeal: false, //使用协议 isShowUseDeal: false, //使用协议
isShowServiceTreaty: false, //会员服务协议 isShowServiceTreaty: false, //会员服务协议
isShowIntimacyTreaty: false //隐私政策 isShowIntimacyTreaty: false, //隐私政策
isShowContrast: false //版本对比
}) })
}, },
//提交支付 //提交支付
@ -294,5 +297,25 @@ Page({
.catch(err => { .catch(err => {
}) })
},
//显示版本对比
showContrast() {
var _self = this
wx.showLoading({
title: '加载中...',
})
app.http.get(app.urls.getVersionContrast, {
header: {
token: app.globalData.token
}
})
.then(res => {
wx.hideLoading({})
_self.setData({
contrastId: app.urls.baseImgUrl + res.data.data,
isShowContrast: true,
})
})
.catch(err => {})
} }
}) })

View File

@ -22,6 +22,7 @@
<view class="code-box"> <view class="code-box">
<view class="title">邀请码 (选填)</view> <view class="title">邀请码 (选填)</view>
<input placeholder="请输入邀请码" type="text" class="code-input" bindinput="inputWatch" maxlength="6" /> <input placeholder="请输入邀请码" type="text" class="code-input" bindinput="inputWatch" maxlength="6" />
<image src="/images/ic_version_contrast.png" bindtap="showContrast" mode="scaleToFill"></image>
</view> </view>
<view class="type-box"> <view class="type-box">
<block wx:for="{{typeList}}" wx:key="index"> <block wx:for="{{typeList}}" wx:key="index">
@ -40,8 +41,7 @@
</block> </block>
</view> </view>
</view> </view>
<view class="foot" style="padding: 15rpx;background-color: #ffffff;">
<view class="foot" style="padding: 15rpx;">
<view class="treaty-box"> <view class="treaty-box">
<text class="{{isChecked ? 'cuIcon-squarecheck':'cuIcon-square'}} text-gray" style="font-size: 34rpx;" <text class="{{isChecked ? 'cuIcon-squarecheck':'cuIcon-square'}} text-gray" style="font-size: 34rpx;"
bindtap="changeCheck"></text> bindtap="changeCheck"></text>
@ -53,21 +53,50 @@
</view> </view>
<button class="cu-btn bg-blue" style="width:100%" bindtap="doPay">立即支付</button> <button class="cu-btn bg-blue" style="width:100%" bindtap="doPay">立即支付</button>
</view> </view>
<!-- 使用协议 --> <!-- 使用协议 -->
<van-popup show="{{ isShowUseDeal }}" bind:close="onClose" custom-style="width:90%;height:75%;" round> <van-popup show="{{ isShowUseDeal }}" bind:close="onClose"
<view class="treaty-content-box"> custom-style="width:90%;height:80%;background-color:transparent;">
<rich-text class="content" nodes="{{treatyStr}}"></rich-text> <view style="display: flex;flex-direction: column;justify-content: center;align-items: center;height: 100%;"
catchtap="onClose">
<scroll-view class="treaty-content-box" scroll-y>
<rich-text nodes="{{treatyStr}}"></rich-text>
</scroll-view>
<text class="cuIcon-roundclose" catchtap="onClose"
style="font-size: 50rpx;color: #fff;margin-top: 15rpx;"></text>
</view> </view>
</van-popup> </van-popup>
<!-- 会员服务协议 --> <!-- 会员服务协议 -->
<van-popup show="{{ isShowServiceTreaty }}" bind:close="onClose" custom-style="width:90%;height:75%;" round> <van-popup show="{{ isShowServiceTreaty }}" bind:close="onClose"
<view class="treaty-content-box"> custom-style="width:90%;height:80%;background-color:transparent;">
<rich-text class="content" nodes="{{treatyStr}}"></rich-text> <view style="display: flex;flex-direction: column;justify-content: center;align-items: center;height: 100%;"
catchtap="onClose">
<scroll-view class="treaty-content-box" scroll-y>
<rich-text nodes="{{treatyStr}}"></rich-text>
</scroll-view>
<text class="cuIcon-roundclose" catchtap="onClose"
style="font-size: 50rpx;color: #fff;margin-top: 15rpx;"></text>
</view> </view>
</van-popup> </van-popup>
<!-- 隐私政策 --> <!-- 隐私政策 -->
<van-popup show="{{ isShowIntimacyTreaty }}" bind:close="onClose" custom-style="width:90%;height:75%;" round> <van-popup show="{{ isShowIntimacyTreaty }}" bind:close="onClose"
<view class="treaty-content-box"> custom-style="width:90%;height:80%;background-color:transparent;">
<rich-text class="content" nodes="{{treatyStr}}"></rich-text> <view style="display: flex;flex-direction: column;justify-content: center;align-items: center;height: 100%;"
catchtap="onClose">
<scroll-view class="treaty-content-box" scroll-y>
<rich-text nodes="{{treatyStr}}"></rich-text>
</scroll-view>
<text class="cuIcon-roundclose" catchtap="onClose"
style="font-size: 50rpx;color: #fff;margin-top: 15rpx;"></text>
</view>
</van-popup>
<van-popup show="{{ isShowContrast }}" bind:close="onClose"
custom-style="background-color:transparent;height:100%;width:100%;" round>
<view bindtap="onClose"
style="width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;margin-top: 80rpx;">
<image src="{{contrastId}}" mode="widthFix" style="width: 80%;max-height: 70%;border-radius: 10rpx;"></image>
<view style="margin-top: 15rpx;">
<text class="cuIcon-roundclose" style="font-size: 40rpx;color: #FFFFFF;"></text>
</view>
</view> </view>
</van-popup> </van-popup>

View File

@ -107,14 +107,19 @@
font-weight: normal; font-weight: normal;
} }
.code-box image {
width: 96rpx;
height: 96rpx;
}
.code-input { .code-input {
text-align: right; text-align: left;
align-self: center; align-self: center;
padding: 15rpx; padding: 15rpx;
margin-left: 15rpx; margin-left: 15rpx;
height: 70rpx; height: 70rpx;
border-radius: 10rpx; border-radius: 10rpx;
width: 70%; width: 60%;
} }
.treaty-box { .treaty-box {
@ -125,6 +130,9 @@
margin-bottom: 40rpx; margin-bottom: 40rpx;
font-size: 28rpx; font-size: 28rpx;
margin-top: 15rpx; margin-top: 15rpx;
background-color: #ffffff;
height: 50%;
width: 90%;
} }
.treaty-content-box { .treaty-content-box {
@ -133,6 +141,9 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 15rpx; padding: 15rpx;
height: 90%;
background-color: #ffffff;
border-radius: 5rpx;
} }
.treaty-content-box .title { .treaty-content-box .title {

View File

@ -1,7 +1,47 @@
<cu-custom isBack="{{true}}"> <cu-custom isBack="{{true}}">
<view slot="content">立即提现</view> <view slot="content">立即提现</view>
</cu-custom> </cu-custom>
<view class="page-box" style="padding: 0rpx;"> <view class="page-box">
<view class="content-box">
<view style="font-size: 32rpx;padding: 20rpx;">可提现金额(元)</view>
<view style="margin-left: 23rpx;">
<text style="font-size: 40rpx;line-height: 80rpx;">¥</text>
<text
style="font-size: 80rpx;line-height: 80rpx;margin-left: 15rpx;">{{accountInfo.accountMoney/100}}</text>
</view>
<view class="content-bottom-box">
<view>
<view>最低提现金额(元)</view>
<view style="height: 40rpx;text-align: left;line-height: 40rpx;">¥1.00</view>
</view>
<view bindtap="toRecord">
<view>查看提现记录</view>
<image src="/images/ic_take_cash_record.png" style="width: 40rpx;height: 40rpx;" mode="scaleToFill">
</image>
</view>
</view>
</view>
<view class="cash-box">
<view class="title-box">
<view class="title">提现金额</view>
</view>
<view class="input-box">
<text style="text-align: left;font-size: 40rpx;line-height: 40rpx;">¥</text>
<input type="digit" value="{{takeValue}}" bindinput="inputWatch" />
<view catchtap="takeAll" style="font-size: 28rpx;color: #E6B980;">全部提现</view>
</view>
<view class="cash-bottom-box">
<view>提现至微信零钱</view>
<image src="/images/ic_wechat_icon.png" style="width: 40rpx;height: 40rpx;" mode="scaleToFill"></image>
</view>
</view>
<view style="width: 100%;margin-top: 70rpx;">
<button class="cu-btn bg-blue" style="width:100%" bindtap="doCash">申请提现</button>
</view>
</view>
<!-- <view class="page-box" style="padding: 0rpx;">
<view class="content-box"> <view class="content-box">
<view> <view>
<view class="money"> <view class="money">
@ -27,4 +67,4 @@
</view> </view>
<view class="foot" style="padding: 15rpx;"> <view class="foot" style="padding: 15rpx;">
<button class="cu-btn bg-blue" style="width:100%" bindtap="doCash">申请提现</button> <button class="cu-btn bg-blue" style="width:100%" bindtap="doCash">申请提现</button>
</view> </view> -->

View File

@ -3,21 +3,25 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: flex-start;
width: 100%; width: 100%;
background-color: #E6B980; background-color: #E6B980;
text-align: center; border-radius: 10rpx;
min-height: 400rpx; color: #ffffff;
} }
.content-box .money { .content-bottom-box {
color: #fff; display: flex;
} flex-direction: row;
align-items: center;
.content-box .hint { justify-content: space-between;
width: 100%;
background-color: #D6A970;
border-bottom-left-radius: 10rpx;
border-bottom-right-radius: 10rpx;
padding: 25rpx;
font-size: 28rpx; font-size: 28rpx;
margin-top: 15rpx; margin-top: 25rpx;
color: #fff;
} }
.cash-box { .cash-box {
@ -26,32 +30,45 @@
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
align-items: flex-start; align-items: flex-start;
width: 90%; width: 100%;
background-color: #fff; background-color: #fff;
border-radius: 15rpx; border-radius: 5rpx;
position: absolute;
top: 450rpx;
box-shadow: 0 4rpx 8rpx 0 #DFDBDB, 0 6rpx 20rpx 0 #DFDBDB; box-shadow: 0 4rpx 8rpx 0 #DFDBDB, 0 6rpx 20rpx 0 #DFDBDB;
margin-top: 15rpx;
} }
.cash-box .title { .cash-box .title {
font-size: 32rpx; font-size: 32rpx;
} }
.cash-bottom-box {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
width: 100%;
border-top: 1rpx solid #f3f3f3;
padding: 20rpx 20rpx 0rpx 20rpx;
}
.input-box { .input-box {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: flex-end;
justify-content: space-between; justify-content: flex-start;
font-size: 80rpx; font-size: 80rpx;
padding: 20rpx;
line-height: 80rpx;
} }
.input-box input { .input-box input {
width: 100%; width: 80%;
text-align: center; text-align: left;
line-height: 80rpx; line-height: 80rpx;
height: 80rpx; height: 80rpx;
font-size: 80rpx;
padding-left: 15rpx;
} }
.title-box { .title-box {
@ -61,4 +78,5 @@
align-items: center; align-items: center;
width: 100%; width: 100%;
font-size: 32rpx; font-size: 32rpx;
padding: 0rpx 20rpx 20rpx 20rpx;
} }

View File

@ -33,6 +33,7 @@ Page({
otherCardList: [], //卡包名片 otherCardList: [], //卡包名片
isPlayAudio: false, //标识当前是否在播放音乐 isPlayAudio: false, //标识当前是否在播放音乐
audioId: '', audioId: '',
uId: '', //海报过来的UserId
count: 3, count: 3,
isMine: 1, //1 自己 2 其他 isMine: 1, //1 自己 2 其他
isDefault: true, isDefault: true,
@ -42,9 +43,11 @@ Page({
isBindPhone: false, isBindPhone: false,
isNeedRefresh: true, isNeedRefresh: true,
isShowComment: false, //是否显示评论弹框 isShowComment: false, //是否显示评论弹框
posterId: '', //分享过来的海报图片 posterId: '', //分享过来的海报ID
posterImg: '', //分享过来的海报图片
isShowPoster: false, isShowPoster: false,
defaultBtnIcon: '/images/ic_share_img.png' defaultBtnIcon: '/images/ic_share_img.png',
shareTitle: '您好,这是我的电子名片,请查看.'
}, },
onLoad(options) { onLoad(options) {
var self = this var self = this
@ -55,15 +58,15 @@ Page({
isMine: 2 isMine: 2
}) })
} }
self.buildId() if (options.cardTemplateUseId) {
self.doLogin()
if (options.posterId) {
//展示图片 //展示图片
self.setData({ self.setData({
posterId: options.posterId, posterId: options.cardTemplateUseId,
isShowPoster: true uId: options.userId
}) })
} }
self.buildId()
self.doLogin()
}, },
// 登录 // 登录
doLogin() { doLogin() {
@ -100,6 +103,9 @@ Page({
} }
self.getOtherCard(2) self.getOtherCard(2)
self.getBtnIcon() //获取首页按钮图片 self.getBtnIcon() //获取首页按钮图片
if (self.data.posterId != '') {
self.getPosterImg()
}
}) })
.catch(err => { .catch(err => {
wx.hideLoading({}) wx.hideLoading({})
@ -107,6 +113,28 @@ Page({
} }
}) })
}, },
//获取分享的海报
getPosterImg() {
var _self = this
app.http.get(app.urls.getMyCardDetail.format({
cardTemplateUseId: _self.data.posterId
}), {
header: {
token: app.globalData.token
}
})
.then(res => {
var img = _self.data.imgUrl + res.data.cardTemplateUsePhotoUrl
console.log(img)
_self.setData({
posterImg: img,
isShowPoster: true
})
})
.catch(err => {
})
},
//首页按钮图片 //首页按钮图片
getBtnIcon() { getBtnIcon() {
var _self = this var _self = this
@ -215,6 +243,15 @@ Page({
addressTxt: it.value addressTxt: it.value
}) })
break break
case 'cardtitle':
wx.setStorageSync('cardtitle', it.value)
_self.setData({
shareTitle: it.value.length > 0 ? it.value : '您好,这是我的电子名片,请查看.'
})
break
case 'postertitle':
wx.setStorageSync('postertitle', it.value)
break
} }
}) })
} else { } else {
@ -249,14 +286,11 @@ Page({
}) })
.then(res => { .then(res => {
if (res.data.length > 0) { if (res.data.length > 0) {
var options = datas[_self.data.curIndex] // collectSwitch: datas[_self.data.curIndex].configColumnCollect, //收藏开关
var isOpen = options.configColumnCollect == '2' || options.configColumnCollect == '4' || options.configColumnLike == '2' && options.configColumnLike == '4' || options.configColumnDispatch == '2' || options.configColumnDispatch == '4' || options.configColumnComment == '2' || options.configColumnComment == '4' // commentSwitch: datas[_self.data.curIndex].configColumnComment, //评论开关
// shareSwitch: datas[_self.data.curIndex].configColumnDispatch, //转发开关
// likeSwitch: datas[_self.data.curIndex].configColumnLike, //点赞开关
var tempItem = { var tempItem = {
funcSwitch: isOpen,
collectSwitch: datas[_self.data.curIndex].configColumnCollect, //收藏开关
commentSwitch: datas[_self.data.curIndex].configColumnComment, //评论开关
shareSwitch: datas[_self.data.curIndex].configColumnDispatch, //转发开关
likeSwitch: datas[_self.data.curIndex].configColumnLike, //点赞开关
cId: datas[_self.data.curIndex].configColumnId, cId: datas[_self.data.curIndex].configColumnId,
type: datas[_self.data.curIndex].configColumnType, type: datas[_self.data.curIndex].configColumnType,
name: datas[_self.data.curIndex].configColumnName, name: datas[_self.data.curIndex].configColumnName,
@ -288,18 +322,8 @@ Page({
//构建主页显示数据 //构建主页显示数据
buildMainData() { buildMainData() {
var _self = this var _self = this
var ids = ''
_self.data.dataList.forEach(it => { _self.data.dataList.forEach(it => {
it.list.forEach(item => { it.list.forEach(item => {
ids += item.uid + ','
// 初始化评论 点赞 收藏状态
item.collectCount = 0
item.collectStatus = false
item.commentCount = 0
item.dispatchCount = 0
item.likeCount = 0
item.likeStatus = false
item.scansCount = 0
item.list.forEach(iem => { item.list.forEach(iem => {
switch (iem.dataType) { switch (iem.dataType) {
case '2': //图片 case '2': //图片
@ -410,57 +434,16 @@ Page({
curIndex: 0, curIndex: 0,
dataList: _self.data.dataList dataList: _self.data.dataList
}) })
_self.getColumnContentHandle(ids)
},
//获取栏目内容点赞 收藏 评论
getColumnContentHandle(ids) {
var _self = this
wx.showLoading({
title: '加载中...',
})
app.http.get(app.urls.getColumnContentHandle.format({
projectId: 'column',
businessIds: ids
}), {
header: {
token: app.globalData.token
}
})
.then(res => {
wx.hideLoading({})
res.data.forEach(it => {
_self.data.dataList.forEach(item => {
item.list.forEach(iem => {
if (iem.uid == it.businessId) {
iem.collectCount = it.collectCount
iem.collectStatus = it.collectStatus
iem.commentCount = it.commentCount
iem.dispatchCount = it.dispatchCount
iem.likeCount = it.likeCount
iem.likeStatus = it.likeStatus
iem.scansCount = it.scansCount
}
})
})
})
_self.setData({
curIndex: 0,
dataList: _self.data.dataList
})
})
.catch(err => {
})
}, },
//显示更多栏目数据 //显示更多栏目数据
showMore(e) { showMore(e) {
this.setData({
isNeedRefresh: false
})
var item = e.currentTarget.dataset.item var item = e.currentTarget.dataset.item
if (item.mode == '2') { if (item.mode == '2') {
var userid = e.currentTarget.dataset.userid var userid = e.currentTarget.dataset.userid
var idx = e.currentTarget.dataset.idx var idx = e.currentTarget.dataset.idx
this.setData({
isNeedRefresh: false
})
wx.navigateTo({ wx.navigateTo({
url: '/packagecard/moments/showlist/showlist?id=' + item.cId + '&userId=' + userid + '&index=' + idx, url: '/packagecard/moments/showlist/showlist?id=' + item.cId + '&userId=' + userid + '&index=' + idx,
}) })
@ -668,7 +651,7 @@ Page({
}) })
.then(res => { .then(res => {
wx.setStorageSync('usercode', res.data.userCode) wx.setStorageSync('usercode', res.data.userCode)
app.globalData.currentUserId = res.data.userId wx.setStorageSync('userId', res.data.userId)
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err)
@ -682,11 +665,12 @@ Page({
cardInfo: {}, cardInfo: {},
areaList: [] areaList: []
}) })
app.http.get(app.urls.getDefaultCard, { app.http.get(app.urls.getDefaultCard.format({
userId: self.data.uId
}), {
header: { header: {
token: app.globalData.token token: app.globalData.token
}, }
data: {}
}).then(res => { }).then(res => {
var area = res.data.areaList var area = res.data.areaList
area.forEach(it => { area.forEach(it => {
@ -944,6 +928,10 @@ Page({
}, },
// 展示名片码 // 展示名片码
showBarCode: function () { showBarCode: function () {
// TODO 测试
// wx.navigateTo({
// url: '/packagecard/moments/publish/momentpublish',
// })
this.setData({ this.setData({
isNeedRefresh: false isNeedRefresh: false
}) })
@ -981,8 +969,10 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function (res) { onShareAppMessage: function (res) {
console.log(res)
var self = this var self = this
self.setData({
isNeedRefresh: false
})
wx.showShareMenu({ wx.showShareMenu({
withShareTicket: true, withShareTicket: true,
success: function (res) { success: function (res) {
@ -992,18 +982,13 @@ Page({
var type = res.target.dataset.sharetype var type = res.target.dataset.sharetype
if (type && type == '2') { if (type && type == '2') {
//转发个人动态 //转发个人动态
// data-item="{{it}}" data-idx="{{idx}}"
// data-index="{{index}}"
var item = res.target.dataset.item
var idx = res.target.dataset.idx
var index = res.target.dataset.index
console.log(item)
} else { } else {
var postId = self.buildId() var postId = self.buildId()
self.shareRecord(postId) self.shareRecord(postId)
var param = '/pages/index/index?cardTemplateDispatchId=' + postId; var param = '/pages/index/index?cardTemplateDispatchId=' + postId;
return { return {
title: '您好,这是我的电子名片,请查看.', title: self.data.shareTitle,
path: param, path: param,
imageUrl: self.data.shareImgUrl imageUrl: self.data.shareImgUrl
} }
@ -1023,18 +1008,16 @@ Page({
}, },
//显示详情 //显示详情
showDetail(e) { showDetail(e) {
this.setData({
isNeedRefresh: false
})
var type = e.currentTarget.dataset.ctype //需要跳详情 var type = e.currentTarget.dataset.ctype //需要跳详情
if (type.indexOf('dda5007c-5fb7-48f2-8537-3cb8ea298242') != -1) { if (type.indexOf('dda5007c-5fb7-48f2-8537-3cb8ea298242') != -1) {
//需要跳详情 //需要跳详情
var cId = e.currentTarget.dataset.cid var cId = e.currentTarget.dataset.cid
var uId = e.currentTarget.dataset.id var uId = e.currentTarget.dataset.id
var like = e.currentTarget.dataset.like
var collect = e.currentTarget.dataset.collect
var comment = e.currentTarget.dataset.comment
var share = e.currentTarget.dataset.share
var params = '&collectSwitch=' + collect + '&likeSwitch=' + like + '&commentSwitch=' + comment + '&shareSwitch=' + share
wx.navigateTo({ wx.navigateTo({
url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId + params, url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId,
}) })
} }
}, },
@ -1175,7 +1158,8 @@ Page({
cardTemplateUseId: '', cardTemplateUseId: '',
isShowCard: false, isShowCard: false,
isMine: 1, isMine: 1,
isDefault: false isDefault: false,
uId: ''
}) })
this.getDefault() this.getDefault()
} else if (type == 2) { } else if (type == 2) {
@ -1240,94 +1224,16 @@ Page({
}, },
//显示评论 //显示评论
showComment(e) { showComment(e) {
//需要跳详情 this.setData({
var cId = e.currentTarget.dataset.cid isShowComment: true
var uId = e.currentTarget.dataset.uid
var like = e.currentTarget.dataset.like
var collect = e.currentTarget.dataset.collect
var comment = e.currentTarget.dataset.comment
var share = e.currentTarget.dataset.share
// collectSwitch: options.collectSwitch,//收藏的开关
// likeSwitch:options.likeSwitch,//点赞的开关
// commentSwitch:options.commentSwitch,//评论的开关
// shareSwitch:options.shareSwitch,//转发的开关
var params = '&collectSwitch=' + collect + '&likeSwitch=' + like + '&commentSwitch=' + comment + '&shareSwitch=' + share
console.log(params)
wx.navigateTo({
url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId + params,
}) })
}, },
//点赞 //点赞
doLike(e) { doLike(e) {
var _self = this
var item = e.currentTarget.dataset.item
var idx = e.currentTarget.dataset.idx //内容索引
var index = e.currentTarget.dataset.index //栏目索引
var favor = item.likeStatus
var msg = ''
if (favor) {
msg = '取消中...'
} else {
msg = '保存中...'
}
wx.showLoading({
title: msg,
})
app.http.post(app.urls.doSaveLike, {
header: {
token: app.globalData.token
},
data: {
businessId: item.uid,
projectId: 'column'
}
})
.then(res => {
wx.hideLoading({})
_self.data.dataList[index].list[idx].likeStatus = !item.likeStatus
if (item.likeStatus) {
--_self.data.dataList[index].list[idx].likeCount
} else {
++_self.data.dataList[index].list[idx].likeCount
}
_self.setData({
dataList: _self.data.dataList
})
})
.catch(err => {})
}, },
//收藏 //收藏
doCollect(e) { doCollect(e) {
var _self = this
var item = e.currentTarget.dataset.item
var idx = e.currentTarget.dataset.idx //内容索引
var index = e.currentTarget.dataset.index //栏目索引
var favor = item.collectStatus
var msg = ''
if (favor) {
msg = '取消收藏...'
} else {
msg = '收藏中...'
}
wx.showLoading({
title: msg,
})
app.http.post(app.urls.doSaveCollect, {
header: {
token: app.globalData.token
},
data: {
businessId: item.uid,
projectId: 'column'
}
})
.then(res => {
wx.hideLoading({})
_self.data.dataList[index].list[idx].collectStatus = !item.collectStatus
_self.setData({
dataList: _self.data.dataList
})
})
.catch(err => {})
} }
}) })

View File

@ -119,9 +119,7 @@
style="width:100%;"> style="width:100%;">
<view wx:for="{{item.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="it" class="column-box-row"> <view wx:for="{{item.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="it" class="column-box-row">
<view wx:for="{{it.list}}" wx:for-index="i" wx:for-item="child" wx:key="i" bindtap="showDetail" <view wx:for="{{it.list}}" wx:for-index="i" wx:for-item="child" wx:key="i" bindtap="showDetail"
data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}" data-collect="{{item.collectSwitch}}" data-ctype="{{item.type}}" data-cid="{{item.cId}}" data-id="{{it.uid}}">
data-comment="{{item.commentSwitch}}" data-ctype="{{item.type}}" data-cid="{{item.cId}}"
data-id="{{it.uid}}">
<!-- 文本 --> <!-- 文本 -->
<view wx:if="{{child.dataType=='1' && child.displayList}}" class="align-center"> <view wx:if="{{child.dataType=='1' && child.displayList}}" class="align-center">
<view class="bg-white"> <view class="bg-white">
@ -154,16 +152,13 @@
<view wx:for="{{item.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="it" class="column-box"> <view wx:for="{{item.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="it" class="column-box">
<!-- 栏目数据 --> <!-- 栏目数据 -->
<view wx:for="{{it.list}}" wx:for-index="i" wx:for-item="child" wx:key="i" bindtap="showDetail" <view wx:for="{{it.list}}" wx:for-index="i" wx:for-item="child" wx:key="i" bindtap="showDetail"
data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}" data-collect="{{item.collectSwitch}}" class="{{child.valueList.length>0 || child.value.length>0 ? 'column-item' : ''}}"
data-comment="{{item.commentSwitch}}"
class="{{(child.valueList.length>0 || child.value.length>0) && child.displayList ? 'column-item' : ''}}"
data-ctype="{{item.type}}" data-cid="{{item.cId}}" data-id="{{it.uid}}"> data-ctype="{{item.type}}" data-cid="{{item.cId}}" data-id="{{it.uid}}">
<!-- 栏目样式1或3 --> <!-- 栏目样式1或3 -->
<view> <view>
<!-- 具体数据 --> <!-- 具体数据 -->
<!-- 文本 --> <!-- 文本 -->
<view wx:if="{{child.dataType=='1' && child.displayList && child.value.length>0}}" <view wx:if="{{child.dataType=='1' && child.displayList}}" class="align-center">
class="align-center">
<view class=" bg-white"> <view class=" bg-white">
<view class="cu-form-group"> <view class="cu-form-group">
<view id="content" style="line-height:40rpx;width: 100%;"> <view id="content" style="line-height:40rpx;width: 100%;">
@ -312,42 +307,37 @@
</view> </view>
</view> </view>
<!-- 评论 收藏 点赞 --> <!-- 评论 收藏 点赞 -->
<view class="func-box" wx:if="{{item.funcSwitch}}"> <!-- collectSwitch: datas[_self.data.curIndex].configColumnCollect, //收藏开关
commentSwitch: datas[_self.data.curIndex].configColumnComment, //评论开关
shareSwitch: datas[_self.data.curIndex].configColumnDispatch, //转发开关
likeSwitch: datas[_self.data.curIndex].configColumnLike, //点赞开关 -->
<!-- <view class="func-box">
<view class="line-gray-ssm"> <view class="line-gray-ssm">
</view> </view>
<view class="func-items"> <view class="func-items">
<!-- 转发 --> <button class="func-item" open-type="share" data-sharetype="2"
<button class="func-item" open-type="share" data-sharetype="2" data-item="{{it}}" data-idx="{{idx}}" wx:if="{{item.shareSwitch != '1' && item.shareSwitch != '3'}}"
data-index="{{index}}" wx:if="{{item.shareSwitch != '1' && item.shareSwitch != '3'}}"
style="font-size: 28rpx;font-weight: normal;text-align: center;background-color: #ffffff;width: 0rpx;margin: 0rpx;padding: 0rpx;border-radius: 0rpx;"> style="font-size: 28rpx;font-weight: normal;text-align: center;background-color: #ffffff;width: 0rpx;margin: 0rpx;padding: 0rpx;border-radius: 0rpx;">
<text class="cuIcon-share text-gray" style="font-size: 38rpx;"></text> <image src="/images/share_count.png" mode="scaleToFill"></image>
<text style="text-align: center;line-height:28rpx;">转发</text> <text style="text-align: center;line-height:28rpx;">转发</text>
</button> </button>
<!-- 收藏 -->
<view class="func-item" wx:if="{{item.collectSwitch != '1' && item.collectSwitch != '3'}}" <view class="func-item" wx:if="{{item.collectSwitch != '1' && item.collectSwitch != '3'}}"
data-item="{{it}}" data-idx="{{idx}}" data-index="{{index}}" catchtap="doCollect"> catchtap="doCollect">
<text class="{{it.collectStatus ? 'cuIcon-favorfill line-yellowlight2': 'cuIcon-favor text-gray'}}" <image src="/images/ic_collect_icon.png" mode="scaleToFill"></image>
style="font-size: 38rpx;"></text>
<text>收藏</text> <text>收藏</text>
</view> </view>
<!-- 评论 -->
<view class="func-item" wx:if="{{item.commentSwitch != '1' && item.commentSwitch != '3'}}" <view class="func-item" wx:if="{{item.commentSwitch != '1' && item.commentSwitch != '3'}}"
catchtap="showComment" data-uid="{{it.uid}}" data-cid="{{item.cId}}" data-like="{{item.likeSwitch}}" catchtap="showComment">
data-share="{{item.shareSwitch}}" data-collect="{{item.collectSwitch}}" <image src="/images/ic_comment_icon.png" mode="scaleToFill"></image>
data-comment="{{item.commentSwitch}}"> <text>10</text>
<text class="cuIcon-comment text-gray" style="font-size: 38rpx;"></text>
<text style="font-size: 30rpx;">{{it.commentCount>1000 ? '1000+':it.commentCount}}</text>
</view>
<!-- 点赞 -->
<view class="func-item" wx:if="{{item.likeSwitch != '1' && item.likeSwitch != '3'}}" catchtap="doLike"
data-item="{{it}}" data-idx="{{idx}}" data-index="{{index}}">
<text
class="{{it.likeStatus ? 'cuIcon-appreciatefill line-yellowlight2' :'cuIcon-appreciate text-gray'}}"
style="font-size: 38rpx;"></text>
<text style="font-size:30rpx;">{{it.likeCount>1000? '1000+':it.likeCount}}</text>
</view> </view>
<view class="func-item" wx:if="{{item.likeSwitch != '1' && item.likeSwitch != '3'}}"
catchtap="doLike">
<image src="/images/ic_unfavour.png" mode="scaleToFill"></image>
<text>12</text>
</view> </view>
</view> </view>
</view> -->
</view> </view>
</view> </view>
</view> </view>
@ -359,6 +349,9 @@
</view> </view>
</view> </view>
<!-- 创建名片 --> <!-- 创建名片 -->
<!-- --> <!-- -->
@ -445,12 +438,11 @@
</view> </view>
</van-action-sheet> </van-action-sheet>
<!-- 显示海报 -->
<van-popup show="{{ isShowPoster }}" bind:close="onClose" <van-popup show="{{ isShowPoster }}" bind:close="onClose"
custom-style="background-color:transparent;height:100%;width:100%;" round> custom-style="background-color:transparent;height:100%;width:100%;" round>
<view bindtap="onClose" <view bindtap="onClose"
style="width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;margin-top: 80rpx;"> style="width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content: center;margin-top: 80rpx;">
<image src="{{posterId}}" mode="widthFix" style="width: 80%;max-height: 70%;border-radius: 10rpx;"></image> <image src="{{posterImg}}" mode="widthFix" style="width: 80%;max-height: 70%;border-radius: 10rpx;"></image>
<view style="margin-top: 15rpx;"> <view style="margin-top: 15rpx;">
<text class="cuIcon-close" style="font-size: 40rpx;color: #FFFFFF;"></text> <text class="cuIcon-close" style="font-size: 40rpx;color: #FFFFFF;"></text>
</view> </view>

View File

@ -745,3 +745,41 @@
align-items: center; align-items: center;
margin-top: 10rpx; margin-top: 10rpx;
} }
.func-items {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 15rpx;
}
.func-item {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
flex: 1;
color: #000;
width: 23%;
border-right: 1rpx solid #d8d8d8;
}
.func-item:last-child {
border-right: 0rpx;
}
.func-item:active {
background-color: #f3f3f3;
color: #dfdfdf;
}
.func-item image {
width: 48rpx;
height: 48rpx;
}
.func-item text {
margin-left: 10rpx;
}

View File

@ -18,7 +18,8 @@ Page({
code: '', code: '',
isOpen: true, isOpen: true,
payState: {}, payState: {},
accountInfo: undefined accountInfo: undefined,
userId: ''
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -32,9 +33,11 @@ Page({
try { try {
var isBind = wx.getStorageSync('bindPhone') var isBind = wx.getStorageSync('bindPhone')
var code = wx.getStorageSync('usercode') var code = wx.getStorageSync('usercode')
var userId = wx.getStorageSync('userId')
if (code && code.length > 0) { if (code && code.length > 0) {
_self.setData({ _self.setData({
code: code code: code,
userId: userId
}) })
} }
_self.setData({ _self.setData({
@ -88,14 +91,11 @@ Page({
}) })
}, },
formatDate(date) { formatDate(date) {
var d = new Date(date), if (date.length > 0) {
month = '' + (d.getMonth() + 1), return date.slice(0, 11)
day = '' + d.getDate(), } else {
year = d.getFullYear(); return ''
}
if (month.length < 2) month = '0' + month;
if (day.length < 2) day = '0' + day;
return [year, month, day].join('-');
}, },
//获取菜单状态 //获取菜单状态
getMenuState() { getMenuState() {
@ -260,6 +260,35 @@ Page({
this.getItemList() this.getItemList()
this.getPayState() this.getPayState()
this.getAccountInfo() this.getAccountInfo()
this.getBaseInfo()
},
getBaseInfo() {
var _self = this
app.http.get(app.urls.getMainMoment.format({
configColumnId: 'de7b5e22-64f9-4c60-a1f9-6ac004dfb9a8'
}), {
header: {
token: app.globalData.token
},
data: {
userId: _self.data.userId
}
})
.then(res => {
if (res.data.length > 0) {
res.data[0].list.forEach(it => {
switch (it.name) {
case 'cardtitle':
wx.setStorageSync('cardtitle', it.value)
break
case 'postertitle':
wx.setStorageSync('postertitle', it.value)
break
}
})
} else {}
})
.catch(err => {})
}, },
//跳转到二级栏目页面 //跳转到二级栏目页面
goColumnList(e) { goColumnList(e) {

View File

@ -8,7 +8,7 @@
<image src="{{cardUrl}}{{cardInfo.cardTemplateUseBackgroundImage}}" alt="" class="card-bgImg" <image src="{{cardUrl}}{{cardInfo.cardTemplateUseBackgroundImage}}" alt="" class="card-bgImg"
wx:if="{{cardInfo.cardTemplateUseBackgroundImage}}"></image> wx:if="{{cardInfo.cardTemplateUseBackgroundImage}}"></image>
<!-- 文字 --> <!-- 文字 -->
<view class="area-box" wx:for="{{areaList}}" data-cur="{{index}}" bindtap="giveFocus" wx:key="index" <view class="area-box {{item.templateAreaFontCenter == 'left' ? 'wrap-line' :''}} {{item.templateAreaFontCenter == 'center' ? 'wrap-center' :''}} {{item.templateAreaFontCenter == 'right' ? 'wrap-line' :''}} " wx:for="{{areaList}}" data-cur="{{index}}" bindtap="giveFocus" wx:key="index"
style="position:absolute;top: {{(item.templateAreaTop / cardInfo.cardTemplateUseHeight) * 100 + '%'}};left:{{(item.templateAreaLeft / cardInfo.cardTemplateUseWidth) * 100 + '%'}};color:{{item.templateAreaFontColor}};width:{{item.templateAreaWidth}}px;height:{{item.templateAreaHeight}}px;font-size:{{item.templateAreaFontSize}};font-style:{{item.templateAreaFontStyle}};font-weight:{{item.templateAreaFontBold}};text-align:{{item.templateAreaFontCenter}};line-height:{{item.templateAreaHeight}}px;" style="position:absolute;top: {{(item.templateAreaTop / cardInfo.cardTemplateUseHeight) * 100 + '%'}};left:{{(item.templateAreaLeft / cardInfo.cardTemplateUseWidth) * 100 + '%'}};color:{{item.templateAreaFontColor}};width:{{item.templateAreaWidth}}px;height:{{item.templateAreaHeight}}px;font-size:{{item.templateAreaFontSize}};font-style:{{item.templateAreaFontStyle}};font-weight:{{item.templateAreaFontBold}};text-align:{{item.templateAreaFontCenter}};line-height:{{item.templateAreaHeight}}px;"
wx:if="{{item.templateAreaServerLink == '1'}}"> wx:if="{{item.templateAreaServerLink == '1'}}">
{{item.templateAreaFontValue}} {{item.templateAreaFontValue}}

View File

@ -16,7 +16,6 @@
} }
.area-box { .area-box {
white-space: nowrap;
background: none !important; background: none !important;
z-index: 111; z-index: 111;
} }
@ -218,3 +217,16 @@
margin-right: 0; margin-right: 0;
background: #ff2525; background: #ff2525;
} }
/* 换行 */
.wrap-line {
overflow-wrap: break-word;
}
/* 居中 */
.wrap-center {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
overflow-wrap: break-word;
}

View File

@ -118,6 +118,7 @@ Page({
}, },
//获取首页展示的栏目 //获取首页展示的栏目
getMainColumn(id) { getMainColumn(id) {
console.log(id)
var _self = this var _self = this
_self.setData({ _self.setData({
dataList: [] dataList: []
@ -157,14 +158,7 @@ Page({
}) })
.then(res => { .then(res => {
if (res.data.length > 0) { if (res.data.length > 0) {
var options = datas[_self.data.curIndex]
var isOpen = options.configColumnCollect == '2' || options.configColumnCollect == '4' || options.configColumnLike == '2' && options.configColumnLike == '4' || options.configColumnDispatch == '2' || options.configColumnDispatch == '4' || options.configColumnComment == '2' || options.configColumnComment == '4'
var tempItem = { var tempItem = {
funcSwitch: isOpen,
collectSwitch: datas[_self.data.curIndex].configColumnCollect, //收藏开关
commentSwitch: datas[_self.data.curIndex].configColumnComment, //评论开关
shareSwitch: datas[_self.data.curIndex].configColumnDispatch, //转发开关
likeSwitch: datas[_self.data.curIndex].configColumnLike, //点赞开关
cId: datas[_self.data.curIndex].configColumnId, cId: datas[_self.data.curIndex].configColumnId,
type: datas[_self.data.curIndex].configColumnType, type: datas[_self.data.curIndex].configColumnType,
name: datas[_self.data.curIndex].configColumnName, name: datas[_self.data.curIndex].configColumnName,
@ -196,22 +190,11 @@ Page({
//构建主页显示数据 //构建主页显示数据
buildMainData() { buildMainData() {
var _self = this var _self = this
var ids = ''
_self.data.dataList.forEach(it => { _self.data.dataList.forEach(it => {
it.list.forEach(item => { it.list.forEach(item => {
ids += item.uid + ','
// 初始化评论 点赞 收藏状态
item.collectCount = 0
item.collectStatus = false
item.commentCount = 0
item.dispatchCount = 0
item.likeCount = 0
item.likeStatus = false
item.scansCount = 0
item.list.forEach(iem => { item.list.forEach(iem => {
switch (iem.dataType) { switch (iem.dataType) {
case '2': //图片 case '2': //图片
if (iem.value.length > 0) {
var photoIds = iem.value.split('@') var photoIds = iem.value.split('@')
if (photoIds.length > 1) { if (photoIds.length > 1) {
//展示方式 //展示方式
@ -229,7 +212,6 @@ Page({
tempList.push(tempItem) tempList.push(tempItem)
}) })
iem.valueList = tempList iem.valueList = tempList
}
break break
case '3': //音频 case '3': //音频
var items = iem.value.split(',') var items = iem.value.split(',')
@ -318,47 +300,6 @@ Page({
curIndex: 0, curIndex: 0,
dataList: _self.data.dataList dataList: _self.data.dataList
}) })
_self.getColumnContentHandle(ids)
},
//获取栏目内容点赞 收藏 评论
getColumnContentHandle(ids) {
var _self = this
wx.showLoading({
title: '加载中...',
})
app.http.get(app.urls.getColumnContentHandle.format({
projectId: 'column',
businessIds: ids
}), {
header: {
token: app.globalData.token
}
})
.then(res => {
wx.hideLoading({})
res.data.forEach(it => {
_self.data.dataList.forEach(item => {
item.list.forEach(iem => {
if (iem.uid == it.businessId) {
iem.collectCount = it.collectCount
iem.collectStatus = it.collectStatus
iem.commentCount = it.commentCount
iem.dispatchCount = it.dispatchCount
iem.likeCount = it.likeCount
iem.likeStatus = it.likeStatus
iem.scansCount = it.scansCount
}
})
})
})
_self.setData({
curIndex: 0,
dataList: _self.data.dataList
})
})
.catch(err => {
})
}, },
//获取首页基础数据 电话 微信号 地址 邮箱 //获取首页基础数据 电话 微信号 地址 邮箱
getMainBaseUserInfo(userid) { getMainBaseUserInfo(userid) {
@ -432,13 +373,8 @@ Page({
//需要跳详情 //需要跳详情
var cId = e.currentTarget.dataset.cid var cId = e.currentTarget.dataset.cid
var uId = e.currentTarget.dataset.id var uId = e.currentTarget.dataset.id
var like = e.currentTarget.dataset.like
var collect = e.currentTarget.dataset.collect
var comment = e.currentTarget.dataset.comment
var share = e.currentTarget.dataset.share
var params = '&collectSwitch=' + collect + '&likeSwitch=' + like + '&commentSwitch=' + comment + '&shareSwitch=' + share
wx.navigateTo({ wx.navigateTo({
url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId + params, url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId,
}) })
} }
}, },
@ -774,92 +710,4 @@ Page({
}) })
} }
}, },
//显示评论
showComment(e) {
//需要跳详情
var cId = e.currentTarget.dataset.cid
var uId = e.currentTarget.dataset.uid
var like = e.currentTarget.dataset.like
var collect = e.currentTarget.dataset.collect
var comment = e.currentTarget.dataset.comment
var share = e.currentTarget.dataset.share
var params = '&collectSwitch=' + collect + '&likeSwitch=' + like + '&commentSwitch=' + comment + '&shareSwitch=' + share
console.log(params)
wx.navigateTo({
url: '/packagecard/moments/momentsdetail/momentsdetail?uId=' + uId + '&cId=' + cId + params,
})
},
//点赞
doLike(e) {
var _self = this
var item = e.currentTarget.dataset.item
var idx = e.currentTarget.dataset.idx //内容索引
var index = e.currentTarget.dataset.index //栏目索引
var favor = item.likeStatus
var msg = ''
if (favor) {
msg = '取消中...'
} else {
msg = '保存中...'
}
wx.showLoading({
title: msg,
})
app.http.post(app.urls.doSaveLike, {
header: {
token: app.globalData.token
},
data: {
businessId: item.uid,
projectId: 'column'
}
})
.then(res => {
wx.hideLoading({})
_self.data.dataList[index].list[idx].likeStatus = !item.likeStatus
if (item.likeStatus) {
--_self.data.dataList[index].list[idx].likeCount
} else {
++_self.data.dataList[index].list[idx].likeCount
}
_self.setData({
dataList: _self.data.dataList
})
})
.catch(err => {})
},
//收藏
doCollect(e) {
var _self = this
var item = e.currentTarget.dataset.item
var idx = e.currentTarget.dataset.idx //内容索引
var index = e.currentTarget.dataset.index //栏目索引
var favor = item.collectStatus
var msg = ''
if (favor) {
msg = '取消收藏...'
} else {
msg = '收藏中...'
}
wx.showLoading({
title: msg,
})
app.http.post(app.urls.doSaveCollect, {
header: {
token: app.globalData.token
},
data: {
businessId: item.uid,
projectId: 'column'
}
})
.then(res => {
wx.hideLoading({})
_self.data.dataList[index].list[idx].collectStatus = !item.collectStatus
_self.setData({
dataList: _self.data.dataList
})
})
.catch(err => {})
}
}) })

View File

@ -147,16 +147,13 @@
<view wx:for="{{item.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="it" class="column-box"> <view wx:for="{{item.list}}" wx:for-index="idx" wx:key="idx" wx:for-item="it" class="column-box">
<!-- 栏目数据 --> <!-- 栏目数据 -->
<view wx:for="{{it.list}}" wx:for-index="i" wx:for-item="child" wx:key="i" bindtap="showDetail" <view wx:for="{{it.list}}" wx:for-index="i" wx:for-item="child" wx:key="i" bindtap="showDetail"
data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}" class="{{child.valueList.length>0 || child.value.length>0 ? 'column-item' : ''}}"
data-collect="{{item.collectSwitch}}" data-comment="{{item.commentSwitch}}"
class="{{(child.valueList.length>0 || child.value.length > 0) && child.displayList ? 'column-item' : ''}}"
data-ctype="{{item.type}}" data-cid="{{item.cId}}" data-id="{{it.uid}}"> data-ctype="{{item.type}}" data-cid="{{item.cId}}" data-id="{{it.uid}}">
<!-- 栏目样式1或3 --> <!-- 栏目样式1或3 -->
<view> <view>
<!-- 具体数据 --> <!-- 具体数据 -->
<!-- 文本 --> <!-- 文本 -->
<view wx:if="{{child.dataType=='1' && child.displayList && child.value.length>0}}" <view wx:if="{{child.dataType=='1' && child.displayList}}" class="align-center">
class="align-center">
<view class=" bg-white"> <view class=" bg-white">
<view class="cu-form-group"> <view class="cu-form-group">
<view id="content" style="line-height:40rpx;width: 100%;"> <view id="content" style="line-height:40rpx;width: 100%;">
@ -179,13 +176,13 @@
</view> </view>
</view> </view>
<!-- 左右滑动 --> <!-- 左右滑动 -->
<view wx:elif="{{child.dataMode=='2' || child.dataMode=='3'}}"> <view
wx:elif="{{child.dataMode=='2' || child.dataMode=='3'}}">
<swiper style="width:100%;height:400rpx;" indicator-dots="{{true}}" <swiper style="width:100%;height:400rpx;" indicator-dots="{{true}}"
autoplay="{{child.dataMode=='3'}}"> autoplay="{{child.dataMode=='3'}}">
<block wx:for="{{child.valueList}}" wx:key="pIndex" wx:for-index="pIndex" wx:for-item="photo"> <block wx:for="{{child.valueList}}" wx:key="pIndex" wx:for-index="pIndex" wx:for-item="photo">
<swiper-item style="width:100%;"> <swiper-item style="width:100%;">
<image style="width:100%;border-radius:5rpx;height:400rpx;" src="{{photo.path}}" <image style="width:100%;border-radius:5rpx;height:400rpx;" src="{{photo.path}}" data-values="{{child.valueList}}" catchtap="viewImg" data-url="{{photo.path}}"
data-values="{{child.valueList}}" catchtap="viewImg" data-url="{{photo.path}}"
mode="aspectFill"> mode="aspectFill">
</image> </image>
</swiper-item> </swiper-item>
@ -195,15 +192,11 @@
<!-- 上下 --> <!-- 上下 -->
<view wx:elif="{{child.dataMode=='4'}}"> <view wx:elif="{{child.dataMode=='4'}}">
<block wx:for="{{child.valueList}}" wx:key="pIndex" wx:for-index="pIndex" wx:for-item="photo"> <block wx:for="{{child.valueList}}" wx:key="pIndex" wx:for-index="pIndex" wx:for-item="photo">
<image class="img-item" src="{{photo.path}}" mode="widthFix" data-values="{{child.valueList}}" <image class="img-item" src="{{photo.path}}" mode="widthFix" data-values="{{child.valueList}}" catchtap="viewImg" data-url="{{photo.path}}">
catchtap="viewImg" data-url="{{photo.path}}">
</image> </image>
</block> </block>
</view> </view>
</view> </view>
<!-- 视频 --> <!-- 视频 -->
<view wx:if="{{child.dataType=='4' && child.displayList && child.valueList.length>0}}" <view wx:if="{{child.dataType=='4' && child.displayList && child.valueList.length>0}}"
style="width: 100%;"> style="width: 100%;">
@ -308,50 +301,6 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 评论 收藏 点赞 -->
<view class="func-box" wx:if="{{item.funcSwitch}}">
<view class="line-gray-ssm">
</view>
<view class="func-items">
<!-- 转发 -->
<button class="func-item" open-type="share" data-sharetype="2" data-item="{{it}}" data-idx="{{idx}}"
data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}"
data-collect="{{item.collectSwitch}}" data-comment="{{item.commentSwitch}}" data-index="{{index}}"
wx:if="{{item.shareSwitch != '1' && item.shareSwitch != '3'}}"
style="font-size: 28rpx;font-weight: normal;text-align: center;background-color: #ffffff;width: 0rpx;margin: 0rpx;padding: 0rpx;border-radius: 0rpx;">
<text class="cuIcon-share text-gray" style="font-size: 38rpx;"></text>
<text style="text-align: center;line-height:28rpx;">转发</text>
</button>
<!-- 收藏 -->
<view class="func-item" wx:if="{{item.collectSwitch != '1' && item.collectSwitch != '3'}}"
data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}"
data-collect="{{item.collectSwitch}}" data-comment="{{item.commentSwitch}}" data-item="{{it}}"
data-idx="{{idx}}" data-index="{{index}}" catchtap="doCollect">
<text
class="{{it.collectStatus ? 'cuIcon-favorfill line-yellowlight2': 'cuIcon-favor text-gray'}}"
style="font-size: 38rpx;"></text>
<text>收藏</text>
</view>
<!-- 评论 -->
<view class="func-item" wx:if="{{item.commentSwitch != '1' && item.commentSwitch != '3'}}"
data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}"
data-collect="{{item.collectSwitch}}" data-comment="{{item.commentSwitch}}" catchtap="showComment"
data-uid="{{it.uid}}" data-cid="{{item.cId}}">
<text class="cuIcon-comment text-gray" style="font-size: 38rpx;"></text>
<text style="font-size: 30rpx;">{{it.commentCount>1000 ? '1000+':it.commentCount}}</text>
</view>
<!-- 点赞 -->
<view class="func-item" wx:if="{{item.likeSwitch != '1' && item.likeSwitch != '3'}}"
data-like="{{item.likeSwitch}}" data-share="{{item.shareSwitch}}"
data-collect="{{item.collectSwitch}}" data-comment="{{item.commentSwitch}}" catchtap="doLike"
data-item="{{it}}" data-idx="{{idx}}" data-index="{{index}}">
<text
class="{{it.likeStatus ? 'cuIcon-appreciatefill line-yellowlight2' :'cuIcon-appreciate text-gray'}}"
style="font-size: 38rpx;"></text>
<text style="font-size:30rpx;">{{it.likeCount>1000? '1000+':it.likeCount}}</text>
</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -713,3 +713,37 @@
width: 300rpx; width: 300rpx;
height: 300rpx; height: 300rpx;
} }
.func-box {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
margin-top: 10rpx;
}
.func-items {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-top: 10rpx;
}
.func-item {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
flex: 1;
}
.func-item image {
width: 48rpx;
height: 48rpx;
}
.func-item text {
margin-left: 10rpx;
}

View File

@ -62,14 +62,11 @@ Page({
}) })
}, },
formatDate(date) { formatDate(date) {
var d = new Date(date), if (date.length > 0) {
month = '' + (d.getMonth() + 1), return date.slice(0, 11)
day = '' + d.getDate(), } else {
year = d.getFullYear(); return ''
}
if (month.length < 2) month = '0' + month;
if (day.length < 2) day = '0' + day;
return [year, month, day].join('-');
}, },
//获取支付历史列表 //获取支付历史列表
getPayHistoryList() { getPayHistoryList() {

View File

@ -2,7 +2,6 @@
<view slot="content">会员中心</view> <view slot="content">会员中心</view>
</cu-custom> </cu-custom>
<view class="page-box" wx:if="{{!isDredge}}"> <view class="page-box" wx:if="{{!isDredge}}">
<block wx:if="{{recordList.length > 0}}">
<!-- 会员信息卡片显示 --> <!-- 会员信息卡片显示 -->
<view class="info-box bg-yellow-yellow"> <view class="info-box bg-yellow-yellow">
<view class="base-info"> <view class="base-info">
@ -22,6 +21,7 @@
style="align-self: flex-end;margin-right: 15rpx;padding: 10rpx 15rpx;border-radius: 15rpx;border: 1rpx solid #ffffff;"> style="align-self: flex-end;margin-right: 15rpx;padding: 10rpx 15rpx;border-radius: 15rpx;border: 1rpx solid #ffffff;">
立即续费</view> 立即续费</view>
</view> </view>
<block wx:if="{{recordList.length > 0}}">
<block wx:for="{{recordList}}" wx:key="index"> <block wx:for="{{recordList}}" wx:key="index">
<view class="item"> <view class="item">
<image class="icon" src="{{item.cardChargeUserAvatarUrl}}" mode="scaleToFill"></image> <image class="icon" src="{{item.cardChargeUserAvatarUrl}}" mode="scaleToFill"></image>
@ -46,7 +46,7 @@
<van-loading wx:if="{{isLoadMore}}" size="24px">加载中...</van-loading> <van-loading wx:if="{{isLoadMore}}" size="24px">加载中...</van-loading>
</block> </block>
<view wx:else style="margin-top:200rpx;width:100%;"> <view wx:else style="margin-top:200rpx;width:100%;">
<van-empty description="暂无数据" /> <van-empty description="暂无缴费记录" />
</view> </view>
</view> </view>
<view class="page-box" wx:else> <view class="page-box" wx:else>

View File

@ -46,6 +46,7 @@ var apis = {
getCardPayState: `app/cardcharge/savecharge/{mode}`, //获取开通名片的订单信息 getCardPayState: `app/cardcharge/savecharge/{mode}`, //获取开通名片的订单信息
doSaveOrderPayState: `app/cardcharge/checkorder/{cardChargeOrderNumber}`, //保存订单支付状态 doSaveOrderPayState: `app/cardcharge/checkorder/{cardChargeOrderNumber}`, //保存订单支付状态
getPayHistoryList: `app/cardcharge/listpage`, //获取 getPayHistoryList: `app/cardcharge/listpage`, //获取
getVersionContrast: `app/projectconfigrelease/file/versionContrastPhoto`, //版本对比图
/*用户 */ /*用户 */
/**店铺相关 **/ /**店铺相关 **/
doSaveShop: `app/shop/save`, //保存商店 doSaveShop: `app/shop/save`, //保存商店
@ -118,18 +119,14 @@ var apis = {
getMainColumn: `app/cardconfigcolumn/listhome`, //获取首页显示栏目 getMainColumn: `app/cardconfigcolumn/listhome`, //获取首页显示栏目
getColumnListByGroupId: `app/cardconfigcolumn/list`, //根据栏目组id获取栏目? configColumnGroupId getColumnListByGroupId: `app/cardconfigcolumn/list`, //根据栏目组id获取栏目? configColumnGroupId
getMainMoment: `app/configcolumndata/list/{configColumnId}`, //获取首页栏目数据 通过栏目ID获取栏目下的数据列表(包含每条数据的字段集合) 传入userId参数则查询指定人的 , 没传入userId参数则查询当前token的 getMainMoment: `app/configcolumndata/list/{configColumnId}`, //获取首页栏目数据 通过栏目ID获取栏目下的数据列表(包含每条数据的字段集合) 传入userId参数则查询指定人的 , 没传入userId参数则查询当前token的
getMineColumnList: `app/configcolumnset/list`, //获取我的栏目配置列表 getMineColumnList: `app/cardconfigcolumngroup/setlist`, //获取我的栏目配置列表
doSaveColumnDisplay: `app/configcolumnset/savedisplay`, //保存我的栏目隐藏显示 doSaveColumnDisplay: `app/configcolumnset/savedisplay`, //保存我的栏目隐藏显示
doSaveColumnName: `app/configcolumnset/savename`, //保存我的栏目名称 doSaveColumnName: `app/configcolumnset/savename`, //保存我的栏目名称
doOrderColumn: `app/configcolumnset/saveorder`, //保存栏目排序, post {configColumnId, configColumnOrder} doOrderColumn: `app/configcolumnset/saveorder`, //保存栏目排序, post {configColumnId, configColumnOrder}
//评论 点赞 收藏 //评论 点赞 收藏
doSaveCollect: `app/contentcollect/save`, //保存取消收藏 businessId=xxx&projectId=poster doSaveCollect: `app/contentcollect/save`, //保存取消收藏 businessId=xxx&projectId=poster
doSaveLike: `app/contentlike/save`, //保存取消点赞 ?businessId=xx& projectId=xx doSaveLike: `app/contentlike/save`, //保存取消点赞 ?businessId
getPosterFavorList: `app/cardtemplate/mylistposter`, //获取我的海报收藏列表 getPosterFavorList: `app/cardtemplate/mylistposter`, //获取我的海报收藏列表
getColumnContentHandle: `app/contentcomment/countlist/{projectId}/{businessIds}`, //获取栏目内容评论 点赞 收藏数量
doSaveComment: `app/contentcomment/save`, //?businessId=xx&projectId=columnComment&contentCommentContent=xxx 保存评论
getCommentList: `app/contentcomment/listpagerelease/{projectId}/{businessId}`, // ?contentCommentParentId=xxx 获取评论列表
doDelComment: `app/contentcomment/remove/{ids}`, //删除评论
//名片信息 //名片信息
getCardList: `app/cardtemplate/list`, //获取名片列表 getCardList: `app/cardtemplate/list`, //获取名片列表
getCardDetail: `app/cardtemplate/get/{cardTemplateId}`, //获取名片详情 getCardDetail: `app/cardtemplate/get/{cardTemplateId}`, //获取名片详情
@ -140,7 +137,7 @@ var apis = {
updateMyCard: `app/cardtemplateuse/update/{cardTemplateUseId}`, //更新名片内容 updateMyCard: `app/cardtemplateuse/update/{cardTemplateUseId}`, //更新名片内容
setDefaultCard: `app/cardtemplateuse/default/{cardTemplateUseId}`, //制定名片 setDefaultCard: `app/cardtemplateuse/default/{cardTemplateUseId}`, //制定名片
deleteCard: `app/cardtemplateuse/remove/{ids}`, //删除名片 deleteCard: `app/cardtemplateuse/remove/{ids}`, //删除名片
getDefaultCard: `app/cardtemplateuse/getdefault`, //首页默认名片 getDefaultCard: `app/cardtemplateuse/getdefault/{userId}`, //首页默认名片
shareRecord: `app/cardtemplatedispatch/save`, //转发记录 shareRecord: `app/cardtemplatedispatch/save`, //转发记录
checkRecord: `app/cardtemplatescans/save`, //保存查看记录 checkRecord: `app/cardtemplatescans/save`, //保存查看记录
shareCard: `app/cardtemplateuse/getdispatch/{cardTemplateUseId}`, //查看分享名片 shareCard: `app/cardtemplateuse/getdispatch/{cardTemplateUseId}`, //查看分享名片