<template>
|
<view class="box">
|
<view class="cate">
|
<view @click="changeRow(index)" :class="active === index ? 'cate-item active' : 'cate-item'" v-for="(item, index) in cate" :key="'cate_'+index">
|
{{item.name}}
|
<view class="cate-item-xiab" v-if="active === index"></view>
|
</view>
|
</view>
|
<view class="list">
|
<view class="list-item" v-for="(item, index) in dataList" :key="index">
|
<view class="a">
|
<view class="a-left">
|
<view class="a-left-tips">{{item.receiveType==1?'自提':'快递配送'}}</view>
|
<text>订单号:{{item.id}}</text>
|
</view>
|
<text v-if="item.status ==0" class="a-right">待支付</text>
|
<text v-if="item.status ==1" class="a-right">{{item.receiveType==1?'待自提':'待发货'}}</text>
|
<text v-if="item.status ==2" class="a-right">待收货</text>
|
<text v-if="item.status ==3" class="a-right grey">交易完成</text>
|
<text v-if="item.status ==4" class="a-right grey">已取消</text>
|
<text v-if="item.status ==6" class="a-right grey">已退款</text>
|
</view>
|
<view class="b">
|
<view class="b-item" v-for="(item1, index1) in (item.goodsorderDetailList||[])">
|
<view class="b-item-image">
|
<image :src="item1.imgurl||'/static/logo.png'" mode="widthFix"></image>
|
</view>
|
<view class="b-item-title">{{item1.name||''}}</view>
|
<view class="b-item-jia">
|
<text>¥{{(item1.price||0).toFixed(2)}}</text>
|
<text>x{{item1.goodsNum||0}}</text>
|
</view>
|
</view>
|
<view class="b-item" v-for="(item1, index1) in (item.goodsorderDetailList||[])">
|
<view class="b-item-image">
|
<image :src="item1.imgurl||'/static/logo.png'" mode="widthFix"></image>
|
</view>
|
<view class="b-item-title">{{item1.name||''}}</view>
|
<view class="b-item-jia">
|
<text>¥{{(item1.price||0).toFixed(2)}}</text>
|
<text>x{{item1.goodsNum||0}}</text>
|
</view>
|
</view>
|
</view>
|
<view class="c">
|
<view class="c-label">
|
<view class="c-label-title">实付款:</view>
|
<view class="c-label-price">
|
<text>{{(item.price||0).toFixed(2)}}</text>
|
<text></text>
|
</view>
|
</view>
|
<view class="c-btns">
|
<view class="c-btns-item blue" @click="contactPhone(item)">联系经销商</view>
|
<view class="c-btns-item bg" >自提码</view>
|
</view>
|
</view>
|
<view class="d" v-if="item.memberInfo">
|
订单备注:{{item.memberInfo||''}}
|
</view>
|
</view>
|
<view v-if="!hasNext" class="nomore">已加载全部</view>
|
</view>
|
<u-popup :show="showPhone" round="15" mode="bottom" :safeAreaInsetBottom="true" @close="contactPhone()" :closeable="true" :closeOnClickOverlay="true">
|
<view class="phone">
|
<view class="phone-head">
|
<view></view>
|
<text>联系客户</text>
|
</view>
|
<!-- <view class="phone-item">
|
<view>
|
<image style="width: 36rpx;height: 36rpx" src="/static/icon/ic_kefu.png" mode="widthFix"></image>
|
<button open-type="contact" plain="true" bindcontact="handleContact">在线客服</button>
|
</view>
|
<view class="line" v-if="serverPhone && serverPhone.length"></view>
|
</view> -->
|
<view class="phone-item" >
|
<view>
|
<image src="/static/icon/ic_call@2x.png" mode="widthFix" @click="contactPhoneDo()" ></image>
|
<text>{{linkItem.linkname}} </text>
|
<text style="margin-left: 10px;"> {{linkItem.linkphone}}</text>
|
</view>
|
</view>
|
<view style="width: 100%; height: 30rpx;"></view>
|
<!-- <view class="phone-botton" @click="contactPhone()" >关闭</view> -->
|
</view>
|
</u-popup>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
export default {
|
computed: {
|
...mapState(['navHeight', 'statusbarHeight','userInfo', 'token'])
|
},
|
data() {
|
return {
|
i: '',
|
active:0,
|
loading:false,
|
currentPage:1,
|
total:0,
|
hasNext:true,
|
dataList:[],
|
linkItem:{},
|
cate: [
|
{ name: '全部', id: '' },
|
{ name: '待支付', id: 0 },
|
{ name: '待发货/自提', id: 1 ,
|
{ name: '待收货', id: 2 }
|
]
|
};
|
},
|
onLoad(options) {
|
if (options.status) {
|
this.i = Number(options.status)
|
}
|
},
|
onShow() {
|
this.shop ={}
|
this.checkUserLogin()
|
this.shop = this.shopInfo || {}
|
this.getFirstPageData()
|
},
|
onReachBottom(){
|
this.getDataList();
|
},
|
methods: {
|
contactPhone(item){
|
this.showPhone = !this.showPhone
|
this.linkItem = item ||{}
|
console.log("==================================",this.showPhone)
|
},
|
contactPhoneDo(){
|
if(this.linkItem.linkphone !=null && this.linkItem.linkphone!=''){
|
uni.makePhoneCall({
|
phoneNumber: this.linkItem.linkphone
|
})
|
}
|
},
|
changeRow(index) {
|
this.active=index
|
this.i = this.cate[index].id
|
this.getFirstPageData()
|
},
|
getFirstPageData(){
|
this.currentPage = 0
|
this.hasNext=true
|
this.total=0
|
this.dataList=[]
|
this.getDataList()
|
},
|
async getDataList(){
|
if(this.loading || !this.hasNext){
|
return
|
}
|
this.loading=true
|
this.currentPage = this.currentPage+1
|
if(this.currentPage == 1){
|
this.hasNext =true
|
this.dataList=[]
|
}
|
var that =this
|
let res = await that.$u.api.orderPage({
|
capacity:10,
|
model: {
|
orderStatus: this.i
|
},
|
page:this.currentPage
|
});
|
console.log(res)
|
if (res.code === 200 ) {
|
if ( res.data && res.data.page ===this.currentPage) {
|
res.data.records = res.data.records||[]
|
that.dataList.push(...res.data.records)
|
that.total=res.data.total
|
if( this.currentPage >= res.data.pageCount||0){
|
that.hasNext=false
|
}else{
|
that.hasNext=true
|
}
|
}
|
}
|
this.loading=false
|
},
|
checkUserLogin(){
|
var that =this
|
if( this.userInfo ==null || this.userInfo.id==null || this.token==null || this.token==''){
|
uni.navigateTo({
|
url: '/pages/index/index'
|
})
|
}
|
}
|
}
|
}
|
</script>
|
<style>
|
page {
|
background-color: #F9F9FB;
|
}
|
</style>
|
<style lang="scss" scoped>
|
.box {
|
width: 100%;
|
.list {
|
width: 100%;
|
padding: 22rpx 30rpx;
|
padding-bottom: 60rpx;
|
box-sizing: border-box;
|
.list-item {
|
width: 100%;
|
padding: 30rpx;
|
box-sizing: border-box;
|
background: #FFFFFF;
|
border-radius: 16rpx;
|
margin-bottom: 20rpx;
|
&:last-child {
|
margin: 0 !important;
|
}
|
.a {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
.a-left {
|
display: flex;
|
align-items: center;
|
.a-left-tips {
|
padding: 0 6rpx;
|
height: 40rpx;
|
line-height: 40rpx;
|
background: #00B775;
|
border-radius: 8rpx;
|
font-weight: 400;
|
font-size: 22rpx;
|
color: #FFFFFF;
|
margin-right: 16rpx;
|
}
|
text {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #222222;
|
}
|
}
|
.a-right {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #E4001D;
|
}
|
.grey{
|
color: #999999 !important;
|
}
|
}
|
.b {
|
width: 100%;
|
display: flex;
|
flex-direction: column;
|
margin-top: 22rpx;
|
.b-item {
|
width: 100%;
|
height: 136rpx;
|
display: flex;
|
align-items: flex-start;
|
justify-content: space-between;
|
margin-bottom: 22rpx;
|
&:last-child {
|
margin: 0 !important;
|
}
|
.b-item-image {
|
flex-shrink: 0;
|
width: 136rpx;
|
height: 136rpx;
|
border-radius: 8rpx;
|
overflow: hidden;
|
border: 1rpx solid #E5E5E5;
|
margin-right: 20rpx;
|
image {
|
width: 100%;
|
}
|
}
|
.b-item-title {
|
flex: 1;
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #222222;
|
margin-right: 30rpx;
|
display: -webkit-box;
|
-webkit-line-clamp: 2; /* 限制文本为2行 */
|
-webkit-box-orient: vertical;
|
overflow: hidden;
|
}
|
.b-item-jia {
|
flex-shrink: 0;
|
display: flex;
|
flex-direction: column;
|
align-items: flex-end;
|
text {
|
&:nth-child(1) {
|
font-weight: 500;
|
font-size: 30rpx;
|
color: #222222;
|
}
|
&:nth-child(2) {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #999999;
|
margin-top: 14rpx;
|
}
|
}
|
}
|
}
|
}
|
.c {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-top: 24rpx;
|
.c-label {
|
display: flex;
|
align-items: center;
|
.c-label-title {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #333333;
|
}
|
.c-label-price {
|
display: flex;
|
align-items: baseline;
|
text {
|
&:nth-child(1) {
|
font-weight: 600;
|
font-size: 32rpx;
|
color: #222222;
|
&::before {
|
content: '¥';
|
font-weight: 600;
|
font-size: 26rpx;
|
color: #222222;
|
}
|
}
|
&:nth-child(2) {
|
font-weight: 600;
|
font-size: 26rpx;
|
color: #222222;
|
}
|
}
|
}
|
}
|
.c-btns {
|
display: flex;
|
align-items: center;
|
.blue {
|
border: 1rpx solid #004096;
|
color: #004096 !important;
|
}
|
.bg{
|
background: #004096;
|
border-radius: 34rpx;
|
border: 1rpx solid #004096;
|
font-family: PingFangSC, PingFang SC;
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #FFFFFF !important;
|
line-height: 40rpx;
|
text-align: center;
|
font-style: normal;
|
}
|
.c-btns-item {
|
padding: 0 24rpx;
|
box-sizing: border-box;
|
height: 64rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
border-radius: 34rpx;
|
border: 1rpx solid #B2B2B2;
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #666666;
|
margin-right: 20rpx;
|
&:last-child {
|
margin: 0 !important;
|
}
|
}
|
}
|
}
|
}
|
}
|
.cate {
|
width: 100%;
|
height: 90rpx;
|
display: flex;
|
align-items: center;
|
background: #FFFFFF;
|
position: sticky;
|
top: 0;
|
left: 0;
|
z-index: 999;
|
.cate-item {
|
flex: 1;
|
height: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #666666;
|
position: relative;
|
.cate-item-xiab {
|
position: absolute;
|
bottom: 0;
|
left: 50%;
|
transform: translate(-50%, 0);
|
width: 40rpx;
|
height: 6rpx;
|
background-color: #004096;
|
}
|
}
|
}
|
}
|
</style>
|