Files
douhuo-h5/pages/synthesis/seekOrder.vue
2023-05-23 16:47:13 +08:00

210 lines
4.7 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="content">
<view class="list" v-if="yearArr.length > 0">
<view class="listItem" v-for="(item, index) in yearArr" :key="index">
<view class="listItem-no">
订单号{{item.order_no}}
</view>
<view class="listItem-cont">
<view class="listItem-cont-label">
<view class="listItem-cont-name">
订单类型
</view>
<view class="listItem-cont-text listItem-cont-status">
{{item.synthesis.title}}
</view>
</view>
<view class="listItem-cont-label">
<view class="listItem-cont-name">
业务联系人
</view>
<view class="listItem-cont-text listItem-cont-price">
{{item.user.parent.nickname}}
</view>
</view>
</view>
<view class="listItem-labor">
<view class="listItem-labor-time">
{{item.created_at}}
</view>
<view class="listItem-labor-btn">
<view @click="$Router.push({name: 'FeeConfirm', params: {synthesisId: item.synthesis_order_id}})" class="listItem-labor-go yellow">
查看详情
</view>
</view>
</view>
</view>
</view>
<view class="pack-center pages-hint" v-else>
<image src="/static/imgs/Noevaluate.png"></image>
<view>暂无订单</view>
</view>
</view>
</template>
<script>
import { seekOrder } from '@/apis/interfaces/synthesis'
export default {
data() {
return {
yearStatus : 0, // 0 未付款 1 2
yearArr : [], // 咨询单列表
page : {}, // 分页信息
lodingStats : false, // 加载状态
}
},
created() {
// 获取-咨询单-列表
this.yearServe();
},
methods: {
// 咨询单-列表
yearServe(page){
seekOrder({
status : this.yearStatus,
page : page || 1
}).then(res => {
let esArr = res.data
let list = this.yearArr,
newData = []
if(page == 1 || page == undefined) list = []
newData = list.concat(esArr)
this.yearArr = newData
this.page = res.page
this.lodingStats = false
uni.stopPullDownRefresh()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 状态选择
stateClick(state) {
this.yearStatus = state
// 获取-咨询单列表
this.yearServe();
},
// 订单支付
canClick(e) {
// pay_status == 1可支付
if(e.can.pay_status == 1) {
// pay_way为1的时线上支付, 为2时线下支付
if(e.service.pay_way == 1) {
this.$Router.push({name: 'FeePay', params: {orderId: e.service_order_id}})
}
}
},
// 选择支付方式
expressSheet(item) {
uni.showActionSheet({
itemList: ['微信支付', '打款凭证'],
success: sheetRes => {
console.log(sheetRes)
},
fail: sheetFail => {}
})
},
// 页面相关事件处理函数--监听用户下拉动作
onPullDownRefresh() {
// 获取-咨询单-列表
this.yearServe();
},
// 上拉加载
onReachBottom(){
this.lodingStats = true
let pageNumber = this.page.current
if(this.page.has_more){
pageNumber++
// 获取-咨询单-列表
this.yearServe(pageNumber);
}
}
}
}
</script>
<style lang="scss" scoped>
.content {
background-color: #f7f9fa;
overflow-y: scroll;
height: 100%;
position: absolute;
width: 100%;
}
.list {
padding: 30rpx;
box-sizing: border-box;
.listItem {
background-color: #ffffff;
border-radius: 10rpx;
margin-bottom: 30rpx;
.listItem-no {
line-height: 90rpx;
padding: 0 30rpx;
box-sizing: border-box;
border-bottom: 2rpx solid #eeeeee;
}
.listItem-cont {
padding: 15rpx 30rpx;
box-sizing: border-box;
.listItem-cont-label {
display: flex;
line-height: 60rpx;
color: #666666;
font-size: 28rpx;
.listItem-cont-name {
flex: 1;
}
.listItem-cont-text {
color: #000000;
&.listItem-cont-status {
color: #da2b56;
}
&.listItem-cont-price {
font-weight: 600;
}
}
}
}
.listItem-labor {
border-top: 2rpx solid #eeeeee;
line-height: 50rpx;
padding: 25rpx 30rpx;
box-sizing: border-box;
font-size: 26rpx;
display: flex;
.listItem-labor-time {
flex: 1;
color: #999999;
}
.listItem-labor-go {
display: inline-block;
border: 2rpx solid #da2b56;
color: #da2b56;
border-radius: 80rpx;
padding: 0 20rpx;
&.active {
border-color: #999999;
color: #666666;
}
&.yellow {
border-color: #ec7647;
color: #ec7647;
}
}
}
}
}
</style>