星油云站
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

279 lines
5.7 KiB

<template>
<view class="container">
<cu-custom class="main-totextbar bg-main-oil" :isBack="true" bgColor="bg-main-oil">
<block slot="backText">返回</block>
<block slot="content">订单列表</block>
</cu-custom>
<view class="search">
<uni-easyinput prefixIcon="search" borderColor="#DCDFE6" v-model="paramter.params.customerPhone" placeholder="请输入手机号后四位"
@confirm="search" maxlength="4" @clear="search" />
</view>
<scroll-view v-if="dataList.length" class="list" :scroll-y="true" @scrolltolower="lower">
<view class="item" v-for="item,index in dataList" :key="index" @click="toDetails(item)">
<view class="header">用户手机:{{item.customerPhone}}<text
:style="{color:statusEnum[item.orderStatus].color}">{{statusEnum[item.orderStatus].value}}</text>
</view>
<view class="introduce">
<image :src="item.oderDetailImg"></image>
<view>{{item.productName}}</view>
<view>规格:{{handler(item.attributeJson)}}</view>
<view>¥{{item.marketPrice}} X{{item.orderNum}}</view>
<view>共{{item.orderNum}}件商品已支付积分:{{item.payIntegral}}</view>
</view>
</view>
<view style="height: 30rpx; background: #fff;"></view>
</scroll-view>
<view v-else class="empty">
<image src="https://publicxingyou.oss-cn-hangzhou.aliyuncs.com/mp-oil/yunsite-empty.png"></image>
<view>还没有订单哦~</view>
</view>
</view>
</template>
<script>
import serve from '@/api/packageIntegral/orderList.js'
export default {
options: {
styleIsolation: 'shared'
},
data() {
return {
code: '',
controlWindows: {
code: false
},
paramter: {
currentPage: 1,
pagesize: 20,
params: {
customerPhone: ''
},
},
dataList: [],
statusEnum: {
'-1': {
color: 'red',
value: "已取消"
},
0: {
color: 'blue',
value: "订单新建"
},
1: {
color: 'orange',
value: "待核销"
},
2: {
color: 'blue',
value: "已核销"
},
}
}
},
onLoad() {
this.getByPageCloudMini()
},
methods: {
handler(json) {
json = json.replace(/'/g, '"')
let res = JSON.parse(json)
let values = Object.values(res)
let text =values.reduce((prev,item,index) => {
let _text = `${index == 0 ? '' :','}${item}`
return prev += _text
},'')
return text
// let text = ''
// values.forEach((item, index) => {
// let _text = `${index == 0 ? '' :','}${item}`
// text += _text
// })
// return text
// console.log('values',values)
},
toDetails(item) {
uni.navigateTo({
url: `../orderDetails/index?orderId=${item.orderId}`
})
},
search() {
this.paramter.currentPage = 1
this.getByPageCloudMini()
},
getByPageCloudMini() {
serve.getByPageCloudMini(this.paramter).then(res => {
if (res.code === 20000) {
if (!res.data.list.length && this.paramter.currentPage != 1) {
uni.showToast({
title: '没有更多订单啦~',
icon: 'none'
})
return
}
if (this.paramter.currentPage == 1) {
this.dataList = []
}
this.dataList = this.dataList.concat(res.data.list)
// console.log(this.dataList)
}
})
},
lower() {
this.paramter.currentPage += 1
this.getByPageCloudMini()
},
determine() {
this.$refs.popup.open('center')
},
confirm() {
this.controlWindows.code = false
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .xt__verify-code .xt__input-ground .xt__box {
width: 146rpx;
height: 146rpx;
border-width: 1rpx;
border-radius: 14rpx;
}
.container {
height: 100vh;
display: flex;
flex-direction: column;
background: #F1F2F7;
>.search {
margin: 50rpx auto 0;
width: 689rpx;
height: 74rpx;
background: #FFF;
}
>.list {
margin-top: 35rpx;
flex: 1;
overflow-y: hidden;
.item {
position: relative;
margin-top: 20rpx;
background: #fff;
// min-height: 106rpx;
// border-bottom: 12rpx solid #F1F2F7;
&:nth-of-type(1) {
margin-top: 0
}
.header {
padding: 26rpx 23rpx 0;
height: 80rpx;
// line-height: 83rpx;
width: 100%;
font-size: 30rpx;
color: #666;
border-bottom: 1rpx solid #D7D7D7;
>text {
float: right;
// color: #F83D3D;
}
}
.introduce {
position: relative;
padding: 24rpx 29rpx 31rpx 268rpx;
min-height: 220rpx;
>image {
position: absolute;
top: 13rpx;
left: 34rpx;
width: 220rpx;
height: 220rpx;
// border: 1px solid #333;
}
>view {
&:nth-of-type(1) {
font-size: 28rpx;
color: #000;
}
&:nth-of-type(2),
&:nth-of-type(3) {
margin-top: 11rpx;
font-size: 24rpx;
color: #999;
}
&:nth-of-type(3) {
margin-top: 18rpx;
}
&:nth-of-type(4) {
margin-top: 11rpx;
font-size: 26rpx;
color: #333;
}
}
}
>.footer {
position: relative;
margin-top: 40rpx;
line-height: 78rpx;
padding: 0 34rpx 40rpx;
font-size: 32rpx;
color: #000;
font-weight: 550;
.button {
position: absolute;
top: 0;
right: 40rpx;
width: 198rpx;
height: 78rpx;
line-height: 78rpx;
text-align: center;
font-size: 28rpx;
color: #FFF;
background: #FE0606;
border-radius: 10rpx;
}
}
}
}
>.empty {
margin: 218rpx auto 0;
>image {
width: 473rpx;
height: 404rpx;
}
>view {
margin-top: 45rpx;
text-align: center;
font-size: 28rpx;
color: #999;
}
}
}
</style>