Commit b44a16e96c452e40a2e045fcd8ece1b93c27da15

Authored by vking
1 parent f9e8d8d4

taocan-share-pinglun

@@ -45,7 +45,8 @@ @@ -45,7 +45,8 @@
45 "pages/taocan/orderHis", 45 "pages/taocan/orderHis",
46 "pages/pinglun/create", 46 "pages/pinglun/create",
47 "pages/pinglun/success", 47 "pages/pinglun/success",
48 - "pages/pinglun/mylist" 48 + "pages/pinglun/mylist",
  49 + "pages/pinglun/video"
49 ], 50 ],
50 "subpackages": [ 51 "subpackages": [
51 { 52 {
@@ -90,6 +90,9 @@ page { @@ -90,6 +90,9 @@ page {
90 border-radius: 5000rpx; 90 border-radius: 5000rpx;
91 } 91 }
92 92
  93 +.radius10{
  94 + border-radius: 10rpx;
  95 +}
93 .radius { 96 .radius {
94 border-radius: 20rpx; 97 border-radius: 20rpx;
95 } 98 }
@@ -6,6 +6,8 @@ Component({ @@ -6,6 +6,8 @@ Component({
6 */ 6 */
7 properties: { 7 properties: {
8 post:Object, 8 post:Object,
  9 + hasSeller:Boolean,//显示商户信息
  10 + hasStatus:Boolean,//显示审核状态
9 }, 11 },
10 12
11 /** 13 /**
@@ -23,6 +25,31 @@ Component({ @@ -23,6 +25,31 @@ Component({
23 * 组件的方法列表 25 * 组件的方法列表
24 */ 26 */
25 methods: { 27 methods: {
26 - 28 + displayImage(e){
  29 + let index=util.attr(e,'index')
  30 + if(this.data.enclosure[index].avinfo){//video
  31 + let attr=this.data.enclosure[index]
  32 + wx.navigateTo({
  33 + url:util.http_build_query({
  34 + url:attr.url,
  35 + title:this.data.post.sellerinfo?this.data.post.sellerinfo.sellername:''
  36 + },'/pages/pinglun/video'),
  37 + })
  38 + }else {
  39 + let urls=[],current=''
  40 + this.data.enclosure.some((attr,i)=>{
  41 + if(i==index){
  42 + current=attr.url
  43 + }
  44 + if(!attr.avinfo){
  45 + urls.push(attr.url)
  46 + }
  47 + })
  48 + wx.previewImage({
  49 + urls: urls,
  50 + current: current
  51 + })
  52 + }
  53 + },
27 } 54 }
28 }) 55 })
@@ -6,20 +6,37 @@ @@ -6,20 +6,37 @@
6 <view class="txt-24-h text-bold margin-bottom-sm">{{post.author}}</view> 6 <view class="txt-24-h text-bold margin-bottom-sm">{{post.author}}</view>
7 <stat value="{{post.grade}}" cla="card" disabled></stat> 7 <stat value="{{post.grade}}" cla="card" disabled></stat>
8 </view> 8 </view>
9 - <view class="text-gray txt-24-h">{{util.unixtoTime(post.create_time,'YYYY-MM-DD')}}</view> 9 + <view class="text-gray txt-24-h {{hasStatus?'hasStatus status-'+post.status:''}}">{{util.unixtoTime(post.create_time,'YYYY-MM-DD')}}</view>
10 </view> 10 </view>
11 <view class="view flex align-start justify-center"> 11 <view class="view flex align-start justify-center">
12 <view class="cu-avatar round lg" style="background-color: rgba(0,0,0,0);"></view> 12 <view class="cu-avatar round lg" style="background-color: rgba(0,0,0,0);"></view>
13 <view class="flex-treble flex flex-direction margin-left-sm"> 13 <view class="flex-treble flex flex-direction margin-left-sm">
14 - <view class="text-df margin-bottom-xs" wx:if="{{post.text}}">{{post.text}}</view> 14 + <view class="text-df margin-bottom-xs" wx:if="{{post.text}}" style="word-break:break-all;">{{post.text}}</view>
15 <view class="text-df margin-bottom-xs text-blue">#{{post.eval_label}}</view> 15 <view class="text-df margin-bottom-xs text-blue">#{{post.eval_label}}</view>
16 <view class="grid col-3 grid-square" wx:if="{{enclosure.length>0}}"> 16 <view class="grid col-3 grid-square" wx:if="{{enclosure.length>0}}">
17 <block wx:for="{{enclosure}}" wx:key="enclosure"> 17 <block wx:for="{{enclosure}}" wx:key="enclosure">
18 - <view class="bg-image" style="background-image: url('{{item.url}}.lim.jpg')"> 18 + <view class="bg-image" style="background-image: url('{{item.url}}.lim.jpg')" catchtap="displayImage" data-index="{{index}}">
19 <view class="bg-image-video view" wx:if="{{item.avinfo}}"></view> 19 <view class="bg-image-video view" wx:if="{{item.avinfo}}"></view>
20 </view> 20 </view>
21 </block> 21 </block>
22 </view> 22 </view>
  23 + <navigator url="/pages/reserve/detail?id={{post.sid}}" catchtap="catchtap"
  24 + hover-class="navigator-hover" wx:if="{{hasSeller && post.sellerinfo}}">
  25 + <view class="view padding-sm flex align-center radius10" style="background-color: #F8F8F8;">
  26 + <view class="cu-avatar lg radius10 margin-right-sm"
  27 + style="background-image: url('{{post.sellerinfo.seller_image}}')"></view>
  28 + <view class="flex-treble flex flex-direction">
  29 + <view class="txt-26-h text-bold" style="margin-bottom: 6rpx;">{{post.sellerinfo.sellername}}</view>
  30 + <view class="flex txt-24-h text-gray">
  31 + <view>{{post.sellerinfo.name}}</view>
  32 + <view>{{post.sellerinfo.c_info}}</view>
  33 + <view wx:if="{{post.sellerinfo.average>0}}">¥{{post.sellerinfo.average}}/人</view>
  34 + </view>
  35 + </view>
  36 + <view class="more"></view>
  37 + </view>
  38 + </navigator>
23 </view> 39 </view>
24 </view> 40 </view>
25 41
  42 +
@@ -12,4 +12,34 @@ @@ -12,4 +12,34 @@
12 height: 60rpx; 12 height: 60rpx;
13 top:calc(50% - 30rpx); 13 top:calc(50% - 30rpx);
14 left:calc(50% - 30rpx); 14 left:calc(50% - 30rpx);
  15 +}
  16 +.hasStatus{
  17 + position: relative;
  18 +}
  19 +.hasStatus:after{
  20 + display: block;
  21 + position: absolute;
  22 + width: 79rpx;
  23 + height: 58rpx;
  24 + top:-18rpx;
  25 + left:-100rpx;
  26 + content: "";
  27 + background-size: 100% 100%;
  28 +}
  29 +.status-1:after{
  30 + background-image: url("http://nosqn.colorcun.com/pinglun/p%20%2811%29.png");
  31 +}
  32 +.status-2:after{
  33 + background-image: url("http://nosqn.colorcun.com/pinglun/p%20%2810%29.png");
  34 +}
  35 +.status-3:after,.status-4:after{
  36 + background-image: url("http://nosqn.colorcun.com/pinglun/p%20%2812%29.png");
  37 +}
  38 +.more{
  39 + width: 12rpx;
  40 + height: 22rpx;
  41 + background-image: url("http://nosqn.colorcun.com/custom/lite-yd/image/click.png");
  42 + background-size: 100% 100%;
  43 + min-width: 12rpx;
  44 + background-repeat: no-repeat;
15 } 45 }
@@ -74,6 +74,11 @@ Page({ @@ -74,6 +74,11 @@ Page({
74 */ 74 */
75 onShow: function () { 75 onShow: function () {
76 this.getDetail() 76 this.getDetail()
  77 + App.Customer.CheckIsComment({rid:this.id}).then(res => {
  78 + this.setData({
  79 + hasComment:res.data!=1,//已评论
  80 + })
  81 + })
77 }, 82 },
78 83
79 /** 84 /**
@@ -217,7 +217,7 @@ @@ -217,7 +217,7 @@
217 <view class="item" >取消预订</view> 217 <view class="item" >取消预订</view>
218 </navigator> 218 </navigator>
219 <navigator url="/pages/pinglun/create?sid={{detail.seller.id}}&oid={{detail.id}}&sellername={{detail.seller.sellername}}" 219 <navigator url="/pages/pinglun/create?sid={{detail.seller.id}}&oid={{detail.id}}&sellername={{detail.seller.sellername}}"
220 - wx:if="{{detail.status==2}}" 220 + wx:if="{{detail.hasFinished && hasComment}}"
221 hover-class="navigator-hover"> 221 hover-class="navigator-hover">
222 <view class="item" >评论</view> 222 <view class="item" >评论</view>
223 </navigator> 223 </navigator>
@@ -66,7 +66,7 @@ @@ -66,7 +66,7 @@
66 <view class="more"></view> 66 <view class="more"></view>
67 </view> 67 </view>
68 </view> 68 </view>
69 - <view class="block-rev"> 69 + <view class="block-rev actions">
70 <view class="title flex-lr"> 70 <view class="title flex-lr">
71 <view >常用操作</view> 71 <view >常用操作</view>
72 </view> 72 </view>
@@ -90,6 +90,12 @@ @@ -90,6 +90,12 @@
90 <view class="text">客户经理模式</view> 90 <view class="text">客户经理模式</view>
91 </navigator> 91 </navigator>
92 </view> 92 </view>
  93 + <view class="content flex-ll">
  94 + <navigator class="flex-vc" url="/pages/pinglun/mylist">
  95 + <view class="icon picon p5"></view>
  96 + <view class="text">我的评价</view>
  97 + </navigator>
  98 + </view>
93 </view> 99 </view>
94 <view class="block-list"> 100 <view class="block-list">
95 <button class="button-none" 101 <button class="button-none"
@@ -67,6 +67,20 @@ image{ @@ -67,6 +67,20 @@ image{
67 box-sizing: border-box; 67 box-sizing: border-box;
68 font-size: 24rpx; 68 font-size: 24rpx;
69 } 69 }
  70 +.block-rev.actions{
  71 + height: 452rpx;
  72 +}
  73 +.block-rev.actions .content{
  74 + height: calc(350rpx / 2);
  75 + box-sizing: border-box;
  76 + font-size: 24rpx;
  77 +}
  78 +.block-rev.actions .content:nth-child(even) .flex-vc{
  79 + margin-top: 50rpx;
  80 +}
  81 +.block-rev.actions .content:nth-child(odd) .flex-vc{
  82 + margin-bottom: 20rpx;
  83 +}
70 .content .flex-vc{ 84 .content .flex-vc{
71 width: 25%; 85 width: 25%;
72 min-width: 25%; 86 min-width: 25%;
@@ -106,6 +120,9 @@ image{ @@ -106,6 +120,9 @@ image{
106 .picon.p3{ 120 .picon.p3{
107 background-image: url("http://nosqn.colorcun.com/taocan/1%20%2821%29.png"); 121 background-image: url("http://nosqn.colorcun.com/taocan/1%20%2821%29.png");
108 } 122 }
  123 +.picon.p5{
  124 + background-image: url("http://nosqn.colorcun.com/pinglun/p%20%289%29.png");
  125 +}
109 126
110 .block-rev .width3{ 127 .block-rev .width3{
111 width: 75%; 128 width: 75%;
@@ -140,6 +140,10 @@ Page({ @@ -140,6 +140,10 @@ Page({
140 }, 140 },
141 displayImage(e){ 141 displayImage(e){
142 let path=util.attr(e,'path') 142 let path=util.attr(e,'path')
  143 + let duration=util.attr(e,'duration')
  144 + if(duration){
  145 + return util.toast('发布后才能播放')
  146 + }
143 wx.previewImage({ 147 wx.previewImage({
144 urls:[path], 148 urls:[path],
145 }) 149 })
@@ -33,11 +33,13 @@ @@ -33,11 +33,13 @@
33 <qnupload qnConf="{{qnConf}}" upConf="{{upConf}}" 33 <qnupload qnConf="{{qnConf}}" upConf="{{upConf}}"
34 file="{{item}}" files="{{files}}" 34 file="{{item}}" files="{{files}}"
35 bindevent="qnevent" class="view qnupload"> 35 bindevent="qnevent" class="view qnupload">
36 - <view class="view scroll-block flex flex-direction justify-center align-center" catchtap="displayImage" data-path="{{item.path}}">  
37 - <image class="view image" src="{{item.path}}"></image> 36 + <view class="view scroll-block flex flex-direction justify-center align-center"
  37 + catchtap="displayImage" data-path="{{item.path}}" data-duration="{{item.duration}}">
  38 + <image class="view image" src="{{item.thumbTempFilePath||item.path}}"></image>
38 <view class="view image-delete" catchtap="deleteImage" data-index="{{index}}"></view> 39 <view class="view image-delete" catchtap="deleteImage" data-index="{{index}}"></view>
39 <image class="view image-up" src=""></image> 40 <image class="view image-up" src=""></image>
40 <view class="view image-text"></view> 41 <view class="view image-text"></view>
  42 + <view class="bg-image-video view" wx:if="{{item.duration>0}}"></view>
41 </view> 43 </view>
42 </qnupload> 44 </qnupload>
43 </block> 45 </block>
@@ -66,3 +66,11 @@ @@ -66,3 +66,11 @@
66 border: 2rpx solid #5EB2FF; 66 border: 2rpx solid #5EB2FF;
67 color: #42A5FF; 67 color: #42A5FF;
68 } 68 }
  69 +.bg-image-video{
  70 + position: absolute;
  71 + background-image: url("http://nosqn.colorcun.com/pinglun/p%20%287%29.png");
  72 + width: 60rpx;
  73 + height: 60rpx;
  74 + top:calc(50% - 30rpx);
  75 + left:calc(50% - 30rpx);
  76 +}
1 // pages/pinglun/mylist.js 1 // pages/pinglun/mylist.js
  2 +import App from '../../utils/api'
  3 +import util from '../../utils/util'
2 Page({ 4 Page({
3 5
4 /** 6 /**
@@ -12,7 +14,14 @@ Page({ @@ -12,7 +14,14 @@ Page({
12 * 生命周期函数--监听页面加载 14 * 生命周期函数--监听页面加载
13 */ 15 */
14 onLoad: function (options) { 16 onLoad: function (options) {
15 - 17 + App.Customer.GetSellerComments({
  18 + scene:2
  19 + }).then(res=>{
  20 + this.setData({
  21 + posts:res.data,
  22 + loading:1,
  23 + })
  24 + })
16 }, 25 },
17 26
18 /** 27 /**
1 { 1 {
2 - "usingComponents": {} 2 + "navigationBarBackgroundColor": "#ffffff",
  3 + "navigationBarTextStyle": "black",
  4 + "usingComponents": {
  5 + "nav":"/components/nav/nav",
  6 + "plcard":"/components/2.0/pinglun/card"
  7 + }
3 } 8 }
1 <!--pages/pinglun/mylist.wxml--> 1 <!--pages/pinglun/mylist.wxml-->
2 -<text>pages/pinglun/mylist.wxml</text> 2 +<nav>我的评价</nav>
  3 +<page loading="{{loading}}">
  4 + <block wx:if="{{posts.length>0}}">
  5 + <view class="view" wx:for="{{posts}}" wx:key="posts">
  6 + <view class="view margin-lg solid-bottom padding-bottom-lg">
  7 + <plcard post="{{item}}" hasSeller hasStatus></plcard>
  8 + </view>
  9 + </view>
  10 + </block>
  11 +</page>
1 -/* pages/pinglun/mylist.wxss */  
  1 +/* pages/pinglun/mylist.wxss */
  2 +@import "../../colorui/main.wxss";
  1 +// pages/pinglun/video.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 生命周期函数--监听页面加载
  13 + */
  14 + onLoad: function (options) {
  15 + this.setData({
  16 + options:options,
  17 + })
  18 + },
  19 +
  20 + /**
  21 + * 生命周期函数--监听页面初次渲染完成
  22 + */
  23 + onReady: function () {
  24 +
  25 + },
  26 +
  27 + /**
  28 + * 生命周期函数--监听页面显示
  29 + */
  30 + onShow: function () {
  31 +
  32 + },
  33 +
  34 + /**
  35 + * 生命周期函数--监听页面隐藏
  36 + */
  37 + onHide: function () {
  38 +
  39 + },
  40 +
  41 + /**
  42 + * 生命周期函数--监听页面卸载
  43 + */
  44 + onUnload: function () {
  45 +
  46 + },
  47 +
  48 + /**
  49 + * 页面相关事件处理函数--监听用户下拉动作
  50 + */
  51 + onPullDownRefresh: function () {
  52 +
  53 + },
  54 +
  55 + /**
  56 + * 页面上拉触底事件的处理函数
  57 + */
  58 + onReachBottom: function () {
  59 +
  60 + },
  61 +
  62 +})
  1 +{
  2 + "navigationBarBackgroundColor": "#ffffff",
  3 + "navigationBarTextStyle": "black",
  4 + "usingComponents": {
  5 + "nav":"/components/nav/nav"
  6 + }
  7 +}
  1 +<!--pages/pinglun/video.wxml-->
  2 +<nav>{{options.title||'周到安排'}}</nav>
  3 +<video src="{{options.url}}" autoplay style="width: 100vw;height: calc(100vh - 140rpx);"
  4 + poster-for-crawler="{{options.url}}.lim.jpg"
  5 + poster="{{options.url}}.lim.jpg" ></video>
  6 +
  1 +/* pages/pinglun/video.wxss */
  2 +page{
  3 + background-color: black;
  4 +}
@@ -626,10 +626,9 @@ @@ -626,10 +626,9 @@
626 "scene": null 626 "scene": null
627 }, 627 },
628 { 628 {
629 - "id": 76,  
630 "name": "pages/customer/detail_owner", 629 "name": "pages/customer/detail_owner",
631 "pathName": "pages/customer/detail_owner", 630 "pathName": "pages/customer/detail_owner",
632 - "query": "id=59113", 631 + "query": "id=118852",
633 "scene": null 632 "scene": null
634 }, 633 },
635 { 634 {
@@ -745,6 +744,12 @@ @@ -745,6 +744,12 @@
745 "pathName": "pages/pinglun/success", 744 "pathName": "pages/pinglun/success",
746 "query": "", 745 "query": "",
747 "scene": null 746 "scene": null
  747 + },
  748 + {
  749 + "name": "pages/pinglun/mylist",
  750 + "pathName": "pages/pinglun/mylist",
  751 + "query": "",
  752 + "scene": null
748 } 753 }
749 ] 754 ]
750 } 755 }
@@ -540,6 +540,15 @@ export default { @@ -540,6 +540,15 @@ export default {
540 openid:'author_openid', 540 openid:'author_openid',
541 }, 541 },
542 542
  543 + //根据不同场景获取不同的列表数据 flag
  544 + 'App.Customer.GetSellerComments':{
  545 + openid:'openid',
  546 + },
  547 + //根据商家的订单以及用户查询
  548 + 'App.Customer.CheckIsComment':{
  549 + openid:'openid',
  550 + },
  551 +
543 //获取商家优惠对接人信息 552 //获取商家优惠对接人信息
544 'App.Customer.GetSellerPreferentialDocking':null, 553 'App.Customer.GetSellerPreferentialDocking':null,
545 //接单人,获得商家设置的接单人列表 554 //接单人,获得商家设置的接单人列表
@@ -20,6 +20,7 @@ const soltName=['','早餐','午餐','晚餐','夜宵'] @@ -20,6 +20,7 @@ const soltName=['','早餐','午餐','晚餐','夜宵']
20 export default { 20 export default {
21 reserve(detail){ 21 reserve(detail){
22 detail.hasRunning=this.hasRunningFlag(detail) 22 detail.hasRunning=this.hasRunningFlag(detail)
  23 + detail.hasFinished=this.hasFinished(detail)//正常完成
23 if(!detail.hasRunning){ 24 if(!detail.hasRunning){
24 detail.hasCancel=detail.status==4; 25 detail.hasCancel=detail.status==4;
25 detail.hasOvered=detail.status!=0 && detail.status!=6; 26 detail.hasOvered=detail.status!=0 && detail.status!=6;
@@ -93,4 +94,12 @@ export default { @@ -93,4 +94,12 @@ export default {
93 if(hasToday) return ns 94 if(hasToday) return ns
94 return parseInt(ns)+86400 95 return parseInt(ns)+86400
95 }, 96 },
  97 + hasFinished(detail){//订单完成
  98 + if(detail.status==3) return true
  99 + if(detail.status==1 || detail.status==2 || detail.status==5){
  100 + let ns = new Date() / 1000
  101 + if(ns > this.getNextTime(detail)) return true//超时
  102 + }
  103 + return false;
  104 + },
96 } 105 }