作者 刘晓艳

穿搭小程序

... ... @@ -4,6 +4,14 @@
width: 100%;
height: 120rpx;
}
.no_data{
display: inline-block;
width: 100%;
font-size: 32rpx;
text-align: center;
color: #000;
margin: 50rpx 0;
}
/* 弹窗 */
.mask_box {
width: 100%;
... ...
... ... @@ -7,11 +7,13 @@ Page({
data: {
},
goIndex(){
wx.redirectTo({
wx.switchTab({
url: '/pages/index/index',
})
},
/**
* 生命周期函数--监听页面加载
*/
... ...
... ... @@ -43,6 +43,11 @@ Page({
wx.navigateBack({
delta: 1
})
}else{
wx.showToast({
title: '举报内容不能为空',
icon:'none'
})
}
})
},
... ... @@ -67,6 +72,11 @@ Page({
wx.navigateBack({
delta: 1
})
} else {
wx.showToast({
title: '评论不能为空',
icon: 'none'
})
}
})
},
... ...
... ... @@ -20,16 +20,23 @@ Page({
showPoster(e) {
var id = e.currentTarget.dataset.id
var that = this
var list = that.data.list
list.showMore = false
wx.hideTabBar({})
wx.showToast({
title: '加载中',
icon: 'loading'
icon: 'loading',
// success: (res) => {
// setTimeout((res) => {
// }, 2000)
// },
})
// setTimeout(function() {
that.setData({
poster_state: true
poster_state: true,
more_state: false
})
// }, 2000)
this.getPoster(id)
},
... ... @@ -40,12 +47,12 @@ Page({
}
this.setData({
poster_state: false,
list: list
// list: list,
more_state: false
})
wx.showTabBar({})
},
getPoster(id) {
let that = this;
let url = '/home/index/fashionShare';
... ... @@ -68,7 +75,6 @@ Page({
})
},
showMore() {
this.setData({
more_state: !(this.data.more_state)
... ... @@ -121,7 +127,6 @@ Page({
}).catch((errMsg) => {})
},
submitComment(e) {
var id = e.currentTarget.dataset.id
let url = '/home/index/tablePost'
... ... @@ -144,7 +149,6 @@ Page({
},
//点击关注
attention(e) {
var status = ''
... ... @@ -183,8 +187,6 @@ Page({
})
},
//点赞
likeCharge(e) {
var id = e.currentTarget.dataset.id
... ... @@ -220,6 +222,41 @@ Page({
})
},
//收藏,取消收藏
collectInfo(e) {
var id = e.currentTarget.dataset.id
var list = this.data.list
var status = ''
if (list.user_collect == 1) {
list.user_collect = 0
status = 2
} else {
list.user_collect = 1
status = 1
}
this.setData({
list: list
})
this.collect(id, status)
},
collect(id, status) {
let url = '/home/index/collect'
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) => {
console.log(res)
if (res.data.code == 20000) {
this.getData()
}
})
},
showMore(e) {
var index = e.currentTarget.dataset.index
... ...
... ... @@ -23,10 +23,12 @@
<view class='list_content'>{{list.title}}</view>
<view class='list_img_box'>
<block wx:for='{{list.img}}' wx:for-item='items' wx:key=''>
<image src='{{items}}'></image>
<image src='{{items.img}}'></image>
</block>
</view>
<view class='list_content'>{{list.text}}</view>
<view class='list_content'>
<text wx:for='{{list.styles}}' wx:key=''>#{{item}}</text>
</view>
</view>
<view class='list_state_box'>
<view class='time'>{{list.open_time}}</view>
... ... @@ -47,7 +49,7 @@
</view>
<view class='more_box'>
<text class='iconfont icon-gengduo' catchtap='showMore'></text>
<view class='more_label_box' wx:if='{{list.more_state}}'>
<view class='more_label_box' wx:if='{{more_state}}'>
<view class='more_item' catchtap='showPoster' data-id="{{list.id}}">
<text class='iconfont icon-haibao more'></text>
<text>生成分享海报</text>
... ...
... ... @@ -245,7 +245,7 @@ page {
.user_name {
font-size: 30rpx;
color: #000;
width: 40%;
/* width: 40%; */
}
.collect_box {
... ... @@ -289,7 +289,9 @@ page {
color: #1a1a1a;
margin-top: 10rpx;
}
.list_content text{
margin-right: 10rpx;
}
.list_img_box {
margin-top: 30rpx;
}
... ... @@ -360,12 +362,13 @@ page {
display: inline-block;
position: absolute;
right: 0;
bottom: -205rpx;
bottom: -185rpx;
width: 250rpx;
background: #fff;
box-shadow: 0 8rpx 30rpx 0 #e5e5e5;
color: #000;
padding: 30rpx 0;
z-index: 100;
}
.more {
... ... @@ -380,7 +383,7 @@ page {
width: 100%;
height: 3rpx;
background: #ebebeb;
margin: 30rpx 0;
margin: 20rpx 0;
}
.pinglun2, .xin2 {
... ...
... ... @@ -8,8 +8,9 @@ Page({
data: {
status: '',
list: [],
mask_state:false,
id:0,
mask_state: false,
id: 0,
page: 1
},
goUserInfo(e) {
... ... @@ -23,8 +24,8 @@ Page({
let url = '/home/index/checkFans'
let params = {
status: this.data.status,
open_user_id:this.data.id,
page:1
open_user_id: this.data.id,
page: this.data.page
}
let header = {
"XX-Token": wx.getStorageSync('token'),
... ... @@ -41,38 +42,19 @@ Page({
})
},
//关注接口
// 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,
// 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()
// }
// })
// },
showMask(e) {
var id = e.currentTarget.dataset.id
var status = e.currentTarget.dataset.status
var host = status
wx.setStorageSync('id', id)
wx.setStorageSync('status', status)
this.setData({
mask_state: true,
// id: id,
// status: status
})
if (host != 1) {
this.setData({
mask_state: true,
})
} else {
this.attentionInfo()
}
},
cancleMask() {
... ... @@ -80,14 +62,15 @@ Page({
mask_state: false
})
},
attentionInfo() {
var id = wx.getStorageSync('id')
var status = parseInt(wx.getStorageSync('status'))
var that = this
let url = '/home/index/host';
let param = {
open_user_id:id,
status:status ,
open_user_id: id,
status: status,
}
let header = {
'XX-Token': wx.getStorageSync('token'),
... ... @@ -95,6 +78,11 @@ Page({
}
app.post(url, param, header).then((res) => {
if (res.data.code == 20000) {
// // status == 1 ? status = 1 : status = 2
// console.log(status)
// that.setData({
// status: status
// })
that.getData()
}
})
... ... @@ -108,12 +96,12 @@ Page({
status: options.status ? options.status : '',
id: options.id ? options.id : 0
})
this.getData()
if (options.status == 1) {
wx.setNavigationBarTitle({
title: '关注',
})
}
this.getData()
},
/**
... ...
... ... @@ -10,8 +10,8 @@
</view>
</view>
</view>
<view class="list_label list_active" catchtap='showMask' data-id='{{item.id}}' data-status='1' wx:if='{{status==2}}'>添加关注</view>
<view class="list_label" catchtap='showMask' data-id='{{item.id}}' data-status='2' wx:if='{{status==1}}'>取消关注</view>
<view class="list_label" catchtap='showMask' data-id='{{item.id}}' data-status='1' wx:if='{{status==2}}'>添加关注</view>
<view class="list_label list_active" catchtap='showMask' data-id='{{item.id}}' data-status='2' wx:if='{{status==1}}'>取消关注</view>
</view>
</view>
... ...
... ... @@ -50,6 +50,7 @@
align-items: center;
justify-content: center;
}
.list_active{
background: #F7F7F7;
color: #3568CC;
... ...
... ... @@ -14,7 +14,7 @@ Page({
style_array: ['时尚', '学院', '欧美风'],
style_index: -1,
height_array: [
'150cm-153cm', '153cm-156cm', '156cm-159cm', '159cm-162cm', '162cm-165cm', '165cm-168cm', '168cm-171cm', '171cm-174cm', '174cm-177cm', '174cm-177cm', '177cm-180cm', '180cm-183cm', '183cm-186cm', '186cm-189cm', '192cm-195cm', '195cm-198cm',
'150cm-153cm', '153cm-156cm', '156cm-159cm', '159cm-162cm', '162cm-165cm', '165cm-168cm', '168cm-171cm', '171cm-174cm', '174cm-177cm', '177cm-180cm', '180cm-183cm', '183cm-186cm', '186cm-190cm',
],
height_index: -1,
weight_array: [
... ... @@ -27,7 +27,6 @@ Page({
stature: '',
weight: '',
status: 0,
order: 1,
poster_list: [],
img_state: false,
... ... @@ -37,12 +36,8 @@ Page({
list: [],
list2: [],
last_page: '',
// 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: ''
state: true,
tempHeight: ''
},
saveImg(e) {
... ... @@ -108,39 +103,56 @@ Page({
return false
} else {
this.setData({
order: current
order: current,
page: 1,
list: []
})
}
this.getData()
},
//点击关注
attention(e) {
var status = this.data.status
showMask(e) {
var index = e.currentTarget.dataset.index
var id = e.currentTarget.dataset.id
var list = this.data.list
var status = this.data.status
var host = e.currentTarget.dataset.host
if (list[index].user_host == 1) {
list[index].user_host = 0
status = 2
} else {
list[index].user_host = 1
status = 1
}
this.attentionInfo(id, status)
this.setData({
status: status,
list: list
})
wx.setStorageSync('id', id)
wx.setStorageSync('status', status)
wx.setStorageSync('index', index)
if (host == 1) {
this.setData({
mask_state: true,
})
} else {
this.attentionInfo()
}
},
cancleMask() {
this.setData({
mask_state: false
})
},
//关注接口
attentionInfo(id, status) {
let that = this;
attentionInfo() {
var id = wx.getStorageSync('id')
var status = parseInt(wx.getStorageSync('status'))
var list = this.data.list
var index = wx.getStorageSync('index')
var that = this
let url = '/home/index/host';
let param = {
open_user_id: id,
status: status
status: status,
}
let header = {
'XX-Token': wx.getStorageSync('token'),
... ... @@ -148,16 +160,27 @@ Page({
}
app.post(url, param, header).then((res) => {
if (res.data.code == 20000) {
this.getData()
status == 1 ? list[index].user_host = 1 : list[index].user_host = 2
console.log(status)
that.setData({
status: status,
list: list
})
that.setData({
list: [],
page: 1,
})
that.getData()
}
})
},
//点赞
likeCharge(e) {
var that = this
var id = e.currentTarget.dataset.id
var index = e.currentTarget.dataset.index
var list = this.data.list
var list = that.data.list
var status = ''
if (list[index].user_support == 1) {
list[index].user_support = 0
... ... @@ -166,14 +189,14 @@ Page({
list[index].user_support = 1
status = 1
}
this.setData({
that.setData({
list: list
})
this.like(id, status)
// this.getData()
that.like(id, status)
},
like(id, status) {
var that = this
let url = '/home/index/support'
let params = {
list_id: id,
... ... @@ -185,7 +208,12 @@ Page({
}
app.post(url, params, header).then((res) => {
if (res.data.code == 20000) {
this.getData()
var page = parseInt(this.data.page)-1
that.setData({
list: [],
page: page,
})
that.getData()
}
})
},
... ... @@ -222,6 +250,10 @@ Page({
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
this.setData({
list: [],
page: 1,
})
this.getData()
}
})
... ... @@ -234,13 +266,7 @@ Page({
wx.navigateTo({
url: '/pages/index/comment/comment?id=' + id + '&type=' + type,
})
},
//事件处理函数
bindViewTap: function() {
wx.navigateTo({
url: '../logs/logs'
})
},
showClassify() {
... ... @@ -248,6 +274,21 @@ Page({
classify_state: !(this.data.classify_state)
})
},
cancleClassify() {
this.setData({
classify_state: false
})
},
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),
list: list
})
},
showPoster(e) {
var id = e.currentTarget.dataset.id
... ... @@ -257,11 +298,9 @@ Page({
title: '加载中',
icon: 'loading'
})
// setTimeout(function() {
that.setData({
poster_state: true
})
// }, 2000)
this.getPoster(id)
},
... ... @@ -277,7 +316,6 @@ Page({
wx.showTabBar({})
},
getPoster(id) {
let that = this;
let url = '/home/index/fashionShare';
... ... @@ -292,27 +330,30 @@ Page({
console.log(res)
if (res.data.code == 20000) {
this.setData({
that.setData({
poster: res.data.data.url,
})
}
})
},
that.setData({
state: true
})
} else if (res.data.code == 30001) {
wx.showToast({
title: '上传图片才可生成海报',
icon: 'none'
})
setTimeout(function() {
that.setData({
poster_state: false
})
wx.showTabBar({
cancleClassify() {
this.setData({
classify_state: false
})
},
})
}, 2000)
that.setData({
state: false
})
}
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),
list: list
})
},
... ... @@ -338,9 +379,16 @@ Page({
},
releaseInfo() {
wx.navigateTo({
url: '/pages/index/release/release',
})
if (this.data.tempHeight == '') {
wx.showToast({
title: '请去完善身份信息',
icon: 'none'
})
} else {
wx.navigateTo({
url: '/pages/index/release/release',
})
}
},
//设置查询的关键词
... ... @@ -442,22 +490,14 @@ Page({
console.log('data', res)
if (res.data.code == 20000) {
var list = this.data.list
console.log(list, '33')
console.log(list.concat(res.data.data.list))
// list2.concat(res.data.data.list)
// var list = list2
// for (var i = 0; i < list.length; i++) {
// list[i].more_state = false
// }
if (res.data.data.list != '') {
console.log(that.data.list2)
that.setData({
list: list.concat(res.data.data.list),
last_page: res.data.data.last_page,
})
console.log('list', that.data.list)
} else if (this.data.page > res.data.data.last_page) {
wx.showToast({
title: '没有更多数据了',
... ... @@ -477,107 +517,43 @@ Page({
}).catch((errMsg) => {})
},
//画图
drawCanvas: function() {
console.log(this.data.cardPath, 'aa')
this.setData({
cardPath: this.data.cardPath,
headPath: this.data.headPath,
sendName: this.data.sendName
});
let ctx = wx.createCanvasContext('myCanvas');
let ctxW = this.data.windowWidth;
let ctxH = 1210;
// 默认像素比
let pixelRatio = this.data.pixelRatio;
// 垂直渐变
const grd = ctx.createLinearGradient(0, 0, 0, ctxH);
grd.addColorStop(0, '#ffffff');
grd.addColorStop(1, '#ffffff');
ctx.setFillStyle(grd);
ctx.fillRect(0, 0, ctxW, ctxH);
wx.getImageInfo({
src: this.data.cardPath,
success: (res) => {
console.log('canvas', res)
ctx.drawImage(res.path, 15, 15, 345, 470); //card
wx.getImageInfo({
src: this.data.headPath,
success: (res) => {
/**/
ctx.arc(46, 358, 25, 0, 2 * Math.PI)
ctx.fill()
ctx.save();
ctx.beginPath(); //开始绘制
ctx.clip(); //剪切
ctx.drawImage(res.path, 23, 333, 50, 50); //userHeader // 推进去图片必须是https
ctx.restore(); //恢复之前保存的绘图上下文 继续绘制
/**/
ctx.setTextAlign('left');
ctx.setTextBaseline('middle');
ctx.setFontSize(16);
ctx.setFillStyle('#fff');
this.fontLineFeed(ctx, this.data.sendName, 450, 30, 79, 328);
ctx.stroke();
ctx.draw();
}
})
}
})
},
// 保存图片
saveImage: function(e) {
wx.canvasToTempFilePath({
canvasId: 'myCanvas',
success: function(res) {
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success(result) {
wx.showToast({
title: '图片保存成功',
icon: 'success',
duration: 2000
})
}
getUserInfo() {
let url = '/home/index/userLook'
let params = {}
let header = {
"XX-Token": wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log('userinfo', res)
if (res.data.code == 20000) {
this.setData({
// avatar: res.data.data.avatar,
// birthday: birthday,
// constellation: res.data.data.constellation,
// sex_index: sex_index,
// signature: res.data.data.signature,
tempHeight: res.data.data.stature,
// user_name: res.data.data.user_nickname,
// weight: res.data.data.weight,
})
}
})
},
// 文字换行
fontLineFeed: function(ctx, str, splitLen, strHeight, x, y) {
let strArr = [];
for (let i = 0, len = str.length / splitLen; i < len; i++) {
strArr.push(str.substring(i * splitLen, i * splitLen + splitLen));
}
let s = 0;
for (let j = 0, len = strArr.length; j < len; j++) {
s = s + strHeight;
ctx.fillText(strArr[j], x, y + s);
}
})
},
onLoad: function() {
this.getData()
// this.getData()
this.getStyle()
var that = this;
wx: wx.getSystemInfo({
success: function(res) {
that.setData({
pixelRatio: res.pixelRatio,
windowWidth: res.windowWidth,
windowHeight: res.windowHeight
})
}
})
that.drawCanvas();
this.getUserInfo()
},
onShow() {
// this.getData()
this.setData({
list: [],
page: 1
})
this.getData()
},
onReachBottom: function() {
... ...
... ... @@ -11,8 +11,8 @@
<view class='iconfont icon-search' bindtap='goSearch'></view>
<view class='iconfont icon-search icon-shaixuan' bindtap='showClassify'></view>
</view>
</view>
<!-- 内容项 -->
</view>
<!-- 内容项 -->
<view class='content_box'>
<view class='content_item' wx:for='{{list}}' wx:for-index='mindex' wx:key>
<view class='left_box'>
... ... @@ -24,7 +24,7 @@
<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}}'>
<view class="collect_box {{item.user_host==1?'active':''}}" catchtap='showMask' data-index="{{mindex}}" data-id='{{item.open_user_id}}' data-host='{{item.user_host}}'>
<text class="collect_word">{{item.user_host==1?'取消关注':'关注TA'}}</text>
</view>
</view>
... ... @@ -38,7 +38,7 @@
</view>
<view class='list_content'>
<!-- {{item.text}} -->
<text wx:for='{{item.styles}}' wx:for-item='its' wx:key>{{its}}</text>
<text wx:for='{{item.styles}}' wx:for-item='its' wx:key>#{{its}}</text>
</view>
</view>
<view class='list_state_box'>
... ... @@ -78,7 +78,7 @@
</view>
</view>
<view class='iconfont icon-jia' bindtap='releaseInfo'></view>
<view class='mask_box2' wx:if='{{poster_state}}'>
<view class="mask_box2 {{!state?'mask3':''}}" wx:if='{{poster_state}}'>
<!-- <view class="canvasBox"> -->
<!-- <canvas canvas-id='myCanvas' style=''></canvas> -->
<!-- </view> -->
... ... @@ -101,8 +101,8 @@
<view class='popup_img'>
<image src='{{poster}}'></image>
</view>
<view class='popup_icon_box'>
<view class='popup_btn_box' bindtap='saveImg' data-src='{{poster}}'>
<view class='popup_icon_box' wx:if='{{state}}'>
<view class='popup_btn_box2' bindtap='saveImg' data-src='{{poster}}'>
<view class='popup_btn2'>保存图片</view>
</view>
<!-- <image src='/images/chuanda_quan_90@2x.png'></image> -->
... ... @@ -110,7 +110,7 @@
</view>
</view>
</view>
<view class='iconfont icon-quxiao' bindtap='canclePopup'></view>
<view class='iconfont icon-quxiao' bindtap='canclePopup' wx:if='{{state}}'></view>
</view>
</view>
... ... @@ -159,4 +159,15 @@
<image src='{{imgUrl}}'></image>
<text>{{img_text}}</text>
</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='attentionInfo'>确定</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -13,28 +13,37 @@ page {
.mask_box2 {
position: relative;
}
.mask{
.mask3 {
background: #fff !important;
}
.mask {
background: rgba(0, 0, 0, 0.8);
font-size: 32rpx;
color: #FFFFFF;
color: #fff;
flex-wrap: wrap;
}
.img_box{
.img_box {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.img_box image{
.img_box image {
margin: 0 auto;
}
.mask text{
.mask text {
display: inline-block;
width: 100%;
margin-top: 30rpx;
text-align: center;
}
.btn {
width: 400rpx;
height: 80rpx;
... ... @@ -329,9 +338,11 @@ page {
color: #1a1a1a;
margin-top: 10rpx;
}
.list_content text{
.list_content text {
margin-right: 10rpx;
}
.list_img_box {
display: flex;
flex-wrap: wrap;
... ... @@ -382,7 +393,7 @@ page {
border-bottom: 1rpx solid #fff;
padding: 10rpx 17rpx;
}
.more_box {
position: relative;
}
... ... @@ -505,7 +516,7 @@ page {
height: 156rpx;
}
.popup_btn_box {
.popup_btn_box2 {
width: 200rpx;
height: 72rpx;
background: rgba(255, 255, 255, 1);
... ... @@ -549,13 +560,15 @@ page {
right: 0;
z-index: 100;
}
.popup_img{
.popup_img {
width: 100%;
height:1026rpx;
height: 1026rpx;
border-radius: 16rpx;
overflow: hidden;
}
.popup_img image{
.popup_img image {
width: 100%;
height: 100%;
}
... ... @@ -588,7 +601,7 @@ page {
position: fixed;
top: 90rpx;
right: 0rpx;
z-index:900;
z-index: 900;
}
.classify_item {
... ... @@ -605,11 +618,15 @@ page {
width: 83%;
display: flex;
align-items: center;
justify-content: flex-end;
/* border: 1rpx solid red; */
}
.chassify_picker input {
width: 140%;
/* width: 140%; */
text-align: right;
/* border: 1rpx solid black; */
}
.classify_btn_box {
... ...
... ... @@ -13,9 +13,9 @@ Page({
sex_index: -1,
birthday: '',
constellation_array: ['白羊座', '金牛座', '双子座', '巨蟹座', '狮子座', '处女座', '天秤座', '天蝎座', '射手座', '摩羯座', '水瓶座', '双鱼座'],
index:-1,
current_num:0,
max:30,
index: -1,
current_num: 0,
max: 30,
},
getText(e) {
... ... @@ -38,7 +38,7 @@ Page({
})
},
setInfo(e){
setInfo(e) {
this.setData({
index: e.detail.value,
constellation: this.data.constellation_array[e.detail.value]
... ... @@ -85,7 +85,6 @@ Page({
file: tempFilePaths[0]
},
success: function(res) {
console.log(res)
var data = JSON.parse(res.data)
var avatar = data.data.url;
that.setData({
... ... @@ -105,14 +104,17 @@ Page({
'XX-Device-Type': 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
var sex = res.data.data.sex
var sex_index = this.data.sex_index
sex_index = sex - 1
var birthday = res.data.data.birthday
if (birthday == '1970-01-01') {
birthday = ''
}
this.setData({
avatar: res.data.data.avatar,
birthday: res.data.data.birthday,
birthday: birthday,
constellation: res.data.data.constellation,
sex_index: sex_index,
signature: res.data.data.signature,
... ... @@ -126,40 +128,81 @@ 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){
var sex_index = parseInt(this.data.sex_index) + 1
var avatar = this.data.avatar
var user_nickname = e.detail.value.user_name
var sex = sex_index
var birthday = this.data.birthday
var constellation = this.data.constellation
var weight = e.detail.value.weight
var stature = e.detail.value.stature
var signature = this.data.signature
var warn = ''
var flag = true
// if (avatar == "") {
// warn = "请上传头像";
// } else if (user_nickname == '') {
// warn = "请填写姓名";
// } else
// else if(birthday == '') {
// warn = "请选择出生日期"
// } else if (constellation == '') {
// warn = "请选择星座";
// }
// else if(signature == '') {
// warn = "请输入个性签名"
// }
if (sex_index == 0) {
warn = '请选择性别'
} else if (stature == '') {
warn = "请填写身高"
} else if (weight == '') {
warn = '请填写体重'
} else {
flag = false; //若必要信息都填写,则不用弹框.正常调用接口
let that = this;
let url = '/home/index/userUpdate';
let param = {
avatar: avatar,
user_nickname: user_nickname,
sex: sex_index,
birthday: birthday,
constellation: constellation,
weight: weight,
stature: stature,
signature: 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(){
setTimeout(function() {
wx.navigateBack({
dalta:1
dalta: 1
})
},1500)
}else{
}, 1500)
} else {
wx.showToast({
title: res.data.msg,
icon:'none'
icon: 'none'
})
}
})
})
}
if (flag == true) {
wx.showToast({
title: warn,
icon: 'none',
duration: 2000
})
}
},
/**
... ...
... ... @@ -16,7 +16,7 @@
</view>
<!-- bindtap='showMask' -->
<view class='list_input'>
<input type='number' placeholder='请输入' name='user_name' value='{{user_name}}' bindinput='getName'></input>
<input type='text' placeholder='请输入' name='user_name' value='{{user_name}}' bindinput='getName'></input>
<view class='iconfont icon-fanhui'></view>
</view>
</view>
... ... @@ -51,7 +51,7 @@
</view>
<view class='list_input'>
<picker range='{{constellation_array}}' value='{{index}}' bindchange='setInfo'>
<input type='text' placeholder='未选择' name='constellation' value='{{constellation}}' disabled='true'></input>
<input type='text' placeholder='未选择' name='constellation' value="{{constellation!='null'?constellation:''}}" disabled='true'></input>
</picker>
<view class='iconfont icon-fanhui'></view>
</view>
... ... @@ -81,7 +81,7 @@
<text>个性签名</text>
</view>
<view class='list_textarea'>
<textarea placeholder='记录此刻的心情' maxlength='{{max}}' value='{{signature}}' bindinput='getText'>
<textarea placeholder='记录此刻的心情' maxlength='{{max}}' value='{{signature}}' bindinput='getText' maxlength='{{max}}'>
<text class='words_num'>{{current_num}}/{{max}}</text>
</textarea>
</view>
... ...
... ... @@ -16,12 +16,18 @@ Page({
var id = e.currentTarget.dataset.id
var look_type = e.currentTarget.dataset.look_type
var look = e.currentTarget.dataset.look
wx.navigateTo({
url: '/pages/my/userInfo/userInfo?id=' + id + '&look_type=' + look_type + '&look=' + look,
})
},
goDetail(e){
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/index/detail/detail?id=' + id,
})
},
readState(e) {
var status = e.currentTarget.dataset.status
this.setData({
... ... @@ -81,7 +87,7 @@ Page({
*/
onLoad: function(options) {
this.getData()
this.getData2()
// this.getData2()
},
/**
... ...
... ... @@ -6,7 +6,7 @@
</view>
<view class='content_box'>
<block wx:if='{{status==1||status==2}}'>
<view class='item_list' wx:for='{{list1.data}}' wx:key>
<view class='item_list' wx:for='{{list1}}' wx:key>
<view class='list_left'>
<image class='head_img' src='{{item.avatar}}' catchtap='goCenter' data-id='{{item.news_user_id}}' data-look_type='{{status}}' data-look="{{item.news_id}}"></image>
<view>
... ... @@ -14,7 +14,7 @@
<view>
<text wx:if='{{status==1}}'>评论了你的</text>
<text wx:elif='{{status==2}}'>点赞了你的</text>
<text class='list_hint '>{{item.title}}</text>
<text class='list_hint' catchtap='goDetail' data-id='{{item.list_id}}' >{{item.title}}</text>
</view>
</view>
</view>
... ... @@ -36,15 +36,15 @@
<view class='point '></view>
</view>
</block> -->
<block wx:elif='{{status==3}} '>
<view class='item_list' wx:for='{{list2}}' wx:key>
<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>{{item.user_nickname}}您好,您发布的{{title}}审核</text>
<text class='list_hint2'>未通过</text>
<text class='list_hint2'>{{item.status==1?'通过':'未通过'}}</text>
</view>
<view>原因:{{item.status_text}}</view>
<view wx:if='{{item.status!=1}}'>原因:{{item.status_text}}</view>
<view>{{item.status_time}}</view>
</view>
</view>
... ...
... ... @@ -31,8 +31,11 @@ Page({
imgsUrl: [],
open: 1,
more_info: '公开',
imgInfoNum: 0,
},
setTitle(e) {
var content = e.detail.value;
this.setData({
... ... @@ -61,7 +64,7 @@ Page({
imgInfo: content
})
var len = parseInt(content.length);
if (len > this.data.max) return;
if (len > this.data.max3) return;
this.setData({
imgInfoNum: len //当前字数
});
... ... @@ -205,19 +208,19 @@ Page({
console.log(open_time)
this.setData({
open_time: open_time,
time_info: open_time2
time_info: open_time2 + ' 发送'
})
},
showMask() {
showMask1() {
this.setData({
relsese_state: true
})
},
cancleMask() {
cancleMask1() {
this.setData({
relsese_state: false
relsese_state: false,
})
this.tempTime()
},
... ... @@ -298,10 +301,25 @@ Page({
});
},
showMask(e) {
var index = e.currentTarget.dataset.index
wx.setStorageSync('index', index)
this.setData({
mask_state: true,
// id: id
})
},
cancleMask2() {
this.setData({
mask_state: false
})
},
// 删除图片
deleteImg(e) {
var imgs = this.data.images;
var index = e.currentTarget.dataset.index;
var index = wx.getStorageSync('index');
imgs.splice(index, 1);
this.setData({
images: imgs
... ... @@ -368,6 +386,11 @@ Page({
styles: styles
})
},
cancleMask3() {
this.setData({
box_state: false
})
},
submitInfo() {
this.tempClassify()
... ... @@ -452,18 +475,19 @@ Page({
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,
time_info: res.data.data.open_time + ' 发送',
open_time: res.data.data.open_time,
images: imgsUrl,
classify: classify,
styles: styles
styles: styles,
currentWordNumber: (res.data.data.title).length,
number: (res.data.data.text).length
})
}
})
... ...
<!--pages/release/release.wxml-->
<view class='banner_box'>
<view class='type_box' bindtap="showPicker">
<view>
<input placeholder='标题' value='{{title}}' bindinput='setTitle'></input>
<view>
<view class='type_box' bindtap="showPicker">
<input placeholder='标题' value='{{title}}' bindinput='setTitle' maxlength="{{max}}"></input>
<text class="input_num">{{currentWordNumber|0}}/{{max}}</text>
</view>
<view class='textarea_box'>
<textarea class='textarea' placeholder='同大家分享一下你的穿搭秘籍吧~' maxlength='{{max2}}' value='{{text}}' bindinput='setText'>
<text class="number">{{number|0}}/{{max2}}</text>
</textarea>
</view>
<text class="currentWordNumber">{{currentWordNumber|0}}/{{max}}</text>
</view>
<view class='textarea_box'>
<textarea class='textarea' placeholder='同大家分享一下你的穿搭秘籍吧~' maxlength='{{max2}}' value='{{text}}' bindinput='setText'>
<text class="number">{{number|0}}/{{max2}}</text>
</textarea>
</view>
<view class='upload_box'>
<block wx:for="{{images}}" wx:for-item="image" wx:key="index">
<view class='upload_img'>
<view class='icon_box'>
<view class='iconfont icon-jian' catchtap="deleteImg" data-index="{{index}}"></view>
<view class='iconfont icon-jian' catchtap="showMask" data-index="{{index}}"></view>
<view class="edit_label" catchtap="goEdit" data-index="{{index}}" data-url='{{image.url}}'>编辑</view>
</view>
<image src='{{image.url}}' data-index="{{index}}" mode="aspectFill" bindtap="previewImg"></image>
... ... @@ -26,7 +26,7 @@
</view>
</view>
<view class='hint_box'>
<view class='hint_label' bindtap='showMask'>{{time_info}}</view>
<view class='hint_label' bindtap='showMask1'>{{time_info}}</view>
<view class='hint_label more_box'>
<text catchtap='showMore'>{{more_info}}</text>
<view class='more_label_box' wx:if='{{more_state}}'>
... ... @@ -49,7 +49,6 @@
</view>
</view>
</view>
<view class='content_box'>
<view class='tab_box'>
<scroll-view scroll-x>
... ... @@ -57,12 +56,16 @@
<view class="tab_item {{item.state?'bgc-active':''}}" wx:for='{{classify}}' wx:key='index' data-index="{{index}}" bindtap="setClassify">{{item.name}}</view>
</scroll-view>
</view>
<view class='null_box'></view>
<view class='bottom_box'>
<view class='bottom_btn1' bindtap='submitInfo'>确定</view>
<view class='bottom_btn1' bindtap='submitInfo'>确定发布</view>
</view>
</view>
<view class='mask_box' wx:if='{{relsese_state}}' catchtap='cancleMask'>
<!-- 定时发送 -->
<view class='mask_box' wx:if='{{relsese_state}}' catchtap='cancleMask1'>
<view class='release_box'>
<view class='release_title'>选择发布时间</view>
<view class='release_content_box'>
... ... @@ -83,15 +86,40 @@
</view>
</view>
<!-- 编辑图片信息 -->
<view class='mask_box2' wx:if='{{img_state}}'>
<view class='item_list2'>
<image class='list_img' src='{{url}}'></image>
<view class='list_content_box'>
<textarea class="areas" placeholder='请输入简要描述' minlength="{{min}}" maxlength="{{max3}}" bindinput="setImgText">
<text class="currentWordNumber">{{imgInfoNum|0}}/{{max3}}</text>
<textarea class="areas" placeholder='请输入简要描述' minlength="{{min}}" value='{{imgInfo}}' maxlength="{{max3}}" bindinput="setImgText">
<text class="currentWordNumber">{{imgInfoNum}}/{{max3}}</text>
</textarea>
</view>
</view>
<view class='bottom_btn2' bindtap='goCheck'>确定发布</view>
<view class='bottom_btn2' bindtap='goCheck'>确定</view>
</view>
<!-- 草稿箱 -->
<view class='mask_box' wx:if='{{box_state}}' catchtap='cancleMask3'>
<view class='popup_box'>
<view class='popup_title'>提示</view>
<view>是否保存为草稿?</view>
<view class='popup_btn_box'>
<view class='popup_btn' catchtap='cancleMask3'>取消</view>
<view class='popup_btn' bindtap='confirmInfo'>确定</view>
</view>
</view>
</view>
<!-- 草稿箱 -->
<view class='mask_box' wx:if='{{mask_state}}' catchtap='cancleMask2'>
<view class='popup_box'>
<view class='popup_title'>提示</view>
<view>是否确认删除?</view>
<view class='popup_btn_box'>
<view class='popup_btn' catchtap='cancleMask2'>取消</view>
<view class='popup_btn' bindtap='deleteImg'>确定</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -120,7 +120,7 @@ page {
.tab_item {
display: inline-block;
width: 94rpx;
/* width: 94rpx; */
height: 50rpx;
text-align: center;
line-height: 54rpx;
... ... @@ -129,6 +129,7 @@ page {
border-radius: 25rpx;
background: #f5f5f5;
color: #000;
padding: 0 10rpx;
}
.tab_item:last-child {
... ... @@ -156,10 +157,19 @@ page {
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid #ebebeb;
position: relative;
}
.type_box input {
width: 90%;
font-size: 28rpx;
}
.input_num {
position: absolute;
right: 0;
font-size: 28rpx;
color: #999;
}
.type_info {
... ... @@ -295,14 +305,6 @@ picker-view {
z-index: 10;
}
picker-view-column view {
/*height: 30rpx;*//*line-height: 100rpx;*/
}
.confirm {
/*width: 80%;*//*padding: 0 62rpx;*//*box-sizing: border-box;*//*height: 88rpx;*/
}
.confirm_btn {
width: 600rpx;
height: 88rpx;
... ... @@ -386,6 +388,7 @@ picker-view-column view {
color: #000;
padding: 0 30rpx;
box-sizing: border-box;
z-index: 100;
}
.more {
... ... @@ -543,3 +546,7 @@ picker-view-column view {
justify-content: center;
margin: 350rpx auto 0 auto;
}
.null_box{
width: 100%;
height: 200rpx;
}
\ No newline at end of file
... ...
... ... @@ -14,12 +14,45 @@ Page({
keyword: '',
label_list: ''
},
//点击搜索历史
clickHistory(e) {
var keyword = e.currentTarget.dataset.keyword
this.setData({
keyword: keyword
})
this.goSearch()
},
getSearch(e) {
this.setData({
keyword: e.detail.value
})
},
//清空输入框
clearInput() {
this.setData({
keyword: '',
page: 1
})
},
clearHistory() {
let url = '/home/index/historyDelete'
let params = {}
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({
label_list: ''
})
}
})
},
goSearch(e) {
let that = this;
let url = '/home/index/index';
... ... @@ -38,11 +71,15 @@ Page({
}
app.post(url, param, header).then((res) => {
if (res.data.code == 20000) {
var list = res.data.data.list
if (list != '') {
var list = this.data.list
if (res.data.data.list != '') {
that.setData({
list: list,
page: res.data.data.page,
list: list.concat(res.data.data.list),
})
} else if (this.data.page > res.data.data.last_page) {
wx.showToast({
title: '没有更多数据了',
icon: 'none'
})
} else {
wx.showToast({
... ... @@ -50,38 +87,157 @@ Page({
icon: 'none'
})
that.setData({
list: list,
page: res.data.data.page,
list: list.concat(res.data.data.list),
})
}
}
}).catch((errMsg) => {})
},
previewImg(e) {
const current = e.currentTarget.dataset.index;
var imgs = this.data.imgs;
wx.previewImage({
current: imgs[current],
urls: imgs
goDetail(e) {
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/index/detail/detail?id=' + id,
})
},
viewImg(e) {
var mindex = e.currentTarget.dataset.mindex
var sindex = e.currentTarget.dataset.sindex
var list = this.data.list
var imgs = list[mindex].img
var current = e.currentTarget.dataset.src
// console.log(imgs)
this.setData({
imgUrl: current,
img_text: e.currentTarget.dataset.text,
img_state: true
})
wx.hideTabBar({})
},
cancle_img() {
this.setData({
img_state: false
})
wx.showTabBar({})
},
showMask(e) {
var index = e.currentTarget.dataset.index
var id = e.currentTarget.dataset.id
var list = this.data.list
var status = this.data.status
if (list[index].user_host == 1) {
status = 2
} else {
status = 1
}
this.setData({
status: status,
})
wx.setStorageSync('id', id)
wx.setStorageSync('status', status)
wx.setStorageSync('index', index)
this.setData({
mask_state: true,
})
},
showMore() {
cancleMask() {
this.setData({
more_state: !(this.data.more_state)
mask_state: false
})
},
complain() {
wx.navigateTo({
url: '/pages/index/comment/comment',
attentionInfo() {
var id = wx.getStorageSync('id')
var status = parseInt(wx.getStorageSync('status'))
var list = this.data.list
var index = wx.getStorageSync('index')
var 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) {
status == 1 ? list[index].user_host = 1 : list[index].user_host = 2
console.log(status)
that.setData({
status: status,
list: list
})
that.goSearch()
}
})
},
//点赞
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)
},
getData() {
let url = '/home/index/history'
let params = {}
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.goSearch()
}
})
},
//收藏,取消收藏
collectInfo(e) {
var id = e.currentTarget.dataset.id
var index = e.currentTarget.dataset.index
var list = this.data.list
var status = ''
if (list[index].user_collect == 1) {
list[index].user_collect = 0
status = 2
} else {
list[index].user_collect = 1
status = 1
}
this.setData({
list: list
})
this.collect(id, status)
},
collect(id, status) {
let url = '/home/index/collect'
let params = {
list_id: id,
status: status
}
let header = {
"XX-Token": wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
... ... @@ -89,16 +245,93 @@ Page({
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
this.goSearch()
}
})
},
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),
list: list
})
},
showPoster(e) {
var id = e.currentTarget.dataset.id
var that = this
wx.hideTabBar({})
wx.showToast({
title: '加载中',
icon: 'loading'
})
that.setData({
poster_state: true
})
this.getPoster(id)
},
canclePopup() {
var list = this.data.list
for (var i = 0; i < list.length; i++) {
list[i].more_state = false
}
this.setData({
poster_state: false,
list: list
})
},
getPoster(id) {
let that = this;
let url = '/home/index/fashionShare';
let param = {
list_id: id
}
let header = {
'XX-Token': wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
}
app.post(url, param, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
this.setData({
label_list: res.data.data.list
poster: res.data.data.url,
})
// if(this.data.poster==''){
// wx.showToast({
// title: '上传图片才可生成海报',
// })
// }
}
})
},
clearHistory() {
let url = '/home/index/historyDelete'
//评论
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,
})
},
complain(e) {
var id = e.currentTarget.dataset.id
var type = e.currentTarget.dataset.type
wx.navigateTo({
url: '/pages/index/comment/comment?id=' + id + '&type=' + type,
})
},
getData() {
let url = '/home/index/history'
let params = {}
let header = {
"XX-Token": wx.getStorageSync('token'),
... ... @@ -108,19 +341,16 @@ Page({
console.log(res)
if (res.data.code == 20000) {
this.setData({
label_list: ''
label_list: (res.data.data.list).splice(0,9)
})
}
})
},
//清空输入框
clearInput() {
this.setData({
keyword: ''
})
},
/**
... ... @@ -169,7 +399,8 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
this.data.page++
this.goSearch()
},
/**
... ...
... ... @@ -19,13 +19,13 @@
</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 wx:for="{{label_list}}" wx:key="index" bindtap="clickHistory" data-index="{{index}}" data-keyword='{{item}}'>{{item}}</view>
</view>
</view>
<!--文章内容-->
<view class='content_box' wx:if="{{list.length > 0}}">
<view class='content_item' wx:for='{{list}}' wx:for-index='mindex' wx:key>
<view class='content_item' wx:for='{{list}}' wx:for-index='mindex' wx:key bindtap='goDetail' data-id='{{item.id}}'>
<view class='left_box'>
<view class='head_portrait'>
<image src='{{item.avatar}}'></image>
... ... @@ -35,8 +35,8 @@
<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>
<view class="collect_box {{item.user_host==1?'active':''}}" catchtap='showMask' data-index="{{mindex}}" data-id='{{item.open_user_id}}'>
<text class="collect_word">{{item.user_host==1?'取消关注':'关注TA'}}</text>
</view>
</view>
</view>
... ... @@ -85,4 +85,58 @@
</view>
</view>
</view>
</view>
<view class='mask_box2' wx:if='{{poster_state}}'>
<!-- <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>
<view class='popup_content_box'>
<!-- <view class='popup_img2'>
<image src='{{poster_list.img}}'></image>
<view class='circle'></view>
<view class='circle2'></view>
</view> -->
<view class='popup_info_box'>
<!-- <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_box2' bindtap='saveImg' data-src='{{poster}}'>
<view class='popup_btn2'>保存图片</view>
</view>
<!-- <image src='/images/chuanda_quan_90@2x.png'></image> -->
</view>
</view>
</view>
</view>
<view class='iconfont icon-quxiao' bindtap='canclePopup'></view>
</view>
</view>
<view class='mask_box mask' wx:if='{{img_state}}' catchtap='cancle_img'>
<view class='img_box'>
<image src='{{imgUrl}}'></image>
<text>{{img_text}}</text>
</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='attentionInfo'>确定</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/service/renting/search/search.wxss */
/* @import '../renting.wxss'; */
/* @import '../index.wxss'; */
page {
background-color: #f2f2f2;
... ... @@ -348,7 +348,8 @@ page {
height: 42rpx;
line-height: 42rpx;
font-size: 24rpx;
color: #53a6fa;
background: #dcdde0;
color: #fff;
border: 1rpx solid #f7f7f7;
border-radius: 4rpx;
display: flex;
... ... @@ -357,8 +358,8 @@ page {
}
.collect_box.active {
background: #dcdde0;
color: #fff;
background: #f7f7f7;
color: #53a6fa;
}
.star1 {
... ... @@ -412,7 +413,9 @@ page {
.time {
font-size: 26rpx;
}
.zan{
color: #000;
}
.zan, .pinglun1 {
font-size: 28rpx;
margin-right: 10rpx;
... ... @@ -486,18 +489,17 @@ page {
/* 发布弹窗 */
.mask_box {
.mask_box2 {
width: 100%;
height: 100%;
background: #000;
position: fixed;
top: 0;
left: 0;
z-index: 10;
padding: 30rpx;
box-sizing: border-box;
z-index: 200;
}
.icon-quxiao {
font-size: 36rpx;
text-align: center;
... ... @@ -508,25 +510,22 @@ page {
transform: translateX(-50%);
}
.popup_box {
.popup_box2 {
width: 100%;
border-radius: 10rpx;
position: relative;
}
.popup_box image {
.popup_box2 image {
width: 100%;
height: 686rpx;
border-radius: 10rpx;
}
.popup_info_box {
background: #fff;
padding: 30rpx;
box-sizing: border-box;
font-size: 28rpx;
color: #282829;
width: 686rpx;
border-radius: 10rpx;
position: relative;
}
.popup_icon_box {
... ... @@ -535,9 +534,12 @@ page {
justify-content: space-between;
padding: 0 45rpx;
margin-top: 30rpx;
position: absolute;
left: 0;
bottom: 10rpx;
}
.popup_title {
.popup_title2 {
font-size: 34rpx;
color: #000;
font-weight: bold;
... ... @@ -548,7 +550,7 @@ page {
height: 156rpx;
}
.popup_btn_box {
.popup_btn_box2 {
width: 200rpx;
height: 72rpx;
background: rgba(255, 255, 255, 1);
... ... @@ -556,7 +558,7 @@ page {
position: relative;
}
.popup_btn {
.popup_btn2 {
width: 200rpx;
height: 72rpx;
background: rgba(0, 0, 0, 1);
... ... @@ -590,8 +592,53 @@ page {
position: absolute;
bottom: -25rpx;
right: 0;
z-index: 100;
}
.popup_img {
.popup_img{
width: 100%;
height:1026rpx;
border-radius: 16rpx;
overflow: hidden;
}
.popup_img image{
width: 100%;
height: 100%;
}
.popup_img2 {
width: 686rpx;
height: 686rpx;
position: relative;
}
.popup_img2 image {
width: 100%;
height: 100%;
}
/* */
.mask {
background: rgba(0, 0, 0, 0.8);
font-size: 32rpx;
color: #fff;
flex-wrap: wrap;
}
.img_box {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.img_box image {
margin: 20rpx auto;
}
.img_box text {
display: inline-block;
width: 100%;
text-align: center;
}
... ...
... ... @@ -16,11 +16,97 @@ Page({
state2: false,
page: 1,
status: 1,
secret_state: false
},
//点赞
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)
},
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()
}
})
},
//收藏,取消收藏
collectInfo(e) {
var id = e.currentTarget.dataset.id
var index = e.currentTarget.dataset.index
var list = this.data.list
var status = ''
if (list[index].user_collect == 1) {
list[index].user_collect = 0
status = 2
} else {
list[index].user_collect = 1
status = 1
}
this.setData({
list: list
})
this.collect(id, status)
},
collect(id, status) {
let url = '/home/index/collect'
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) => {
console.log(res)
if (res.data.code == 20000) {
this.getData()
}
})
},
goDetail(e) {
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/index/detail/detail?id=' + id,
})
},
complain(e) {
var id = e.currentTarget.dataset.id
var status = e.currentTarget.dataset.status
var list = this.data.list
var index = e.currentTarget.dataset.index
let url = '/home/index/updateFashion'
let params = {
list_id: id,
... ... @@ -31,8 +117,20 @@ Page({
'XX-Device-Type': 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log('sz', res)
if (res.data.code == 20000) {
this.getData()
if (status == 3) {
list[index].secret_state = true
console.log(list)
this.setData({
list: list
})
}
}else{
wx.showToast({
title: '设置失败',
icon:'none'
})
}
})
},
... ... @@ -54,7 +152,6 @@ Page({
var list = this.data.list
list[index].more_state = !(list[index].more_state)
this.setData({
// more_state: !(this.data.more_state),
list: list
})
},
... ... @@ -78,44 +175,43 @@ Page({
})
},
likeCharge(e) {
var id = e.currentTarget.dataset.id
var status = e.currentTarget.dataset.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()
}
})
},
// likeCharge(e) {
// var id = e.currentTarget.dataset.id
// var status = e.currentTarget.dataset.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()
// }
// })
// },
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
}
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()
}
})
},
// 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
// }
// 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) {
... ... @@ -159,7 +255,8 @@ Page({
let params = {
open_user_id: this.data.open_user_id,
look: this.data.look,
look_type: this.data.look_type
look_type: this.data.look_type,
page: this.data.page
}
let header = {
"XX-Token": wx.getStorageSync('token'),
... ... @@ -179,7 +276,7 @@ Page({
}
})
},
getData() {
let url = '/home/index/checkPage'
let params = {
... ... @@ -192,21 +289,37 @@ Page({
'XX-Device-Type': 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
const list = res.data.data.list.map((item, index) => {
if (item.open_time) {
var time = item.open_time.split(' ');
return { ...item,
date: time
}
} else {
return { ...item,
time: item.time
}
}
});
for (var i in list) {
list[i].secret_state = false
}
console.log('list', list)
this.setData({
list: res.data.data.list
list: list
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getData()
this.getData2()
},
/**
... ...
... ... @@ -48,71 +48,84 @@
<view class="iconfont icon-caret-up {{tab_current==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>
<block wx:if='{{list.length==0}}'>
<text class='no_data'>暂无信息</text>
</block>
<block wx:else>
<view class='item_list' wx:key='' wx:for='{{list}}' wx:key bindtap='goDetail' data-id='{{item.list_id}}'>
<block wx:if="{{item.open_time === '昨天' || item.open_time === '今天'||item.open_time === '前天'}}">
<view class='list_title'>{{item.open_time}}</view>
</block>
<block wx:else>
<view class='list_title'>
<view class='year'>{{item.date[0]}}</view>
<view class='month'>{{item.date[1]}}</view>
</view>
<view class='list_content'>
<view class='content'>
<view class='content_info'>{{item.title}}</view>
<view class='list_label'>{{item.style}}</view>
</block>
<view class='content_item_box' data-id='{{item.id}}' bindtap='messageDetail'>
<view class='list_content_box'>
<view class='list_img'>
<image src='{{item.img.img}}' wx:key=''></image>
</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}}' data-status='2' wx:if='{{tab_current!=4&&tab_current!=3}}'>
<text class='iconfont icon-dianzan2 zan' wx:if='{{tab_current!=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='{{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'></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' catchtap='complain' data-id='{{item.list_id}}' data-status='4'>
<text>删除</text>
</view>
<!-- <view class='more_line'></view> -->
<view class='more_item' catchtap='complain' data-id='{{item.list_id}}' data-status='4'>
<text>仅自己可见</text>
</view>
<!-- <view class='more_line'></view> -->
<view class='more_item' catchtap='complain' data-id='{{item.list_id}}' data-status='3'>
<text>粉丝可见</text>
<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 catchtap='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 catchtap='review' data-id='{{item.list_id}}' data-type='review'>
<text class='iconfont icon-pinglun pinglun1'></text>
<text>{{item.table}}</text>
</view>
<view catchtap='collectInfo' data-index="{{index}}" data-id='{{item.list_id}}'>
<text class='iconfont icon-shoucang2 zan' wx:if='{{item.user_collect==1}}'></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}}'>
<view class='more_item' catchtap='collectInfo' data-index="{{index}}" data-id='{{item.list_id}}'>
<text>删除</text>
</view>
</view>
<!-- <view class='more_line'></view> -->
<view class='more_item' catchtap='complain' data-id='{{item.list_id}}' data-status='1'>
<text>全部</text>
</block>
<block wx:else>
<view class='more_label_box' wx:if='{{item.more_state}}'>
<view class='more_item' catchtap='complain' data-id='{{item.list_id}}' data-index='{{index}}' data-status='4'>
<text>删除</text>
</view>
<!-- <view class='more_line'></view> -->
<view class='more_item' catchtap='complain' data-id='{{item.list_id}}' data-index='{{index}}' data-status='3'>
<text>仅自己可见</text>
</view>
<!-- <view class='more_line'></view> -->
<view class='more_item' catchtap='complain' data-id='{{item.list_id}}' data-index='{{index}}' data-status='2'>
<text>粉丝可见</text>
</view>
<!-- <view class='more_line'></view> -->
<view class='more_item' catchtap='complain' data-id='{{item.list_id}}' data-index='{{index}}' data-status='1'>
<text>公开</text>
</view>
</view>
</view>
</block>
</block>
</view>
<text class='iconfont icon-suo' wx:if='{{item.secret_state}}'></text>
</view>
<text class='iconfont icon-suo' wx:if='{{tab_current==1}}' catchtap='showMore' data-index='{{index}}'></text>
</view>
</view>
</view>
</view>
</view>
</view>
</block>
</view>
... ...
... ... @@ -142,6 +142,8 @@ page {
font-size: 32rpx;
font-weight: bold;
color: #010000;
display: flex;
align-items: center;
}
.date .day {
... ... @@ -151,12 +153,11 @@ page {
}
.month {
/*width: 52%;*/
font-size: 24rpx;
/* font-weight: bold; */
color: #010000;
margin-bottom: -4rpx;
font-weight: bold;
margin-left: 5rpx;
}
.date {
... ...
... ... @@ -11,29 +11,68 @@ Page({
look_type: '',
status: 1,
page: 1,
list:[],
list: [],
},
goDetail(e) {
var id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/index/detail/detail?id=' + id,
})
},
showMask(e) {
this.setData({
mask_state: true,
})
},
cancleMask() {
this.setData({
mask_state: false
})
},
attentionInfo() {
var that = this
var id = that.data.id
var status = that.data.host
status == 1 ? status = 2 : status = 1
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) {
that.getData()
}
})
},
goList(e) {
var status = e.currentTarget.dataset.status
var id = this.data.id
wx.navigateTo({
url: '/pages/index/fans/fans?status=' + status+'&id='+id,
url: '/pages/index/fans/fans?status=' + status + '&id=' + id,
})
},
//点赞
likeCharge(e) {
console.log(e)
var id = e.currentTarget.dataset.id
var index = e.currentTarget.dataset.index
var list = this.data.list
var status = ''
if (list[index].my_support == 1) {
console.log(11)
list[index].my_support = 0
if (list[index].user_support == 1) {
list[index].user_support = 0
status = 2
} else {
console.log(22)
list[index].my_support = 1
list[index].user_support = 1
status = 1
}
this.setData({
... ... @@ -54,17 +93,64 @@ Page({
}
app.post(url, params, header).then((res) => {
if (res.data.code == 20000) {
this.getData()
this.getData2()
}
})
},
//收藏,取消收藏
collectInfo(e) {
console.log(e)
var id = e.currentTarget.dataset.id
var index = e.currentTarget.dataset.index
var list = this.data.list
var status = ''
if (list[index].user_collect == 1) {
list[index].user_collect = 0
status = 2
} else {
list[index].user_collect = 1
status = 1
}
this.setData({
list: list
})
this.collect(id, status)
},
collect(id, status) {
let url = '/home/index/collect'
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) => {
console.log(res)
if (res.data.code == 20000) {
this.getData2()
}
})
},
//评论
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,
})
},
getData() {
let url = '/home/index/userPage'
let params = {
open_user_id: this.data.id,
look: this.data.look,
look_type: this.data.look_type
look_type: this.data.look_type,
page: this.data.page
}
let header = {
"XX-Token": wx.getStorageSync('token'),
... ... @@ -73,12 +159,18 @@ Page({
app.post(url, params, header).then((res) => {
console.log(res)
if (res.data.code == 20000) {
if (this.data.id != '') {
var open_user_id = this.data.id
} else {
var open_user_id = res.data.data.list[0].open_user_id
}
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,
// list: res.data.data.list,
open_user_id: open_user_id ,
signature: res.data.data.signature,
user_nickname: res.data.data.user_nickname
})
... ... @@ -184,6 +276,7 @@ Page({
})
if (options.id != '' && options.id != undefined) {
this.getData()
this.getData2()
}
},
... ...
<view class='banner_box' bindtap='uoloadImg'>
<view class='banner_info info1'>
<view class="list_label1 {{host==1?'list_active1':''}}" bindtap='attentionInfo'>{{host==1?'已关注':'添加关注'}}</view>
<view class="list_label1 {{host==1?'list_active1':''}}" bindtap='showMask'>{{host==1?'取消关注':'添加关注'}}</view>
</view>
<view class='head_img'>
<image class='banner_img' src='{{avatar}}'></image>
... ... @@ -30,51 +30,103 @@
<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>
<block wx:if='{{list.length==0}}'>
<text class='no_data'>暂无信息</text>
</block>
<block wx:else>
<block wx:if='{{status==1}}'>
<view class='item_list' wx:key='' wx:for='{{list}}' wx:key catchtap='goDetail' data-id='{{item.list_id}}'>
<view class='list_title'>{{item.open_time}}</view>
<view class='content_item_box'>
<view class='list_content_box'>
<view class='list_img'>
<image src='{{item.img.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' data-index="{{index}}" data-id='{{item.list_id}}'>
<text class='iconfont icon-shoucang2 zan' wx:if='{{item.user_collect==1}}'></text>
<text class='iconfont icon-shoucang4 pinglun1' wx:else></text>
<text class=''>{{item.collect}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
<view class='list_content'>
<view class='content'>
<view class='content_info'>{{item.title}}</view>
<view class='list_label'>{{item.style}}</view>
</view>
</block>
<block wx:else>
<view class='content_item' wx:for='{{list}}' wx:for-index='mindex' wx:key>
<view class='left_box'>
<view class='head_portrait' bindtap='goUserInfo' data-id='{{item.open_user_id}}'>
<image src='{{item.avatar}}'></image>
</view>
<view class='list_state_box'>
<view class='time'>{{item.open_time}}</view>
</view>
<view class='item_list2'>
<view class='list_head_box'>
<view class='user_name1'>{{item.user_nickname}}</view>
</view>
<view catchtap='goDetail' data-id='{{item.id}}' data-index="{{index}}">
<view class='list_content1'>{{item.title}}</view>
<view class='list_img_box'>
<block wx:for='{{item.img}}' wx:for-item='items' wx:key='' wx:for-index='sindex'>
<image src='{{items.img}}' catchtap='viewImg' data-src='{{items.img}}' data-text='{{items.text}}' data-mindex="{{mindex}}" data-sindex='{{sindex}}'></image>
</block>
</view>
<view class='list_content'>
<!-- {{item.text}} -->
<text wx:for='{{item.styles}}' wx:for-item='its' wx:key>#{{its}}</text>
</view>
</view>
<view class='list_state_box2'>
<view class='time2'>{{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.my_support==1}}"></text>
<view bindtap='likeCharge' data-index="{{mindex}}" 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.list_id}}' data-type='review'>
<view bindtap='review' data-id='{{item.id}}' data-type='review'>
<text class='iconfont icon-pinglun pinglun1'></text>
<text>{{item.table}}</text>
<text>{{item.table_num}}</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> -->
<view catchtap='collectInfo' data-index="{{mindex}}" data-id='{{item.id}}'>
<text class='iconfont icon-shoucang2 zan' wx:if='{{item.user_collect==1}}'></text>
<text class='iconfont icon-shoucang4 pinglun1' wx:else></text>
<text class=''>{{item.collect}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</block>
</block>
</view>
<view class='mask_box' wx:if='{{}}' catchtap='cancleMask'>
<view class='mask_box' wx:if='{{mask_state}}' catchtap='cancleMask'>
<view class='popup_box'>
<view class='popup_title'>取消关注</view>
<view>确认取消关注?</view>
<view class='popup_title'>提示</view>
<view>确认取消关注吗?</view>
<view class='popup_btn_box'>
<view class='popup_btn'>再想想</view>
<view class='popup_btn'>再想想</view>
<view class='popup_btn' catchtap='cancleMask'>取消</view>
<view class='popup_btn' bindtap='attentionInfo'>确定</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -3,6 +3,124 @@
page {
background: #f5f6fa;
}
.content_item {
display: flex;
align-items: flex-start;
margin-bottom: 16rpx;
background: #fff;
}
.content_item:last-child {
border-bottom: 0;
}
.head_portrait {
width: 80rpx;
height: 80rpx;
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20rpx;
}
.head_portrait image {
width: 100%;
height: 100%;
}
.left_box {
position: relative;
}
.item_list2 {
width: 85%;
}
.list_head_box {
display: flex;
align-items: center;
justify-content: space-between;
}
.user_name1 {
font-size: 30rpx;
color: #000;
width: 40%;
}
.collect_box {
width: 102rpx;
height: 42rpx;
line-height: 42rpx;
font-size: 24rpx;
background: #dcdde0;
color: #fff;
border: 1rpx solid #f7f7f7;
border-radius: 4rpx;
display: flex;
align-items: center;
justify-content: center;
}
.collect_box.active {
background: #f7f7f7;
color: #53a6fa;
}
.star1 {
font-size: 20rpx;
margin-right: 6rpx;
color: #000;
}
.star2 {
font-size: 20rpx;
color: #53a6fa;
margin-right: 6rpx;
}
.list_info_box {
font-size: 24rpx;
color: #b3b3b3;
}
.list_content {
width: 80%;
font-size: 30rpx;
color: #1a1a1a;
margin-top: 10rpx;
}
.list_content text {
margin-right: 10rpx;
}
.list_img_box {
display: flex;
flex-wrap: wrap;
align-items: center;
margin-top: 30rpx;
}
.list_img_box image {
width: 150rpx;
height: 150rpx;
margin-left: 9rpx;
margin-bottom: 9rpx;
border-radius: 10rpx;
border: 1rpx solid #e5e5e5;
}
.list_state_box2 {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 26rpx;
color: #999;
margin-top: 30rpx;
}
/* */
.list_label1 {
width: 112rpx;
height: 40rpx;
... ... @@ -212,13 +330,15 @@ page {
margin-bottom: 10rpx;
}
.list_content {
.list_content1 {
width: 65%;
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
font-size: 28rpx;
color: #000;
}
.content_info {
... ... @@ -282,6 +402,11 @@ page {
.time {
font-size: 26rpx;
color: #fff;
}
.time2{
width: 60%;
font-size: 26rpx;
color: #999;
}
.zan{
color: #000;
... ... @@ -311,7 +436,7 @@ page {
background: #f5f5f5;
border-radius: 8rpx;
height: 40rpx;
padding: 0 20rpx;
padding: 0 10rpx;
display: flex;
align-items: center;
justify-content: center;
... ... @@ -397,11 +522,11 @@ page {
.zan, .pinglun1 {
font-size: 28rpx;
margin-right: 10rpx;
margin-left: 52rpx;
margin-left: 32rpx;
}
.pinglun1 {
margin-left: 52rpx;
margin-left: 32rpx;
}
.list_comment_box {
... ...
... ... @@ -23,7 +23,6 @@ Page({
iv: this.data.iv
}
app.post(url, param).then((res) => {
console.log(res)
if (res.data.code == 20000) {
wx.setStorageSync('token', res.data.data.token)
wx.switchTab({
... ... @@ -41,12 +40,10 @@ Page({
let url = '/wxapp/public/loginImg';
let param = {}
app.post(url, param).then((res) => {
// console.log(res, res.data.data.img)
if (res.data.code == 20000) {
that.setData({
imgs:res.data.data.img
})
console.log(this.data.imgs)
}
}).catch((errMsg) => { })
},
... ...
... ... @@ -53,7 +53,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getTopicList()
},
/**
... ...
... ... @@ -7,6 +7,6 @@
</view>
<view class='list_title'>{{item.post_title}}</view>
<view class='list_content'>{{item.post_excerpt}}</view>
<view class='list_time'>{{item.post_source}}·{{item.create_time}}</view>
<view class='list_time'>{{item.post_source}} · {{item.create_time=='0小时'?'1分钟内':item.create_time}}</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -11,21 +11,23 @@
height: 520rpx;
margin-bottom: 40rpx;
}
.label_box{
.label_box {
display: flex;
align-items: center;
}
.list_label {
width: 80rpx;
min-width: 80rpx;
display: inline-block;
height: 36rpx;
background: #8b4e93;
color: #fff;
font-size: 30rpx;
border-radius: 5rpx;
display: flex;
align-items: center;
justify-content: center;
line-height: 36rpx;
text-align: center;
padding: 3rpx 10rpx;
margin-bottom: 30rpx;
margin-right: 10rpx;
}
... ...
... ... @@ -37,7 +37,7 @@
"list": []
},
"miniprogram": {
"current": 2,
"current": 3,
"list": [
{
"id": -1,
... ... @@ -54,11 +54,18 @@
"scene": null
},
{
"id": -1,
"id": 2,
"name": "aa",
"pathName": "pages/my/userInfo/userInfo",
"pathName": "pages/index/search/search",
"query": "id=2",
"scene": null
},
{
"id": 3,
"name": "aa",
"pathName": "pages/my/userInfo/userInfo",
"query": "id=3",
"scene": null
}
]
}
... ...