Commit b44a16e96c452e40a2e045fcd8ece1b93c27da15

Authored by vking
1 parent f9e8d8d4

taocan-share-pinglun

... ... @@ -45,7 +45,8 @@
"pages/taocan/orderHis",
"pages/pinglun/create",
"pages/pinglun/success",
"pages/pinglun/mylist"
"pages/pinglun/mylist",
"pages/pinglun/video"
],
"subpackages": [
{
... ...
... ... @@ -90,6 +90,9 @@ page {
border-radius: 5000rpx;
}
.radius10{
border-radius: 10rpx;
}
.radius {
border-radius: 20rpx;
}
... ...
... ... @@ -6,6 +6,8 @@ Component({
*/
properties: {
post:Object,
hasSeller:Boolean,//显示商户信息
hasStatus:Boolean,//显示审核状态
},
/**
... ... @@ -23,6 +25,31 @@ Component({
* 组件的方法列表
*/
methods: {
displayImage(e){
let index=util.attr(e,'index')
if(this.data.enclosure[index].avinfo){//video
let attr=this.data.enclosure[index]
wx.navigateTo({
url:util.http_build_query({
url:attr.url,
title:this.data.post.sellerinfo?this.data.post.sellerinfo.sellername:''
},'/pages/pinglun/video'),
})
}else {
let urls=[],current=''
this.data.enclosure.some((attr,i)=>{
if(i==index){
current=attr.url
}
if(!attr.avinfo){
urls.push(attr.url)
}
})
wx.previewImage({
urls: urls,
current: current
})
}
},
}
})
... ...
... ... @@ -6,20 +6,37 @@
<view class="txt-24-h text-bold margin-bottom-sm">{{post.author}}</view>
<stat value="{{post.grade}}" cla="card" disabled></stat>
</view>
<view class="text-gray txt-24-h">{{util.unixtoTime(post.create_time,'YYYY-MM-DD')}}</view>
<view class="text-gray txt-24-h {{hasStatus?'hasStatus status-'+post.status:''}}">{{util.unixtoTime(post.create_time,'YYYY-MM-DD')}}</view>
</view>
<view class="view flex align-start justify-center">
<view class="cu-avatar round lg" style="background-color: rgba(0,0,0,0);"></view>
<view class="flex-treble flex flex-direction margin-left-sm">
<view class="text-df margin-bottom-xs" wx:if="{{post.text}}">{{post.text}}</view>
<view class="text-df margin-bottom-xs" wx:if="{{post.text}}" style="word-break:break-all;">{{post.text}}</view>
<view class="text-df margin-bottom-xs text-blue">#{{post.eval_label}}</view>
<view class="grid col-3 grid-square" wx:if="{{enclosure.length>0}}">
<block wx:for="{{enclosure}}" wx:key="enclosure">
<view class="bg-image" style="background-image: url('{{item.url}}.lim.jpg')">
<view class="bg-image" style="background-image: url('{{item.url}}.lim.jpg')" catchtap="displayImage" data-index="{{index}}">
<view class="bg-image-video view" wx:if="{{item.avinfo}}"></view>
</view>
</block>
</view>
<navigator url="/pages/reserve/detail?id={{post.sid}}" catchtap="catchtap"
hover-class="navigator-hover" wx:if="{{hasSeller && post.sellerinfo}}">
<view class="view padding-sm flex align-center radius10" style="background-color: #F8F8F8;">
<view class="cu-avatar lg radius10 margin-right-sm"
style="background-image: url('{{post.sellerinfo.seller_image}}')"></view>
<view class="flex-treble flex flex-direction">
<view class="txt-26-h text-bold" style="margin-bottom: 6rpx;">{{post.sellerinfo.sellername}}</view>
<view class="flex txt-24-h text-gray">
<view>{{post.sellerinfo.name}}</view>
<view>{{post.sellerinfo.c_info}}</view>
<view wx:if="{{post.sellerinfo.average>0}}">¥{{post.sellerinfo.average}}/人</view>
</view>
</view>
<view class="more"></view>
</view>
</navigator>
</view>
</view>
... ...
... ... @@ -12,4 +12,34 @@
height: 60rpx;
top:calc(50% - 30rpx);
left:calc(50% - 30rpx);
}
.hasStatus{
position: relative;
}
.hasStatus:after{
display: block;
position: absolute;
width: 79rpx;
height: 58rpx;
top:-18rpx;
left:-100rpx;
content: "";
background-size: 100% 100%;
}
.status-1:after{
background-image: url("http://nosqn.colorcun.com/pinglun/p%20%2811%29.png");
}
.status-2:after{
background-image: url("http://nosqn.colorcun.com/pinglun/p%20%2810%29.png");
}
.status-3:after,.status-4:after{
background-image: url("http://nosqn.colorcun.com/pinglun/p%20%2812%29.png");
}
.more{
width: 12rpx;
height: 22rpx;
background-image: url("http://nosqn.colorcun.com/custom/lite-yd/image/click.png");
background-size: 100% 100%;
min-width: 12rpx;
background-repeat: no-repeat;
}
\ No newline at end of file
... ...
... ... @@ -74,6 +74,11 @@ Page({
*/
onShow: function () {
this.getDetail()
App.Customer.CheckIsComment({rid:this.id}).then(res => {
this.setData({
hasComment:res.data!=1,//已评论
})
})
},
/**
... ...
... ... @@ -217,7 +217,7 @@
<view class="item" >取消预订</view>
</navigator>
<navigator url="/pages/pinglun/create?sid={{detail.seller.id}}&oid={{detail.id}}&sellername={{detail.seller.sellername}}"
wx:if="{{detail.status==2}}"
wx:if="{{detail.hasFinished && hasComment}}"
hover-class="navigator-hover">
<view class="item" >评论</view>
</navigator>
... ...
... ... @@ -66,7 +66,7 @@
<view class="more"></view>
</view>
</view>
<view class="block-rev">
<view class="block-rev actions">
<view class="title flex-lr">
<view >常用操作</view>
</view>
... ... @@ -90,6 +90,12 @@
<view class="text">客户经理模式</view>
</navigator>
</view>
<view class="content flex-ll">
<navigator class="flex-vc" url="/pages/pinglun/mylist">
<view class="icon picon p5"></view>
<view class="text">我的评价</view>
</navigator>
</view>
</view>
<view class="block-list">
<button class="button-none"
... ...
... ... @@ -67,6 +67,20 @@ image{
box-sizing: border-box;
font-size: 24rpx;
}
.block-rev.actions{
height: 452rpx;
}
.block-rev.actions .content{
height: calc(350rpx / 2);
box-sizing: border-box;
font-size: 24rpx;
}
.block-rev.actions .content:nth-child(even) .flex-vc{
margin-top: 50rpx;
}
.block-rev.actions .content:nth-child(odd) .flex-vc{
margin-bottom: 20rpx;
}
.content .flex-vc{
width: 25%;
min-width: 25%;
... ... @@ -106,6 +120,9 @@ image{
.picon.p3{
background-image: url("http://nosqn.colorcun.com/taocan/1%20%2821%29.png");
}
.picon.p5{
background-image: url("http://nosqn.colorcun.com/pinglun/p%20%289%29.png");
}
.block-rev .width3{
width: 75%;
... ...
... ... @@ -140,6 +140,10 @@ Page({
},
displayImage(e){
let path=util.attr(e,'path')
let duration=util.attr(e,'duration')
if(duration){
return util.toast('发布后才能播放')
}
wx.previewImage({
urls:[path],
})
... ...
... ... @@ -33,11 +33,13 @@
<qnupload qnConf="{{qnConf}}" upConf="{{upConf}}"
file="{{item}}" files="{{files}}"
bindevent="qnevent" class="view qnupload">
<view class="view scroll-block flex flex-direction justify-center align-center" catchtap="displayImage" data-path="{{item.path}}">
<image class="view image" src="{{item.path}}"></image>
<view class="view scroll-block flex flex-direction justify-center align-center"
catchtap="displayImage" data-path="{{item.path}}" data-duration="{{item.duration}}">
<image class="view image" src="{{item.thumbTempFilePath||item.path}}"></image>
<view class="view image-delete" catchtap="deleteImage" data-index="{{index}}"></view>
<image class="view image-up" src=""></image>
<view class="view image-text"></view>
<view class="bg-image-video view" wx:if="{{item.duration>0}}"></view>
</view>
</qnupload>
</block>
... ...
... ... @@ -66,3 +66,11 @@
border: 2rpx solid #5EB2FF;
color: #42A5FF;
}
.bg-image-video{
position: absolute;
background-image: url("http://nosqn.colorcun.com/pinglun/p%20%287%29.png");
width: 60rpx;
height: 60rpx;
top:calc(50% - 30rpx);
left:calc(50% - 30rpx);
}
\ No newline at end of file
... ...
// pages/pinglun/mylist.js
import App from '../../utils/api'
import util from '../../utils/util'
Page({
/**
... ... @@ -12,7 +14,14 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
App.Customer.GetSellerComments({
scene:2
}).then(res=>{
this.setData({
posts:res.data,
loading:1,
})
})
},
/**
... ...
{
"usingComponents": {}
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"usingComponents": {
"nav":"/components/nav/nav",
"plcard":"/components/2.0/pinglun/card"
}
}
\ No newline at end of file
... ...
<!--pages/pinglun/mylist.wxml-->
<text>pages/pinglun/mylist.wxml</text>
<nav>我的评价</nav>
<page loading="{{loading}}">
<block wx:if="{{posts.length>0}}">
<view class="view" wx:for="{{posts}}" wx:key="posts">
<view class="view margin-lg solid-bottom padding-bottom-lg">
<plcard post="{{item}}" hasSeller hasStatus></plcard>
</view>
</view>
</block>
</page>
... ...
/* pages/pinglun/mylist.wxss */
\ No newline at end of file
/* pages/pinglun/mylist.wxss */
@import "../../colorui/main.wxss";
\ No newline at end of file
... ...
// pages/pinglun/video.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
options:options,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"usingComponents": {
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
<!--pages/pinglun/video.wxml-->
<nav>{{options.title||'周到安排'}}</nav>
<video src="{{options.url}}" autoplay style="width: 100vw;height: calc(100vh - 140rpx);"
poster-for-crawler="{{options.url}}.lim.jpg"
poster="{{options.url}}.lim.jpg" ></video>
... ...
/* pages/pinglun/video.wxss */
page{
background-color: black;
}
\ No newline at end of file
... ...
... ... @@ -626,10 +626,9 @@
"scene": null
},
{
"id": 76,
"name": "pages/customer/detail_owner",
"pathName": "pages/customer/detail_owner",
"query": "id=59113",
"query": "id=118852",
"scene": null
},
{
... ... @@ -745,6 +744,12 @@
"pathName": "pages/pinglun/success",
"query": "",
"scene": null
},
{
"name": "pages/pinglun/mylist",
"pathName": "pages/pinglun/mylist",
"query": "",
"scene": null
}
]
}
... ...
... ... @@ -540,6 +540,15 @@ export default {
openid:'author_openid',
},
//根据不同场景获取不同的列表数据 flag
'App.Customer.GetSellerComments':{
openid:'openid',
},
//根据商家的订单以及用户查询
'App.Customer.CheckIsComment':{
openid:'openid',
},
//获取商家优惠对接人信息
'App.Customer.GetSellerPreferentialDocking':null,
//接单人,获得商家设置的接单人列表
... ...
... ... @@ -20,6 +20,7 @@ const soltName=['','早餐','午餐','晚餐','夜宵']
export default {
reserve(detail){
detail.hasRunning=this.hasRunningFlag(detail)
detail.hasFinished=this.hasFinished(detail)//正常完成
if(!detail.hasRunning){
detail.hasCancel=detail.status==4;
detail.hasOvered=detail.status!=0 && detail.status!=6;
... ... @@ -93,4 +94,12 @@ export default {
if(hasToday) return ns
return parseInt(ns)+86400
},
hasFinished(detail){//订单完成
if(detail.status==3) return true
if(detail.status==1 || detail.status==2 || detail.status==5){
let ns = new Date() / 1000
if(ns > this.getNextTime(detail)) return true//超时
}
return false;
},
}
\ No newline at end of file
... ...