优化订单,组件页面下拉刷新,修改评论bug

master
lemon橪 2021-09-27 19:58:18 +08:00
parent cebde87682
commit 3b9b2e8ba2
6 changed files with 42 additions and 30 deletions

View File

@ -2,12 +2,13 @@
<view class="myTracks"> <view class="myTracks">
<u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty> <u-empty text="暂无历史记录" style="margin-top:200rpx;" mode="history" v-if="whetherEmpty"></u-empty>
<div v-else> <div v-else>
<view v-for="(item, index) in trackList" :key="index"> <view v-for="(item, index) in trackList" :key="index">
<view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view> <view class="myTracks-title" @click="navgaiteToStore(item)">{{item.storeName}}</view>
<view class="myTracks-items"> <view class="myTracks-items">
<view class="myTracks-item"> <view class="myTracks-item">
<u-checkbox-group> <u-checkbox-group>
<u-checkbox v-model="item.___isDel" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx" @change="changeChecked(item)"></u-checkbox> <u-checkbox v-model="item.___isDel" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx"
@change="changeChecked(item)"></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
<view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)"> <view class="myTracks-item-img" @click.stop="navgaiteToDetail(item)">
<image :src="item.thumbnail"></image> <image :src="item.thumbnail"></image>
@ -33,7 +34,8 @@
<view class="myTracks-action"> <view class="myTracks-action">
<view class="myTracks-action-check"> <view class="myTracks-action-check">
<u-checkbox-group> <u-checkbox-group>
<u-checkbox v-model="allChecked" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx" @change="checkedAllitem"></u-checkbox> <u-checkbox v-model="allChecked" v-if="editFlag" active-color="#ff6b35" style="margin-right: 10rpx"
@change="checkedAllitem"></u-checkbox>
全选 全选
</u-checkbox-group> </u-checkbox-group>
</view> </view>
@ -79,6 +81,10 @@ export default {
onLoad() { onLoad() {
this.getList(); this.getList();
}, },
onPullDownRefresh() {
this.trackList = [];
this.getList();
},
methods: { methods: {
/** /**
* 导航到店铺 * 导航到店铺

View File

@ -47,7 +47,7 @@
</view> </view>
<view v-if="current == 0 && sku.commentStatus == 'UNFINISHED'"> <view v-if="current == 0 && sku.commentStatus == 'UNFINISHED'">
<view class="evaluate"> <view class="evaluate">
<view @click="talkCommont(order)"> <view @click="talkCommont(sku)">
<u-tag text="发表评价" shape="circle" mode="plain" type="error" /> <u-tag text="发表评价" shape="circle" mode="plain" type="error" />
</view> </view>
</view> </view>
@ -192,10 +192,11 @@ export default {
/** /**
* 发表评价 * 发表评价
*/ */
talkCommont(order) { talkCommont(sku) {
console.log(sku)
uni.navigateTo({ uni.navigateTo({
url: `./releaseEvaluate?sn=${order.sn}&order=${encodeURIComponent( url: `./releaseEvaluate?sn=${sku.sn}&sku=${encodeURIComponent(
JSON.stringify(order) JSON.stringify(sku)
)}`, )}`,
}); });
}, },

View File

@ -1,7 +1,7 @@
<template> <template>
<view> <view>
<!-- 遍历出评价商品 --> <!-- 遍历出评价商品 -->
<view v-for="(sku, index) in order.orderItems" :key="index"> <view>
<view class="after-sales-goods-detail-view"> <view class="after-sales-goods-detail-view">
<view> <view>
<view class="goods-item-view"> <view class="goods-item-view">
@ -23,23 +23,27 @@
<view class="sub-title">满意请打好评哦</view> <view class="sub-title">满意请打好评哦</view>
</view> </view>
<view class="rate-view"> <view class="rate-view">
<view class="rate-btn" @click="onGrade('GOOD', index)"> <view class="rate-btn" @click="onGrade('GOOD')">
<view style="font-size: 42rpx" :style="{ color: form.grade === 'GOOD' ? 'red' : '#CCCCCC' }" class="alifont icon-haoping1"></view> <u-icon name="heart-fill" style="font-size: 42rpx"
:style="{ color: form.grade === 'GOOD' ? 'red' : '#CCCCCC' }"></u-icon>
<text>好评</text> <text>好评</text>
</view> </view>
<view class="rate-btn" @click="onGrade('MODERATE', index)"> <view class="rate-btn" @click="onGrade('MODERATE')">
<view style="font-size: 42rpx" :style="{ color: form.grade === 'MODERATE' ? 'red' : '#CCCCCC' }" class="alifont icon-zhongping1"></view> <u-icon name="heart-fill" style="font-size: 42rpx"
:style="{ color: form.grade === 'MODERATE' ? 'red' : '#CCCCCC' }"></u-icon>
<text>中评</text> <text>中评</text>
</view> </view>
<view class="rate-btn" @click="onGrade('WORSE', index)"> <view class="rate-btn" @click="onGrade('WORSE')">
<view style="font-size: 42rpx" :style="{ color: form.grade === 'WORSE' ? 'red' : '#CCCCCC' }" class="alifont icon-chaping"></view> <u-icon name="heart-fill" style="font-size: 42rpx"
:style="{ color: form.grade === 'WORSE' ? 'red' : '#CCCCCC' }"></u-icon>
<text>差评</text> <text>差评</text>
</view> </view>
</view> </view>
</view> </view>
<view class="info-evaluate-view"> <view class="info-evaluate-view">
<view class="input-view"> <view class="input-view">
<u-input v-model="form.content" height="200" placeholder-style="font-size:12px;color:#CCCCCC" :type="type" :border="border" :maxlength="maxlength" :placeholder="placeholder" /> <u-input v-model="form.content" height="200" placeholder-style="font-size:12px;color:#CCCCCC" :type="type"
:border="border" :maxlength="maxlength" :placeholder="placeholder" />
</view> </view>
<view class="input-num"> <view class="input-num">
<text>{{ form.content.length }}/{{ maxlength }}</text> <text>{{ form.content.length }}/{{ maxlength }}</text>
@ -47,7 +51,8 @@
</view> </view>
<view class="info-evaluate-view"> <view class="info-evaluate-view">
<view class="images-view"> <view class="images-view">
<u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150" @on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload> <u-upload :header=" { accessToken: storage.getAccessToken() }" :action="action" width="150"
@on-uploaded="onUploaded" :max-count="5" :show-progress="false"></u-upload>
</view> </view>
</view> </view>
</view> </view>
@ -57,7 +62,8 @@
<view class="seller-rate-view"> <view class="seller-rate-view">
<view class="rate-title">描述相符</view> <view class="rate-title">描述相符</view>
<view> <view>
<u-rate count="count" gutter="20" active-color="#FFC71C" v-model="form.descriptionScore" :size="40"></u-rate> <u-rate count="count" gutter="20" active-color="#FFC71C" v-model="form.descriptionScore" :size="40">
</u-rate>
</view> </view>
</view> </view>
<view class="seller-rate-view"> <view class="seller-rate-view">
@ -94,7 +100,7 @@ export default {
maxlength: 500, //500 maxlength: 500, //500
placeholder: placeholder:
"宝贝满足您的期待吗?说说它的优点和美中不足的地方吧。您的评价会帮助更多的人", "宝贝满足您的期待吗?说说它的优点和美中不足的地方吧。您的评价会帮助更多的人",
order: {}, // sku: {}, //
form: { form: {
content: "", // content: "", //
goodsId: "", //id goodsId: "", //id
@ -111,10 +117,9 @@ export default {
onLoad(options) { onLoad(options) {
// //
this.form.orderItemSn = options.sn; this.form.orderItemSn = options.sn;
this.order = JSON.parse(decodeURIComponent(options.order)); this.sku = JSON.parse(decodeURIComponent(options.sku));
this.form.goodsId = this.order.orderItems[0].goodsId; this.form.goodsId = this.sku.goodsId;
this.form.orderItemSn = this.order.orderItems[0].sn; this.form.skuId = this.sku.skuId;
this.form.skuId = this.order.orderItems[0].skuId;
}, },
methods: { methods: {
/** /**
@ -141,7 +146,7 @@ export default {
success: () => { success: () => {
setTimeout(() => { setTimeout(() => {
uni.navigateBack(); uni.navigateBack();
}, 2000); }, 500);
}, },
}); });
} }

View File

@ -830,9 +830,7 @@ page {
margin-bottom: 20rpx; margin-bottom: 20rpx;
color: #666; color: #666;
} }
.address-list {
margin-left: 20rpx;
}
.address-item { .address-item {
font-weight: normal; font-weight: normal;
letter-spacing: 1rpx; letter-spacing: 1rpx;

View File

@ -135,22 +135,23 @@ export default {
*/ */
async onLoad(options) { async onLoad(options) {
this.storeId = options.id; this.storeId = options.id;
this.goodsParams.storeId = options.id;
this.couponParams.storeId = options.id;
}, },
onPageScroll(e) { onPageScroll(e) {
this.scrollTop = e.scrollTop; this.scrollTop = e.scrollTop;
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.init();
this.init();
}, },
mounted() { mounted() {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// //
uni.showShareMenu({ withShareTicket: true }); uni.showShareMenu({ withShareTicket: true });
// #endif // #endif
this.init(); this.init();
}, },
// //
onReachBottom() { onReachBottom() {
this.goodsParams.pageNumber++; this.goodsParams.pageNumber++;

View File

@ -168,6 +168,7 @@ export function orderStatusList(val) {
PAID: "已付款", PAID: "已付款",
DELIVERED: "已发货", DELIVERED: "已发货",
CANCELLED: "已取消", CANCELLED: "已取消",
COMPLETED:"已完成",
COMPLETE: "已完成", COMPLETE: "已完成",
TAKE: "待核验", TAKE: "待核验",
}; };