作者 刘晓艳

海报,个人中心等接口调取,调整

{
"pages": [
"pages/start/start",
"pages/my/userInfo/userInfo",
"pages/index/search/search",
"pages/index/release/release",
"pages/index/message/message",
... ...
... ... @@ -12,7 +12,7 @@
<block>
<view class="collect_box {{list.user_host==1?'active':''}}" bindtap='attention' data-id='{{list.open_user_id}}'>
<text class='iconfont icon-shoucang0 star2'></text>
<text class="collect_word">关注TA</text>
<text class="collect_word">{{list.user_host==1?'取消关注':'关注TA'}}</text>
</view>
</block>
</view>
... ... @@ -78,7 +78,7 @@
<block wx:if='{{item.user_status==1}}'>
<view class='collect_box active' bindtap='replay' data-index="{{index}}" data-id='{{item.id}}' data-comment_state='{{item.user_status}}' data-name='{{item.user_nickname}}'>
<text class='iconfont icon-pinglun star2'></text>
<text class="collect_word">回复</text>
<text class="collect_word">发布者</text>
</view>
</block>
</view>
... ...
... ... @@ -322,6 +322,10 @@ page {
font-size: 26rpx;
}
.zan {
color: #000;
}
.zan, .pinglun1 {
font-size: 28rpx;
margin-right: 10rpx;
... ... @@ -408,7 +412,7 @@ page {
box-sizing: border-box;
}
.comment_box textarea,input {
.comment_box textarea, input {
font-size: 26rpx;
height: 80rpx;
}
... ...
... ... @@ -10,6 +10,13 @@ Page({
list: []
},
goUserInfo(e) {
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/my/userInfo/userInfo?id=' + id,
})
},
getData() {
let url = '/home/index/checkFans'
let params = {
... ... @@ -21,9 +28,15 @@ Page({
}
app.post(url, params, header).then((res) => {
console.log(res)
var list = res.data.data.list
// if (this.data.status == 1) {
// for (var i in list) {
// list[i].user_host == 1
// }
// }
if (res.data.code == 20000) {
this.setData({
list: res.data.data.list
list: list
})
}
})
... ... @@ -49,8 +62,10 @@ Page({
},
//关注接口
attentionInfo(id, status) {
attentionInfo(e) {
let that = this;
var id = e.currentTarget.dataset.id
var status = e.currentTarget.dataset.status
let url = '/home/index/host';
let param = {
open_user_id: id,
... ... @@ -73,10 +88,10 @@ Page({
*/
onLoad: function(options) {
this.setData({
status:options.status?options.status:''
status: options.status ? options.status : ''
})
this.getData()
if(options.status==1){
if (options.status == 1) {
wx.setNavigationBarTitle({
title: '关注',
})
... ...
<!--pages/index/fans/fans.wxml-->
<view class='content_box'>
<view class='item_list' wx:for='{{list}}' wx:key>
<view class='item_list' wx:for='{{list}}' wx:key bindtap='goUserInfo' data-id='{{item.id}}'>
<view class='list_left'>
<image class='head_img' src='{{item.avatar}}'></image>
<view>
... ... @@ -10,6 +10,7 @@
</view>
</view>
</view>
<view class="list_label list_active" bindtap='attention' data-id='{{list.open_user_id}}'>添加关注</view>
<view class="list_label list_active" bindtap='attentionInfo' data-id='{{item.id}}' data-status='1' wx:if='{{status==2}}'>添加关注</view>
<view class="list_label" bindtap='attentionInfo' data-id='{{item.id}}' data-status='2' wx:if='{{status==1}}'>取消关注</view>
</view>
</view>
... ...
... ... @@ -30,17 +30,51 @@ Page({
list: [],
order: 1,
poster_list: [],
img_state:false,
imgUrl:'',
img_text:'',
img_state: false,
imgUrl: '',
img_text: '',
poster: '',
// https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534766809331&di=012cc4ad15d457ffa55c6537503eb84a&imgtype=0&src=http%3A%2F%2Fpicture.5068.com%2Fallimg%2F121120%2F4-1211201G920.jpg
cardPath: '',
headPath: '',
// https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534765039080&di=1e81a596bc89cd54db55c0dbc7c4bb87&imgtype=0&src=http%3A%2F%2Fimg3.100bt.com%2Fupload%2Fttq%2F20140529%2F1401337844678_middle.png
sendName: ''
},
saveImg(e) {
var src = e.currentTarget.dataset.src
wx.downloadFile({
url: src,
success: function(res) {
let path = res.tempFilePath
wx.saveImageToPhotosAlbum({
filePath: path,
success(res) {
wx.showToast({
title: '保存成功',
icon: 'success'
})
},
fail(res) {
console.log(res)
},
complete(res) {
console.log(res)
}
})
},
fail: function(res) {
console.log(res)
}
})
},
goUserInfo(e) {
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/my/userInfo/userInfo?id=' + id,
})
},
viewImg(e) {
... ... @@ -51,26 +85,18 @@ Page({
var current = e.currentTarget.dataset.src
console.log(imgs)
this.setData({
imgUrl:current,
img_text:e.currentTarget.dataset.text,
img_state:true
})
wx.hideTabBar({
imgUrl: current,
img_text: e.currentTarget.dataset.text,
img_state: true
})
// wx.previewImage({
// current: current,
// urls: imgs,
// })
wx.hideTabBar({})
},
cancle_img(){
cancle_img() {
this.setData({
img_state:false
})
wx.showTabBar({
img_state: false
})
wx.showTabBar({})
},
chargeType(e) {
... ... @@ -192,7 +218,7 @@ Page({
}
app.post(url, params, header).then((res) => {
console.log(res)
if(res.data.code==20000){
if (res.data.code == 20000) {
this.getData()
}
})
... ... @@ -222,10 +248,17 @@ Page({
showPoster(e) {
var id = e.currentTarget.dataset.id
this.setData({
poster_state: true
})
var that=this
wx.hideTabBar({})
wx.showToast({
title: '加载中',
icon: 'loading'
})
// setTimeout(function() {
that.setData({
poster_state: true
})
// }, 2000)
this.getPoster(id)
},
... ... @@ -254,14 +287,13 @@ Page({
}
app.post(url, param, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
this.setData({
// poster_list: res.data.data,
cardPath: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1534766809331&di=012cc4ad15d457ffa55c6537503eb84a&imgtype=0&src=http%3A%2F%2Fpicture.5068.com%2Fallimg%2F121120%2F4-1211201G920.jpg',
headPath: res.data.data.img,
sendName: res.data.data.text,
poster: res.data.data.url,
})
}
})
},
... ... @@ -432,7 +464,7 @@ Page({
//画图
drawCanvas: function() {
console.log(this.data.cardPath,'aa')
console.log(this.data.cardPath, 'aa')
this.setData({
cardPath: this.data.cardPath,
headPath: this.data.headPath,
... ... @@ -454,7 +486,7 @@ Page({
wx.getImageInfo({
src: this.data.cardPath,
success: (res) => {
console.log('canvas',res)
console.log('canvas', res)
ctx.drawImage(res.path, 15, 15, 345, 470); //card
wx.getImageInfo({
src: this.data.headPath,
... ...
... ... @@ -16,16 +16,16 @@
<view class='content_box'>
<view class='content_item' wx:for='{{list}}' wx:for-index='mindex' wx:key>
<view class='left_box'>
<view class='head_portrait'>
<view class='head_portrait' bindtap='goUserInfo' data-id='{{item.open_user_id}}'>
<image src='{{item.avatar}}'></image>
</view>
</view>
</view>
<view class='item_list'>
<view class='list_head_box'>
<view class='user_name'>{{item.user_nickname}}</view>
<view class=' state_box'>
<view class="collect_box {{item.user_host==1?'active':''}}" catchtap='attention' data-index="{{mindex}}" data-id='{{item.open_user_id}}'>
<text class="collect_word">关注TA</text>
<text class="collect_word">{{item.user_host==1?'取消关注':'关注TA'}}</text>
</view>
</view>
</view>
... ... @@ -76,33 +76,39 @@
</view>
<view class='iconfont icon-jia' bindtap='releaseInfo'></view>
<view class='mask_box2' wx:if='{{poster_state}}'>
<view class="canvasBox">
<canvas canvas-id='myCanvas' style=''></canvas>
<!-- <view class="canvasBox"> -->
<!-- <canvas canvas-id='myCanvas' style=''></canvas> -->
<!-- </view> -->
<!-- <view class='popup_img'>
<image src='{{poster}}'></image>
</view>
<view class="btn" bindtap="saveImage">保存图片</view>
<view class='iconfont icon-quxiao quxiao2' bindtap='canclePopup'></view>
<!-- <view class='popup_box2'>
<view class='iconfont icon-quxiao quxiao2' bindtap='canclePopup'></view> -->
<view class='popup_box2'>
<view>
<view class='popup_content_box'>
<view class='popup_img2'>
<!-- <view class='popup_img2'>
<image src='{{poster_list.img}}'></image>
<view class='circle'></view>
<view class='circle2'></view>
</view>
</view> -->
<view class='popup_info_box'>
<view class='popup_title2'>{{poster_list.title}}</view>
<view>{{poster_list.text}}</view>
<!-- <view class='popup_title2'>{{poster_list.title}}</view>
<view>{{poster_list.text}}</view> -->
<view class='popup_img'>
<image src='{{poster}}'></image>
</view>
<view class='popup_icon_box'>
<view class='popup_btn_box'>
<view class='popup_btn_box' bindtap='saveImg' data-src='{{poster}}'>
<view class='popup_btn2'>保存图片</view>
</view>
<image src='/images/chuanda_quan_90@2x.png'></image>
<!-- <image src='/images/chuanda_quan_90@2x.png'></image> -->
</view>
</view>
</view>
</view>
<view class='iconfont icon-quxiao' bindtap='canclePopup'></view>
</view> -->
</view>
</view>
<!-- catchtap='cancleClassify' -->
... ...
... ... @@ -449,13 +449,13 @@ page {
}
.icon-quxiao {
/* font-size: 36rpx;
font-size: 36rpx;
text-align: center;
color: #fff;
position: absolute;
bottom: -80rpx;
left: 50%;
transform: translateX(-50%); */
transform: translateX(-50%);
}
.popup_box2 {
... ... @@ -472,12 +472,13 @@ page {
.popup_info_box {
width: 686rpx;
background: #fff;
/* background: #fff;
padding: 30rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #282829;
color: #282829; */
border-radius: 10rpx;
position: relative;
}
.popup_icon_box {
... ... @@ -486,6 +487,9 @@ page {
justify-content: space-between;
padding: 0 45rpx;
margin-top: 30rpx;
position: absolute;
left: 0;
bottom: 0;
}
.popup_title2 {
... ... @@ -543,6 +547,16 @@ page {
right: 0;
z-index: 100;
}
.popup_img{
width: 100%;
height:1026rpx;
border-radius: 16rpx;
overflow: hidden;
}
.popup_img image{
width: 100%;
height: 100%;
}
.popup_img2 {
width: 686rpx;
... ...
... ... @@ -23,6 +23,7 @@ Page({
} else {
this.getData2()
}
console.log(this.data.status)
},
getData() {
... ...
... ... @@ -12,14 +12,15 @@
<view>
<view class=' user_name '>{{item.user_nickname}}</view>
<view>
<text>评论了你的</text>
<text wx:if='{{status==1}}'>评论了你的</text>
<text wx:elif='{{status==2}}'>点赞了你的</text>
<text class='list_hint '>{{item.title}}</text>
</view>
</view>
</view>
<view class='point '></view>
<view class='point' wx:if='{{status==2}}'></view>
</view>
</block>
</block>
<!-- <block wx:if='{{status==2}} '>
<view class='item_list '>
<view class='list_left '>
... ... @@ -35,12 +36,12 @@
<view class='point '></view>
</view>
</block> -->
<block wx:if='{{status==3}} '>
<block wx:elif='{{status==3}} '>
<view class='item_list' wx:for='{{list2}}' wx:key>
<view class='list_left'>
<view>
<view class='user_name' style='font-weight:normal; '>
<text>Rose | ローズ您好,您发布的今日打卡审核</text>
<text>{{item.user_nickname}}您好,您发布的{{title}}审核</text>
<text class='list_hint2'>未通过</text>
</view>
<view>原因:发布内容有歧义</view>
... ...
... ... @@ -14,7 +14,7 @@ Page({
currentTime: 0,
relsese_state: false,
relsese_state1: -1,
release_time2: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '012:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00', ],
release_time2: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00', ],
more_state: false,
images: [],
styles: [],
... ... @@ -24,7 +24,7 @@ Page({
img_state: false,
tempUrl: [],
time_info: '定时发送',
open_time: '',
open_time: 0,
temp_time2: '',
temp_time: '',
list_id: 0,
... ... @@ -156,6 +156,7 @@ Page({
var minutes = date.getMinutes()
var seconds = date.getSeconds()
var release_time = this.data.release_time
console.log(release_time)
if (week == 0) {
info = "周日";
... ... @@ -183,6 +184,7 @@ Page({
this.setData({
release_time: release_time,
lastMonth: lastMonth,
// open_time: year + '/' + month + '/' + day + ' ' + hours + ':00',
})
},
... ... @@ -200,6 +202,7 @@ Page({
}
var open_time = time + ' ' + temp_time
var open_time2 = time2 + ' ' + temp_time
console.log(open_time)
this.setData({
open_time: open_time,
time_info: open_time2
... ... @@ -324,9 +327,6 @@ Page({
index: index,
url: url
})
// wx.navigateTo({
// url: '/pages/index/brief/brief?index=' + index + '&url=' + url,
// })
},
showMore() {
... ... @@ -371,6 +371,7 @@ Page({
submitInfo() {
this.tempClassify()
console.log(this.data.open_time)
let url = '/home/index/fashion'
let params = {
list_id: this.data.list_id,
... ... @@ -392,9 +393,15 @@ Page({
title: '提交成功',
})
setTimeout((res) => {
wx.navigateBack({
dalta: 1
})
if (this.data.open == 4) {
wx.navigateBack({
dalta: 1
})
} else {
wx.redirectTo({
url: '/pages/index/check/check',
})
}
}, 1000)
} else {
wx.showToast({
... ... @@ -416,7 +423,6 @@ Page({
'XX-Device-Type': 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res)
var open = res.data.data.open
var more_info = this.data.more_info
if (open == 1) {
... ... @@ -473,7 +479,7 @@ Page({
this.setData({
list_id: options.id ? options.id : ''
})
if (options.id != 0) {
if (options.id != 0 && options.id != undefined) {
this.getData()
}
},
... ...
... ... @@ -33,15 +33,15 @@
<view class='more_item' bindtap='setOpen' data-open='1'>
<text>公开</text>
</view>
<view class='more_line'></view>
<!-- <view class='more_line'></view> -->
<view class='more_item' catchtap='setOpen' data-open='3'>
<text>仅自己可见</text>
</view>
<view class='more_line'></view>
<!-- <view class='more_line'></view> -->
<view class='more_item' catchtap='setOpen' data-open='2'>
<text>粉丝可见</text>
</view>
<view class='more_line'></view>
<!-- <view class='more_line'></view> -->
<view class='more_item' catchtap='setOpen' data-open='4'>
<text>草稿箱</text>
</view>
... ...
... ... @@ -220,8 +220,6 @@ page {
justify-content: center;
}
.picker-title {
margin: 50rpx 0 0 0;
font-size: 36rpx;
... ... @@ -386,7 +384,7 @@ picker-view-column view {
box-shadow: 0 8rpx 30rpx 0 #e5e5e5;
font-size: 28rpx;
color: #000;
padding: 15rpx 30rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
... ... @@ -395,8 +393,13 @@ picker-view-column view {
}
.more_item {
/* padding: 0 25rpx; */
text-align: center;
border-bottom: 1rpx solid #ebebeb;
padding: 10rpx 0;
}
.more_item:last-child {
border-bottom: 0;
}
.more_line {
... ...
// pages/my/draft/draft.js
const app=getApp()
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
list:''
list: '',
mask_state: false,
},
getData() {
... ... @@ -18,85 +19,114 @@ Page({
}
app.post(url, params, header).then((res) => {
console.log(res)
if(res.data.code==20000){
if(res.data.data.list==''){
if (res.data.code == 20000) {
if (res.data.data.list == '') {
this.setData({
list: res.data.data.list
})
wx.showToast({
title: '暂无数据',
icon:'none'
icon: 'none'
})
}else{
} else {
this.setData({
list: res.data.data.list
})
}
}
}
})
},
goDetail(e){
var id=e.currentTarget.dataset.id
showMask(e) {
var id = e.currentTarget.dataset.id
this.setData({
mask_state: true,
id: id
})
},
cancleMask() {
this.setData({
mask_state: false
})
},
delInfo() {
var that=this
let url = '/home/index/draftsDelete'
let params = {
list_id: this.data.id
}
let header = {
"XX-Token": wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
}
app.post(url, params, header).then((res) => {
if (res.data.code == 20000) {
that.getData()
}
})
},
goDetail(e) {
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/index/release/release?id='+id,
url: '/pages/index/release/release?id=' + id,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
this.getData()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
... ... @@ -9,8 +9,20 @@
</view>
<view class='list_content'>
<view>{{item.text}}</view>
<view class='iconfont icon-shanchu1'></view>
<view class='iconfont icon-shanchu1' catchtap='showMask' data-id='{{item.list_id}}'></view>
</view>
</view>
</view>
</view>
<view class='mask_box' wx:if='{{mask_state}}' catchtap='cancleMask'>
<view class='popup_box'>
<view class='popup_title'>提示</view>
<view>确认删除吗?</view>
<view class='popup_btn_box'>
<view class='popup_btn' catchtap='cancleMask'>取消</view>
<view class='popup_btn' bindtap='delInfo'>确定</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -59,37 +59,39 @@ Page({
})
},
//点赞
likeCharge(e) {
var id = e.currentTarget.dataset.id
var index = e.currentTarget.dataset.index
var list = this.data.list
var status = ''
if (list[index].user_support == 1) {
list[index].user_support = 0
status = 2
} else {
list[index].user_support = 1
status = 1
var status = e.currentTarget.dataset.status
let url = '/home/index/support'
let params = {
list_id: id,
status: status
}
this.setData({
list: list
let header = {
"XX-Token": wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
}
app.post(url, params, header).then((res) => {
if (res.data.code == 20000) {
this.getData()
}
})
this.like(id, status)
// this.getData()
},
like(id, status) {
let url = '/home/index/support'
collectInfo(e) {
var id=e.currentTarget.dataset.id
var status=e.currentTarget.dataset.status
let url = '/home/index/collect'
let params = {
list_id: id,
status: status
status: status
}
let header = {
"XX-Token": wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
this.getData()
}
... ... @@ -158,6 +160,7 @@ Page({
}
})
},
getData() {
let url = '/home/index/checkPage'
let params = {
... ... @@ -178,12 +181,12 @@ Page({
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getData()
// this.getData()
this.getData2()
},
... ... @@ -198,7 +201,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.getData()
},
/**
... ...
... ... @@ -63,16 +63,21 @@
<view class='list_state_box'>
<view class='time'>{{item.open_time}}</view>
<view class='list_icon'>
<view bindtap='likeCharge' data-index="{{index}}" data-id='{{item.id}}'>
<text class='iconfont icon-dianzan2 zan' wx:if="{{item.user_support==1}}"></text>
<text class='iconfont icon-huida pinglun1' wx:else></text>
<view bindtap='likeCharge' data-index="{{index}}" data-id='{{item.list_id}}' data-status='2' wx:if='{{tab_current!=4&&tab_current!=3}}'>
<text class='iconfont icon-dianzan2 zan'></text>
<!-- <text class='iconfont icon-huida pinglun1' wx:else></text> -->
<text class=''>{{item.support}}</text>
</view>
<view bindtap='review' data-id='{{item.id}}' data-type='review'>
<view bindtap='review' data-id='{{item.list_id}}' data-type='review'>
<text class='iconfont icon-pinglun pinglun1'></text>
<text>{{item.table}}</text>
</view>
<view class='more_box'>
<view catchtap='collectInfo' wx:if='{{tab_current==4}}' data-status='2' data-index="{{index}}" data-id='{{item.list_id}}'>
<text class='iconfont icon-shoucang2 zan'></text>
<!-- <text class='iconfont icon-shoucang4 pinglun1' wx:else></text> -->
<text class=''>{{item.collect}}</text>
</view>
<view class='more_box' wx:if='{{tab_current==1 || tab_current==4}}'>
<text class='iconfont icon-gengduo' catchtap='showMore' data-index='{{index}}'></text>
<block wx:if='{{state2}}'>
<view class='more_label_box more2' wx:if='{{item.more_state}}'>
... ... @@ -101,7 +106,7 @@
</view>
</block>
</view>
<text class='iconfont icon-suo'></text>
<text class='iconfont icon-suo' wx:if='{{tab_current==1}}'></text>
</view>
</view>
</view>
... ...
... ... @@ -374,6 +374,9 @@ page {
.time {
font-size: 26rpx;
}
.zan{
color: #000;
}
.zan, .pinglun1 {
font-size: 28rpx;
... ...
// pages/my/userInfo/userInfo.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
id: '',
look: '',
look_type: '',
status: 1,
page: 1
},
getData() {
let url = '/home/index/userPage'
let params = {
open_user_id: this.data.id,
look: this.data.look,
look_type: this.data.look_type
}
let header = {
"XX-Token": wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
this.setData({
avatar: res.data.data.avatar,
fans_num: res.data.data.fans_num,
host: res.data.data.host,
host_num: res.data.data.host_num,
list: res.data.data.list,
signature: res.data.data.signature,
user_nickname: res.data.data.user_nickname
})
}
})
},
getData2() {
let url = '/home/index/checkPage'
let params = {
open_user_id: this.data.id,
status: this.data.status,
page: this.data.page
}
let header = {
"XX-Token": wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
this.setData({
list: res.data.data.list
})
}
})
},
chargeTime(e) {
var current = e.currentTarget.dataset.current
var tab_current = this.data.tab_current
if (current == 1) {
this.setData({
state: !(this.data.state)
})
}
if (current == 4) {
this.setData({
state2: true
})
} else {
this.setData({
state2: false
})
}
if (tab_current == current) {
return false
} else {
this.setData({
tab_current: current,
status: current,
})
this.getData2()
}
},
//关注接口
attentionInfo(e) {
var id = this.data.id
var host = this.data.host
var status = ''
host == 1 ? status = 2 : status = 1
let that = this;
let url = '/home/index/host';
let param = {
open_user_id: id,
status: status
}
let header = {
'XX-Token': wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
}
app.post(url, param, header).then((res) => {
if (res.data.code == 20000) {
this.getData()
}
})
},
goBox() {
wx.navigateTo({
url: '/pages/my/draft/draft',
})
},
goMessage() {
wx.navigateTo({
url: '/pages/index/message/message',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.setData({
id: options.id ? options.id : ''
})
if (options.id != '' && options.id != undefined) {
this.getData()
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<view class='banner_box' bindtap='uoloadImg'>
<view class='banner_info info1'>
<view class="list_label1 {{host==1?'list_active1':''}}" bindtap='attentionInfo' data-id='{{item.id}}'>{{host==1?'已关注':'添加关注'}}</view>
</view>
<view class='head_img'>
<image class='banner_img' src='{{avatar}}'></image>
</view>
<view class='user_name'>{{user_nickname}}</view>
<view class='user_brief'>{{signature}}</view>
<view class='banner_info' style='padding:0 50rpx;'>
<view bindtap='goList' data-status='2'>
<text class='' style='color:#999;'>粉丝</text>
<text class='user_num'>{{fans_num}}</text>
</view>
<view bindtap='goList' data-status='1'>
<text class='' style='color:#999;'>关注</text>
<text class='user_num'>{{host_num}}</text>
</view>
</view>
</view>
<view class='content_box'>
<view class='list_tab_box'>
<view class="tab_item {{status==1?'tab_active':''}}" data-current='1' bindtap='chargeTime'>
<view>从前</view>
<view class="iconfont icon-caret-up {{status==1?'icon_active':''}}"></view>
</view>
<view class="tab_item {{status==4?'tab_active':''}}" data-current='4' bindtap='chargeTime'>
<view>收藏</view>
<view class="iconfont icon-caret-up {{status==4?'icon_active':''}}"></view>
</view>
</view>
<view class='item_list' wx:key='' wx:for='{{list}}' wx:key>
<view class='list_title'>{{item.open_time}}</view>
<view class='content_item_box' data-id='{{item.id}}' bindtap='messageDetail'>
<view class='list_content_box'>
<view class='list_img'>
<image src='{{item.img}}' wx:key=''></image>
</view>
<view class='list_content'>
<view class='content'>
<view class='content_info'>{{item.title}}</view>
<view class='list_label'>{{item.style}}</view>
</view>
<view class='list_state_box'>
<view class='time'>{{item.open_time}}</view>
<view class='list_icon'>
<view bindtap='likeCharge' data-index="{{index}}" data-id='{{item.list_id}}' wx:if='{{status!=4}}'>
<text class='iconfont icon-dianzan2 zan' wx:if="{{item.user_support==1}}"></text>
<text class='iconfont icon-huida pinglun1' wx:else></text>
<text class=''>{{item.support}}</text>
</view>
<view bindtap='review' data-id='{{item.list_id}}' data-type='review'>
<text class='iconfont icon-pinglun pinglun1'></text>
<text>{{item.table}}</text>
</view>
<view catchtap='collectInfo' wx:if='{{status==4}}' data-index="{{index}}" data-id='{{item.list_id}}'>
<text class='iconfont icon-shoucang2 zan'></text>
<!-- <text class='iconfont icon-shoucang4 pinglun1' wx:else></text> -->
<text class=''>{{item.collect}}</text>
</view>
<view class='more_box' wx:if='{{status==1 || status==4}}'>
<text class='iconfont icon-gengduo' catchtap='showMore' data-index='{{index}}'></text>
<block wx:if='{{state2}}'>
<view class='more_label_box more2' wx:if='{{item.more_state}}'>
<view class='more_item' bindtap='showPoster'>
<text>删除</text>
</view>
</view>
</block>
<block wx:else>
<view class='more_label_box' wx:if='{{item.more_state}}'>
<view class='more_item' bindtap='showPoster'>
<text>删除</text>
</view>
<view class='more_line'></view>
<view class='more_item' catchtap='complain'>
<text>仅自己可见</text>
</view>
<view class='more_line'></view>
<view class='more_item' catchtap='complain'>
<text>粉丝可见</text>
</view>
<view class='more_line'></view>
<view class='more_item' catchtap='complain'>
<text>全部</text>
</view>
</view>
</block>
</view>
<text class='iconfont icon-suo' wx:if='{{status==1}}'></text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class='mask_box' wx:if='{{}}' catchtap='cancleMask'>
<view class='popup_box'>
<view class='popup_title'>取消关注</view>
<view>确认取消关注?</view>
<view class='popup_btn_box'>
<view class='popup_btn'>再想想</view>
<view class='popup_btn'>再想想</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/my/myindex/myindex.wxss */
page {
background: #f5f6fa;
}
.list_label1 {
width: 112rpx;
height: 40rpx;
background: #DCDDE0;
border-radius: 5rpx;
font-size: 24rpx;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.list_active1{
background: #F7F7F7;
color: #3568CC;
}
.info1{
justify-content: flex-end!important;
}
.banner_box {
width: 100%;
height: 500rpx;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
padding: 40rpx;
background: #fff;
box-sizing: border-box;
}
.banner_info {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.user_name text {
font-size: 32rpx !important;
color: #282829 !important;
font-weight: bold;
}
.user_name {
width: 100%;
text-align: center;
}
.icon-caogaoxiang, .icon-xiaoxi {
font-size: 28rpx !important;
color: #282829 !important;
margin-right: 10rpx;
}
.user_brief {
font-size: 28rpx;
color: #282829;
text-align: center;
}
.user_num {
font-size: 32rpx !important;
font-weight: bold;
color: #282829 !important;
margin-left: 10rpx;
}
.banner_box text {
font-size: 28rpx;
color: #282829;
}
.banner_img {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.info_box {
width: 100%;
display: flex;
justify-content: flex-end;
margin-top: -80rpx;
padding-right: 38rpx;
}
.head_img {
width: 144rpx;
height: 144rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
border: 1rpx solid #000;
background: #fff;
padding: 12rpx;
box-sizing: border-box;
position: relative;
}
.head_img image {
width: 100%;
height: 100%;
}
.edit_box {
width: 38rpx;
height: 38rpx;
position: absolute;
right: 0;
bottom: 0;
background: #5a5b5c;
border-radius: 50%;
font-size: 28rpx;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
border: 1rpx solid #fff;
}
.icon-bianji {
font-size: 25rpx;
color: #fff;
}
.content_box {
padding: 30rpx 20rpx;
box-sizing: border-box;
margin-top: 20rpx;
background: #fff;
}
.no-post {
color: #999;
font-size: 26rpx;
text-align: center;
}
.item_list {
width: 100%;
height: 100%;
display: flex;
align-items: flex-start;
margin-bottom: 20rpx;
}
.item_list:last-child {
margin-bottom: 0;
}
.list_title {
width: 25%;
font-size: 32rpx;
font-weight: bold;
color: #010000;
}
.date .day {
/* width: 50%; */
font-size: 50rpx;
font-weight: bold;
}
.month {
/*width: 52%;*/
font-size: 24rpx;
/* font-weight: bold; */
color: #010000;
margin-bottom: -4rpx;
font-weight: bold;
}
.date {
width: 24%;
display: flex;
align-items: baseline;
/* justify-content: flex-end; *//* margin-right: 50rpx; */
}
.year-month {
display: flex;
flex-direction: column;
width: 15%;
margin-right: 20rpx;
text-align: right;
}
.year-month .year, .year-month .month {
width: 100%;
}
.content_item_box {
width: 100%;
height: 100%;
}
.add-bg {
background: #f2f2f2;
padding: 10rpx 10rpx 0 10rpx;
}
.list_content_box {
display: flex;
align-items: flex-start;
justify-content: space-between;
margin-bottom: 10rpx;
}
.list_content {
width: 65%;
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
}
.content_info {
width: 74%;
height: 85rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
}
.add-width {
width: 100%;
}
.list_img {
width: 180rpx;
height: 180rpx;
margin-right: 14rpx;
display: flex;
align-items: center;
justify-content: center;
border: 1rpx solid #e5e5e5;
}
.list_img image {
width: 100%;
height: 100%;
}
.list_tab_box {
display: flex;
align-items: center;
padding: 0 150rpx;
box-sizing: border-box;
margin-bottom: 40rpx;
}
.tab_item {
width: 50%;
text-align: center;
font-size: 30rpx;
font-weight: bold;
color: #a5a6a8;
position: relative;
}
.tab_active {
color: #000;
}
.icon-caret-up {
color: #fff;
}
.icon_active {
color: #000;
}
.time {
font-size: 26rpx;
color: #fff;
}
.zan, .pinglun1 {
font-size: 28rpx;
margin-right: 10rpx;
margin-left: 32rpx;
}
.pinglun1 {
margin-left: 32rpx;
}
.content {
width: 100%;
display: flex;
align-items: flex-start;
justify-content: space-between;
font-size: 28rpx;
color: #000;
}
.list_label {
font-size: 24rpx;
color: #f80;
background: #f5f5f5;
border-radius: 8rpx;
height: 40rpx;
padding: 0 20rpx;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.list_icon {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
}
.mask_box {
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
background: rgba(0, 0, 0, 0.2);
display: flex;
align-items: center;
justify-content: center;
}
.popup_box {
width: 718rpx;
height: 380rpx;
background: rgba(255, 255, 255, 1);
box-shadow: 0rpx 8rpx 16rpx 0rpx rgba(0, 0, 0, 0.08);
border-radius: 36rpx;
text-align: center;
position: relative;
}
.popup_title {
font-size: 36rpx;
color: #000;
text-align: center;
border-bottom: 1rpx solid #ebebeb;
padding: 20rpx 0;
margin-bottom: 40rpx;
}
.popup_btn_box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
position: absolute;
bottom: 40rpx;
padding: 0 30rpx;
box-sizing: border-box;
}
.popup_btn {
width: 312rpx;
height: 82rpx;
background: rgba(247, 247, 247, 1);
border: 1rpx solid rgba(226, 226, 226, 1);
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
color: #000;
}
.list_state_box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 26rpx;
color: #999;
margin-top: 70rpx;
}
.time {
font-size: 26rpx;
}
.zan, .pinglun1 {
font-size: 28rpx;
margin-right: 10rpx;
margin-left: 52rpx;
}
.pinglun1 {
margin-left: 52rpx;
}
.list_comment_box {
background: #ebecf0;
font-size: 24rpx;
color: #6b7e91;
margin-top: 28rpx;
}
.comment_list {
border-bottom: 1rpx solid #fff;
padding: 10rpx 17rpx;
}
.more_box {
position: relative;
}
.more_box view {
display: inline-block;
}
.more_label_box {
display: inline-block;
position: absolute;
right: 0;
bottom: -355rpx;
width: 250rpx;
background: #fff;
box-shadow: 0 8rpx 30rpx 0 #e5e5e5;
color: #000;
text-align: center;
padding: 30rpx 0;
}
.more {
margin-right: 10rpx;
}
.more2 {
position: absolute;
right: 0;
bottom: -105rpx;
}
.more_item {
padding: 0 25rpx;
text-align: center;
}
.more_line {
width: 100%;
height: 3rpx;
background: #ebebeb;
margin: 20rpx 0;
}
... ...
... ... @@ -37,7 +37,7 @@
"list": []
},
"miniprogram": {
"current": 1,
"current": 2,
"list": [
{
"id": -1,
... ... @@ -50,6 +50,14 @@
"id": -1,
"name": "fabu",
"pathName": "pages/index/release/release",
"query": "",
"scene": null
},
{
"id": -1,
"name": "aa",
"pathName": "pages/my/userInfo/userInfo",
"query": "id=2",
"scene": null
}
]
... ...