作者 刘晓艳

穿搭整体逻辑调整

... ... @@ -14,6 +14,7 @@ Page({
list: [],
state: false,
name: '',
comment_text: ''
},
showPoster() {
... ... @@ -34,9 +35,11 @@ Page({
})
},
complain() {
complain(e) {
var id = e.currentTarget.dataset.id
var type = e.currentTarget.dataset.type
wx.navigateTo({
url: '/pages/index/comment/comment',
url: '/pages/index/comment/comment?id=' + id + '&type=' + type,
})
},
... ... @@ -66,24 +69,24 @@ Page({
'XX-Device-Type': 'wxapp'
}
app.post(url, param, header).then((res) => {
console.log(res)
console.log('数据:', res)
var list = res.data.data.fashion
list.more_state = false
if (res.data.code == 20000) {
that.setData({
list: res.data.data.fashion,
list: list,
tables: res.data.data.tables,
})
}
}).catch((errMsg) => {})
},
alertInfo(e){
console.log(1111111111)
},
submitComment(e) {
console.log(e)
console.log(222)
var id = e.currentTarget.dataset.id
let url = '/home/index/tablePost'
let params = {
list_id: this.data.list_id,
list_id: id,
text: e.detail.value
}
let header = {
... ... @@ -93,10 +96,102 @@ Page({
app.post(url, params, header).then((res) => {
if (res.data.code == 20000) {
this.getData()
this.setData({
comment_text: ''
})
}
})
},
//点击关注
attention(e) {
var status = ''
var index = e.currentTarget.dataset.index
var id = e.currentTarget.dataset.id
var list = this.data.list
if (list.user_host == 1) {
list.user_host = 0
status = 2
} else {
list.user_host = 1
status = 1
}
this.attentionInfo(id, status)
this.setData({
list: list
})
},
//关注接口
attentionInfo(id, status) {
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()
}
})
},
//点赞
likeCharge(e) {
var id = e.currentTarget.dataset.id
var list = this.data.list
var status = ''
if (list.user_support == 1) {
list.user_support = 0
status = 2
} else {
list.user_support = 1
status = 1
}
this.setData({
list: list
})
this.like(id, status)
},
like(id, status) {
let url = '/home/index/support'
let params = {
list_id: id,
status: status
}
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()
}
})
},
showMore(e) {
var index = e.currentTarget.dataset.index
var list = this.data.list
list.more_state = !(list.more_state)
this.setData({
more_state: !(this.data.more_state),
list: list
})
},
/**
* 生命周期函数--监听页面加载
*/
... ...
... ... @@ -10,7 +10,7 @@
<view class='user_name' catchtap='showModal' data-index="{{index}}">{{list.user_nickname}}</view>
<view class='state_box'>
<block>
<view class='collect_box active' bindtap='collectInfo' data-index="{{index}}" data-id='{{item.id}}'>
<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>
</view>
... ... @@ -28,64 +28,32 @@
</view>
<view class='list_content'>{{list.text}}</view>
</view>
<!-- <view class='list_state_box2'>
<view class='time'>{{list.open_time}}</view>
<view class='list_icon'>
<text bindtap='likeCharge' data-index="{{index}}" data-id='{{item.id}}' data-is_paise='{{item.is_paise}}'>
<text class='iconfont icon-heart xin1' wx:if="{{!item.is_paise}}"></text>
<text class='iconfont icon-dianzan- zan'></text>
<text class=''>{{list.support}}</text>
</text>
<text bindtap='review' data-id='{{item.id}}'>
<text class='iconfont icon-pinglun pinglun1'></text>
<text>{{list.table}}</text>
</text>
<text>
<text class='iconfont icon-shoucang zan'></text>
<text class=''>{{list.collect}}</text>
</text>
<view class='more_box'>
<text class='iconfont icon-gengduo' bindtap='showMore'></text>
<view class='more_label_box' wx:if='{{more_state}}'>
<view class='more_item' bindtap='showPoster'>
<text class='iconfont icon-haibao more'></text>
<text>生成分享海报</text>
</view>
<view class='more_line'></view>
<view class='more_item' bindtap='complain'>
<text class='iconfont icon-jubao more'></text>
<text>投诉举报</text>
</view>
</view>
</view>
</view>
</view> -->
<view class='list_state_box'>
<view class='time'>{{list.open_time}}</view>
<view class='list_icon'>
<view catchtap='likeCharge' data-index="{{mindex}}" data-id='{{item.id}}'>
<i class='iconfont icon-dianzan2 zan' wx:if="{{item.user_support==1}}"></i>
<view catchtap='likeCharge' data-id='{{list.id}}'>
<i class='iconfont icon-dianzan2 zan' wx:if="{{list.user_support==1}}"></i>
<text class='iconfont icon-huida pinglun1' wx:else></text>
<text class=''>{{list.support}}</text>
</view>
<view catchtap='review' data-id='{{item.id}}' data-type='review'>
<view >
<text class='iconfont icon-pinglun pinglun1'></text>
<text>{{list.table_num}}</text>
</view>
<view catchtap='collectInfo' data-index="{{mindex}}" data-id='{{item.id}}'>
<i class='iconfont icon-shoucang2 zan' wx:if='{{item.user_collect==1}}'></i>
<view catchtap='collectInfo' data-id='{{list.id}}'>
<i class='iconfont icon-shoucang2 zan' wx:if='{{list.user_collect==1}}'></i>
<text class='iconfont icon-shoucang4 pinglun1' wx:else></text>
<text class=''>{{list.collect}}</text>
</view>
<view class='more_box'>
<text class='iconfont icon-gengduo' catchtap='showMore' data-index='{{mindex}}'></text>
<view class='more_label_box' wx:if='{{item.more_state}}'>
<view class='more_item' catchtap='showPoster' data-id="{{item.id}}">
<text class='iconfont icon-gengduo' catchtap='showMore'></text>
<view class='more_label_box' wx:if='{{list.more_state}}'>
<view class='more_item' catchtap='showPoster' data-id="{{list.id}}">
<text class='iconfont icon-haibao more'></text>
<text>生成分享海报</text>
</view>
<view class='more_line'></view>
<view class='more_item' catchtap='complain' data-id='{{item.id}}' data-type='complain'>
<view class='more_item' catchtap='complain' data-id='{{list.id}}' data-type='complain'>
<text class='iconfont icon-jubao more'></text>
<text>投诉举报</text>
</view>
... ... @@ -130,9 +98,9 @@
<textarea placeholder="回复:+{{name}}" bindconfirm='commentInfo' fixed='true'></textarea>
</view>
<!-- wx:else -->
<view class='comment_box' >
<!-- <input placeholder='AAA' bindconfirm='alertInfo'></input> -->
<textarea placeholder='请输入评论内容' bindconfirm='submitComment' fixed='true'></textarea>
<view class='comment_box'>
<input placeholder='请输入评论内容' value='{{comment_text}}' bindconfirm='submitComment' data-id='{{list.id}}'></input>
<!-- <textarea placeholder='请输入评论内容' bindconfirm='submitComment' fixed='true'></textarea> -->
</view>
<view class='mask_box' wx:if='{{poster_state}}'>
... ...
... ... @@ -253,8 +253,9 @@ page {
height: 42rpx;
line-height: 42rpx;
font-size: 24rpx;
color: #53a6fa;
border: 1rpx solid #F7F7F7;
background: #dcdde0;
color: #fff;
border: 1rpx solid #f7f7f7;
border-radius: 4rpx;
display: flex;
align-items: center;
... ... @@ -262,8 +263,8 @@ page {
}
.collect_box.active {
background: #DCDDE0;
color: #fff;
background: #f7f7f7;
color: #53a6fa;
}
.star1 {
... ... @@ -274,7 +275,7 @@ page {
.star2 {
font-size: 25rpx;
color: #3568CC;
color: #3568cc;
margin-right: 6rpx;
}
... ... @@ -290,7 +291,7 @@ page {
}
.list_img_box {
margin-top: 30rpx;
margin-top: 30rpx;
}
.list_img_box image {
... ... @@ -346,6 +347,7 @@ page {
.more_box {
position: relative;
}
.more_box view {
display: inline-block;
}
... ... @@ -385,10 +387,7 @@ page {
.pinglun2 {
margin-top: 4rpx;
}
.collect_word{
font-size: 24rpx;
color: #3568CC;
}
.comment_content {
font-size: 26rpx;
color: #13161a;
... ... @@ -405,11 +404,11 @@ page {
position: fixed;
left: 0;
bottom: 0;
padding:20rpx 30rpx;
padding: 20rpx 30rpx;
box-sizing: border-box;
}
.comment_box textarea {
.comment_box textarea,input {
font-size: 26rpx;
height: 80rpx;
}
... ...
// pages/index/fans/fans.js
const app=getApp()
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
status:''
status: '',
list: []
},
getData() {
let url = '/home/index/checkFans'
let params = {
... ... @@ -21,65 +22,113 @@ Page({
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
this.setData({
list: res.data.data.list
})
}
})
},
//点击关注
attention(e) {
var status = ''
var index = e.currentTarget.dataset.index
var id = e.currentTarget.dataset.id
var list = this.data.list
if (list.user_host == 1) {
list.user_host = 0
status = 2
} else {
list.user_host = 1
status = 1
}
this.attentionInfo(id, status)
this.setData({
list: list
})
},
//关注接口
attentionInfo(id, status) {
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()
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
options.status?(this.getData()):''
onLoad: function(options) {
this.setData({
status:options.status?options.status:''
})
this.getData()
if(options.status==1){
wx.setNavigationBarTitle({
title: '关注',
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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
... ...
<!--pages/index/fans/fans.wxml-->
<view class='content_box'>
<view class='item_list'>
<view class='item_list' wx:for='{{list}}' wx:key>
<view class='list_left'>
<image class='head_img' src='/images/img3.png'></image>
<image class='head_img' src='{{item.avatar}}'></image>
<view>
<view class='user_name'>Rose | ローズ</view>
<view class='user_name'>{{item.user_nickname}}</view>
<view>
<text>发布365篇,粉丝50000个</text>
<text>发布{{item.fashion_num}}篇,粉丝{{item.fans_num}}个</text>
</view>
</view>
</view>
<view class="list_label list_active">添加关注</view>
<view class="list_label list_active" bindtap='attention' data-id='{{list.open_user_id}}'>添加关注</view>
</view>
</view>
... ...
... ... @@ -93,10 +93,10 @@ Page({
var list = this.data.list
if (list[index].user_host == 1) {
list[index].user_host = 0
status = 1
status = 2
} else {
list[index].user_host = 1
status = 2
status = 1
}
this.attentionInfo(id, status)
this.setData({
... ... @@ -119,7 +119,7 @@ Page({
}
app.post(url, param, header).then((res) => {
if (res.data.code == 20000) {
this.getData()
}
})
},
... ... @@ -132,15 +132,16 @@ Page({
var status = ''
if (list[index].user_support == 1) {
list[index].user_support = 0
status = 1
status = 2
} else {
list[index].user_support = 1
status = 2
status = 1
}
this.setData({
list: list
})
this.like(id, status)
// this.getData()
},
like(id, status) {
... ... @@ -154,7 +155,9 @@ Page({
'XX-Device-Type': 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
this.getData()
}
})
},
... ... @@ -166,10 +169,10 @@ Page({
var status = ''
if (list[index].user_collect == 1) {
list[index].user_collect = 0
status = 1
status = 2
} else {
list[index].user_collect = 1
status = 2
status = 1
}
this.setData({
list: list
... ... @@ -178,7 +181,7 @@ Page({
},
collect(id, status) {
let url = '/home/index/support'
let url = '/home/index/collect'
let params = {
list_id: id,
status: status
... ... @@ -189,6 +192,9 @@ Page({
}
app.post(url, params, header).then((res) => {
console.log(res)
if(res.data.code==20000){
this.getData()
}
})
},
... ... @@ -278,7 +284,6 @@ Page({
complain(e) {
var id = e.currentTarget.dataset.id
var type = e.currentTarget.dataset.type
console.log(type)
wx.navigateTo({
url: '/pages/index/comment/comment?id=' + id + '&type=' + type,
})
... ...
... ... @@ -19,7 +19,7 @@
<view class='head_portrait'>
<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>
... ...
... ... @@ -11,8 +11,23 @@ Page({
mask_state: false,
sex_array: ['男', '女'],
sex_index: -1,
birthday:'',
constellation: ['白羊座', '金牛座', '双子座', '巨蟹座', '狮子座', '处女座', '天秤座', '天蝎座', '射手座', '摩羯座', '水瓶座','双鱼座'],
birthday: '',
constellation_array: ['白羊座', '金牛座', '双子座', '巨蟹座', '狮子座', '处女座', '天秤座', '天蝎座', '射手座', '摩羯座', '水瓶座', '双鱼座'],
index:-1,
current_num:0,
max:30,
},
getText(e) {
var signature = e.detail.value;
this.setData({
signature: signature
})
var len = parseInt(signature.length);
if (len > this.data.max) return;
this.setData({
current_num: len //当前字数
});
},
//选择性别
... ... @@ -23,6 +38,13 @@ Page({
})
},
setInfo(e){
this.setData({
index: e.detail.value,
constellation: this.data.constellation_array[e.detail.value]
})
},
setTime(e) {
this.setData({
... ... @@ -44,7 +66,7 @@ Page({
})
},
chooseImg() { //这里是选取图片的方法
chooseImg() {
var that = this;
wx.chooseImage({
count: 1,
... ... @@ -103,6 +125,43 @@ Page({
})
},
formSubmit(e) {
var sex_index = parseInt(this.data.sex_index)+1
let that = this;
let url = '/home/index/userUpdate';
let param = {
avatar: this.data.avatar,
user_nickname: e.detail.value.user_name,
sex: sex_index,
birthday: this.data.birthday,
constellation: this.data.constellation,
weight: e.detail.value.weight,
stature: e.detail.value.stature,
signature: this.data.signature,
}
let header = {
'XX-Token': wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
}
app.post(url, param, header).then((res) => {
if(res.data.code==20000){
wx.showToast({
title: '修改成功',
})
setTimeout(function(){
wx.navigateBack({
dalta:1
})
},1500)
}else{
wx.showToast({
title: res.data.msg,
icon:'none'
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
... ...
... ... @@ -50,8 +50,8 @@
<text>星座</text>
</view>
<view class='list_input'>
<picker mode='date' bindchange='selectTime'>
<input type='text' placeholder='未选择' name='end_time' value='{{end_time}}' disabled='true'></input>
<picker range='{{constellation_array}}' value='{{index}}' bindchange='setInfo'>
<input type='text' placeholder='未选择' name='constellation' value='{{constellation}}' disabled='true'></input>
</picker>
<view class='iconfont icon-fanhui'></view>
</view>
... ... @@ -63,7 +63,7 @@
<text>身高</text>
</view>
<view class='list_input'>
<input type='number' placeholder='请填写' name='period' value='{{detail_address}}'></input>
<input type='number' placeholder='请填写' name='stature' value='{{stature}}'></input>
<view class='iconfont icon-fanhui'></view>
</view>
</view>
... ... @@ -72,7 +72,7 @@
<text>体重</text>
</view>
<view class='list_input'>
<input type='number' placeholder='请填写' name='current_time' value='{{detail_address}}'></input>
<input type='number' placeholder='请填写' name='weight' value='{{weight}}'></input>
<view class='iconfont icon-fanhui'></view>
</view>
</view>
... ... @@ -81,7 +81,7 @@
<text>个性签名</text>
</view>
<view class='list_textarea'>
<textarea placeholder='记录此刻的心情' maxlength='{{max}}' bindinput='getText'>
<textarea placeholder='记录此刻的心情' maxlength='{{max}}' value='{{signature}}' bindinput='getText'>
<text class='words_num'>{{current_num}}/{{max}}</text>
</textarea>
</view>
... ...
... ... @@ -7,7 +7,10 @@ Page({
*/
data: {
status: 1,
page: 1
page: 1,
list1: [],
list2: [],
},
readState(e) {
... ... @@ -15,9 +18,9 @@ Page({
this.setData({
status: status
})
if(status!=3){
if (status != 3) {
this.getData()
}else{
} else {
this.getData2()
}
},
... ... @@ -36,11 +39,7 @@ Page({
console.log(res)
if (res.data.code == 20000) {
this.setData({
current_page: res.data.data.list.current_page,
list: res.data.data.list.current_page,
last_page: res.data.data.list.last_page,
per_page: res.data.data.list.per_page,
total: res.data.data.list.total
list1: res.data.data.list,
})
}
})
... ... @@ -58,7 +57,9 @@ Page({
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
this.setData({
list2: res.data.data.list,
})
}
})
... ...
... ... @@ -5,41 +5,41 @@
<view class="label {{status ==3?'active':''}}" bindtap='readState' data-status='3'>审核消息</view>
</view>
<view class='content_box'>
<block wx:if='{{status==1}}'>
<view class='item_list'>
<block wx:if='{{status==1||status==2}}'>
<view class='item_list' wx:for='{{list1.data}}' wx:key>
<view class='list_left'>
<image class='head_img' src='/images/img3.png'></image>
<image class='head_img' src='{{item.avatar}}'></image>
<view>
<view class='user_name'>Rose | ローズ</view>
<view class=' user_name '>{{item.user_nickname}}</view>
<view>
<text>评论了你的</text>
<text class='list_hint'>今日打卡</text>
<text class='list_hint '>{{item.title}}</text>
</view>
</view>
</view>
<view class='point'></view>
<view class='point '></view>
</view>
</block>
<block wx:if='{{status==2}}'>
<view class='item_list'>
<view class='list_left'>
<image class='head_img' src='/images/img3.png'></image>
</block>
<!-- <block wx:if='{{status==2}} '>
<view class='item_list '>
<view class='list_left '>
<image class='head_img ' src='/images/img3.png '></image>
<view>
<view class='user_name'>Rose | ローズ</view>
<view class='user_name '>Rose | ローズ</view>
<view>
<text>评论了你的</text>
<text class='list_hint'>今日打卡</text>
<text class='list_hint '>今日打卡</text>
</view>
</view>
</view>
<view class='point'></view>
<view class='point '></view>
</view>
</block>
<block wx:if='{{status==3}}'>
<view class='item_list'>
</block> -->
<block wx:if='{{status==3}} '>
<view class='item_list' wx:for='{{list2}}' wx:key>
<view class='list_left'>
<view>
<view class='user_name' style='font-weight:normal;'>
<view class='user_name' style='font-weight:normal; '>
<text>Rose | ローズ您好,您发布的今日打卡审核</text>
<text class='list_hint2'>未通过</text>
</view>
... ...
... ... @@ -27,8 +27,10 @@ Page({
open_time: '',
temp_time2: '',
temp_time: '',
list_id:0,
list_id: 0,
imgsUrl: [],
open: 1,
more_info: '公开',
},
setTitle(e) {
... ... @@ -71,7 +73,6 @@ Page({
var tempUrl = this.data.tempUrl
var imgInfo = this.data.imgInfo
images[index].text = imgInfo
console.log(images)
this.setData({
img_state: false,
images: images
... ... @@ -88,11 +89,11 @@ Page({
})
},
getStyleId(){
getStyleId() {
var styles = this.data.styles
var classify = this.data.classify
for(var i=0;i<classify;i++){
if(classify[i].state){
for (var i = 0; i < classify; i++) {
if (classify[i].state) {
styles.push(classify[i].id)
}
}
... ... @@ -190,11 +191,18 @@ Page({
var lastMonth = this.data.lastMonth
var currentTime = this.data.currentTime
var time = lastMonth[currentTime]
var time2 = lastMonth[currentTime]
var temp_time = this.data.temp_time
if (currentTime == 0) {
time2 = '今天'
} else if (currentTime == 1) {
time2 = '明天'
}
var open_time = time + ' ' + temp_time
console.log(open_time)
var open_time2 = time2 + ' ' + temp_time
this.setData({
open_time: open_time
open_time: open_time,
time_info: open_time2
})
},
... ... @@ -248,10 +256,16 @@ Page({
//服务器返回格式: { "Catalog": "testFolder", "FileName": "1.jpg", "Url": "https://test.com/1.jpg" }
let images = that.data.images;
images.push(data.data);
var imgsUrl = []
for (var i in images) {
var tempImg = {}
tempImg.url = images[i].url
imgsUrl.push(tempImg)
}
that.setData({
images: images
images: imgsUrl
});
console.log(images)
//如果是最后一张,则隐藏等待中
if (uploadImgCount == tempFilePaths.length) {
wx.hideToast();
... ... @@ -325,9 +339,20 @@ Page({
wx.showToast({
title: '设置成功',
})
var more_info = this.data.more_info
if (e.currentTarget.dataset.open == 1) {
more_info = '公开'
} else if (e.currentTarget.dataset.open == 2) {
more_info = '粉丝可见'
} else if (e.currentTarget.dataset.open == 3) {
more_info = '仅自己可见'
} else if (e.currentTarget.dataset.open == 4) {
more_info = '草稿箱'
}
this.setData({
open: e.currentTarget.dataset.open,
more_state:false
more_state: false,
more_info: more_info
})
},
... ... @@ -363,15 +388,80 @@ Page({
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
wx.showToast({
title: '提交成功',
})
setTimeout((res) => {
wx.navigateBack({
dalta:1
dalta: 1
})
}, 1000)
} else {
wx.showToast({
title: res.data.msg,
icon: 'none'
})
}
})
},
getData() {
let url = '/home/index/draftsEdit'
let params = {
list_id: this.data.list_id,
}
let header = {
"XX-Token": wx.getStorageSync('token'),
'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) {
more_info = '公开'
} else if (open == 2) {
more_info = '粉丝可见'
} else if (open == 3) {
more_info = '仅自己可见'
} else if (open == 4) {
more_info = '草稿箱'
}
var classify = this.data.classify
var styles = res.data.data.styles
for (var i in classify) {
for (var j in styles) {
if (classify[i].id == styles[j]) {
classify[i].state = true
}
}
}
var images = res.data.data.img
var imgsUrl = []
for (var i in images) {
var tempImg = {}
tempImg.url = images[i].url
tempImg.text = images[i].text
imgsUrl.push(tempImg)
}
// console.log(imgsUrl)
if (res.data.code == 20000) {
this.setData({
title: res.data.data.title,
text: res.data.data.text,
open: open,
more_info: more_info,
time_info: res.data.data.open_time,
open_time: res.data.data.open_time,
images: imgsUrl,
classify: classify,
styles: styles
})
}
})
},
/**
... ... @@ -380,6 +470,12 @@ Page({
onLoad: function(options) {
this.getStyle()
this.getTime()
this.setData({
list_id: options.id ? options.id : ''
})
if (options.id != 0) {
this.getData()
}
},
/**
... ...
... ... @@ -28,7 +28,7 @@
<view class='hint_box'>
<view class='hint_label' bindtap='showMask'>{{time_info}}</view>
<view class='hint_label more_box'>
<text catchtap='showMore'>公开</text>
<text catchtap='showMore'>{{more_info}}</text>
<view class='more_label_box' wx:if='{{more_state}}'>
<view class='more_item' bindtap='setOpen' data-open='1'>
<text>公开</text>
... ...
... ... @@ -10,12 +10,13 @@ Page({
imgs: ['/images/img3.png', '/images/img3.png', '/images/img3.png'],
more_state: false,
list: [],
page:1,
keyword:'',
page: 1,
keyword: '',
label_list: ''
},
getSearch(e){
getSearch(e) {
this.setData({
keyword:e.detail.value
keyword: e.detail.value
})
},
... ... @@ -89,7 +90,7 @@ Page({
console.log(res)
if (res.data.code == 20000) {
this.setData({
list: res.data.data.list
label_list: res.data.data.list
})
}
... ... @@ -106,12 +107,21 @@ Page({
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
this.setData({
label_list: ''
})
}
})
},
//清空输入框
clearInput() {
this.setData({
keyword: ''
})
},
/**
* 生命周期函数--监听页面加载
... ...
... ... @@ -3,13 +3,13 @@
<view class="head_search_box">
<view class="input">
<view class='iconfont icon-search fangdajing'></view>
<input placeholder='请输入搜索相关内容' bindinput="getSearch" value="{{searchValue}}" bindconfirm="startSearch" placeholder-class='input_size' class='search_input' />
<input placeholder='请输入搜索相关内容' bindinput="getSearch" value="{{keyword}}" bindconfirm="startSearch" placeholder-class='input_size' class='search_input' />
<view class="iconfont icon-jia1 jia1" catchtap="clearInput"></view>
</view>
<view class="search-text" bindtap="goSearch">搜索</view>
</view>
<!-- <view class="history_box">
<view class="history_box" wx:if="{{list.length<=0}}">
<view class="head">
<view class="title">搜索历史</view>
<view class="clear" bindtap="clearHistory">
... ... @@ -17,15 +17,14 @@
<text>清空历史</text>
</view>
</view>
<view class="history_list {{searchHistory.length === 0?'text-center':''}}">
<!-- <text wx:if="{{searchHistory.length === 0}}">暂无搜索历史~</text>
<view wx:for="{{searchHistory}}" wx:key="index" bindtap="clickHistory" data-index="{{index}}">{{item}}</view>
<view class="history_list {{label_list.length === 0?'text-center':''}}">
<text wx:if="{{label_list.length === 0}}">暂无搜索历史~</text>
<view wx:for="{{label_list}}" wx:key="index" bindtap="clickHistory" data-index="{{index}}">{{item}}</view>
</view>
</view> -->
</view>
<!--文章内容-->
<view class='content_box'>
<view class='content_box' wx:if="{{list.length > 0}}">
<view class='content_item' wx:for='{{list}}' wx:for-index='mindex' wx:key>
<view class='left_box'>
<view class='head_portrait'>
... ...
... ... @@ -19,14 +19,31 @@ Page({
app.post(url, params, header).then((res) => {
console.log(res)
if(res.data.code==20000){
this.setData({
list:res.data.data.list
})
if(res.data.data.list==''){
this.setData({
list: res.data.data.list
})
wx.showToast({
title: '暂无数据',
icon:'none'
})
}else{
this.setData({
list: res.data.data.list
})
}
}
})
},
goDetail(e){
var id=e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/index/release/release?id='+id,
})
},
/**
* 生命周期函数--监听页面加载
*/
... ...
<!--pages/my/draft/draft.wxml-->
<view class='content_box'>
<view class='item_list'>
<image class='list_img' src='/images/img3.png'></image>
<view class='item_list' wx:for='{{list}}' wx:key bindtap='goDetail' data-id='{{item.list_id}}'>
<image class='list_img' src='{{item.img}}'></image>
<view class='list_content_box'>
<view class='list_content'>
<view>今日穿搭</view>
<view>2分钟前</view>
<view>{{item.title}}</view>
<view>{{item.time}}</view>
</view>
<view class='list_content'>
<view>今日穿搭</view>
<view>{{item.text}}</view>
<view class='iconfont icon-shanchu1'></view>
</view>
</view>
... ...
... ... @@ -14,6 +14,8 @@ Page({
look_type: '',
state: false,
state2: false,
page: 1,
status: 1,
},
cancleMask() {
... ... @@ -21,15 +23,20 @@ Page({
mask_state: false
})
},
editInfo() {
wx.navigateTo({
url: '/pages/index/info/info',
})
},
showMore() {
showMore(e) {
var index = e.currentTarget.dataset.index
var list = this.data.list
list[index].more_state = !(list[index].more_state)
this.setData({
more_state: !(this.data.more_state)
// more_state: !(this.data.more_state),
list: list
})
},
... ... @@ -52,6 +59,52 @@ 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
}
this.setData({
list: list
})
this.like(id, status)
// this.getData()
},
like(id, status) {
let url = '/home/index/support'
let params = {
list_id: id,
status: status
}
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()
}
})
},
//评论
review(e) {
var id = e.currentTarget.dataset.id
var type = e.currentTarget.dataset.type
wx.navigateTo({
url: '/pages/index/comment/comment?id=' + id + '&type=' + type,
})
},
chargeTime(e) {
var current = e.currentTarget.dataset.current
var tab_current = this.data.tab_current
... ... @@ -62,19 +115,25 @@ Page({
}
if (current == 4) {
this.setData({
state2: !(this.data.state2)
state2: true
})
} else {
this.setData({
state2: false
})
}
if (tab_current == current) {
return false
} else {
this.setData({
tab_current: current
tab_current: current,
status: current,
})
this.getData()
}
},
getData() {
getData2() {
let url = '/home/index/userPage'
let params = {
open_user_id: this.data.open_user_id,
... ... @@ -92,21 +151,40 @@ Page({
fans_num: res.data.data.fans_num,
host: res.data.data.host,
host_num: res.data.data.host_num,
list: res.data.data.list,
// list: res.data.data.list,
signature: res.data.data.signature,
user_nickname: res.data.data.user_nickname
})
}
})
},
getData() {
let url = '/home/index/checkPage'
let params = {
open_user_id: this.data.open_user_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
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getData()
this.getData2()
},
/**
... ...
... ... @@ -34,25 +34,6 @@
<view class="tab_item {{tab_current==1?'tab_active':''}}" data-current='1' bindtap='chargeTime'>
<view>从前</view>
<view class="iconfont icon-caret-up {{tab_current==1?'icon_active':''}}"></view>
<view class='more_box' wx:if='{{state}}'>
<view class='more_label_box'>
<view class='more_item' catchtap='showPoster' data-id="{{item.id}}">
<text>删除</text>
</view>
<view class='more_line'></view>
<view class='more_item' catchtap='complain' data-id='{{item.id}}' data-type='complain'>
<text>仅自己可见</text>
</view>
<view class='more_line'></view>
<view class='more_item' catchtap='complain' data-id='{{item.id}}' data-type='complain'>
<text>粉丝可见</text>
</view>
<view class='more_line'></view>
<view class='more_item' catchtap='complain' data-id='{{item.id}}' data-type='complain'>
<text>全部</text>
</view>
</view>
</view>
</view>
<view class="tab_item {{tab_current==2?'tab_active':''}}" data-current='2' bindtap='chargeTime'>
<view>赞过</view>
... ... @@ -65,20 +46,13 @@
<view class="tab_item {{tab_current==4?'tab_active':''}}" data-current='4' bindtap='chargeTime'>
<view>收藏</view>
<view class="iconfont icon-caret-up {{tab_current==4?'icon_active':''}}"></view>
<view class='more_box more_box2' wx:if='{{state2}}'>
<view class='more_label_box'>
<view class='more_item' catchtap='showPoster' data-id="{{item.id}}">
<text>删除</text>
</view>
</view>
</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' wx:for='{{item.img}}' wx:key>
<view class='list_img'>
<image src='{{item.img}}' wx:key=''></image>
</view>
<view class='list_content'>
... ... @@ -89,34 +63,43 @@
<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}}' data-is_paise='{{item.is_paise}}'>
<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>
<text class=''>{{item.support}}</text>
</view>
<view bindtap='review' data-id='{{item.id}}'>
<view bindtap='review' data-id='{{item.id}}' data-type='review'>
<text class='iconfont icon-pinglun pinglun1'></text>
<text>{{item.table_num}}</text>
<text>{{item.table}}</text>
</view>
<view class='more_box'>
<text class='iconfont icon-gengduo' catchtap='showMore'></text>
<view class='more_label_box' wx:if='{{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>
<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>
<view class='more_line'></view>
<view class='more_item' catchtap='complain'>
<text>全部</text>
</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>
</view>
</block>
</view>
<text class='iconfont icon-suo'></text>
</view>
... ...
... ... @@ -113,7 +113,7 @@ page {
}
.content_box {
padding: 30rpx;
padding: 30rpx 20rpx;
box-sizing: border-box;
margin-top: 20rpx;
background: #fff;
... ... @@ -138,7 +138,7 @@ page {
}
.list_title {
width: 20%;
width: 25%;
font-size: 32rpx;
font-weight: bold;
color: #010000;
... ... @@ -278,6 +278,7 @@ page {
}
.content {
width: 100%;
display: flex;
align-items: flex-start;
justify-content: space-between;
... ... @@ -397,33 +398,36 @@ page {
}
.more_box {
position: absolute;
left: 0;
bottom: -325rpx;
padding: 0 30rpx;
box-sizing: border-box;
position: relative;
}
.more_box2 {
position: absolute;
left: 0;
bottom: -81rpx;
.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;
font-weight: normal;
color: #000;
padding: 20rpx 0;
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;
... ...
... ... @@ -6,6 +6,7 @@
<!-- <image src='/images/img2.png'></image>
<image src='/images/img2.png'></image>
<image src='/images/img2.png'></image> -->
<image src='{{imgs}}'></image>
</view>
<view class='box2'>
<button class='btn' open-type="getUserInfo" bindgetuserinfo='start'>立即开启</button>
... ...
... ... @@ -25,8 +25,10 @@
}
.box image {
width: 50%;
height: 50%;
/* width: 50%;
height: 50%; */
width: 100%;
height: 100%;
}
.btn {
... ... @@ -36,6 +38,7 @@
font-size: 30rpx;
color: #fff;
}
.btn::after{
.btn::after {
border: 0;
}
\ No newline at end of file
}
... ...