tianyi 18 hours ago
parent
commit
9faa9c572b
  1. 133
      package1/group/shopEvaluate.vue
  2. 2
      package1/myCenter/partTimeJobRegister.vue
  3. 2
      package1/order/orderEvaluate.vue
  4. 2
      package1/runErrand/runErrand.vue

133
package1/group/shopEvaluate.vue

@ -59,7 +59,7 @@
<view class="eval-text"> <view class="eval-text">
{{item.remark}} {{item.remark}}
</view> </view>
<view class="eval-img"> <view class="eval-img" v-if="item.picture">
<img @tap="largeImg" :src="item.picture" alt=""> <img @tap="largeImg" :src="item.picture" alt="">
</view> </view>
<view class="reply-card" :class="{'expanded': isExpanded}" v-for="(item1,index1) in item.comments" :key="index1"> <view class="reply-card" :class="{'expanded': isExpanded}" v-for="(item1,index1) in item.comments" :key="index1">
@ -75,6 +75,39 @@
</view> </view>
</view> </view>
</view> </view>
<view class="" v-if="isMerchant == 1">
<view @tap="changeStatus(index)" class="reply-card" v-if="!item.isReply" style="text-align: right;padding-right: 10px;color: #00BFFF;">
回复
</view>
<view class="" v-else>
<view class="" style="background: #f5f5f5;border-radius: 10px;border: 1px solid #777;margin-top: 10px;">
<view class="eval-num" style="border: none;">
<textarea name="" v-model="replyText" id="" cols="30" rows="10" placeholder="有什么想说的吗?可以写下来,提交给我们" style="width: 100%;font-size: 28rpx;padding: 30rpx;height: 200rpx;"></textarea>
</view>
<view class="eval-num" style="border: none;padding: 0 30rpx;display: flex;margin-bottom: 10px;">
<view class="upload-img" @tap="pictureAdd()"
style="background: #eee;text-align: center;line-height: 160rpx;">
<uni-icons type="camera" size="28" color="#777"></uni-icons>
</view>
<view style="flex: 1;display: flex;">
<view v-if="replyPicture !=''"
:key="index" style="width: 160rpx;height: 160rpx;margin-left: 20rpx;">
<img :src="replyPicture" alt="" class="upload-img">
</view>
</view>
</view>
</view>
<!-- <textarea type="text" v-model="replyText" placeholder="要说什么写下来吧" style="background: #eee;border-radius: 10px;height: 100px;margin: 10px 0;padding: 10px;" /> -->
<view class="" style="display: flex;flex-direction: row-reverse;padding-right: 10px;margin-top: 10px;">
<view @tap="submit(index)" class="" style="margin-left: 20px;color: #00BFFF;">
确认
</view>
<view class="" @tap="changeStatus(index)">
取消
</view>
</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -91,8 +124,10 @@
export default { export default {
data() { data() {
return { return {
replyText:'',
isMerchant:0,
replyPicture:"",
isExpanded: false, isExpanded: false,
replyText: '感谢您的评价,希望可以带给您更好的体验。我们会继续努力,优化服务,欢迎再次光临!如果您有任何建议,也欢迎随时告诉我们。感谢您的支持与喜爱!',
menuButtonInfo: {}, menuButtonInfo: {},
isPintuan: true, isPintuan: true,
bigImg: '', bigImg: '',
@ -153,6 +188,7 @@
} }
}, },
onLoad(option) { onLoad(option) {
this.isMerchant = option.isMerchant
this.shopItem = JSON.parse(option.item) this.shopItem = JSON.parse(option.item)
this.getshopComments(this.shopItem.id) this.getshopComments(this.shopItem.id)
}, },
@ -171,6 +207,9 @@
} else { } else {
that.shopComments = [...that.shopComments, ...res.result.records] that.shopComments = [...that.shopComments, ...res.result.records]
} }
for(let i=0;i<that.shopComments.length;i++){
that.shopComments[i].isReply=false
}
that.$forceUpdate() that.$forceUpdate()
if(this.searchAll){ if(this.searchAll){
that.menuList[0].num = res.result.total that.menuList[0].num = res.result.total
@ -182,9 +221,42 @@
uni.hideLoading() uni.hideLoading()
}).catch((res) => {}) }).catch((res) => {})
}, },
submit(v){
let that = this;
let data = [{ //
parentId:this.shopComments[v].id,
leve:1,
remark:this.replyText,
picture:this.replyPicture,
createBy:this.shopComments[v].createBy,
createByName:'微信用户',
createByIcon:'https://ooo.0o0.ooo/2019/04/28/5cc5a71a6e3b6.png',
orderId:this.shopComments[v].orderId,
shopId:this.shopComments[v].shopId,
}]
that.tui.request("/app/comment/save", "POST", data, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "评论成功",
icon: 'none'
})
setTimeout(res => {
this.back()
}, 1000)
} else {
that.tui.toast(res.message);
}
uni.hideLoading();
}).catch((res) => {});
},
toggleReply() { toggleReply() {
this.isExpanded = !this.isExpanded; this.isExpanded = !this.isExpanded;
}, },
changeStatus(v){
this.shopComments[v].isReply = !this.shopComments[v].isReply
this.$forceUpdate()
},
checkTab(index) { checkTab(index) {
for (let i = 0; i < this.menuList.length; i++) { for (let i = 0; i < this.menuList.length; i++) {
if (i == index) { if (i == index) {
@ -207,6 +279,55 @@
} }
this.getshopComments(this.shopItem.id) this.getshopComments(this.shopItem.id)
}, },
pictureAdd() {
let that = this
uni.chooseMedia({
count: 1,
mediaType: ['image'],
sourceType: ['camera', 'album'],
success(res) {
uni.showLoading({
title: '加载中...',
mask: true
})
for (let i = 0; i < res.tempFiles.length; i++) {
that.upLoadFile(res.tempFiles[i].tempFilePath)
}
}
})
},
async upLoadFile(path) {
let that = this;
let hiver_token = uni.getStorageSync("hiver_token")
await uni.uploadFile({
url: that.tui.interfaceUrl() + '/upload/file',
filePath: path,
name: 'file',
header: {
"content-type": "multipart/form-data",
'accessToken': hiver_token
},
formData: {},
success: (uploadFileRes) => {
let pathData = JSON.parse(uploadFileRes.data)
this.replyPicture = pathData.result
that.$forceUpdate()
},
fail: (err) => {
uni.hideLoading();
uni.showToast({
title: JSON.stringify(err),
icon: 'none'
})
}
});
await setTimeout(res => {
uni.hideLoading();
}, 1000)
},
// //
largeImg(img) { largeImg(img) {
this.bigImg = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/00b1f011787c4549bbea650d95a4eb39.png' this.bigImg = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/00b1f011787c4549bbea650d95a4eb39.png'
@ -462,4 +583,12 @@
background-color: #ccc; background-color: #ccc;
border-radius: 20rpx; border-radius: 20rpx;
} }
.eval-num{
padding-bottom: 30rpx;
border-bottom: 1px solid #eee;
}
.upload-img {
width: 160rpx;
height: 160rpx;
}
</style> </style>

2
package1/myCenter/partTimeJobRegister.vue

@ -447,7 +447,7 @@
uni.chooseMedia({ uni.chooseMedia({
count: 1, count: 1,
mediaType: ['image'], mediaType: ['image'],
sourceType: ['album'], sourceType: ['camera', 'album'],
success(res) { success(res) {
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '加载中...',

2
package1/order/orderEvaluate.vue

@ -249,7 +249,7 @@
uni.chooseMedia({ uni.chooseMedia({
count: 1, count: 1,
mediaType: ['image'], mediaType: ['image'],
sourceType: ['album'], sourceType: ['camera', 'album'],
success(res) { success(res) {
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '加载中...',

2
package1/runErrand/runErrand.vue

@ -660,7 +660,7 @@
uni.chooseMedia({ uni.chooseMedia({
count: 1, count: 1,
mediaType: ['image'], mediaType: ['image'],
sourceType: ['album'], sourceType: ['camera', 'album'],
success(res) { success(res) {
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '加载中...',

Loading…
Cancel
Save