Commit 5dc2fb0e4124f57e17f59ffa86f71fac50e6bc93

Authored by vking
1 parent 3caf02ce

taocan-share-pinglun

... ... @@ -42,7 +42,9 @@
"pages/taocan/index",
"pages/taocan/order",
"pages/taocan/orderHis",
"pages/pinglun/create"
"pages/pinglun/create",
"pages/pinglun/success",
"pages/pinglun/mylist"
],
"subpackages": [
{
... ... @@ -173,7 +175,7 @@
},
"usingComponents": {
"layout": "/components/layout",
"page":"/components/2.0/common/page"
"page": "/components/2.0/common/page"
},
"debug": true,
"sitemapLocation": "sitemap.json"
... ...
// pages/pinglun/create.js
import App from '../../utils/api'
import util from '../../utils/util'
import DA from '../../pages/reserve/data';
Page({
/**
... ... @@ -54,10 +55,23 @@ Page({
*/
onLoad: function (options) {
this.options=options
this.setData({
sellername:options.sellername,
})
this.initPage()
},
async initPage(){
try{
this.setData({
labels:await DA.getLabels(),
sellername:this.options.sellername,
loading:1,
})
}catch(e){
this.setData({
loading:-1,
})
}
}
,
/**
* 生命周期函数--监听页面初次渲染完成
... ... @@ -140,4 +154,54 @@ Page({
})
util.toast('图片已删除','none')
},
labelTap(e){
let labels=this.data.labels
labels[util.attr(e,'index')].active=!labels[util.attr(e,'index')].active
this.setData({
labels:labels,
})
},
text:'',
textareaInput(e){
this.text=util.val(e).trim();
},
submitIng:false,
submit(){
if(this.submitIng) return;
let eval_label=[]
this.data.labels.some(l=>{
if(l.active){
eval_label.push(l.name)
}
})
if(eval_label.length<1) return util.toast('请选择标签','none')
this.submitIng=true
let enclosure=[];
this.data.files.some(attr=>{
if(attr.remote){
enclosure.push(attr.remote)
}
})
let params={
sid:this.options.sid,
rid:this.options.oid,
eval_label:eval_label.toString(),
author_openid:getApp().openid,
enclosure:JSON.stringify(enclosure),
identity:1,
text:this.text||'',
types:1,
grade:this.statVal,
}
App.User.SetComment(params).then(res=>{
if(res.ret!=200){
return util.toast(res.msg,'')
}
wx.redirectTo({
url:'./success?sellername='+this.options.sellername
})
}).catch(e=>{
this.submitIng=false
})
}
})
\ No newline at end of file
... ...
<!--pages/pinglun/create.wxml-->
<nav>{{sellername}}</nav>
<page loading="1">
<view class="view">
<page loading="{{loading}}">
<view class="view" style="padding-bottom: 200rpx;">
<view class="view padding-lr-lg">
<view class="view flex align-center solid-bottom" style="height: 136rpx;">
<view class="txt-36-h text-bold">评分</view>
... ... @@ -14,13 +14,16 @@
<view class="txt-36-h text-bold" style="margin-top: 48rpx; min-width: 72rpx;">标签</view>
<view class="txt-36-h text-bold margin-left-xs margin-right" style="color:#FF7A00;margin-top: 48rpx;">*</view>
<view class="view margin-top-lg flex flex-wrap">
<view class="tag-item view padding-lr margin-bottom margin-right flex align-center">包间环境好</view>
<view class="tag-item active view padding-lr margin-bottom margin-right flex align-center">包间环境好</view>
<view class="tag-item view padding-lr margin-bottom margin-right flex align-center">包间环境好</view>
<block wx:for="{{labels}}" wx:key="labels">
<view bindtap="labelTap" data-index="{{index}}"
class="tag-item {{item.active?'active':''}} view padding-lr margin-bottom margin-right flex align-center">{{item.name}}</view>
</block>
</view>
</view>
<textarea
class="margin-top-lg" style="height: 294rpx; font-size: 30rpx;"
class="margin-top-lg" style="height: 294rpx; font-size: 30rpx;line-height: 42rpx;"
bindinput="textareaInput"
placeholder-style="font-size: 30rpx;line-height: 42rpx;color:#999999;"
placeholder="从包间环境、菜品口味、服务来评价餐厅,可以帮助更多想要订这家餐厅的人哦~"></textarea>
</view>
<scroll-view class="view"
... ...
// pages/pinglun/mylist.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/pinglun/mylist.wxml-->
<text>pages/pinglun/mylist.wxml</text>
... ...
/* pages/pinglun/mylist.wxss */
\ No newline at end of file
... ...
// pages/pinglun/success.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
sellername:options.sellername||'',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"usingComponents": {
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
<!--pages/pinglun/success.wxml-->
<nav>{{sellername}}</nav>
<view class="view flex flex-direction justify-start align-center padding-top-xl margin-top-xl">
<view class="view flex align-center">
<image src="http://nosqn.colorcun.com/pinglun/p%20%288%29.png" style="width: 60rpx;height: 60rpx;"></image>
<view class="txt-38-h text-bold margin-left-sm">感谢您的评价!</view>
</view>
<view class="margin-top-sm margin-bottom-xl txt-30-h">您的评价已提交,我们会尽快进行审核</view>
<navigator url="./mylist" open-type="redirect" hover-class="other-navigator-hover">
<view class="margin-top mylist">查看评价</view>
</navigator>
</view>
... ...
/* pages/pinglun/success.wxss */
@import "../../colorui/main.wxss";
.mylist{
width: 300rpx;
height: 80rpx;
border-radius: 40rpx;
border: 2rpx solid #5EB2FF;
font-size: 34rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #42A5FF;
line-height: 80rpx;
text-align: center;
}
\ No newline at end of file
... ...
... ... @@ -10,6 +10,10 @@ let getCates=async function(){
})
return cates;
}
let getLabels=async function(){
let res=await App.Reserve.GetCustomerConfig();
return res.data.pub_label;
}
let getCatesID=async function(index){
let res=await App.Reserve.GetCustomerConfig();
return res.data.cate[index].id;
... ... @@ -17,4 +21,5 @@ let getCatesID=async function(index){
export default {
getCates:getCates,
getCatesID:getCatesID,
getLabels:getLabels,
}
\ No newline at end of file
... ...
... ... @@ -601,7 +601,7 @@
{
"name": "pages/reserve/detail",
"pathName": "pages/reserve/detail",
"query": "id=1001&_activeTab=reserve&_date=2020-02-16&_pnum=6",
"query": "id=80&_activeTab=reserve&_date=2020-02-16&_pnum=6",
"scene": null
},
{
... ... @@ -738,6 +738,12 @@
"pathName": "pages/pinglun/create",
"query": "sid=80&oid=118852&sellername=秦风面庄001",
"scene": null
},
{
"name": "pages/pinglun/success",
"pathName": "pages/pinglun/success",
"query": "",
"scene": null
}
]
}
... ...
... ... @@ -521,6 +521,11 @@ export default {
//分享关系记录
'App.Customer.SetShareRel':null,
//预订成功之后用户评价当前预订
'App.User.SetComment':{
openid:'author_openid',
},
//获取商家优惠对接人信息
'App.Customer.GetSellerPreferentialDocking':null,
//接单人,获得商家设置的接单人列表
... ...