作者 lihongjuan

1

要显示太多修改。

为保证性能只显示 51 of 51+ 个文件。

... ... @@ -33,7 +33,107 @@ App({
}
})
},
post: function (url, data, headerParams) {
wx.showNavigationBarLoading()
var promise = new Promise((resolve, reject) => {
//init
let that = this;
let postData = data;
let baseUrl = 'http://delicacy.w.brotop.cn/api/';
//网络请求
let header = {
// 'XX-Device-Type': 'wxapp',
'token': wx.getStorageSync("token") || ''
}
header = Object.assign(header, headerParams)
//网络请求
wx.request({
url: baseUrl + url,
data: postData,
method: headerParams,
header: header,
success: function (res) { //返回取得的数据
if (res.data.code == '1') {
resolve(res.data.data);
} else if (res.data.code == '201') {
resolve(res.data);
} else {
// wx.showToast({
// title: res.data.msg,
// duration: 1200,
// icon: 'none'
// })
reject(res)
}
// else if (res.data.code == '42002') {
// }
// setTimeout(function () {
// wx.hideNavigationBarLoading()
// }, 600)
},
fail: function (e) {
reject('网络出错');
// wx.hideLoading()
wx.hideNavigationBarLoading()
},
complete: function () {
wx.hideNavigationBarLoading()
},
})
});
return promise;
},
upload(filetype, file) {
var promise = new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
wx.showLoading({
title: '上传中',
})
let url = 'http://delicacy.w.brotop.cn/api/common/upload';
let head = {
'token': wx.getStorageSync('token'),
'XX-Device-Type': ''
}
let typename = {
filetype: filetype
}
wx.uploadFile({
url: url, //仅为示例,非真实的接口地址
filePath: file,
name: 'file',
header: head,
formData: typename,
success: function (res) {
console.log('上传文件后', res)
let temdata = JSON.parse(res.data);
console.log(temdata)
let urlobj = {
url: temdata.data.url
}
resolve(urlobj);
},
fail: function (res) {
reject('网络出错');
wx.hideNavigationBarLoading()
wx.hideLoading()
},
complete: () => {
wx.hideNavigationBarLoading()
wx.hideLoading()
},
})
});
return promise;
},
globalData: {
userInfo: null
userInfo: null,
baseurl:'http://delicacy.w.brotop.cn'
}
})
\ No newline at end of file
... ...
{
"pages": [
"pages/homepage/homepage",
"pages/personziliao/personziliao",
"pages/examine/examine",
"pages/index/index",
"pages/personziliao/personziliao",
"pages/comment/comment",
"pages/passPhotos/passPhotos",
"pages/collectlist/collectlist",
... ... @@ -14,13 +14,14 @@
"pages/morecomment/morecomment",
"pages/searchresult/searchresult",
"pages/searchcity/searchcity",
"pages/index/index",
"pages/logs/logs",
"pages/login/login",
"pages/recommond/recommond",
"pages/canting/canting",
"pages/mycomment/mycomment"
"pages/mycomment/mycomment",
"pages/personpage/personpage",
"pages/rank/rankpage",
"pages/morepic/morepic"
],
"window": {
"backgroundTextStyle": "light",
... ...
/* 输入框搜索 */
image{
width:100%;
height:100%;
image {
width: 100%;
height: 100%;
}
.head {
width: 750rpx;
display: flex;
... ... @@ -11,22 +12,21 @@ image{
justify-content: space-between;
padding: 24rpx 32rpx;
box-sizing: border-box;
}
}
.headleft {
.headleft {
display: flex;
align-items: center;
justify-content: center
}
justify-content: center;
}
.headleftimg {
.headleftimg {
width: 31rpx;
height: 31rpx;
font-size: 0;
}
}
.headmiddle {
.headmiddle {
width: 542rpx;
height: 60rpx;
background: rgba(249, 249, 249, 1);
... ... @@ -35,30 +35,30 @@ image{
align-items: center;
padding: 16rpx 20rpx;
box-sizing: border-box;
}
}
.headmiddleleft {
.headmiddleleft {
width: 32rpx;
height: 32rpx;
font-size: 0;
}
}
.headmiddleleft image {
.headmiddleleft image {
width: 100%;
height: 100%;
}
}
.headright {
.headright {
width: 48rpx;
height: 48rpx;
font-size: 0;
position: relative;
}
}
.sizenum {
.sizenum {
width: 32rpx;
height: 32rpx;
color: #FF4E14;
color: #ff4e14;
font-size: 20rpx;
text-align: center;
line-height: 30rpx;
... ... @@ -67,47 +67,48 @@ image{
top: -5rpx;
background: #fff;
border-radius: 50%;
border: 1rpx solid #FF4E14;
}
.headmiddleright{
width:400rx;
margin-left:16rpx;
border: 1rpx solid #ff4e14;
}
}
.headmiddleright {
width: 400rx;
margin-left: 16rpx;
}
.headmiddleright input {
.headmiddleright input {
width: 100%;
height: 100%;
color: #BDC4CE;
color: #bdc4ce;
font-size: 24rpx;
padding: 12rpx 0;
box-sizing: border-box
}
box-sizing: border-box;
}
.cityname {
.cityname {
color: #fff;
font-size: 22rpx;
margin-top: 5rpx;
}
}
.headbot {
.headbot {
height: 256rpx;
width: 750rpx;
background: #C29445;
background: #c29445;
position: relative;
}
.shuru{
color:#BDC4CE;
font-size: 28rpx;
}
.shuru {
color: #bdc4ce;
font-size: 28rpx;
}
.commonname{
color:#06121E;
font-size: 32rpx
.commonname {
color: #06121e;
font-size: 32rpx;
}
.commnameone{
color:#06121E;
.commnameone {
color: #06121e;
font-size: 28rpx;
}
... ... @@ -131,11 +132,13 @@ image{
align-items: center;
justify-content: center;
}
.commonpadding{
.commonpadding {
padding: 32rpx;
box-sizing: border-box;
background: #fff;
}
.yourow {
width: 15rpx;
height: 20rpx;
... ... @@ -143,12 +146,14 @@ image{
}
/* 五角星 */
.staritem{
width:32rpx;
height:32rpx;
.staritem {
width: 32rpx;
height: 32rpx;
font-size: 0;
margin-right:4rpx;
margin-right: 4rpx;
}
.register {
width: 100%;
height: 100%;
... ... @@ -159,10 +164,46 @@ image{
right: 0;
z-index: 999;
}
.nomoer{
color:#8C9198;
font-size:24rpx;
.nomoer {
color: #8c9198;
font-size: 24rpx;
text-align: center;
margin-top: 26rpx;
padding-bottom: 20rpx;
}
.nodata {
color: #999;
font-size: 32rpx;
text-align: center;
margin-top:26rpx;
padding-bottom:20rpx;
margin-top: 100rpx;
}
.noimg {
width: 523rpx;
/* height:215rpx; */
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.nodataimg {
width: 523rpx;
height: 315rpx;
font-size: 0;
}
.nomoer {
color: #8c9198;
font-size: 24rpx;
text-align: center;
margin-top: 26rpx;
padding-bottom: 20rpx;
}
.nomoredata {
margin-top: 208rpx;
}
\ No newline at end of file
... ...

734 字节

// pages/canting/canting.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
restaurant:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getrestaurant()
},
getrestaurant(){
let that = this;
var url = '/member/getSign';
var params = {
page:that.data.page,
limit:15
}
app.post(url, params,"post").then((res) => {
console.log(res);
that.setData({
restaurant:that.data.restaurant.concat(res.data)
})
}).catch((err) => {
})
},
goodtail(e) {
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/shopdetail/shopdetail?id=' + id,
})
},
/**
... ... @@ -54,7 +82,12 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let newpage=this.data.page;
newpage++;
this.setData({
page:newpage
})
this.getrestaurant()
},
/**
... ...
<view class="colecttop flextwo">
<!-- <view class="colecttop flextwo">
<view class="comt">(20/34)</view>
</view>
<view class="collectbox">
<view class="colectbitem flex">
</view> -->
<view class="noimg" wx:if="{{restaurant.length==0}}">
<view class="nodataimg" >
<image src="/img/nodataimg.png"></image>
</view>
<view class="nomoer nomoredata">没有更多了哦~</view>
</view>
<view class="collectbox" wx:else>
<view class="colectbitem flex" wx:for="{{restaurant}}" wx:key="" bindtap="goodtail" data-id="{{item.id}}">
<view class="collectbitemleft">
<image src="/img/photo.png"></image>
<image src="{{item.image}}"></image>
</view>
<view class="collectbtitemr">
<view class='goodname'>海贼王寿司店</view>
<view class='goodname'>{{item.name}}</view>
<view class="flexone starbox">
<view class="star flexone">
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.level>=1}}"></image>
<image src="/img/noxing.png" wx:if="{{item.level<0.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.level>=0.5&&item.level<1}}"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.level>=2}}"></image>
<image src="/img/noxing.png" wx:if="{{item.level<1.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.level>=1.5&&item.level<2}}"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.level>=3}}"></image>
<image src="/img/noxing.png" wx:if="{{item.level<2.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.level>=2.5&&item.level<3}}"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.level>=4}}"></image>
<image src="/img/noxing.png" wx:if="{{item.level<3.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.level>=3.5&&item.level<4}}"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.level>=5}}"></image>
<image src="/img/noxing.png" wx:if="{{item.level<4.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.level>=4.5&&item.level<5}}"></image>
</view>
</view>
<view class="shouprice">¥88</view>
<view class="shouprice">¥{{item.price}}</view>
</view>
<view class="addressbox flexone">
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>{{item.business_name}}</view>
<view class='asddressitem'>{{item.series_name}}</view>
<!-- <view class='asddressitem'>东京街</view> -->
</view>
</view>
</view>
<view class="colectbitem flex">
<!-- <view class="colectbitem flex">
<view class="collectbitemleft">
<image src="/img/photo.png"></image>
</view>
... ... @@ -71,7 +88,7 @@
</view>
</view>
</view>
</view> -->
</view>
<view class="nomoer">没有更多了哦~</view>
\ No newline at end of file
<!-- <view class="nomoer">没有更多了哦~</view> -->
\ No newline at end of file
... ...
... ... @@ -7,3 +7,6 @@
padding: 10rpx 32rpx;
box-sizing: border-box
}
.collectbox{
margin-top:20rpx;
}
\ No newline at end of file
... ...
// pages/collectlist/collectlist.js
const app=getApp()
Page({
/**
... ... @@ -7,14 +8,32 @@ Page({
data: {
nav: 1,
delBtnWidth: 160,
data: [{ content: "1", right: 0 }, { content: "2", right: 0 }, { content: "3", right: 0 }, { content: "4", right: 0 }, { content: "5", right: 0 }, { content: "6", right: 0 }, { content: "7", right: 0 }, { content: "8", right: 0 }, { content: "9", right: 0 }, { content: "10", right: 0 }],
data: [],
isScroll: true,
windowHeight: 0,
page:1,
colectlist:[],
dianpinglist:[],
pagek:1,
nomore:false
},
sel(e) {
this.setData({
nav: e.currentTarget.dataset.id
})
if(this.data.nav==1){
this.setData({
page:1,
colectlist:[]
})
this.getcollect()
}else{
this.setData({
page: 1,
data:[]
})
this.getcommentlist()
}
},
/**
* 生命周期函数--监听页面加载
... ... @@ -28,6 +47,15 @@ Page({
});
}
});
this.getcollect()
},
goodtail(e) {
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/shopdetail/shopdetail?id=' + id,
})
},
drawStart: function (e) {
// console.log("drawStart");
... ... @@ -83,7 +111,85 @@ Page({
},
delItem: function (e) {
let that=this;
let id=e.currentTarget.dataset.id;
console.log(id)
wx.showModal({
title: '提示',
content: '是否删除此条点评',
success(res) {
if (res.confirm) {
let that = this;
var url = '/remark/deleteRemark';
var params = {
remark_id: id,
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: '删除成功',
icon:"none"
})
that.setData({
pagek:1,
data:[]
})
that.getcommentlist()
}).catch((err) => {
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
// 获取我的收藏
getcollect(){
let that = this;
var url = 'member/getShopCollect';
var params = {
page:that.data.page,
limit:15
}
app.post(url, params,"post").then((res) => {
console.log(res);
that.setData({
colectlist: that.data.colectlist.concat(res.data)
})
console.log(that.data.colectlist)
}).catch((err) => {
})
},
// 获取我的点评
getcommentlist(){
let that = this;
var url = '/member/getRemarkCollect';
var params = {
page: that.data.pagek,
limit:15
}
app.post(url, params,"post").then((res) => {
console.log(res);
that.setData({
data:that.data.data.concat(res.data)
})
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
... ... @@ -124,6 +230,22 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
if(this.data.nav==1){
let newpage = this.data.page;
newpage++;
this.setData({
page: newpage
})
this.colectlist()
}else{
let newpage=this.data.pagek;
newpage++;
this.setData({
pagek:newpage
})
this.getcommentlsit()
}
},
... ...
... ... @@ -3,104 +3,102 @@
<view class="collectitem {{nav==2?'collectactive':''}}" bindtap="sel" data-id="2">点评</view>
</view>
<view class="collectbox" wx:if="{{nav==1}}">
<view class="colectbitem flex">
<view class="collectbitemleft">
<image src="/img/photo.png"></image>
</view>
<view class="collectbtitemr">
<view class='goodname'>海贼王寿司店</view>
<view class="flexone starbox">
<view class="star flexone">
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
</view>
</view>
<view class="shouprice">¥88</view>
</view>
<view class="addressbox flexone">
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view>
<view class="noimg" wx:if="{{colectlist.length==0}}">
<view class="nodataimg" >
<image src="/img/nodataimg.png"></image>
</view>
<view class="nomoer nomoredata">没有更多了哦~</view>
</view>
</view>
<view class="colectbitem flex">
<view wx:else>
<view class="colectbitem flex" wx:for="{{colectlist}}" wx:key="" bindtap="goodtail" data-id="{{item.id}}">
<view class="collectbitemleft">
<image src="/img/photo.png"></image>
<image src="{{item.image}}"></image>
</view>
<view class="collectbtitemr">
<view class='goodname'>海贼王寿司店</view>
<view class='goodname'>{{item.name}}</view>
<view class="flexone starbox">
<view class="star flexone">
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.level>=1}}"></image>
<image src="/img/noxing.png" wx:if="{{item.level<0.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.level>=0.5&&item.level<1}}"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.level>=2}}"></image>
<image src="/img/noxing.png" wx:if="{{item.level<1.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.level>=1.5&&item.level<2}}"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.level>=3}}"></image>
<image src="/img/noxing.png" wx:if="{{item.level<2.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.level>=2.5&&item.level<3}}"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.level>=4}}"></image>
<image src="/img/noxing.png" wx:if="{{item.level<3.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.level>=3.5&&item.level<4}}"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.level>=5}}"></image>
<image src="/img/noxing.png" wx:if="{{item.level<4.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.level>=4.5&&item.level<5}}"></image>
</view>
</view>
<view class="shouprice">¥88</view>
<view class="shouprice">¥{{item.price}}</view>
</view>
<view class="addressbox flexone">
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>{{item.business_name}}</view>
</view>
</view>
</view>
</view>
</view>
<scroll-view scroll-y="{{isScroll}}" style='height:{{windowHeight}}px' wx:else>
<view wx:else>
<view class="noimg" wx:if="{{data.length==0}}">
<view class="nodataimg" >
<image src="/img/nodataimg.png"></image>
</view>
<view class="nomoer nomoredata">没有更多了哦~</view>
</view>
<scroll-view scroll-y="{{isScroll}}" style='height:{{windowHeight}}px' wx:else>
<block wx:key="item" wx:for="{{data}}">
<view data-index='{{index}}' class="order-item" bindtouchstart="drawStart" bindtouchmove="drawMove" bindtouchend="drawEnd" style="right:{{item.right}}rpx">
<view class="colectbitem flex">
<view class="collectbitemleft">
<image src="/img/photo.png"></image>
<image src="{{item.image}}"></image>
</view>
<view class="collectbtitemr">
<view class="userbox flexone">
<view class="userimg">
<image src="/img/kele.png"></image>
<image src="{{item.avatar}}"></image>
</view>
<view class="username">用户名称</view>
<view class="userlevel">Lv 20</view>
<view class="username">{{item.nickname}}</view>
<view class="userlevel">Lv {{item.user_level}}</view>
</view>
<view class='goodname goodtext'>海贼王寿司店海贼王寿司店海贼王寿司店海贼王寿司店海贼王寿司店</view>
<view class='goodname goodtext'>{{item.content}}</view>
<view class="addressbox flexone">
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>{{item.shop_name}}</view>
<!-- <view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view> -->
</view>
</view>
</view>
<view class="remove" bindtap="delItem">
<view class="remove" bindtap="delItem" data-id="{{item.id}}">
<view class="delimg">
<image src="/img/delimg.png"></image>
... ... @@ -108,7 +106,9 @@
</view>
</view>
</block>
</scroll-view>
</scroll-view>
</view>
<view class="nomoer">没有更多了哦~</view>
<!-- <view class="nomoer" wx:if="{{nomore}}">没有更多了哦~</view> -->
\ No newline at end of file
... ...
... ... @@ -86,6 +86,10 @@ page {
width: 48rpx;
height: 48rpx;
font-size: 0;
border-radius: 50%
}
.userimg image{
border-radius: 50%
}
.username {
... ... @@ -135,3 +139,11 @@ page {
height:36rpx;
font-size: 0
}
.nodataimg{
width:523rpx;
height:315rpx;
font-size: 0
}
.nomoredata{
margin-top:208rpx;
}
\ No newline at end of file
... ...
// pages/comment/comment.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
totalstar:0,
servicestar:0,
taststar: 0,
environmentstar:0,
foodstar:0,
mark:'',
image:[],
cimage:[],
money:'',
name:'',
shopid:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
name:options.name,
shopid:options.shopid
})
},
// 综合评分
total(e){
let id=e.currentTarget.dataset.id;
this.setData({
totalstar:id
})
},
// 服务评分
service(e){
let id=e.currentTarget.dataset.id
this.setData({
servicestar:id
})
},
// 口味评分
tast(e){
let id=e.currentTarget.dataset.id
this.setData({
taststar:id
})
},
// 环境评分
envirment(e){
let id = e.currentTarget.dataset.id
this.setData({
environmentstar:id
})
},
// 食材评分
food(e){
let id=e.currentTarget.dataset.id
this.setData({
foodstar:id
})
},
//感受
entermark(e){
this.setData({
mark:e.detail.value
})
console.log(this.data.mark)
},
chooseImage() {
let that = this;
wx.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
success: function (res) {
console.log(res.tempFilePaths[0])
app.upload('image', res.tempFilePaths[0], "post").then((res) => {
console.log('上传文件', res);
let url = app.globalData.baseurl+res.url;
that.data.image.push(url)
that.data.cimage.push(res.url)
that.setData({
image: that.data.image,
cimage: that.data.cimage
})
console.log(that.data.image);
console.log(that.data.cimage)
}).catch((err) => {
console.log(err)
})
},
fail: function (res) { }
})
},
// 删除图片
del(e){
let that=this;
let url=e.currentTarget.dataset.url;
that.data.image.forEach(function(value,index,array){
if(value==url){
that.data.image.splice(index,1);
that.data.cimage.splice(index, 1)
}
})
that.setData({
image:that.data.image,
cimage:that.data.cimage
})
console.log(that.data.image);
console.log(that.data.cimage)
},
// 输入金额
entermoney(e){
this.setData({
money:e.detail.value
})
},
publish(){
let that = this;
if (that.data.totalstar==0){
wx.showToast({
title: '请选择综合评分',
icon:"none"
})
return false
}
if (that.data.servicestar == 0) {
wx.showToast({
title: '请选择服务评分',
icon: "none"
})
return false
}
if (that.data.taststar == 0) {
wx.showToast({
title: '请选择口味评分',
icon: "none"
})
return false
}
if (that.data.environmentstar == 0) {
wx.showToast({
title: '请选择环境评分',
icon: "none"
})
return false
}
if (that.data.mark == '') {
wx.showToast({
title: '请输入评论内容',
icon: "none"
})
return false
}
if (that.data.mark == '') {
wx.showToast({
title: '请输入评论内容',
icon: "none"
})
return false
}
if (that.data.money == '') {
wx.showToast({
title: '请输入人均消费',
icon: "none"
})
return false
}
var url = '/remark/addRemark';
var params = {
shop_id:that.data.shopid,
price:that.data.money,
content:that.data.mark,
images:that.data.image.join(","),
score1:that.data.totalstar,
score2:that.data.servicestar,
score3:that.data.taststar,
score4:that.data.environmentstar,
score5:that.data.foodstar,
type:1
}
app.post(url, params,"post").then((res) => {
console.log(res);
wx.showToast({
title: '发表成功',
icon:'none'
})
setTimeout(function(){
wx.navigateBack({
checked:true
})
},1500)
}).catch((err) => {
})
},
/**
... ...
<view class="infobox">
<view class="infoTitle">海贼王寿司店</view>
<view class="infoTitle">{{name}}</view>
<view class="infobox">
<view class="infoTitle">评分</view>
<view class="evaluateItem">
<view class="tltle">评价</view>
<view class="starbox">
<image class="starItem" src="/img/star.png" />
<image class="starItem" src="/img/star.png" />
<image class="starItem" src="/img/star.png" />
<image class="starItem" src="/img/star.png" />
<image class="starItem" src="/img/banke.png" />
<view class="tltle">综合</view>
<view class="starbox" bindtap="total" data-id="1">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{totalstar>=1}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="total" data-id="2">
<image class="starItem" src="/img/pingfenshi.png " wx:if="{{totalstar>=2}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<textarea placeholder="说说此刻的感受吧…" class="wordArea" />
<view class="labelbox">
<view class="starbox" bindtap="total" data-id="3">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{totalstar>=3}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="total" data-id="4">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{totalstar>=4}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="total" data-id="5">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{totalstar>=5}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
</view>
<view class="evaluateItem">
<view class="tltle">服务</view>
<view class="starbox" bindtap="service" data-id="1">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{servicestar>=1}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="service" data-id="2">
<image class="starItem" src="/img/pingfenshi.png " wx:if="{{servicestar>=2}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="service" data-id="3">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{servicestar>=3}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="service" data-id="4">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{servicestar>=4}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="service" data-id="5">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{servicestar>=5}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
</view>
<view class="evaluateItem">
<view class="tltle">口味</view>
<view class="starbox" bindtap="tast" data-id="1">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{taststar>=1}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="tast" data-id="2">
<image class="starItem" src="/img/pingfenshi.png " wx:if="{{taststar>=2}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="tast" data-id="3">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{taststar>=3}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="tast" data-id="4">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{taststar>=4}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="tast" data-id="5">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{taststar>=5}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
</view>
<view class="evaluateItem">
<view class="tltle">环境</view>
<view class="starbox" bindtap="envirment" data-id="1">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{environmentstar>=1}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="envirment" data-id="2">
<image class="starItem" src="/img/pingfenshi.png " wx:if="{{environmentstar>=2}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="envirment" data-id="3">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{environmentstar>=3}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="envirment" data-id="4">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{environmentstar>=4}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="envirment" data-id="5">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{environmentstar>=5}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
</view>
<view class="evaluateItem">
<view class="tltle">食材</view>
<view class="starbox" bindtap="food" data-id="1">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{foodstar>=1}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="food" data-id="2">
<image class="starItem" src="/img/pingfenshi.png " wx:if="{{foodstar>=2}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="food" data-id="3">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{foodstar>=3}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="food" data-id="4">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{foodstar>=4}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="food" data-id="5">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{foodstar>=5}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
</view>
</view>
<textarea placeholder="说说此刻的感受吧…" class="wordArea" bindinput="entermark" />
<!-- <view class="labelbox">
<view class="labelItem">
<text>+</text>标题
</view>
</view> -->
<view class="imagebox flexone">
<view class="picbox flexone">
<view class="imgItem" wx:for="{{image}}" wx:key="">
<image mode="aspectFill" src="{{item}}" />
<view class="chahao" bindtap="del" data-url="{{item}}">
<image src="/img/chahao.png"></image>
</view>
</view>
<view class="imgarr">
<image class="imgItem" mode="aspectFill" src="/img/jiang.png" />
</view>
<view class="imgItem" bindtap="chooseImage">
<image mode="aspectFill" src="/img/jiang.png" />
</view>
</view>
</view>
<view class="costbox">
<view class="costbox">
<view class="costTitle">人均</view>
<view class="fillbox">
<text>¥</text>
<input placeholder="请输入消费金额" class="fillCost" type="number"/>
</view>
<input placeholder="请输入消费金额" class="fillCost" type="digit" bindinput="entermoney" />
</view>
</view>
<view class="submit btnActive">发表</view>
\ No newline at end of file
<view class="submit btnActive" bindtap="publish">发表</view>
\ No newline at end of file
... ...
... ... @@ -20,8 +20,18 @@ page {
.imgItem {
width: 176rpx;
height: 176rpx;
margin-right: 24rpx;
margin-right: 20rpx;
margin-bottom: 32rpx;
position: relative;
}
.chahao{
width:50rpx;
height:50rpx;
font-size: 0;
position: absolute;
top:-10rpx;
right:-10rpx;
}
.imgItem:nth-child(3n) {
... ... @@ -92,9 +102,10 @@ page {
}
.starItem {
width: 24rpx;
height: 24rpx;
margin-right: 8rpx;
width: 32rpx;
height: 32rpx;
font-size: 0
}
.costbox {
... ... @@ -157,3 +168,9 @@ page {
.btnActive {
background: #FDAA2A;
}
.imagebox{
display:flex;
align-items: center;
width:600rpx;
flex-wrap: wrap
}
\ No newline at end of file
... ...
// pages/commentdetail/commentdetail.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
commentid: '',
commentdetail: '',
sendactive: false,
comment: '',
shopid:'',
ispraise:false,
iscollect:false,
sendshow:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
this.setData({
commentid: options.commentid,
shopid:options.shopid
})
this.getcommentdetail()
},
mycomment(){
wx.navigateTo({
url: '/pages/mycomment/mycomment',
})
},
getcommentdetail() {
let that = this;
var url = 'remark/getRemarkInfo';
var params = {
id: that.data.commentid,
}
app.post(url, params, "post").then((res) => {
console.log(res);
that.setData({
commentdetail: res
})
}).catch((err) => {
})
},
// 输入评论内容
enterword(e) {
this.setData({
comment:e.detail.value
})
},
finish(){
this.setData({
sendactive:true
})
},
// 发送评论
send(){
let that = this;
if (that.data.comment==''){
wx.showToast({
title: '请输入评论',
icon:"none"
})
}else{
that.setData({
sendshow: true
})
var url = 'remark_comments/addComments';
var params = {
remark_id: that.data.commentid,
content: that.data.comment
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: '评论成功',
icon: 'none'
})
setTimeout(function () {
wx.navigateBack({
checked: true
})
}, 1500)
app.globalData.shopid = this.data.shopid
}).catch((err) => {
})
}
},
// 点赞
praise(e){
let that=this;
let id=e.currentTarget.dataset.id;
that.setData({
ispraise:!that.data.ispraise
})
if(that.data.ispraise==true){
wx.showToast({
title: '点赞成功',
icon:"none"
})
that.data.commentdetail.praise_num = that.data.commentdetail.praise_num+1;
that.setData({
commentdetail: that.data.commentdetail
})
}else{
wx.showToast({
title: '取消点赞成功',
icon: "none"
})
that.data.commentdetail.praise_num = that.data.commentdetail.praise_num-1;
that.setData({
commentdetail: that.data.commentdetail
})
}
var url = '/remark/remarkPraise';
var params = {
remark_id: id,
}
app.post(url, params,"post").then((res) => {
console.log(res);
}).catch((err) => {
})
},
// 收藏
collect(e) {
let that = this;
let id = e.currentTarget.dataset.id;
that.setData({
iscollect: !that.data.iscollect
})
if (that.data.iscollect == true) {
wx.showToast({
title: '收藏成功',
icon: "none"
})
that.data.commentdetail.collect_num = that.data.commentdetail.collect_num + 1;
that.setData({
commentdetail: that.data.commentdetail
})
} else {
wx.showToast({
title: '取收藏赞成功',
icon: "none"
})
that.data.commentdetail.collect_num = that.data.commentdetail.collect_num - 1;
that.setData({
commentdetail: that.data.commentdetail
})
}
var url = '/remark/remarkCollect';
var params = {
remark_id: id,
}
app.post(url, params, "post").then((res) => {
console.log(res);
}).catch((err) => {
})
},
// 评论列表点赞
xiaozan(e){
let that = this;
let id=e.currentTarget.dataset.id;
let index=e.currentTarget.dataset.index;
that.data.commentdetail.comments.forEach(function(value,indexk,array){
if (indexk==index){
value.sel=!value.sel;
if(value.sel==true){
wx.showToast({
title: '点赞成功',
icon:"none"
})
}else{
wx.showToast({
title: '取消点赞成功',
icon: "none"
})
}
}
})
var url = 'remark_comments/remarkPraise';
var params = {
remark_comments_id: id,
}
app.post(url, params).then((res) => {
console.log(res);
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
<view class="photo">
<view class="box" wx:if="{{commentdetail.status==1}}">
<view class="iconbox">
<image src="/img/chenggong_img.png" class="icon" mode="widthFix" />
</view>
<view class="tipsword">
<view>点评正在审核中</view>
<view>可在我的评论中查看审核状态</view>
</view>
<view class="btnbox">
<view class="btnItem" bindtap="mycomment">我的评论</view>
</view>
</view>
<view wx:else>
<view class="photo">
<view class="photobox">
<view class="comtop flextwo">
<view class="comleft">
<image src="/img/kele.png"></image>
<image src="{{commentdetail.avatar}}"></image>
</view>
<view class="comright">
<view class="comrtop flexone">
<view class="comrname">一心只想撤撤撤</view>
<view class="comrname">{{commentdetail.nickname}}</view>
<view class="star starone flexone">
<view class="staritem">
<image src="/img/fenxing.png"></image>
<image src="/img/star.png" wx:if="{{commentdetail.user_level>=1}}"></image>
<image src="/img/huangkong.png" wx:if="{{commentdetail.user_level<0.5}}"></image>
<image src="/img/huangban.png" wx:if="{{commentdetail.user_level>=0.5&&commentdetail.user_level<1}}"></image>
</view>
<view class="staritem">
<image src="/img/fenxing.png"></image>
<image src="/img/star.png" wx:if="{{commentdetail.user_level>=2}}"></image>
<image src="/img/huangkong.png" wx:if="{{commentdetail.user_level<1.5}}"></image>
<image src="/img/huangban.png" wx:if="{{commentdetail.user_level>=1.5&&commentdetail.user_level<2}}"></image>
</view>
<view class="staritem">
<image src="/img/fenxing.png"></image>
<image src="/img/star.png" wx:if="{{commentdetail.user_level>=3}}"></image>
<image src="/img/huangkong.png" wx:if="{{commentdetail.user_level<2.5}}"></image>
<image src="/img/huangban.png" wx:if="{{commentdetail.user_level>=2.5&&commentdetail.user_level<3}}"></image>
</view>
<view class="staritem">
<image src="/img/fenxing.png"></image>
<image src="/img/star.png" wx:if="{{commentdetail.user_level>=4}}"></image>
<image src="/img/huangkong.png" wx:if="{{commentdetail.user_level<3.5}}"></image>
<image src="/img/huangban.png" wx:if="{{commentdetail.user_level>=3.5&&commentdetail.user_level<4}}"></image>
</view>
<view class="staritem">
<image src="/img/stfenxingr.png"></image>
<image src="/img/star.png" wx:if="{{commentdetail.user_level>=5}}"></image>
<image src="/img/huangkong.png" wx:if="{{commentdetail.user_level<4.5}}"></image>
<image src="/img/huangban.png" wx:if="{{commentdetail.user_level>=4.5&&commentdetail.user_level<5}}"></image>
</view>
</view>
</view>
<view class="comdate">2019年10月12日</view>
<view class="comdate">{{commentdetail.createtime}}</view>
</view>
</view>
... ... @@ -37,66 +62,70 @@
<view class="flexone fenxia">
<view class="star starone flexone">
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{commentdetail.score>=1}}"></image>
<image src="/img/lingfen_icon.png" wx:if="{{commentdetail.score<0.5}}"></image>
<image src="/img/banke.png" wx:if="{{commentdetail.score>=0.5&&commentdetail.score<1}}"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{commentdetail.score>=2}}"></image>
<image src="/img/lingfen_icon.png" wx:if="{{commentdetail.score<1.5}}"></image>
<image src="/img/banke.png" wx:if="{{commentdetail.score>=1.5&&commentdetail.score<2}}"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{commentdetail.score>=3}}"></image>
<image src="/img/lingfen_icon.png" wx:if="{{commentdetail.score<2.5}}"></image>
<image src="/img/banke.png" wx:if="{{commentdetail.score>=2.5&&commentdetail.score<3}}"></image>
</view>
<view class="staritem">
<image src="/img/pingfenshi.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{commentdetail.score>=4}}"></image>
<image src="/img/lingfen_icon.png" wx:if="{{commentdetail.score<3.5}}"></image>
<image src="/img/banke.png" wx:if="{{commentdetail.score>=3.5&&commentdetail.score<4}}"></image>
</view>
<view class="staritem">
<image src="/img/banke.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{commentdetail.score>=5}}"></image>
<image src="/img/lingfen_icon.png" wx:if="{{commentdetail.score<4.5}}"></image>
<image src="/img/banke.png" wx:if="{{commentdetail.score>=4.5&&commentdetail.score<5}}"></image>
</view>
</view>
<view class="fen">8.5分</view>
<view class="fen">{{commentdetail.score}}分</view>
</view>
<view class="text">
掌柜态度很专业热情,有问必答,回复也很快,我问了不少问题,他都不觉得烦,都会认真回答我,这点我向掌柜表示由衷的敬意,这样的好掌柜可不多了。
</view>
<view class="textboximg flexone">
<view class="boxitem">
<image src="/img/photo.png"></image>
{{commentdetail.content}}
</view>
<view class="boxitem">
<image src="/img/photo.png"></image>
<view class="textboximg flexone" wx:if="{{commentdetail.images.length!=0}}">
<view class="boxitem" wx:for="{{commentdetail.images}}" wx:key="">
<image src="{{item}}"></image>
</view>
<view class="boxitem">
<image src="/img/photo.png"></image>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="detailcommentbox">
<view class="detailcommentbox" wx:if="{{commentdetail.comments.length!=0}}">
<view class="phototopleft flexone">
<view class="xiang">点评 </view>
<view class="tiao">(800条)</view>
<view class="tiao">({{commentdetail.comments.length}}条)</view>
</view>
<view class="commentlist">
<view class="commentitem">
<view class="commentitem" wx:for="{{commentdetail.comments}}" wx:key="">
<view class="comtop flextwo">
<view class="comleft">
<image src="/img/kele.png"></image>
<image src="{{item.avatar}}"></image>
</view>
<view class="comright">
<view class="listtop flextwo">
<view class="comrtop">
<view class="comrname">一心只想撤撤撤</view>
<view class="comdate">2019年10月12日</view>
<view class="comrname">{{item.nickname}}</view>
<view class="comdate">{{item.createtime}}</view>
</view>
<view class="listzan flexone">
<view class="listzan flexone" bindtap="xiaozan" data-id="{{item.id}}" data-index="{{index}}">
<view class="lsitzanleft">
<image src="/img/xiaozan.png"></image>
<image src="/img/yizan.png"></image>
</view>
<view class="zannumber">35</view>
<view class="zannumber">{{item.praise_num}}</view>
</view>
</view>
... ... @@ -108,65 +137,44 @@
<view class="comleft"></view>
<view class="comright">
<view class="text">
掌柜态度很专业热情,有问必答,回复也很快,我问了不少问题,他都不觉得烦,都会认真回答我,这点我向掌柜表示由衷的敬意,这样的好掌柜可不多了。
</view>
{{item.content}}
</view>
</view>
</view>
<view class="commentitem">
<view class="comtop flextwo">
<view class="comleft">
<image src="/img/kele.png"></image>
</view>
<view class="comright">
<view class="listtop flextwo">
<view class="comrtop">
<view class="comrname">一心只想撤撤撤</view>
<view class="comdate">2019年10月12日</view>
</view>
<view class="listzan flexone">
<view class="lsitzanleft">
<image src="/img/xiaozan.png"></image>
</view>
<view class="zannumber">35</view>
</view>
</view>
</view>
</view>
<view class="comtext flexone">
<view class="comleft"></view>
<view class="comright">
<view class="text">
掌柜态度很专业热情,有问必答,回复也很快,我问了不少问题,他都不觉得烦,都会认真回答我,这点我向掌柜表示由衷的敬意,这样的好掌柜可不多了。
</view>
</view>
<!-- 底部评论 -->
<view class="commentbototm flextwo">
<view class="commbotleft {{sendactive==true?'commentleftactive':''}}">
<input placeholder="写点什么..." placeholder-class="enter" bindinput='enterword' bindblur='finish' />
</view>
<view class="combotright flexone" wx:if="{{sendactive==false}}">
<view class="combotitem flexone itemleft" bindtap="praise" data-id="{{commentdetail.id}}">
<view class="combotitemleft">
<image src="/img/dazan.png" wx:if="{{ispraise==false}}"></image>
<image src="/img/yizan.png" wx:else></image>
</view>
<view class="combotzannumber {{ispraise==true?'praiseactive':''}}">{{commentdetail.praise_num}}</view>
</view>
</view>
<!-- 底部评论 -->
<view class="commentbototm flextwo">
<view class="commbotleft">
<input placeholder="写点什么..." placeholder-class="enter"/>
<view class="combotitem flexone" bindtap="collect" data-id="{{commentdetail.id}}">
<view class="combotitemleft">
<image src="/img/xin.png" wx:if="{{iscollect==false}}"></image>
<image src="/img/yicollect.png" wx:else></image>
</view>
<view class="combotright flexone">
<view class="combotitem flexone itemleft">
<view class="combotitemleft ">
<image src="/img/dazan.png"></image>
<view class="combotzannumber {{iscollect==true?'praiseactive':''}}">{{commentdetail.collect_num}}</view>
</view>
<view class="combotzannumber">23</view>
</view>
<view class="combotitem flexone">
<view class="combotitemleft">
<image src="/img/collect.png"></image>
<view class="send" bindtap="{{sendshow==false?'send':''}}" wx:else>
<view class="sendimg">
<image src="/img/yousend.png"></image>
</view>
<view class="combotzannumber">23</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
@import '../morecomment/morecomment.wxss';
@import '../examine/examine.wxss';
.photo {
margin-top: 0;
background: #fff;
... ... @@ -70,29 +70,53 @@
color: #bdc4ce;
font-size: 24rpx;
}
.commbotleft input{
width:100%;
height:100%;
.commbotleft input {
width: 100%;
height: 100%;
padding: 12rpx 38rpx;
box-sizing: border-box;
}
.enter {
color: #bdc4ce;
font-size: 24rpx;
}
.combotitemleft{
width:44rpx;
height:44rpx;
font-size: 0
.combotitemleft {
width: 44rpx;
height: 44rpx;
font-size: 0;
}
.combotzannumber{
color:#06121E;
.combotzannumber {
color: #06121e;
font-size: 24rpx;
margin-left:6rpx;
margin-left: 6rpx;
}
.praiseactive{
color:#FA8183
}
.itemleft {
margin-right: 40rpx;
}
.send {
width: 96rpx;
height: 56rpx;
background: rgba(253, 170, 42, 1);
opacity: 1;
border-radius: 8rpx;
display:flex;
justify-content: center;
align-items: center
}
.sendimg{
width:30rpx;
height:26rpx;
font-size:0
}
.itemleft{
margin-right:40rpx;
.commentleftactive{
width:560rpx;
}
\ No newline at end of file
... ...
// pages/homepage/homepage.js
const app = getApp();
// var util = require('../../utils/util.js');
Page({
/**
* 页面的初始数据
*/
data: {
imgUrls: [
'../../img/bannerimg.png',
'../../img/bannerimg.png',
'../../img/bannerimg.png'
],
imgUrls: [],
indicatorDots: false,
autoplay: false,
autoplay: true,
interval: 2000,
duration: 1000,
currentSwiper: 0,
... ... @@ -25,95 +24,231 @@ Page({
selarray: ['全部', '银座', '金座'],
toparr: ['商圈', '菜系', '评级', '综合'],
topindex: 0,
wrap:false,
wrap: false,
// 国家
countryname: '',
countryid: '',
userinfo: '',
page: 1,
goodlist: [],
business_id: '',
series_id: '',
grade_id: '',
composite_id: '',
city_id:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
console.log(this.data.navindex)
this.getcountry();
// 获取banner
this.getbanner()
},
// 获取轮播图
getbanner() {
let that = this;
var url = 'sundry/get_slide';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
imgUrls: res
})
}).catch((err) => {
})
},
goodtail(){
goodtail(e) {
let token = wx.getStorageSync("token");
if (token == '') {
wx.showToast({
title: '请先登录',
icon: "none"
})
setTimeout(function() {
wx.navigateTo({
url: '/pages/index/index',
})
}, 1500)
} else {
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/shopdetail/shopdetail',
url: '/pages/shopdetail/shopdetail?id=' + id,
})
}
},
// 页面头部切换
selnav(e){
selnav(e) {
this.setData({
sel:e.currentTarget.dataset.index,
wrap:true
sel: e.currentTarget.dataset.index,
wrap: true
})
if(this.data.sel==0){
if (this.data.sel == 0) {
this.setData({
selarray: ['全部', '银座', '金座'],
selt:0,
selk: ''
selt: 0,
selk: '',
goodlist: []
})
}else if(this.data.sel==1){
this.getshanguqan();
this.gethomelist()
} else if (this.data.sel == 1) {
this.setData({
selarray: ['东京菜(234)', '神户菜(23)', '大阪菜(45)'],
selt: 1,
selk: ''
selk: '',
goodlist: []
})
}else if(this.data.sel==2){
this.getcai();
this.gethomelist()
} else if (this.data.sel == 2) {
this.setData({
selarray: ['米其林三星级(123)', '米其林二星级(123)', '米其林一星级(123)'],
selt: 2,
selk: ''
selk: '',
goodlist: []
})
this.getrank();
this.gethomelist()
} else if (this.data.sel == 3) {
this.setData({
selarray: ['好评优先', '距离优先', '高价优先','低价优先'],
selt: 3,
selk: ''
selk: '',
goodlist: []
})
this.gettotal();
this.gethomelist()
}
},
// 遮罩层头部切换
selnavk(e) {
this.setData({
selt: e.currentTarget.dataset.index
selt: e.currentTarget.dataset.index,
sel: e.currentTarget.dataset.index
})
if (this.data.selt == 0) {
this.setData({
selarray: ['全部', '银座', '金座'],
goodlist: []
})
this.getshanguqan();
this.gethomelist()
} else if (this.data.selt == 1) {
this.setData({
selarray: ['东京菜(234)', '神户菜(23)', '大阪菜(45)'],
goodlist: []
})
this.getcai();
this.gethomelist()
} else if (this.data.selt == 2) {
this.setData({
selarray: ['米其林三星级(123)', '米其林二星级(123)', '米其林一星级(123)'],
goodlist: []
})
this.getrank();
this.gethomelist()
} else if (this.data.selt == 3) {
this.setData({
selarray: ['好评优先', '距离优先', '高价优先', '低价优先'],
goodlist: []
})
this.gettotal();
this.gethomelist()
}
},
go(){
go() {
},
selwrap(e) {
this.setData({
selk: e.currentTarget.dataset.index
let that = this;
let id = e.currentTarget.dataset.id;
let type = e.currentTarget.dataset.type;
that.setData({
goodlist: []
})
this.data.selarray.forEach(function(value, index, array) {
if (id == value.id) {
value.sel = !value.sel;
if (value.sel == true) {
if (type == 1) {
that.setData({
business_id: id
})
} else if (type == 2) {
that.setData({
series_id: id
})
} else if (type == 3) {
that.setData({
grade_id: id
})
console.log(this.data.selk)
} else if (type == 4) {
that.setData({
composite_id: id
})
}
} else {
if (type == 1) {
that.setData({
business_id: ''
})
} else if (type == 2) {
that.setData({
series_id: ''
})
} else if (type == 3) {
that.setData({
grade_id: ''
})
} else if (type == 4) {
that.setData({
composite_id: ''
})
}
}
} else {
value.sel = false;
}
})
that.setData({
selarray: that.data.selarray
})
that.gethomelist()
},
selctcity() {
let token = wx.getStorageSync("token");
if (token == '') {
wx.showToast({
title: '请先登录',
icon: "none"
})
setTimeout(function() {
wx.navigateTo({
url: '/pages/index/index',
})
}, 1500)
} else {
wx.navigateTo({
url: '/pages/searchcity/searchcity',
url: '/pages/searchcity/searchcity?countryid=' + this.data.countryid + '&cityname=' + app.globalData.cityname + '&cityid=' + this.data.userinfo.city_id,
})
}
},
swiperChange: function(e) {
... ... @@ -123,16 +258,232 @@ Page({
},
// 搜索框
search() {
let token = wx.getStorageSync("token");
if (token == '') {
wx.showToast({
title: '请先登录',
icon: "none"
})
setTimeout(function () {
wx.navigateTo({
url: '/pages/index/index',
})
}, 1500)
}else{
wx.navigateTo({
url: '/pages/searchresult/searchresult',
})
}
},
// 隐藏遮罩层
hidewrap(){
// 隐藏遮罩层
hidewrap() {
this.setData({
wrap:false
wrap: false
})
},
// 获取用户信息
getuserinfo() {
let that = this;
var url = 'member/index';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
console.log('37494', app.globalData.cityname)
if (app.globalData.cityname != undefined) {
res.city_name = app.globalData.cityname
that.setData({
userinfo: res
})
} else {
that.setData({
userinfo: res
})
app.globalData.cityname=res.city_name==null?'东京':res.city_name
}
console.log('9999', app.globalData.cityname)
that.getshanguqan();
that.gethomelist()
}).catch((err) => {
})
},
// 获取首页列表
gethomelist() {
let that = this;
var url = 'index/getShopList';
console.log('234924',that.data.userinfo)
var params = {
page: that.data.page,
limit: 15,
business_id: that.data.business_id,
series_id: that.data.series_id,
grade_id: that.data.grade_id,
composite_id: that.data.composite_id,
is_recommend: 0,
city_id: that.data.userinfo.city_id == null ? 1 : that.data.userinfo.city_id,
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
goodlist: that.data.goodlist.concat(res.data)
})
that.data.goodlist.forEach(function(value, index, array) {
value.level = value.level.toFixed("1")
})
that.setData({
goodlist: that.data.goodlist
})
}).catch((err) => {
})
},
// 获取国家
getcountry() {
let that = this;
var url = 'sundry/get_country';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
countryname: res[0].name,
countryid: res[0].id
})
}).catch((err) => {
})
},
// 获取商圈
getshanguqan() {
let that = this;
var url = 'sundry/get_business';
var params = {
city_id: that.data.userinfo.city_id == null?'' : that.data.userinfo.city_id,
}
app.post(url, params, "post").then((res) => {
console.log(res);
that.setData({
selarray: res,
})
that.data.selarray.forEach(function(value, index, array) {
value.sel = false;
value.type = 1;
if (that.data.business_id == value.id) {
value.sel = true
}
})
that.setData({
selarray: that.data.selarray
})
}).catch((err) => {
})
},
// 获取菜系
getcai() {
let that = this;
var url = 'sundry/get_series';
var params = {
}
app.post(url, params, "post").then((res) => {
console.log(res);
that.setData({
selarray: res,
})
that.data.selarray.forEach(function(value, index, array) {
value.sel = false;
value.type = 2;
if (that.data.series_id == value.id) {
value.sel = true
}
})
that.setData({
selarray: that.data.selarray
})
}).catch((err) => {
})
},
// 获取评级
getrank() {
let that = this;
var url = 'sundry/get_grade';
var params = {
}
app.post(url, params, "post").then((res) => {
console.log(res);
that.setData({
selarray: res,
})
that.data.selarray.forEach(function(value, index, array) {
value.sel = false;
value.type = 3;
if (that.data.grade_id == value.id) {
value.sel = true
}
})
that.setData({
selarray: that.data.selarray
})
}).catch((err) => {
})
},
// 获取综合评分
gettotal() {
let that = this;
var url = 'sundry/get_score_option';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
selarray: res,
})
that.data.selarray.forEach(function(value, index, array) {
value.sel = false;
value.type = 4;
if (that.data.composite_id == value.id) {
value.sel = true
}
})
that.setData({
selarray: that.data.selarray
})
}).catch((err) => {})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -144,7 +495,13 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.setData({
page:1,
goodlist:[]
})
this.getuserinfo();
// //获取首页列表
// this.gethomelist();
},
/**
... ...
{
"navigationBarTitleText": "美味日本"
"navigationBarTitleText": "美味星球"
}
\ No newline at end of file
... ...
... ... @@ -4,7 +4,7 @@
<view class="headleftimg">
<image src="/img/address.png" mode=""></image>
</view>
<view class="cityname commonname">日本</view>
<view class="cityname commonname">{{userinfo.city_name==null?'东京':userinfo.city_name}}</view>
</view>
<view class="headmiddle" bindtap="search">
<view class="headmiddleleft">
... ... @@ -19,10 +19,10 @@
</view>
<view class="swiper_image">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" class="swiper_item_img" bindchange="swiperChange">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" class="swiper_item_img" bindchange="swiperChange" circular="true">
<block wx:for="{{imgUrls}}" wx:key="doct">
<swiper-item>
<image src="{{item}}" class="slide-image" />
<image src="{{item.image}}" class="slide-image" />
<view class="picimg">
<image src="/img/meitu.png"></image>
</view>
... ... @@ -49,21 +49,23 @@
</view>
</view>
<view class='case-page'>
<view class="nodata" wx:if="{{goodlist.length==0}}">暂无数据</view>
<view class='case-page' wx:else>
<view class='list-masonry'>
<view class='item-masonry' bindtap="goodtail">
<image src='/img/deng.png' mode='widthFix'></image>
<view class="goodname">基值支义们京候么眼革下使叫南石很少去构。</view>
<view class="intro flexone">
<view class='item-masonry' bindtap="goodtail" data-id="{{item.id}}" wx:for="{{goodlist}}" wx:key="" >
<image src='{{item.image}}' mode='widthFix'></image>
<view class="goodname">{{item.name}}</view>
<view class="intro flextwo">
<view class="introleft">
魚介?海鮮料理
{{item.series_name}}
</view>
<view class="introright">
<view class="ping flexone">
<view class="pingleft">
<image src='/img/kuaizi.png'></image>
</view>
<view class="pingfen">4.7</view>
<view class="pingfen">{{item.level}}</view>
</view>
<view class="hualist flexone">
<view class="huaitem">
... ... @@ -79,17 +81,17 @@
</view>
</view>
<view class="shou">
<text class="shoumoney">¥50</text>
<text class="shoumoney">¥{{item.price}}</text>
<text class="shouren">/人</text>
</view>
<view class="addname flexone">
<view class="addimg">
<image src="/img/huangweizhi.png"></image>
</view>
<view class="dizhi commnameone">银厦</view>
<view class="dizhi commnameone">{{item.city_name}}</view>
</view>
</view>
<view class='item-masonry'>
<!-- <view class='item-masonry'>
<image src='/img/deng.png' mode='widthFix'></image>
<view class="goodname">基值支义们京候么眼革下使叫南石很少去构。</view>
<view class="intro flexone">
... ... @@ -278,7 +280,7 @@
</view>
<view class="dizhi commnameone">银厦</view>
</view>
</view>
</view> -->
</view>
</view>
... ... @@ -295,14 +297,9 @@
</view>
</view>
<view class="wrappage">
<view class="wrapitem {{selk==index?'wrapactive':''}}" wx:for="{{selarray}}" wx:key="" catchtap="selwrap" data-index="{{index}}">
{{item}}
<view class="wrapitem {{item.sel==true?'wrapactive':''}}" wx:for="{{selarray}}" wx:key="" catchtap="selwrap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
{{item.name}}
</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -63,8 +63,8 @@ swiper-item {
/*未选中时的小圆点样式 */
.dot {
width: 12rpx;
height: 12rpx;
width: 14rpx;
height: 14rpx;
border-radius: 50%;
margin-right: 16rpx;
background-color: #b9c0f7;
... ... @@ -139,7 +139,7 @@ swiper-item {
break-inside: avoid;
box-sizing: border-box;
padding: 20rpx;
margin-bottom: 28rpx;
/* margin-bottom: 28rpx; */
box-shadow: 0rpx 8rpx 16rpx rgba(0, 0, 0, 0.08);
border-radius: 8rpx;
}
... ... @@ -154,10 +154,12 @@ swiper-item {
font-weight: bold;
margin-top: 20rpx;
width: 296rpx;
margin-bottom:10rpx;
}
.hualist {
margin-top: 4rpx;
justify-content: flex-end
}
.huaitem {
... ... @@ -174,9 +176,14 @@ swiper-item {
}
.pingfen {
overflow: hidden;
text-overflow: ellipsis;
color: #fca052;
font-size: 22rpx;
margin-left: 6rpx;
text-align: right;
margin-right:8rpx;
}
.introleft {
... ... @@ -248,11 +255,14 @@ page {
.wrapitem{
color:#06121E;
font-size: 24rpx;
font-weight: bold;
/* font-weight: bold; */
padding: 16rpx 52rpx;
box-sizing: border-box;
border-bottom:1rpx solid #f5f5f5;
}
.wrapitem:last-child{
border-bottom:none;
}
.wrappage{
margin-top:26rpx;
}
... ...
... ... @@ -4,51 +4,114 @@ const app = getApp()
Page({
data: {
motto: 'Hello World',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo')
sessionKey: '',
openid: '',
iv: '',
encryptedData: '',
type:'',
shopid:''
},
//事件处理函数
bindViewTap: function() {
wx.navigateTo({
url: '../logs/logs'
onLoad: function (options) {
if(options.type!=undefined){
this.setData({
type:options.type,
shopid:options.id
})
}
},
onLoad: function () {
if (app.globalData.userInfo) {
this.setData({
userInfo: app.globalData.userInfo,
hasUserInfo: true
// 登录
start(e) {
console.log(e)
console.log(434348389)
let that = this;
that.setData({
iv: e.detail.iv,
encryptedData: e.detail.encryptedData
})
} else if (this.data.canIUse){
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
app.userInfoReadyCallback = res => {
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
console.log(this.data.iv);
console.log(this.data.encryptedData)
wx.getSetting({
success(res) {
console.log("res", res)
if (res.authSetting['scope.userInfo']) {
console.log(348438)
wx.login({
success: (res) => {
console.log(res)
var url = 'user/getSessionKey';
var params = {
code: res.code,
}
app.post(url, params).then((res) => {
console.log(res);
console.log(435485, res.session_key)
that.setData({
sessionKey: res.session_key,
openid: res.openid
})
wx.setStorageSync("sessionKey", res.session_key)
wx.setStorageSync("openid", res.openid)
that.login()
}).catch((err) => {
})
}
});
} else {
// 在没有 open-type=getUserInfo 版本的兼容处理
wx.getUserInfo({
success: res => {
app.globalData.userInfo = res.userInfo
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
console.log("未授权=====")
// wx.switchTab({
// url: '/pages/homepage/homepage',
// })
}
}
})
},
login() {
let that = this;
console.log(378784)
let url = 'user/login';
let params = {
session_key: that.data.sessionKey,
iv: that.data.iv,
encrypted_data: that.data.encryptedData,
openid: that.data.openid
}
app.post(url, params, 'post').then((res) => {
console.log(res)
wx.setStorageSync('token', res.token);
if(that.data.type==1){
wx.navigateTo({
url: '/pages/shopdetail/shopdetail?id='+that.data.shopid,
})
}else{
wx.switchTab({
url: '/pages/homepage/homepage',
})
}
},
getUserInfo: function(e) {
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
}).catch((errMsg) => {
console.log(errMsg)
})
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
"navigationBarTitleText": "美味星球"
}
\ No newline at end of file
... ...
<!--index.wxml-->
<view class="container">
<view class="userinfo">
<button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
<block wx:else>
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
</block>
</view>
<view class="usermotto">
<text class="user-motto">{{motto}}</text>
<view class="box">
<view class='logo'>
<image src="/img/logo.png"></image>
</view>
<button open-type="getUserInfo" bindgetuserinfo='start' class="bottomtextright" >微信授权</button>
</view>
... ...
/**index.wxss**/
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
.logo {
width: 197rpx;
height: 197rpx;
font-size: 0;
margin: 120rpx auto 0;
border-radius: 50%;
}
.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
.logon image{
border-radius: 50%;
}
.userinfo-nickname {
color: #aaa;
}
.bottomtextright {
width: 360rpx;
height: 80rpx;
background: rgba(253, 172, 48, 1);
border: 2rpx solid rgba(253, 170, 42, 1);
opacity: 1;
border-radius: 8rpx;
color:#fff;
font-size: 28rpx;
text-align: center;
.usermotto {
margin-top: 200px;
margin:522rpx auto 0;
}
button::after{
border:none;
outline:none;
}
... ...
// pages/morecomment/morecomment.js
const app=getApp()
Page({
/**
... ... @@ -6,30 +7,65 @@ Page({
*/
data: {
comentarr: ['全部', '好评', '差评', '带图评论'],
coment:0,
page:1,
shopid:'',
commentlist:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
console.log(options)
this.setData({
shopid:options.shopid
})
this.getmorecomment()
},
selitem(e){
console.log(e)
this.setData({
coment: e.currentTarget.dataset.index
coment: e.currentTarget.dataset.index,
page:1,
commentlist:[]
})
this.getmorecomment()
},
comdetail(){
// 获取更多的评论列表
getmorecomment(){
let that = this;
console.log(that.data.coment)
var url = '/remark/getRemarkList';
var params = {
page: that.data.page,
shop_id:that.data.shopid,
limit:15,
type:that.data.comment
}
app.post(url, params,"post").then((res) => {
console.log(res);
that.setData({
commentlist: that.data.commentlist.concat(res.data)
})
}).catch((err) => {
})
},
// 点评详情
comentdetail(e) {
let commentid = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/commentdetail/commentdetail',
url: '/pages/commentdetail/commentdetail?commentid=' + commentid + '&shopid=' + this.data.shopid,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -69,7 +105,13 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
let newpage=this.data.page;
newpage++;
this.setData({
page:newpage
})
this.getmorecomment()
},
/**
... ...
... ... @@ -2,35 +2,46 @@
<view class="commenttopitem {{coment==index?'comactive':''}}" wx:for="{{comentarr}}" wx:key="" bindtap="selitem" data-index="{{index}}">{{item}}</view>
</view>
<view class="bodybox">
<view class="photo" >
<view class="jianintro photobox" bindtap="comdetail">
<view class="photo" wx:for="{{commentlist}}" wx:key="">
<view class="jianintro photobox" bindtap="comentdetail" data-id="{{item.id}}">
<view class="comtop flextwo">
<view class="comleft">
<image src="/img/kele.png"></image>
<image src="{{item.avatar}}"></image>
</view>
<view class="comright">
<view class="comrtop flextwo">
<view class="comrname">一心只想撤撤撤</view>
<view class="comrname">{{item.nickname}}</view>
<view class="star starone flexone">
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/star.png" wx:if="{{item.user_level>=1}}"></image>
<image src="/img/huangkong.png" wx:if="{{item.user_level<0.5}}"></image>
<image src="/img/huangban.png" wx:if="{{item.user_level>=0.5&&tem.user_level<1}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/star.png" wx:if="{{item.user_level>=2}}"></image>
<image src="/img/huangkong.png" wx:if="{{item.user_level<1.5}}"></image>
<image src="/img/huangban.png" wx:if="{{item.user_level==1.5&&tem.user_level<2}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/star.png" wx:if="{{item.user_level>=3}}"></image>
<image src="/img/huangkong.png" wx:if="{{item.user_level<2.5}}"></image>
<image src="/img/huangban.png" wx:if="{{item.user_level>=2.5&&item.user_level<3}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/star.png" wx:if="{{item.user_level>=4}}"></image>
<image src="/img/huangkong.png" wx:if="{{item.user_level<3.5}}"></image>
<image src="/img/huangban.png" wx:if="{{item.user_level>=3.5&&item.user_level<4}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/star.png" wx:if="{{item.user_level>=5}}"></image>
<image src="/img/huangkong.png" wx:if="{{item.user_level<4.5}}"></image>
<image src="/img/huangban.png" wx:if="{{item.user_level>=4.5&&item.user_level<5}}"></image>
</view>
</view>
</view>
<view class="comdate">2019年10月12日</view>
<view class="comdate">{{item.createtime}}</view>
</view>
</view>
... ... @@ -41,39 +52,48 @@
<view class="flexone fenxia">
<view class="star starone flexone">
<view class="staritem">
<image src="/img/star.png"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.score>=1}}"></image>
<image src="/img/noxing.png" wx:if="{{item.score<0.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.score>=0.5&&item.score<1}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.score>=2}}"></image>
<image src="/img/noxing.png" wx:if="{{item.score<1.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.score>=1.5&&item.score<2}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.score>=3}}"></image>
<image src="/img/noxing.png" wx:if="{{item.score<2.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.score>=2.5&&item.score<3}}"></image>
</view>
<view class="staritem">
<image src="/img/banke.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.score>=4}}"></image>
<image src="/img/noxing.png" wx:if="{{item.score<3.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.score>=3.5&&item.score<4}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.score>=5}}"></image>
<image src="/img/noxing.png" wx:if="{{item.score<4.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.score>=4.5&&item.score<5}}"></image>
</view>
</view>
<view class="fen">8.5分</view>
<view class="fen">{{item.score}}分</view>
</view>
<view class="text">
掌柜态度很专业热情,有问必答,回复也很快,我问了不少问题,他都不觉得烦,都会认真回答我,这点我向掌柜表示由衷的敬意,这样的好掌柜可不多了。
{{item.content}}
</view>
<view class="textboximg flexone">
<view class="boxitem">
<image src="/img/photo.png"></image>
<view class="boxitem" wx:for='{{item.images}}' wx:key="">
<image src="{{item}}"></image>
</view>
<view class="boxitem">
<!-- <view class="boxitem">
<image src="/img/photo.png"></image>
</view>
<view class="boxitem">
<image src="/img/photo.png"></image>
</view>
</view> -->
</view>
</view>
... ... @@ -81,7 +101,7 @@
</view>
</view>
</view>
<view class="photo" >
<!-- <view class="photo" >
<view class="jianintro photobox" bindtap="comdetail">
<view class="comtop flextwo">
<view class="comleft">
... ... @@ -159,6 +179,6 @@
</view>
</view>
</view>
</view> -->
</view>
\ No newline at end of file
... ...
// pages/morephoto/morephoto.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
photolist:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getphoto()
},
// 获取相册
getphoto(){
let that = this;
var url = '/member/getPhoto';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
photolist:res
})
}).catch((err) => {
})
},
previewimg(e){
let that=this;
let index=e.currentTarget.dataset.index;
wx.previewImage({
current: that.data.photolist[index],
urls: that.data.photolist,
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
<view class="photoptop flexone">
<view class="photoitem">
<image src="/img/photo.png"></image>
</view>
<view class="photoitem">
<image src="/img/photo.png"></image>
</view>
<view class="photoitem">
<image src="/img/photo.png"></image>
</view>
<view class="photoitem">
<image src="/img/photo.png"></image>
</view>
<view class="photoitem">
<image src="/img/photo.png"></image>
</view>
<view class="photoitem lastimg">
<image src="/img/photo.png"></image>
<view class="noimg" wx:if="{{photolist.length==0}}">
<view class="nodataimg" >
<image src="/img/nodataimg.png"></image>
</view>
<view class="photoitem">
<image src="/img/photo.png"></image>
<view class="nomoer nomoredata">没有更多了哦~</view>
</view>
<view class="photoitem">
<image src="/img/photo.png"></image>
<view class="photoptop flexone" wx:else>
<view class="photoitem" wx:for='{{photolist}}' wx:key="" bindtap='previewimg' data-index="{{index}}">
<image src="{{item}}" mode="aspectFit" ></image>
</view>
<view class="photoitem lastimg">
<image src="/img/photo.png"></image>
</view>
</view>
\ No newline at end of file
... ...
// pages/morepic/morepic.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
images:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
images: app.globalData.images
})
console.log(this.data.images)
},
previewimg(e) {
let that = this;
let index = e.currentTarget.dataset.index;
wx.previewImage({
current: that.data.images[index],
urls: that.data.images,
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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="noimg" wx:if="{images.length==0}}">
<view class="nodataimg" >
<image src="/img/nodataimg.png"></image>
</view>
<view class="nomoer nomoredata">没有更多了哦~</view>
</view>
<view class="photoptop flexone" wx:else>
<view class="photoitem" wx:for='{{images}}' wx:key="" bindtap="previewimg" data-index="{{index}}">
<image src="{{item}}"></image>
</view>
</view>
\ No newline at end of file
... ...
@import '../shopdetail/shopdetail.wxss';
.jianintro {
background: #FBF8FB;
}
.photobox{
padding: 30rpx;
box-sizing: border-box;
}
.photoitem{
width:214rpx;
height:214rpx;
}
.photoptop{
padding: 30rpx 12rpx 30rpx 30rpx;
flex-wrap: wrap
}
\ No newline at end of file
... ...
// pages/morecomment/morecomment.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
comentarr: ['全部', '已发布', '审核中', '未通过'],
comentarr: ['全部', '审核中', '已发布', '未通过'],
coment: 0,
type:'',
commentlist:[],
page:1
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getcomment()
},
selitem(e) {
console.log(e)
this.setData({
coment: e.currentTarget.dataset.index
coment: e.currentTarget.dataset.index,
page:1,
commentlist:[]
})
console.log(this.data.coment)
if (this.data.coment==0){
this.setData({
type:''
})
} else if (this.data.coment==1){
console.log(this.data.comment)
this.setData({
type:1
})
console.log(this.data.type)
} else if (this.data.coment==2){
this.setData({
type:2
})
} else if (this.data.coment == 3) {
this.setData({
type: 3
})
}
console.log(this.data.type)
this.getcomment()
},
comdetail() {
... ... @@ -28,6 +58,129 @@ Page({
})
},
// 获取我的评论
getcomment(){
console.log(990900)
var that = this;
var url = 'member/getRemark';
var params = {
type: that.data.type,
page:that.data.page,
limit:15
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
commentlist: that.data.commentlist.concat(res.data)
})
}).catch((err) => {
})
},
// 店铺收藏
collect(e){
let id=e.currentTarget.dataset.id;
let index=e.currentTarget.dataset.index;
console.log(index)
let that = this;
var url = '/shop/shopCollect';
var params = {
shop_id: id,
}
app.post(url, params,"post").then((res) => {
console.log(res);
that.data.commentlist.forEach(function(value,indexk,array){
if(index==indexk){
if (value.is_collect==0){
value.is_collect=1;
wx.showToast({
title: '店铺收藏成功',
icon: 'none'
})
} else if (value.is_collect == 1){
value.is_collect = 0;
wx.showToast({
title: '取消店铺收藏成功',
icon: 'none'
})
}
}
})
that.setData({
commentlist: that.data.commentlist
})
console.log(that.data.commentlist)
}).catch((err) => {
})
},
goodtail(e) {
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/shopdetail/shopdetail?id=' + id,
})
},
// 删除点评
delcomment(e){
let that = this
let id=e.currentTarget.dataset.id;
wx.showModal({
title: '提示',
content: '是否删除此条评论',
success(res) {
if (res.confirm) {
var url = '/remark/deleteRemark';
var params = {
remark_id:id
}
app.post(url, params).then((res) => {
console.log(res);
wx.showToast({
title: '删除点评成功',
icon:'none'
})
console.log(6666)
that.setData({
commentlist:[],
page:1,
})
that.getcomment()
}).catch((err) => {
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
// 点评详情
comentdetail(e) {
let commentid = e.currentTarget.dataset.id;
let shopid=e.currentTarget.dataset.shop_id
wx.navigateTo({
url: '/pages/commentdetail/commentdetail?commentid='+commentid+'&shopid='+ this.data.shopid,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -67,7 +220,12 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let newpage=this.data.page;
newpage++;
this.setData({
page:newpage
})
this.getcomment()
},
/**
... ...
<view class="commenttop flexone">
<view class="commenttopitem {{coment==index?'comactive':''}}" wx:for="{{comentarr}}" wx:key="" bindtap="selitem" data-index="{{index}}">{{item}}</view>
</view>
<view class="bodybox">
<view class="photo">
<view class="jianintro photobox" bindtap="comdetail">
<view class="comtop flextwo">
<view class="comleft">
<image src="/img/kele.png"></image>
</view>
<view class="comright">
<view class="comrtop flextwo">
<view class="usertop flexone">
<view class="comrname">一心只想撤撤撤</view>
<view class="userlevel">Lv 20</view>
</view>
<view class="delimg">
<image src="/img/delimg.png"></image>
</view>
</view>
<view class="comdate">2019年10月12日</view>
</view>
</view>
<view class="comtext flexone">
<view class="comleft"></view>
<view class="comright">
<view class="flexone fenxia">
<view class="star starone flexone">
<view class="staritem">
<image src="/img/star.png"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
</view>
<view class="staritem">
<image src="/img/banke.png"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
</view>
</view>
<view class="fen">8.5分</view>
</view>
<view class="fuwu flexone">
<view class="fuwuitem">服务:4.2</view>
<view class="fuwuitem">口味:4.2</view>
<view class="fuwuitem">环境:4.2</view>
<view class="fuwuitem">食材:4.2</view>
</view>
<view class="text">
掌柜态度很专业热情,有问必答,回复也很快,我问了不少问题,他都不觉得烦,都会认真回答我,这点我向掌柜表示由衷的敬意,这样的好掌柜可不多了。
</view>
<view class="all">全部</view>
<view class="textboximg flexone">
<view class="boxitem">
<image src="/img/photo.png"></image>
</view>
<view class="boxitem">
<image src="/img/photo.png"></image>
</view>
<view class="boxitem">
<image src="/img/photo.png"></image>
</view>
</view>
</view>
</view>
</view>
<view class="jianbot flextwo">
<view class="jianleft flex">
<view class="collectbitemleft">
<image src="/img/photo.png"></image>
<view class="noimg" wx:if="{{commentlist.length==0}}">
<view class="nodataimg">
<image src="/img/nodataimg.png"></image>
</view>
<view class="collectbtitemr">
<view class="nomoer nomoredata">没有更多了哦~</view>
</view>
<view class='goodname goodtext'>海贼王寿司店</view>
<view class="addressbox flexone">
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view>
</view>
</view>
</view>
<view class="jianright">
<image src="/img/graycollect.png"></image>
</view>
</view>
<view class="combotright flexone">
<view class="combotitem flexone itemleft">
<view class="combotitemleft ">
<image src="/img/pingtiao.png"></image>
</view>
<view class="combotzannumber">23</view>
</view>
<view class="combotitem flexone">
<view class="combotitemleft">
<image src="/img/smallzan.png"></image>
</view>
<view class="combotzannumber">23</view>
</view>
</view>
</view>
<view class="photo">
<view class="jianintro photobox" bindtap="comdetail">
<view class="bodybox" wx:else>
<view class="photo" wx:for="{{commentlist}}" wx:key="">
<view class="jianintro photobox" bindtap="comentdetail" data-id="{{item.id}}" data-shopid="{{item.shop_id}}">
<view class="comtop flextwo">
<view class="comleft">
<image src="/img/kele.png"></image>
<image src="{{item.avatar}}"></image>
</view>
<view class="comright">
<view class="comrtop flextwo">
<view class="usertop flexone">
<view class="comrname">一心只想撤撤撤</view>
<view class="userlevel">Lv 20</view>
<view class="comrname">{{item.nickname}}</view>
<view class="userlevel">Lv {{item.user_level}}</view>
</view>
<view class="flexone">
<view class="statename">未通过</view>
<view class="delimg">
<view class="shenstatus" wx:if="{{item.status==1}}">审核中</view>
<view class="shenstatus" wx:if="{{item.status==3}}">审核未通过</view>
<view class="delimg" catchtap="delcomment" data-id="{{item.id}}">
<image src="/img/delimg.png"></image>
</view>
</view>
</view>
<view class="comdate">2019年10月12日</view>
<view class="comdate">{{item.createtime}}</view>
</view>
</view>
... ... @@ -146,49 +43,51 @@
<view class="comleft"></view>
<view class="comright">
<view class="flexone fenxia">
<view class="star starone flexone">
<view class="flexone starbox">
<view class="star flexone">
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.score1>=1}}"></image>
<image src="/img/noxing.png" wx:if="{{item.score1<0.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.score1>=0.5&&item.score1<1}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.score1>=2}}"></image>
<image src="/img/noxing.png" wx:if="{{item.score1<1.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.score1>=1.5&&item.score1<2}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.score1>=3}}"></image>
<image src="/img/noxing.png" wx:if="{{item.score1<2.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.score1>=2.5&&item.score1<3}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.score1>=4}}"></image>
<image src="/img/noxing.png" wx:if="{{item.score1<3.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.score1>=3.5&&item.score1<4}}"></image>
</view>
<view class="staritem">
<image src="/img/banke.png"></image>
<image src="/img/pingfenshi.png" wx:if="{{item.score1>=5}}"></image>
<image src="/img/noxing.png" wx:if="{{item.score1<4.5}}"></image>
<image src="/img/banke.png" wx:if="{{item.score1>=4.5&&item.score1<5}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png"></image>
</view>
</view>
<view class="fen">8.5分</view>
<view class="shouprice">¥{{item.price}}/人</view>
</view>
<view class="fuwu flexone">
<view class="fuwuitem">服务:4.2</view>
<view class="fuwuitem">口味:4.2</view>
<view class="fuwuitem">环境:4.2</view>
<view class="fuwuitem">食材:4.2</view>
<view class="fuwuitem">服务:{{item.score2}}</view>
<view class="fuwuitem">口味:{{item.score3}}</view>
<view class="fuwuitem">环境:{{item.score4}}</view>
<view class="fuwuitem">食材:{{itme.score5}}</view>
</view>
<view class="text">
掌柜态度很专业热情,有问必答,回复也很快,我问了不少问题,他都不觉得烦,都会认真回答我,这点我向掌柜表示由衷的敬意,这样的好掌柜可不多了。
</view>
<view class="all">全部</view>
<view class="textboximg flexone">
<view class="boxitem">
<image src="/img/photo.png"></image>
{{item.content}}
</view>
<view class="boxitem">
<image src="/img/photo.png"></image>
</view>
<view class="boxitem">
<image src="/img/photo.png"></image>
<!-- <view class="all">全部</view> -->
<view class="textboximg flexone" wx:if="{{item.images.length!=0}}">
<view class="boxitem" wx:for="{{item.images}}" wx:key="">
<image src="{{item}}"></image>
</view>
</view>
</view>
... ... @@ -198,22 +97,23 @@
<view class="jianbot flextwo">
<view class="jianleft flex">
<view class="collectbitemleft">
<image src="/img/photo.png"></image>
<image src="{{item.image}}"></image>
</view>
<view class="collectbtitemr">
<view class='goodname goodtext'>海贼王寿司店</view>
<view class='goodname goodtext'>{{item.shop_name}}</view>
<view class="addressbox flexone">
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>东京街</view>
<view class='asddressitem'>{{item.business_name}}</view>
<view class='asddressitem'>{{item.series_name}}</view>
<!-- <view class='asddressitem'>东京街</view> -->
</view>
</view>
</view>
<view class="jianright">
<image src="/img/graycollect.png"></image>
<view class="jianright" bindtap="collect" data-id="{{item.shop_id}}" data-index="{{index}}">
<image src="/img/graycollect.png" wx:if="{{item.is_collect==0}}"></image>
<image src="/img/yellowcollect.png" wx:if="{{item.is_collect==1}}"></image>
</view>
</view>
... ... @@ -228,11 +128,13 @@
<view class="combotitemleft">
<image src="/img/smallzan.png"></image>
</view>
<view class="combotzannumber">23</view>
<view class="combotzannumber">{{item.praise_num}}</view>
</view>
</view>
</view>
</view>
<view class="nomoer">没有更多了哦~</view>
\ No newline at end of file
<!-- <view class="nomoer">没有更多了哦~</view> -->
\ No newline at end of file
... ...
... ... @@ -137,3 +137,12 @@
line-height: 36rpx;
margin-right:14rpx;
}
.shenstatus{
padding: 2rpx 18rpx;
border-radius: 180rpx;
background:#BDC4CE;
color:#fff;
font-size: 22rpx;
text-align: center;
margin-right:26rpx;
}
\ No newline at end of file
... ...
... ... @@ -5,13 +5,25 @@ Page({
* 页面的初始数据
*/
data: {
totalstar: 0,
servicestar: 0,
taststar: 0,
environmentstar: 0,
foodstar: 0,
mark:'',
money:'',
image:[],
cimage:[],
shopid:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
shopid:options.shopid
})
if(options.type==1){
wx.setNavigationBarTitle({
title: '传照片'
... ... @@ -23,6 +35,193 @@ Page({
}
},
// 上传图片
chooseImage() {
let that = this;
wx.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
success: function (res) {
console.log(res.tempFilePaths[0])
app.upload('image', res.tempFilePaths[0], "post").then((res) => {
console.log('上传文件', res);
let url = app.globalData.baseurl + res.url;
that.data.image.push(url)
that.data.cimage.push(res.url)
that.setData({
image: that.data.image,
cimage: that.data.cimage
})
console.log(that.data.image);
console.log(that.data.cimage)
}).catch((err) => {
console.log(err)
})
},
fail: function (res) { }
})
},
// 删除图片
del(e) {
let that = this;
let url = e.currentTarget.dataset.url;
that.data.image.forEach(function (value, index, array) {
if (value == url) {
that.data.image.splice(index, 1);
that.data.cimage.splice(index, 1)
}
})
that.setData({
image: that.data.image,
cimage: that.data.cimage
})
console.log(that.data.image);
console.log(that.data.cimage)
},
entermark(e){
this.setData({
mark:e.detail.value
})
},
// 综合评分
total(e) {
let id = e.currentTarget.dataset.id;
this.setData({
totalstar: id
})
},
// 服务评分
service(e) {
let id = e.currentTarget.dataset.id
this.setData({
servicestar: id
})
},
// 口味评分
tast(e) {
let id = e.currentTarget.dataset.id
this.setData({
taststar: id
})
},
// 环境评分
envirment(e) {
let id = e.currentTarget.dataset.id
this.setData({
environmentstar: id
})
},
// 食材评分
food(e) {
let id = e.currentTarget.dataset.id
this.setData({
foodstar: id
})
},
// 输入金额
entermoney(e) {
this.setData({
money: e.detail.value
})
console.log(this.data.money)
},
publish() {
let that = this;
if(that.data.mark==''){
wx.showToast({
title: '请输入评论内容',
icon: "none"
})
return false
}
if (that.data.totalstar == 0) {
wx.showToast({
title: '请选择综合评分',
icon: "none"
})
return false
}
if (that.data.servicestar == 0) {
wx.showToast({
title: '请选择服务评分',
icon: "none"
})
return false
}
if (that.data.taststar == 0) {
wx.showToast({
title: '请选择口味评分',
icon: "none"
})
return false
}
if (that.data.environmentstar == 0) {
wx.showToast({
title: '请选择环境评分',
icon: "none"
})
return false
}
if (that.data.money==''){
wx.showToast({
title: '请输入人均消费',
icon:'none'
})
return false
}
if (that.data.money == '') {
wx.showToast({
title: '请输入人均消费',
icon: 'none'
})
return false
}
var url = '/remark/addRemark';
var params = {
shop_id: that.data.shopid,
price: that.data.money,
content: that.data.mark,
images: that.data.image.join(","),
score1: that.data.totalstar,
score2: that.data.servicestar,
score3: that.data.taststar,
score4: that.data.environmentstar,
score5: that.data.foodstar,
type: 1
}
app.post(url, params, "post").then((res) => {
console.log(res);
wx.showToast({
title: '发表成功',
icon: 'none'
})
setTimeout(function () {
wx.navigateBack({
checked: true
})
}, 1500)
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
<view class="infobox">
<view class="imgarr">
<image class="imgItem" mode="aspectFill" src="/img/jiang.png" />
<image class="imgItem" mode="aspectFill" src="/img/tianjia_img@2x.png" />
<image class="imgItem" mode="aspectFill" src="/img/shangchuan_img.png" />
<view class="imagebox flexone">
<view class="picbox flexone">
<view class="imgItem" wx:for="{{image}}" wx:key="">
<image mode="aspectFill" src="{{item}}" />
<view class="chahao" bindtap="del" data-url="{{item}}">
<image src="/img/chahao.png"></image>
</view>
<textarea placeholder="说说此刻的感受吧…" class="wordArea" />
<view class="labelbox">
</view>
</view>
<view class="imgItem" bindtap="chooseImage">
<image mode="aspectFill" src="/img/jiang.png" />
</view>
</view>
<textarea placeholder="说说此刻的感受吧…" class="wordArea" bindinput="entermark"/>
<!-- <view class="labelbox">
<view class="labelItem">
<text>+</text>标题
</view>
</view>
</view> -->
</view>
<view class="infobox">
<view class="infoTitle">评分</view>
<view class="infobox">
<view class="infoTitle">评分</view>
<view class="evaluateItem">
<view class="tltle">综合</view>
<view class="starbox">
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/banke.png"/>
<view class="starbox" bindtap="total" data-id="1">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{totalstar>=1}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="total" data-id="2">
<image class="starItem" src="/img/pingfenshi.png " wx:if="{{totalstar>=2}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="total" data-id="3">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{totalstar>=3}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="total" data-id="4">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{totalstar>=4}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="total" data-id="5">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{totalstar>=5}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
</view>
<view class="evaluateItem">
<view class="tltle">服务</view>
<view class="starbox">
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/banke.png"/>
<view class="starbox" bindtap="service" data-id="1">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{servicestar>=1}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="service" data-id="2">
<image class="starItem" src="/img/pingfenshi.png " wx:if="{{servicestar>=2}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="service" data-id="3">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{servicestar>=3}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="service" data-id="4">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{servicestar>=4}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="service" data-id="5">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{servicestar>=5}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
</view>
<view class="evaluateItem">
<view class="tltle">口味</view>
<view class="starbox">
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/banke.png"/>
<view class="starbox" bindtap="tast" data-id="1">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{taststar>=1}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="tast" data-id="2">
<image class="starItem" src="/img/pingfenshi.png " wx:if="{{taststar>=2}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="tast" data-id="3">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{taststar>=3}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="tast" data-id="4">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{taststar>=4}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="tast" data-id="5">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{taststar>=5}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
</view>
<view class="evaluateItem">
<view class="tltle">环境</view>
<view class="starbox">
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/banke.png"/>
<view class="starbox" bindtap="envirment" data-id="1">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{environmentstar>=1}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="envirment" data-id="2">
<image class="starItem" src="/img/pingfenshi.png " wx:if="{{environmentstar>=2}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="envirment" data-id="3">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{environmentstar>=3}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="envirment" data-id="4">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{environmentstar>=4}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="envirment" data-id="5">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{environmentstar>=5}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
</view>
<view class="evaluateItem">
<view class="tltle">食材</view>
<view class="starbox">
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/star.png"/>
<image class="starItem" src="/img/banke.png"/>
</view>
<view class="starbox" bindtap="food" data-id="1">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{foodstar>=1}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="food" data-id="2">
<image class="starItem" src="/img/pingfenshi.png " wx:if="{{foodstar>=2}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="food" data-id="3">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{foodstar>=3}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
<view class="costbox">
</view>
<view class="starbox" bindtap="food" data-id="4">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{foodstar>=4}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
<view class="starbox" bindtap="food" data-id="5">
<image class="starItem" src="/img/pingfenshi.png" wx:if="{{foodstar>=5}}" />
<image class="starItem" src="/img/lingfen_icon.png" wx:else/>
</view>
</view>
</view>
</view>
<view class="costbox">
<view class="costTitle">人均</view>
<view class="fillbox">
<text>¥</text>
<input placeholder="请输入消费金额" class="fillCost" type="number"/>
</view>
<input placeholder="请输入消费金额" class="fillCost" type="digit" bindinput="entermoney"/>
</view>
<view class="submit">发表</view>
\ No newline at end of file
</view>
<view class="submit" bindtap="publish">发表</view>
\ No newline at end of file
... ...
@import '../comment/comment.wxss';
page {
background: #F9F9F9;
padding: 0 32rpx 32rpx;
... ... @@ -82,9 +83,10 @@ page {
}
.starItem {
width: 24rpx;
height: 24rpx;
margin-right: 8rpx;
width: 32rpx;
height: 32rpx;
font-size: 0
}
.costbox {
... ... @@ -131,7 +133,7 @@ page {
.submit {
width: 686rpx;
height: 88rpx;
background: rgba(189, 196, 206, 1);
background: #FDAA2A;
opacity: 1;
border-radius: 8rpx;
font-size: 28rpx;
... ...
// pages/usecenter/usecenter.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
userid:'',
page:1,
goodlist:[],
userinfo:''
},
// 获取用户信息
getuserinfo() {
let that = this;
var url = 'member/getUserInfo';
var params = {
user_id:that.data.userid
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
userinfo: res
})
that.gethomelist()
}).catch((err) => {
})
},
// 获取首页列表
gethomelist() {
let that = this;
var url = 'index/getShopList';
var params = {
page: that.data.page,
limit: 15,
business_id: '',
series_id: '',
grade_id: '',
composite_id: '',
is_recommend: 1,
city_id: that.data.userinfo.city_id
}
app.post(url, params, "post").then((res) => {
console.log(res);
that.setData({
goodlist: that.data.goodlist.concat(res.data)
})
that.data.goodlist.forEach(function (value, index, array) {
value.level = value.level.toFixed("1")
})
that.setData({
goodlist: that.data.goodlist
})
}).catch((err) => {
})
},
goodtail(e) {
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/shopdetail/shopdetail?id=' + id,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
userid: options.userid
})
this.getuserinfo();
// // 获取列表
// this.gethomelist()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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="setimgtop commonpadding flex">
<view class='setimg'>
<image src="/img/detting.png" mode=""></image>
</view>
</view> -->
<view class="shangheng"></view>
<view class="commonpadding topbu" bindtap="ziliao">
<view class="tiezitopone flex">
<view class="tiezitouhead">
<image src="{{userinfo.avatar==null?'/img/peopleimg.png':userinfo.avatar}}" mode=""></image>
</view>
<view class="zhuyeright" wx:if="{{userinfo.nickname!=null}}">
<view class="tieziname">{{userinfo.nickname}}</view>
<view class="star starone flexone">
<view class="staritem">
<image src="/img/star.png" wx:if="{{userinfo.level>=1}}"></image>
<image src="/img/huangkong.png" wx:if="{{userinfo.level<1}}"></image>
<image src="/img/huangban.png" wx:if="{{userinfo.level>=1.5&&userinfo.level<2}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png" wx:if="{{userinfo.level>=2}}"></image>
<image src="/img/huangkong.png" wx:if="{{userinfo.level<2}}"></image>
<image src="/img/huangban.png" wx:if="{{userinfo.level>=2.5&&userinfo.level<3}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png" wx:if="{{userinfo.level>=3}}"></image>
<image src="/img/huangkong.png" wx:if="{{userinfo.level<31}}"></image>
<image src="/img/huangban.png" wx:if="{{userinfo.level>=3.5&&userinfo.level<4}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png" wx:if="{{userinfo.level>=4}}"></image>
<image src="/img/huangkong.png" wx:if="{{userinfo.level<4}}"></image>
<image src="/img/huangban.png" wx:if="{{userinfo.level>=4.5&&userinfo.level<5}}"></image>
</view>
<view class="staritem">
<image src="/img/star.png" wx:if="{{userinfo.level>=5}}"></image>
<image src="/img/huangkong.png" wx:if="{{userinfo.level<5}}"></image>
<image src="/img/huangban.png" wx:if="{{userinfo.level>=5.5&&userinfo.level<6}}"></image>
</view>
</view>
</view>
<view class="zhuyeright" wx:else bindtap="userlogin">
<view class="tieziname">微信登录</view>
</view>
</view>
<view class="text" wx:if="{{userinfo.brief!=null}}">{{userinfo.brief}}</view>
</view>
<view class="tuijiancan">
<view class="recomane">推荐餐厅</view>
<view class='case-page'>
<view class='list-masonry'>
<view class='item-masonry' bindtap="goodtail" wx:for="{{goodlist}}" wx:key="" data-id="{{item.id}}">
<image src='{{item.image}}' mode='widthFix'></image>
<view class="goodname">{{item.name}}</view>
<view class="intro flextwo">
<view class="introleft">
{{item.series_name}}
</view>
<view class="introright">
<view class="ping flexone">
<view class="pingleft">
<image src='/img/kuaizi.png'></image>
</view>
<view class="pingfen">{{item.level}}</view>
</view>
<view class="hualist flexone">
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
</view>
</view>
</view>
<view class="shou">
<text class="shoumoney">¥{{item.price}}</text>
<text class="shouren">/人</text>
</view>
<view class="addname flexone">
<view class="addimg">
<image src="/img/huangweizhi.png"></image>
</view>
<view class="dizhi commnameone">{{item.city_name}}</view>
</view>
</view>
<!-- <view class='item-masonry'>
<image src='/img/deng.png' mode='widthFix'></image>
<view class="goodname">基值支义们京候么眼革下使叫南石很少去构。</view>
<view class="intro flexone">
<view class="introleft">
魚介?海鮮料理
</view>
<view class="introright">
<view class="ping flexone">
<view class="pingleft">
<image src='/img/kuaizi.png'></image>
</view>
<view class="pingfen">4.7</view>
</view>
<view class="hualist flexone">
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
</view>
</view>
</view>
<view class="shou">
<text class="shoumoney">¥50</text>
<text class="shouren">/人</text>
</view>
<view class="addname flexone">
<view class="addimg">
<image src="/img/huangweizhi.png"></image>
</view>
<view class="dizhi commnameone">银厦</view>
</view>
</view>
<view class='item-masonry'>
<image src='/img/juxia.png' mode='widthFix'></image>
<view class="goodname">基值支义们京候么眼革下使叫南石很少去构。</view>
<view class="intro flexone">
<view class="introleft">
魚介?海鮮料理
</view>
<view class="introright">
<view class="ping flexone">
<view class="pingleft">
<image src='/img/kuaizi.png'></image>
</view>
<view class="pingfen">4.7</view>
</view>
<view class="hualist flexone">
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
</view>
</view>
</view>
<view class="shou">
<text class="shoumoney">¥50</text>
<text class="shouren">/人</text>
</view>
<view class="addname flexone">
<view class="addimg">
<image src="/img/huangweizhi.png"></image>
</view>
<view class="dizhi commnameone">银厦</view>
</view>
</view>
<view class='item-masonry'>
<image src='/img/fenxia.png' mode='widthFix'></image>
<view class="goodname">基值支义们京候么眼革下使叫南石很少去构。</view>
<view class="intro flexone">
<view class="introleft">
魚介?海鮮料理
</view>
<view class="introright">
<view class="ping flexone">
<view class="pingleft">
<image src='/img/kuaizi.png'></image>
</view>
<view class="pingfen">4.7</view>
</view>
<view class="hualist flexone">
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
</view>
</view>
</view>
<view class="shou">
<text class="shoumoney">¥50</text>
<text class="shouren">/人</text>
</view>
<view class="addname flexone">
<view class="addimg">
<image src="/img/huangweizhi.png"></image>
</view>
<view class="dizhi commnameone">银厦</view>
</view>
</view>
<view class='item-masonry'>
<image src='/img/juxia.png' mode='widthFix'></image>
<view class="goodname">基值支义们京候么眼革下使叫南石很少去构。</view>
<view class="intro flexone">
<view class="introleft">
魚介?海鮮料理
</view>
<view class="introright">
<view class="ping flexone">
<view class="pingleft">
<image src='/img/kuaizi.png'></image>
</view>
<view class="pingfen">4.7</view>
</view>
<view class="hualist flexone">
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
</view>
</view>
</view>
<view class="shou">
<text class="shoumoney">¥50</text>
<text class="shouren">/人</text>
</view>
<view class="addname flexone">
<view class="addimg">
<image src="/img/huangweizhi.png"></image>
</view>
<view class="dizhi commnameone">银厦</view>
</view>
</view>
<view class='item-masonry'>
<image src='/img/deng.png' mode='widthFix'></image>
<view class="goodname">基值支义们京候么眼革下使叫南石很少去构。</view>
<view class="intro flexone">
<view class="introleft">
魚介?海鮮料理
</view>
<view class="introright">
<view class="ping flexone">
<view class="pingleft">
<image src='/img/kuaizi.png'></image>
</view>
<view class="pingfen">4.7</view>
</view>
<view class="hualist flexone">
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
<view class="huaitem">
<image src="/img/flower.png"></image>
</view>
</view>
</view>
</view>
<view class="shou">
<text class="shoumoney">¥50</text>
<text class="shouren">/人</text>
</view>
<view class="addname flexone">
<view class="addimg">
<image src="/img/huangweizhi.png"></image>
</view>
<view class="dizhi commnameone">银厦</view>
</view>
</view> -->
</view>
</view>
</view>
... ...