dengrui/pagesA/daiEvaluated/daiEvaluated.vue

102 lines
3.4 KiB
Vue
Raw Normal View History

2021-08-26 01:49:06 +00:00
<template>
<view v-if="pageShow">
<!-- 使用标题栏 -->
<status-nav :statusBackw="true" :statusTitle="true" :title-val="'待评价'" :tabcolor="'#ffffff'"></status-nav>
<view :style="{paddingTop:(statusHNH+10)+'px'}">
<view v-if="dataArr.length!=0" class="margin-sx20 bacb padding-zy20">
<view class="padding-sx30 borbot" v-for="(item,index) in dataArr" :key="index">
<view class="disac" @tap="checkDetail(item.spu_id)">
<image class="flexs goodsImg" :src="item.src" mode="aspectFill"></image>
<view class="margin-z20">
<view class="fon28 clips2">{{item.title}}</view>
<view class="margin-sx10"><text class="fon26" style="color: #6f6f6f;">{{item.num}}</text><text class="bold fon26 margin-z10"><text class="fon32">{{item.price}}</text>.0</text></view>
</view>
</view>
<view class="disba jcend">
<view @tap="goEvaluated(index)" class="fon26 colorf78" style="border: 1rpx solid #FF7800;height: 60rpx;width: 150rpx;border-radius: 29.5rpx;text-align: center;line-height: 60rpx;">评价</view>
</view>
</view>
</view>
<view v-if="dataArr.length==0" class="zanwu"></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
dataArr:[],
page:1,
2021-08-29 01:35:35 +00:00
size:10,
total:'',
isZanw:true,
2021-08-26 01:49:06 +00:00
statusHNH:uni.getStorageSync('statusHNH'),
pageShow:false
}
},
onShow() {
this.$toolAll.tools.guoq()
},
onLoad() {
this.checkDai()
},
2021-08-29 01:35:35 +00:00
onReachBottom() {
if(this.total!=this.dataArr.length){
this.page++
this.checkDai()//调用自主预约列表事件
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多商品列表','none',1000)
this.isZanw = false
}
},
2021-08-26 01:49:06 +00:00
methods: {
checkDai(){//查询待评价列表
this.$requst.post('user/order',{tag:'waiting_comment',page:this.page,size:this.size}).then(res=>{
// console.log('待评价商品列表:',res);
if(res.code==0){
this.pageShow = true
2021-08-29 01:35:35 +00:00
if(this.page==1) this.dataArr = []
this.total = res.data.total
2021-08-26 01:49:06 +00:00
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
item.skus.forEach(itemone=>{
if(itemone.has_comment!='yes'){
let orderObj = {
id:item.id,
orderId:itemone.order_id,
danId:itemone.id,
src:this.$http + itemone.sku_cover,
title:itemone.spu_name,
cate:itemone.sku_name,
num:itemone.num,
allprice:item.price/100,
price:itemone.price/100,
spu_id:itemone.spu_id
}
this.dataArr.push(orderObj)
}
})
})
}
}
},error=>{})
},
goEvaluated(index){//去评价事件
uni.setStorageSync('orderPing',this.dataArr[index])
uni.navigateTo({
url:'/pagesA/evaluate/evaluate'
})
},
checkDetail(id){//查看详情事件
uni.navigateTo({
url:'/pagesA/productDetail/productDetail?id='+id
})
}
}
}
</script>
<style>
</style>