fixing bug

This commit is contained in:
2020-09-05 14:26:17 +08:00
parent e1a74972f2
commit b653379d53
8 changed files with 72 additions and 42 deletions

View File

@@ -3,7 +3,7 @@
<scroll-view scroll-y class="history-box" @scrolltolower="reachBottom">
<view class="item-box">
<!-- 需求只显示最近五十条数据 后台未作限制 -->
<view v-for="(item, index) in historyList.slice(0, 50)" :key="index" class="history-item">
<view v-for="(item, index) in historyList" :key="index" class="history-item">
<view class="item-title" @click="viewStoreDetails(item.store_id)">
<image :src="item.store_avatar"></image>
<view class="u-line-1">{{ item.store_name }}</view>

View File

@@ -57,10 +57,6 @@
<view class="order-view order-area" @click="showAddress=true">
<view class="title">省市区:</view>
<input type="text" v-model="area" disabled />
<!-- <view class="location">
<image src="../static/mine/28.png"></image>
<view>定位</view>
</view> -->
</view>
<view class="order-view order-address">
<view class="title">详细地址:</view>
@@ -113,10 +109,6 @@
<view class="order-view order-area" @click="showAddress=true">
<view class="title">省市区:</view>
<input type="text" v-model="area" disabled />
<!-- <view class="location">
<image src="../static/mine/28.png"></image>
<view>定位</view>
</view> -->
</view>
<view class="order-view order-address">
<view class="title">详细地址:</view>
@@ -254,7 +246,6 @@ export default {
// this.current = 0;
// this.swiperCurrent = 0;
this.showPopup = false;
this.choose = false;
},
onLoad() {
this.getOrderList();
@@ -270,6 +261,7 @@ export default {
this.phone = '';
this.area = '';
this.address = '';
this.choose = false;
}
},
methods: {

View File

@@ -2,20 +2,25 @@
<view class="comment">
<view class="main-container">
<u-input v-model="content" type="textarea" height="300" maxlength="200" />
<!-- <u-upload
<u-upload
ref="uUpload"
@on-uploaded="onUploaded"
:custom-btn="true"
:max-count="count"
:auto-upload="false"
:action="action"
:header="header"
:form-data="formData"
:name="fileName"
:size-type="['original']"
@on-uploaded="setImageList"
>
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<image src="../static/mine/27.png"></image>
</view>
</u-upload> -->
</u-upload>
</view>
<u-toast ref="uToast" />
<view class="write-btn" @click="addWashEvaluate">发表评价</view>
<view class="write-btn" @click="setLoaclList">发表评价</view>
</view>
</template>
<script>
@@ -23,8 +28,17 @@ export default {
data() {
return {
washId: '',
// count: 4, // 最大图片数量
count: 1,
action: this.$u.http.config.baseUrl + '/Upload/uploadfile',
header: {
"authorization": 'Bearer' + " " + uni.getStorageSync('token')
},
fileName: 'common', // 与formData name 一样
formData: {
name: 'common', // 其他图片
},
content: '',
imageList: [],
}
},
onLoad(option) {
@@ -38,11 +52,22 @@ export default {
}
return true;
},
setLoaclList() {
this.$refs.uUpload.upload();
},
setImageList(lists) {
// console.log(lists);
lists.forEach(item => {
this.imageList.push(item.response.data.file_name);
})
this.addWashEvaluate();
},
addWashEvaluate() {
if(!this.verifyParams()) return false;
this.$u.api.sendOrderComment({
id: this.washId,
comment: this.content,
comment_img: this.imageList[0]
}).then(res => {
this.$refs.uToast.show({
title: res.message,
@@ -65,23 +90,23 @@ export default {
background-color: #ffffff;
padding: 30rpx;
margin-bottom: 10rpx;
// textarea {
// width: 100% !important;
// height: 500rpx;
// margin-bottom: 60rpx;
// }
// .slot-btn {
// width: 140rpx;
// height: 140rpx;
// background: rgba(236,236,236,1);
// border-radius: 10rpx;
// text-align: center;
// > img {
// margin-top: 48rpx;
// width: 54rpx;
// height: 49rpx;
// }
// }
textarea {
width: 100% !important;
height: 500rpx;
margin-bottom: 60rpx;
}
.slot-btn {
width: 140rpx;
height: 140rpx;
background: rgba(236,236,236,1);
border-radius: 10rpx;
text-align: center;
> image {
margin-top: 48rpx;
width: 54rpx;
height: 49rpx;
}
}
}
.write-btn {
margin: 120rpx auto 0;