3f535f30
杨鑫
'初始'
|
1
2
3
4
5
|
<template>
<view class="container">
<global-loading />
<!-- 追加评论 -->
|
0e38abb3
杨鑫
'最新'
|
6
|
<!-- <view class="addEvaluate-box flex-items-plus flex-column-plus">
|
3f535f30
杨鑫
'初始'
|
7
8
|
<view class="addEvaluate flex-column-plus">
<view class="addEvaluateTitle-box flex-row-plus mar-top-20 mar-left-20">
|
855bef33
杨鑫
'最新版本'
|
9
|
|
1991126c
杨鑫
'最新'
|
10
|
<image class="title-img" :src="$baseURL+productImage"></image>
|
3f535f30
杨鑫
'初始'
|
11
12
13
|
<view class="title-textbox overflow">
<label class="fs28 title-text">{{orderProductVO.productName}}</label>
<view v-if="orderProductVO.value" class="fs24 mar-top-10 sukValue">
|
6f06533e
杨鑫
最新1
|
14
|
规格:{{orderProductVO.value}}
|
3f535f30
杨鑫
'初始'
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
</view>
<view v-else class="font-color-999 fs24 mar-top-10">
默认规格
</view>
</view>
</view>
<view class="fs26 mar-top-40 mar-left-20 addEvaluateText">追加评价</view>
<view class="textarea-box mar-top-20 mar-left-20">
<textarea class="textarea-text" v-model="commentText" placeholder-style="color:#BBBBBB" placeholder="亲,有什么需要追加的吗"/>
</view>
<view class="mar-left-10 mar-top-10 evaluateImg">
<u-upload :action="action" ref="uUpload" :limitType="['png', 'jpg', 'jpeg', 'webp', 'gif', 'image']" :header="headerToken" :form-data="formData"></u-upload>
</view>
</view>
|
0e38abb3
杨鑫
'最新'
|
29
30
|
</view> -->
<!-- <view class="butBox flex-items-plus mar-left-30">
|
3f535f30
杨鑫
'初始'
|
31
|
<view class="submitbut" @click="submitTap">追加评论</view>
|
0e38abb3
杨鑫
'最新'
|
32
|
</view> -->
|
3f535f30
杨鑫
'初始'
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
</view>
</template>
<script>
const NET = require('../../utils/request')
const API = require('../../config/api')
export default {
data() {
return {
addCommentVOList:{},
orderProductVO:{},
commentText:'',
fileList:[],
commentImgsFlag:false,
commentImgs:'',
|
855bef33
杨鑫
'最新版本'
|
48
|
action:API.UpUrl,
|
3f535f30
杨鑫
'初始'
|
49
50
51
52
53
54
55
|
formData:{'folderId': -1},
headerToken:{Authorization:''},
productImage:'',
type:0
}
},
onLoad(options) {
|
5d752fd3
杨鑫
'最新'
|
56
|
// console.log('评价',options.detail)
|
179c8432
杨鑫
'商城'
|
57
58
|
let detail = JSON.parse(options.detail)
// options.detail =JSON.parse(options.detail)
|
5d752fd3
杨鑫
'最新'
|
59
60
61
|
// let detail={
// type:options.type
// }
|
179c8432
杨鑫
'商城'
|
62
63
|
this.type = detail.type;
|
5d752fd3
杨鑫
'最新'
|
64
|
|
3f535f30
杨鑫
'初始'
|
65
66
|
if(options.detail){
const params = this.$getJumpParam(options)
|
855bef33
杨鑫
'最新版本'
|
67
|
|
3f535f30
杨鑫
'初始'
|
68
|
this.addCommentVOList = params.addCommentVOList
|
855bef33
杨鑫
'最新版本'
|
69
70
|
this.orderProductVO = params.type===1?this.addCommentVOList.skus[0]:this.addCommentVOList
|
3f535f30
杨鑫
'初始'
|
71
72
|
this.productImage = this.orderProductVO.image
}else{
|
179c8432
杨鑫
'商城'
|
73
|
if(detail.type == 1){
|
3f535f30
杨鑫
'初始'
|
74
75
76
77
78
79
80
81
82
83
|
this.addCommentVOList = uni.getStorageSync('addCommentVOList');
this.orderProductVO = this.addCommentVOList.skus[0]
this.productImage = this.orderProductVO.image
}else{
this.addCommentVOList = uni.getStorageSync('addCommentVOList');
this.orderProductVO = this.addCommentVOList
this.productImage = this.orderProductVO.productImage
}
uni.removeStorageSync('addCommentVOList')
}
|
179c8432
杨鑫
'商城'
|
84
85
|
if(detail.commentId){
this.commentId = detail.commentId
|
3f535f30
杨鑫
'初始'
|
86
87
88
89
90
91
|
}
const res = uni.getStorageSync('storage_key');
this.headerToken.Authorization = res.token
},
onReady() {
this.fileList = this.$refs.uUpload.lists
|
87d6eb96
杨鑫
'修改BUG'
|
92
|
|
3f535f30
杨鑫
'初始'
|
93
94
95
|
},
methods: {
submitTap(){
|
855bef33
杨鑫
'最新版本'
|
96
|
|
3f535f30
杨鑫
'初始'
|
97
98
99
100
101
102
103
104
105
106
107
108
109
|
if (!this.commentText) {
uni.showToast({
title: '请先说点什么吧',
icon: 'none'
})
return
}
// uni.showLoading({
// title: '提交中...',
// })
if(this.fileList.length>0){
this.commentImgsFlag = true
for(let i=0;i<this.fileList.length;i++){
|
855bef33
杨鑫
'最新版本'
|
110
|
this.commentImgs += this.fileList[i].response.data+','
|
3f535f30
杨鑫
'初始'
|
111
112
|
}
}
|
179c8432
杨鑫
'商城'
|
113
|
|
3f535f30
杨鑫
'初始'
|
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
let data = []
if(this.type == 1){
data = [{
commentId:this.commentId,
image:this.commentImgs,
comment:this.commentText
}]
}else if(this.type == 2){
data = [{
commentId:this.addCommentVOList.commentId,
image:this.commentImgs,
comment:this.commentText
}]
}
|
179c8432
杨鑫
'商城'
|
128
|
console.log('上传评价',data,this.type)
|
855bef33
杨鑫
'最新版本'
|
129
|
// return
|
3f535f30
杨鑫
'初始'
|
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
|
NET.request(API.AdditionalComment,{params:data} , 'POST').then(res => {
uni.hideLoading()
uni.showToast({
title: '追评成功',
})
setTimeout(() => {
uni.redirectTo({
url: 'userEvaluate'
})
}, 1500);
}).catch(res => {
uni.hideLoading()
uni.showToast({
title: res.message,
})
})
}
}
}
</script>
<style lang="scss">
page{
background-color: #F7F7F7;
}
.container{
.addEvaluate-box{
margin-top: 20upx;
.addEvaluate{
width: 690upx;
background-color: #FFFFFF;
border-radius: 10upx;
padding-bottom: 30upx;
.addEvaluateText {
font-weight: bold;
}
.addEvaluateTitle-box{
.title-img{
width: 90upx;
height: 90upx;
border-radius: 4upx;
}
.title-textbox{
width: 530upx;
margin-left: 20upx;
font-weight: bold;
.sukValue {
color: #CCCCCC;
font-weight: 400;
}
}
}
}
.textarea-box{
.textarea-text{
width: 610upx;
height: 200upx;
background-color: #FFFFFF;
font-size: 26upx;
padding: 20upx 20upx;
border: 2rpx solid #E4E5E6;
}
}
.addPicture-box{
background-color: #F5F5F5;
width: 40upx;
height: 40upx;
margin-top: 100upx;
margin-left: 100upx;
border-radius: 10upx;
display: flex;
justify-content: center;
align-items: center;
color: #BBBBBB;
}
}
.butBox{
position: absolute;
bottom: 40upx;
.submitbut{
height: 100upx;
width: 690upx;
background: #333333;
color: #FFEBC4;
font-size: 28upx;
text-align: center;
line-height: 100upx;
}
}
}
</style>
<style scoped>
.evaluateImg /deep/ .u-upload .u-list-item {
background: none;
border: 2rpx solid #E4E5E6;
border-radius: 0;
}
.evaluateImg /deep/ .u-upload .u-list-item .uicon-plus:before {
content: '';
height: 71rpx;
width: 71rpx;
|
844aa73a
杨鑫
'最新'
|
232
|
background: url("https://jy.scjysm.asia:18086/cdwlMall/questionnaire/file/static/images/addImg.png") no-repeat center center;
|
3f535f30
杨鑫
'初始'
|
233
234
235
236
|
display: block;
background-size: contain;
}
</style>
|