作者 朱振飞

Merge branch 'master' of http://114.215.101.231:8099/miniprogram/jiuzidian into Branch_zhu

# Conflicts:
#	app.json
#	project.config.json
... ... @@ -46,7 +46,11 @@
"pages/myblock/message/message",
"pages/myblock/feedback/feedback",
"pages/myblock/rule/rule",
"pages/myblock/about/about"
"pages/myblock/about/about",
"pages/findblock/jiudandetail/jiudandetail",
"pages/findblock/meirixinjiu/meirixinjiu",
"pages/findblock/jiulist/jiulist",
"pages/findblock/putongwenzhang/putongwenzhang"
],
"window": {
"backgroundTextStyle": "light",
... ...
... ... @@ -61,7 +61,80 @@ Page({
currentSwiper: e.detail.current
})
},
//跳页
jump(e){
let type=e.currentTarget.dataset.type;
console.log(type)
if(type==1){
wx.navigateTo({
url: '/pages/findblock/jiulist/jiulist?type='+type,
})
}else if(type==2){
wx.navigateTo({
url: '/pages/findblock/zhuanjiapinjiu/zhuanjiapinjiu',
})
} else if (type == 3) {
wx.navigateTo({
url: '/pages/findblock/niangjiushi/niangjiushi',
})
} else if (type == 4){
wx.navigateTo({
url: '/pages/findblock/putongwenzhang/putongwenzhang',
})
}
},
//进入视频
entervideo(e){
let url=e.currentTarget.dataset.url;
wx.navigateTo({
url: '/pages/homeblock/video/video?url='+url,
})
},
//每日新酒发布
everyjiu(){
wx.navigateTo({
url: '/pages/findblock/meirixinjiu/meirixinjiu',
})
},
//点赞和取消点赞
dianzan(e){
let id=e.currentTarget.dataset.id;
let userid=e.currentTarget.dataset.userid;
let winemaker_id = e.currentTarget.dataset.winemaker_id
console.log(winemaker_id)
let type=e.currentTarget.dataset.type;
let chuanid = type == 1 ? userid : type == 2 ? id : type == 3 ? winemaker_id:id
let that = this;
let url = 'index/Common/good', params = {
sort: type,
id: chuanid
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
that.getfindlist()
}).catch((err) => {
})
},
//进入评论页面
ping(e){
let id=e.currentTarget.dataset.id;
let type=e.currentTarget.dataset.type;
let winemaker_id = e.currentTarget.dataset.winemaker_id
wx.navigateTo({
url: '/pages/myblock/pingjia/pingjia?type=' + type + '&id=' + id + '&winemaker_id=' + winemaker_id,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -15,7 +15,7 @@
</view>
<view class="middlehead">
<view class="middlehead" bindtap="everyjiu">
<view class="rilihead">
<view class="rili">
<image src="{{url}}aicon_62x.png"></image>
... ... @@ -33,7 +33,7 @@
</view>
</view>
<view class="dayjiu" bindtap="everyjiu">
<view class="tast" wx:for="{{news}}" wx:key=''>
<view class="tastimg">
<image src="{{item.thumb}}"></image>
... ... @@ -45,12 +45,14 @@
</view>
</view>
</view>
<view class="wineblock" wx:for="{{list}}" wx:key="">
<view class="wineblock" wx:for="{{list}}" wx:key="" bindtap="jump" data-type="{{item.type}}">
<view class="middlehead">
<view class="rilihead">
<view class="rili">
<image src="{{item.icon}}"></image>
<image src="{{item.icon}}" mode="aspectFit"></image>
</view>
<view class="jiudan">
{{item.name}}
... ... @@ -67,26 +69,38 @@
</view>
<view class="winetitle">{{item.article.share_content}}</view>
<view class="wineimg">
<image src="{{url}}aicon_64.png"></image>
<view class="wineimg" wx:if="{{item.type==2}}" data-url="{{item.article.video}}" catchtap='entervideo'>
<image src="{{item.article.video_image}}"></image>
<view class="vioimg">
<image src="{{url}}/aicon_70x.png"></image>
</view>
</view>
<view class="wineimg" wx:else>
<image src="{{item.article.thumb}}"></image>
</view>
<view class="winebottom">
<view class="winebottomleft">
<view class="winebottomleftimg">
<image src="{{url}}aicon_65x.png"></image>
<image src="{{item.article.avatar}}"></image>
</view>
<view class="wineeng">WinesBook</view>
<view class="wineeng">{{item.article.name}}</view>
</view>
<view class="winebottonright">
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_66x.png"></image>
<view class="winerighttouimg" catchtap='dianzan' data-userid="{{item.article.user_id}}" data-type="{{item.type}}" data-id="{{item.article.id}}" data-winemaker_id="{{item.article.winemaker_id}}">
<image src="{{url}}aicon_71x.png" wx:if="{{item.article.is_good==1}}"></image>
<image src="{{url}}aicon_66x.png"wx:else></image>
</view>
<view class="winezan">{{item.article.good_count}}</view>
</view>
<view class="winerighttou">
<view class="winerighttou" bindtap="ping" data-id="{{item.article.id}}" data-type="{{item.type}}" data-winemaker_id="{{item.article.winemaker_id}}">
<view class="winerighttouimg">
<image src="{{url}}aicon_67x.png"></image>
</view>
... ...
... ... @@ -106,10 +106,16 @@ image{
.tast{
display:flex;
align-items: center;
border-bottom:14rpx solid #F2F2F2;
padding-bottom: 30rpx;
border-bottom:1rpx solid #f5f5f5;
padding: 20rpx 0;
/* border-bottom:14rpx solid #F2F2F2;
padding-bottom: 30rpx; */
}
.dayjiu{
border-bottom:14rpx solid #F2F2F2
}
.tastimg{
width:80rpx;
height:80rpx;
... ... @@ -144,6 +150,16 @@ image{
width:686rpx;
height:300rpx;
margin:30rpx auto 0;
position: relative
}
.vioimg{
width:100rpx;
height:100rpx;
font-size: 0;
position:absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%)
}
.winebottom{
display:flex;
... ... @@ -156,7 +172,13 @@ image{
.winebottomleftimg{
width:60rpx;
height:60rpx;
font-size: 0
font-size: 0;
border-radius:50%;
}
.winebottomleftimg image{
width:100%;
height:100%;
border-radius:50%;
}
.winebottomleft{
display:flex;
... ... @@ -185,7 +207,7 @@ image{
.winezan{
color:#666666;
font-size:28rpx;
margin-left:5rpx;
margin-left:10rpx;
}
.wineblock{
border-bottom: 14rpx solid #F2F2F2;
... ...
... ... @@ -18,6 +18,7 @@ Page({
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
<view class="danhead">
<view class="jiudandetailhead">
<view class="edtaileft">
<view class="edtaileftimg">
... ... @@ -9,8 +11,64 @@
</view>
</view>
<view class="atten">关注</view>
</view>
<view class="jiudanfen">
<view class="jiudanfenitem">
<view class="jiudanfenimg">
<image src="{{url}}/aicon_09x.png"></image>
</view>
<view class="collect">收藏</view>
</view>
<view class="jiudanfenitem">
<view class="jiudanfenimg zhuan">
<image src="{{url}}/aicon_68x.png"></image>
</view>
<view class="collect">转发</view>
</view>
<view class="jiudanfenitem">
<view class="jiudanfenimg">
<image src="{{url}}/aicon_67x.png"></image>
</view>
<view class="collect">54</view>
</view>
<view class="jiudanfenitem">
<view class="jiudanfenimg">
<image src="{{url}}/aicon_66x.png"></image>
</view>
<view class="collect">362</view>
</view>
</view>
</view>
<view class="atten">关注</view>
</view>
\ No newline at end of file
<view class="jiupin" >
<view class="searchitem" >
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{item.logo}}"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">222</view>
<view class="nambottom">
<text class="namebottomitem">sadf</text>
<text class="namebottomitem">asf</text>
<text class="namebottomitem">ds</text>
<text class="namebottomitem">d</text>
</view>
</view>
</view>
<view class="starimg" catchtap="collect" data-id="{{item.id}}">
<image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
<image src="{{url}}aicon_09x.png" wx:else></image>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -2,8 +2,7 @@
display:flex;
align-items: center;
justify-content: space-between;
padding: 30rpx;
box-sizing: border-box;
}
... ... @@ -22,5 +21,120 @@ image{
align-items: center;
}
.editmiddle{
margin-let:
}
\ No newline at end of file
margin-left:30rpx;
}
.middletop{
color:#1A1A1A;
font-size: 32rpx;
}
.middlebottom{
width:67rpx;
height:24rpx;
border:1rpx solid rgba(232,24,37,1);
border-radius:12rpx;
color:#E81825;
font-size: 20rpx;
text-align: center;
line-height: 24rpx;
margin-top:13rpx;
}
.danhead{
padding: 30rpx;
box-sizing: border-box;
border-bottom:12rpx solid #F2F2F2
}
.jiudanfen{
display:flex;
align-items: center;
margin-top:20rpx;
justify-content: space-between
}
.jiudanfenimg{
width:42rpx;
height:40rpx;
font-size: 0
}
.collect{
color:#666666;
font-size: 28rpx;
margin-top:13rpx;
}
.jiudanfenitem:first-child{
margin-left:20rpx;
}
.jiudanfenitem:last-child{
margin-right:20rpx;
}
.searchitem{
display:flex;
align-items: center;
justify-content: space-between;
padding: 37rpx 31rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.searchitemleft{
display:flex;
align-items: center
}
.searchtitle{
color:#666666;
font-size: 28rpx;
margin-left:21rpx;
}
.closeimg{
width:30rpx;
height:30rpx;
font-size: 0
}
.searchresult{
background: #fff;
}
.itemleftimg{
width:80rpx;
height:80rpx;
border-radius:2rpx;
font-size: 0
}
.itemiddle{
margin-left:34rpx;
}
.itemiddle:first-child{
margin-left:0
}
.itemidelename{
color:#1A1A1A;
font-size: 28rpx;
}
.namebottomitem{
color:#999999;
font-size: 24rpx;
padding: 0 20rpx;
border-right:1rpx solid #f5f5f5;
}
.namebottomitem:last-child{
border-right:none;
}
.branditemleftimg{
width:80rpx;
height:80rpx;
font-size: 0;
border-radius: 50%;
}
.jiuqiimg{
width:80rpx;
height:80rpx;
}
.noatten{
width: 100rpx;
height: 50rpx;
background: #999;
border-radius: 2rpx;
font-size: 26rpx;
color: #fff;
text-align: center;
line-height: 50rpx;
}
\ No newline at end of file
... ...
// pages/findblock/jiulist/jiulist.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
type:'',
page:1,
peoplelist:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
type:options.type
})
},
//获取名人酒单列表
getwinelist(){
let that = this;
let url = 'index/Find/rec_list', params = {
page: that.data.page
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
peoplelist: that.data.peoplelist.concat(res.all_list)
})
let newpeoplelist = that.data.peoplelist;
for (var obj of newpeoplelist){
for(var p of obj.list){
p.choose=false
}
}
that.setData({
peoplelist:newpeoplelist
})
console.log(that.data.peoplelist)
}).catch((err) => {
})
},
//出现弹层
shareAction(e){
let id=e.currentTarget.dataset.id;
let newpeoplelist=this.data.peoplelist
for (var obj of newpeoplelist){
for(var p of obj.list){
if(p.id==id){
p.choose = !p.choose
}
}
}
this.setData({
peoplelist: newpeoplelist
})
},
//点赞
zan(e){
let id=e.currentTarget.dataset.id;
let that = this;
let url = 'index/Common/good', params = {
sort:1,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
let newpeoplelist = that.data.peoplelist;
for (var obj of newpeoplelist) {
for (var p of obj.list) {
if (p.user_id == id) {
if (p.is_good==0){
p.is_good=1;
p.good_count = p.good_count+1
}else{
p.is_good = 0;
if (p.good_count ==0){
p.good_count = 0
}else{
p.good_count = p.good_count - 1
}
}
}
}
}
this.setData({
peoplelist: newpeoplelist
})
}).catch((err) => {
})
},
//收藏和取消收藏
collect(e){
let id=e.currentTarget.dataset.id;
let that = this;
let url = 'index/Common/favorite', params = {
sort:3,
id:id
}
app.post(url, params).then((res) => {
console.log(res);
// wx.showToast({
// title: res,
// icon:'none'
// })
}).catch((err) => {
})
},
pinglun(e){
let id=e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/myblock/pingjia/pingjia?id='+id+'&type='+this.data.type,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
page:1,
peoplelist:[]
})
this.getwinelist()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let page=this.data.page;
page++;
this.setData({
page:page
})
this.getwinelist()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "名人酒单"
}
\ No newline at end of file
... ...
<view class="wineblock" wx:for="{{peoplelist}}" wx:key=''>
<view class="date">{{item.date}}</view>
<view class='wine_list' >
<view class='list_item' wx:for="{{item.list}}" wx:key="">
<view class='img_box'>
<image src='{{item.avatar}}'></image>
</view>
<view class='wine_title'>{{item.title}}</view>
<view class='wine_name'>{{item.user_nickname}}</view>
<view class='wine_leavel'>{{item.level}}</view>
<view class='action_box'>
<view class='single_action' bindtap="zan" data-id="{{item.user_id}}">
<view class='zan_icon'>
<image src='/img/aicon_46.png' mode='widthFix' wx:if="{{item.is_good==1}}"></image>
<image src='/img/aicon_47.png' mode='widthFix' wx:else></image>
</view>
{{item.good_count}}
</view>
<view class='single_action' bindtap="pinglun" data-id="{{item.id}}">
<view class='zan_icon'>
<image src='/img/aicon_67.png' mode='widthFix'></image>
</view>
{{item.comment_count}}
</view>
<view class='single_action {{item.choose?"active":""}}' bindtap='shareAction' data-id="{{item.id}}">
<image src='/img/gengduo.png' mode='widthFix' class='moreIcon'></image>
<view class='min_action_box'>
<view class='action_btn' wx:if="{{item.is_favorite==0}}" bindtap="collect" data-id="{{item.user_id}}">收藏</view>
<view class='action_btn' wx:else bindtap="collect" data-id="{{item.user_id}}">取消收藏</view>
<view class='action_btn'>分享</view>
</view>
</view>
</view>
</view>
</view>
</view>
... ...
/* pages/jiudan/jiudan.wxss */
page{
background: #F2F2F2;
}
.wine_list{
display: flex;
display: -webkit-flex;
flex-wrap: wrap;
}
.list_item{
width: 366rpx;
height: 400rpx;
background: #FFF;
border-radius: 5rpx;
margin-left: 6rpx;
margin-top: 6rpx;
display: flex;
flex-flow: column;
font-size: 28rpx;
align-items: center;
box-sizing: border-box;
padding-top: 40rpx;
}
.img_box{
width: 120rpx;
height: 120rpx;
border-radius: 50%;
overflow: hidden;
}
.wine_title{
color: #1A1A1A;
font-weight: 500;
margin-top: 20rpx;
line-height: 1;
}
.wine_name{
font-size: 26rpx;
color: #666;
margin-top: 10rpx;
}
.wine_leavel{
width: 68rpx;
height: 24rpx;
border: 1rpx solid #E81825;
border-radius: 12rpx;
font-size: 20rpx;
color: #E81825;
display: flex;
align-items: center;
justify-content: center;
margin-top: 14rpx;
}
.action_box{
display: flex;
justify-content: space-around;
color: #999;
width: 100%;
margin-top: 40rpx;
}
.single_action{
padding: 0 10rpx;
display: flex;
align-items: center;
position: relative;
}
.zan_icon{
width: 30rpx;
margin-right: 10rpx;
}
.moreIcon{
width: 4rpx;
}
.min_action_box{
width: 134rpx;
height: 175rpx;
position: absolute;
background-color: #FFF;
z-index: 99;
left: -140rpx;
top: 0;
font-size: 30rpx;
flex-flow: column;
box-sizing: border-box;
padding: 10rpx 0;
justify-content: space-around;
align-items: center;
color: #1A1A1A;
border-radius: 5rpx;
box-shadow:0px 8px 16px 0px rgba(44,49,63,0.1);
display: none;
}
.action_btn{
width: 100%;
text-align: center;
position: relative;
}
.action_btn.active{
color: #E81825;
}
.action_btn button{
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
opacity: 0;
}
.single_action.active .min_action_box{
display: flex;
}
.date{
padding: 11rpx 32rpx;
box-sizing: border-box;
background: #F2F2F2;
color:#666666;
font-size: 24rpx;
}
\ No newline at end of file
... ...
// pages/findblock/meirixinjiu/meirixinjiu.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
url:'',
page:1,
winelist:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
})
this.getwinelist()
},
//获取每日新酒列表
getwinelist(){
let that = this;
let url = 'index/Find/new_list', params = {
page: that.data.page
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
winelist: res.all_list
})
}).catch((err) => {
})
},
//收藏和取消收藏
collect(e) {
let that = this;
let id = e.currentTarget.dataset.id;
let url = 'index/Common/favorite', params = {
sort: 1,
id: id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon:'none'
})
that.getwinelist()
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "每日新酒发布"
}
\ No newline at end of file
... ...
<view class="jiupin" wx:for="{{winelist}}" wx:key=''>
<view class="date">{{item.date}}</view>
<view class="searchitem" wx:for="{{item.list}}" wx:key="">
<view class="searchitemleft">
<view class="itemleftimg">
<image src="{{item.thumb}}"></image>
</view>
<view class="itemiddle">
<view class="itemidelename">{{item.title}}</view>
<view class="nambottom">
<text class="namebottomitem">{{item.degree_name}}</text>
<text class="namebottomitem">{{item.odor_name}}</text>
<text class="namebottomitem">官方价{{item.price}}元</text>
<text class="namebottomitem">{{item.ml}}</text>
</view>
</view>
</view>
<view class="starimg" catchtap="collect" data-id="{{item.wine_id}}">
<image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
<image src="{{url}}aicon_09x.png" wx:else></image>
</view>
</view>
</view>
\ No newline at end of file
... ...
.searchitem{
display:flex;
align-items: center;
justify-content: space-between;
padding: 37rpx 31rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.searchitemleft{
display:flex;
align-items: center
}
.searchtitle{
color:#666666;
font-size: 28rpx;
margin-left:21rpx;
}
.closeimg{
width:30rpx;
height:30rpx;
font-size: 0
}
.searchresult{
background: #fff;
}
.itemleftimg{
width:80rpx;
height:80rpx;
border-radius:2rpx;
font-size: 0
}
.itemiddle{
margin-left:34rpx;
}
.itemiddle:first-child{
margin-left:0
}
.itemidelename{
color:#1A1A1A;
font-size: 28rpx;
}
.namebottomitem{
color:#999999;
font-size: 24rpx;
padding: 0 20rpx;
border-right:1rpx solid #f5f5f5;
}
.namebottomitem:last-child{
border-right:none;
}
.branditemleftimg{
width:80rpx;
height:80rpx;
font-size: 0;
border-radius: 50%;
}
.jiuqiimg{
width:80rpx;
height:80rpx;
}
.noatten{
width: 100rpx;
height: 50rpx;
background: #999;
border-radius: 2rpx;
font-size: 26rpx;
color: #fff;
text-align: center;
line-height: 50rpx;
}
.date{
color:#666666;
font-size: 24rpx;
padding: 11rpx 32rpx;
box-sizing: border-box;
background: #F2F2F2
}
\ No newline at end of file
... ...
// pages/findblock/putongwenzhang/putongwenzhang.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
url:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
url: app.globalData.url
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<view class="wineblock">
<view class="winetitle">浓香酒酿酒大师:沈才宏</view>
<view class="wineimg">
<image src="{{url}}aicon_64.png"></image>
</view>
<view class="winebottom">
<view class="winebottomleft">
<view class="winebottomleftimg">
<image src="{{url}}aicon_65x.png"></image>
</view>
<view class="wineeng">WinesBook</view>
</view>
<view class="winebottonright">
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_66x.png"></image>
</view>
<view class="winezan">18</view>
</view>
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_67x.png"></image>
</view>
<view class="winezan">54</view>
</view>
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_68x.png"></image>
</view>
</view>
</view>
</view>
</view>
<view class="wineblock">
<view class="winetitle">浓香酒酿酒大师:沈才宏</view>
<view class="wineimg">
<image src="{{url}}aicon_64.png"></image>
</view>
<view class="winebottom">
<view class="winebottomleft">
<view class="winebottomleftimg">
<image src="{{url}}aicon_65x.png"></image>
</view>
<view class="wineeng">WinesBook</view>
</view>
<view class="winebottonright">
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_66x.png"></image>
</view>
<view class="winezan">18</view>
</view>
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_67x.png"></image>
</view>
<view class="winezan">54</view>
</view>
<view class="winerighttou">
<view class="winerighttouimg">
<image src="{{url}}aicon_68x.png"></image>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
.winetitle{
color:#1A1A1A;
font-size: 28rpx;
margin-left:36rpx;
font-weight: bold
}
.wineimg{
width:686rpx;
height:300rpx;
margin:30rpx auto 0;
}
.winebottom{
display:flex;
justify-content: space-between;
align-items: center;
padding: 0 32rpx;
box-sizing: border-box;
margin-top:30rpx;
}
.winebottomleftimg{
width:60rpx;
height:60rpx;
font-size: 0
}
.winebottomleft{
display:flex;
align-items: center
}
.winebottonright{
width:345rpx;
display:flex;
align-items: center;
justify-content: space-around
}
.winerighttouimg{
width:30rpx;
height:28rpx;
font-size: 0
}
.winerighttou{
display:flex;
align-items: center
}
.wineeng{
color:#666666;
font-size: 28rpx;
margin-left: 20rpx;
}
.winezan{
color:#666666;
font-size:28rpx;
margin-left:5rpx;
}
.wineblock{
border-bottom: 1rpx solid #f5f5f5;
padding-bottom: 30rpx;
margin-top:33rpx;
}
.pin{
width:16rpx;
height:32rpx;
font-size: 0
}
... ...
<!-- 搜索输入框的遮罩层 -->
<view class="searchregister" wx:if="{{searchshow}}">
<view class="searchitem" wx:for="{{searchlist}}" wx:key='' bindtap="searchlist">
<view class="searchitemleft" >
<view class="searchitemleft">
<view class="searimg">
<image src="{{url}}aicon_04@2x.png"></image>
</view>
... ... @@ -12,7 +12,7 @@
<view class="iconfont icon-jiantou listrow "></view>
</view>
</view>
<view class="searchhead">
... ... @@ -45,9 +45,9 @@
<view class="textbox">
<view class="seahead" >
<view class="seahead">
<view class="searword" wx:for="{{list}}" wx:key="" bindtap="enterwine" data-id="{{item.id}}">{{item.name}}</view>
</view>
<view class="historyrecord">
... ... @@ -60,7 +60,7 @@
</view>
<view class="seahead" wx:if="{{history.length!=0}}">
<view class="searword" wx:for="{{history}}" wx:key='' bindtap="searchhistory" data-keyword="{{item.keyword}}">{{item.keyword}}</view>
</view>
<view class="historyrecord">
<view class="hisimg">
... ... @@ -73,7 +73,7 @@
<view class="seahead">
<view class="searword" wx:for="{{favorite}}" wx:key=''>{{item.name}}</view>
</view>
</view>
... ... @@ -103,11 +103,11 @@
<view class="starimg" catchtap="collect" data-id="{{item.id}}">
<image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
<image src="{{url}}aicon_09x.png" wx:else></image>
</view>
</view>
</view>
<view class="brand" wx:if="{{select==2}}">
... ... @@ -130,14 +130,14 @@
</view>
<view class="starimg" catchtap="collect" data-id="{{item.id}}">
<image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
<image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
<image src="{{url}}aicon_09x.png" wx:else></image>
</view>
</view>
</view>
<view class="brand" wx:if="{{select==3}}">
... ... @@ -160,10 +160,10 @@
</view>
<view class="atten" wx:if="{{item.is_concern==1}}" data-id="{{item.id}}" catchtap="attention">取消关注</view>
<view class="atten" data-id="{{item.id}}" wx:else catchtap="attention">关注</view>
<view class="atten" data-id="{{item.id}}" wx:else catchtap="attention">关注</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -6,7 +6,13 @@ Page({
* 页面的初始数据
*/
data: {
url:''
url:'',
id:'',
type:'',
page:1,
pinglist:[],
content:'',
winemaker_id:''
},
/**
... ... @@ -16,8 +22,91 @@ Page({
this.setData({
url: app.globalData.url
})
this.setData({
id:options.id,
type:options.type,
winemaker_id: options.winemaker_id
})
this.getpinglist()
},
//获取评论列表
getpinglist(){
let that = this;
let chuanid='';
if(that.data.type==3){
chuanid=that.data.winemaker_id
}else{
chuanid=that.data.id
}
let url = 'index/Common/comment_detail', params = {
sort:that.data.type,
id: chuanid,
page:that.data.page
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
pinglist:that.data.pinglist.concat(res.list)
})
}).catch((err) => {
})
},
//输入评论内容
entertext(e){
let content=e.detail.value;
this.setData({
content: content
})
},
//发表评论
publishcomment(){
let that = this;
if(that.data.content==''){
wx.showToast({
title: '请输入评论内容',
icon:'none'
})
}else{
let chuanid='';
if (that.data.type == 3) {
chuanid = that.data.winemaker_id
} else {
chuanid = that.data.id
}
let url = 'index/Common/comment', params = {
sort: that.data.type,
id: chuanid ,
content: that.data.content
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: res,
icon: "none"
})
that.setData({
page: 1,
pinglist: []
})
that.getpinglist()
}).catch((err) => {
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -57,7 +146,13 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let page=this.data.page;
page++;
this.setData({
page:page
})
this.getpinglist()
},
/**
... ...
<view class="commentlist">
<view class="commentitem">
<view class="commentitem" wx:for="{{pinglist}}" wx:key=''>
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
<image src="{{item.avatar}}"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightname">{{item.user_nickname}}</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
<view class="righttext">{{item.content}}</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
<view class="commentitem">
<view class="commentleft">
<image src="{{url}}/aicon_77@2x.png"></image>
</view>
<view class="commentright">
<view class="rightname">小叶子</view>
<view class="rightdate">2019年11月5日</view>
<view class="righttext">我怎么这么好看</view>
</view>
</view>
</view>
<view class="pingjiabottom">
<view class="pbleft">
<input placeholder='输入评论的内容' placeholder-class='enterping' />
<input placeholder='输入评论的内容' placeholder-class='enterping' bindinput="entertext"/>
</view>
<view class="pbright">发送</view>
<view class="pbright" bindtap="publishcomment">发送</view>
</view>
\ No newline at end of file
... ...