myevaluatedetail.vue
7.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<template>
<view class="page">
<pyh-nv ref="nv" :config="nvConfig"></pyh-nv>
<view class="listBox" :style="{'padding-top':(pageTop+'px')}">
<view class="content" style="background-color: #fff;padding: 20rpx;height: 100vh;">
<view class="" style="border-bottom: 1px double #ccc;padding-bottom: 30rpx;">
<view class="" style="display: flex;align-items: center;">
<span>报丧评分:</span>
<u--input
placeholder="请输入评分"
border="surround"
v-model="list.funeralScore"
></u--input>
</view>
</view>
<view class="" style="margin-top: 40rpx;border-bottom: 1px double #ccc;padding-bottom: 30rpx;" v-if="info.funeralScore != null">
<view class="" style="display: flex;align-items: center;">
<span>火化预约评分:</span>
<u--input
placeholder="请输入评分"
border="surround"
v-model="list.cremationScheduled"
></u--input>
</view>
</view>
<view class="" style="margin-top: 40rpx;border-bottom: 1px double #ccc;padding-bottom: 30rpx;" v-if="info.cremationId != null">
<view class="" style="display: flex;align-items: center;">
<span>礼堂预约评分:</span>
<u--input
placeholder="请输入评分"
border="surround"
v-model="list.hallScheduled"
></u--input>
</view>
</view>
<view class="" style="margin-top: 40rpx;border-bottom: 1px double #ccc;padding-bottom: 30rpx;" v-if="info.hallId != null">
<view class="" style="display: flex;align-items: center;">
<span>骨灰寄存评分:</span>
<u--input
placeholder="请输入评分"
border="surround"
v-model="list.ashesstorageScheduled"
></u--input>
</view>
</view>
<view class="" style="margin-top: 40rpx;border-bottom: 1px double #ccc;padding-bottom: 30rpx;">
<view class="" style="display: flex;align-items: center;margin-bottom: 80rpx;">
<span>总评分:</span>
<u--input
placeholder="请输入总评分"
border="surround"
v-model="list.score"
></u--input>
</view>
<view class="top" style="margin-bottom: 20rpx;">
<view style="margin-bottom: 20rpx;">评价内容:</view>
<u--textarea v-model="list.content" placeholder="请输入内容" ></u--textarea>
</view>
</view>
<view class="" style="position: absolute;position: fixed;bottom: 0;margin-bottom: 20rpx;width: 95vw;">
<u-button @click="tj" style="width: 95vw;" type="primary" text="提交评价"></u-button>
</view>
</view>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script>
import { data } from 'uview-ui/libs/mixin/mixin';
export default {
data() {
return {
OrderType: 0,
nvConfig:{
title:"服务评价详情",
bgColor:"#ffffff",
color:"#000000",
fixedAssist:{
hide:true,
},
},
list:{
// bereavementNumber: "1",
// content:"",
// createdTime: null,
// createdUser: null,
// evaluationTime: "2023-09-30",
// id: null,
// orderNumber: "1",
// productId: "1",
// score: "",
// updatedTime: null,
// updatedUser: null,
// userId: "1",
bereavementNumber:"",
funeralScore:"",
cremationId:"",
cremationScheduled:"",
hallId:"",
hallScheduled:"",
ashesstorageId:"",
ashesstorageScheduled:"",
userId:uni.getStorageSync("USERS_KEY").userId,
content:"",
score:"",
},
info:{}
};
},
onPageScroll(e) {this.$refs.nv.pageScroll(e)},
computed:{
pageTop(){return parseInt(88*uni.getSystemInfoSync().windowWidth/750) + uni.getSystemInfoSync().statusBarHeight}
},
onLoad(params) {
console.log("info",JSON.parse(params.info));
this.info = JSON.parse(params.info);
},
methods:{
// 提交评论
tj(){
console.log(this.list);
// var date = new Date()
// this.list.evaluationTime = this.parseTime(date);
// this.list.bereavementNumber = this.info.orderNumber;
// console.log(this.list);
// this.API.postpj(this.list).then(res=>{
// console.log("提交评价",res);
// if(res.code == 200){
// this.$refs.uToast.show({
// type: 'success',
// title: '成功主题(带图标)',
// message: "评论成功",
// iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
// })
// setTimeout(function () {
// uni.reLaunch({
// url:'/pages/my/my'
// })
// }, 2000);
// }
// })
var info = {
bereavementNumber:"",
funeralScore:"",
cremationId:"",
cremationScheduled:"",
hallId:"",
hallScheduled:"",
ashesstorageId:"",
ashesstorageScheduled:"",
userId:uni.getStorageSync("USERS_KEY").userId,
content:"",
score:"",
evaluationTime:"",
}
var date = new Date()
info.evaluationTime = this.parseTime(date);
info.bereavementNumber = this.info.funeralNumber;
info.funeralScore = this.list.funeralScore;
info.cremationId = this.info.cremationId;
info.cremationScheduled = this.list.cremationScheduled;
info.hallId = this.info.hallId;
info.hallScheduled = this.list.hallScheduled;
info.ashesstorageId = this.info.ashesstorageId;
info.ashesstorageScheduled = this.list.ashesstorageScheduled;
info.content = this.list.content;
info.score = this.list.score;
console.log("提交项目",info);
// return
this.API.sypjtj(info).then(res=>{
console.log("评价结果",res);
this.$refs.uToast.show({
type: 'success',
title: '成功主题(带图标)',
message: "购买成功",
iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
})
setTimeout(function () {
uni.navigateBack({
delta: 1
});
}, 2000);
})
},
// 时间搓处理
parseTime(timestamp){
var date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
var Y = date.getFullYear() + '-';
var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
var D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + ' ';
var h = (date.getHours() < 10 ? '0'+date.getHours() : date.getHours()) + ':';
var m = (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) + ':';
var s = (date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds());
let strDate = Y+M+D
console.log(strDate) //2020-05-08 17:44:56
return strDate;
},
/**
* 返回点击
*/
onBack(){
uni.navigateBack();
},
/**
* 订单tab点击
*/
onOrderTab(type){
this.OrderType = type;
// #ifdef H5
uni.redirectTo({
url: '/pages/MyOrderList/MyOrderList?type=' + type,
})
//#endif
},
/**
* 订单列表点击
*/
onOrderList(){
uni.navigateTo({
url: '/pages/OrderDetails/OrderDetails',
})
},
/**
* 评价点击
*/
onEvaluate(){
uni.navigateTo({
url: '/pages/MyEvaluatePush/MyEvaluatePush'
})
}
}
}
</script>
<style scoped lang="scss">
@import 'myevaluate.scss';
</style>