demingshangjia/pages/index/index.vue

425 lines
9.8 KiB
Vue
Raw Normal View History

2020-06-11 09:16:12 +08:00
<template>
2020-06-11 17:54:15 +08:00
<view class="home">
2020-07-29 15:21:40 +08:00
<view class="image-swiper"><u-swiper :list="imageList" mode="dot" border-radius="20"></u-swiper></view>
2020-06-11 17:54:15 +08:00
<view class="tab-swiper">
2020-07-29 15:21:40 +08:00
<u-tabs-swiper
ref="uTabs"
:list="list"
:current="current"
@change="tabsChange"
active-color="#FF780F"
inactive-color="#333333"
font-size="26"
height="98"
:show-bar="false"
swiperWidth="750"
gutter="52"
></u-tabs-swiper>
2020-06-11 17:54:15 +08:00
</view>
<swiper :current="swiperCurrent" @animationfinish="animationfinish">
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;" class="order-list">
2020-07-29 20:35:33 +08:00
<view v-for="(item, index) in allorder" :key="index">
<OrderItem :info="item"></OrderItem>
</view>
2020-06-11 17:54:15 +08:00
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;">
2020-07-29 15:21:40 +08:00
<view v-for="(item, index) in 5" :key="index"><OrderItem :cur="current"></OrderItem></view>
2020-06-11 17:54:15 +08:00
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;">
2020-07-29 15:21:40 +08:00
<view v-for="(item, index) in 5" :key="index"><OrderItem :cur="current"></OrderItem></view>
2020-06-11 17:54:15 +08:00
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;">
2020-06-12 14:46:46 +08:00
<view class="complaint">
<view class="select-container">
<view class="title">选择骑手</view>
<view class="worker" v-if="JSON.stringify(worker) != '{}'">
2020-07-29 15:21:40 +08:00
<view>{{ worker.company + ' ' + worker.name }}</view>
<u-icon name="edit-pen" @click="worker = {}"></u-icon>
2020-06-12 14:46:46 +08:00
</view>
2020-07-29 15:21:40 +08:00
<view v-else class="select" @click="showSelect = true">
2020-06-12 14:46:46 +08:00
<view>请选择</view>
<image src="/static/image/home/5.png"></image>
</view>
</view>
<view class="textarea">
<view class="title">投诉简介</view>
2020-07-29 15:21:40 +08:00
<textarea placeholder-style="color:#999999" placeholder="请输入内容" />
2020-06-12 14:46:46 +08:00
</view>
2020-07-15 11:34:43 +08:00
<!-- 事件 -->
2020-07-29 15:21:40 +08:00
<view class="btn" @click="showComplaint = true">确定</view>
2020-06-12 14:46:46 +08:00
</view>
2020-06-11 17:54:15 +08:00
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;">
2020-07-29 15:21:40 +08:00
<view v-for="(item, index) in 5" :key="index"><OrderItem :cur="current"></OrderItem></view>
2020-06-11 17:54:15 +08:00
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;width: 100%;">
2020-07-29 15:21:40 +08:00
<view v-for="(item, index) in 15" :key="index"><OrderItem :cur="current"></OrderItem></view>
2020-06-11 17:54:15 +08:00
</scroll-view>
</swiper-item>
</swiper>
2020-07-15 11:34:43 +08:00
<view class="release-btn" @click="publish">
2020-07-29 15:21:40 +08:00
<image src="../../static/image/index/publish.png"></image>
<view class="text">发布</view>
2020-06-11 09:16:12 +08:00
</view>
2020-06-12 14:46:46 +08:00
<u-select v-model="showSelect" mode="mutil-column-auto" :list="workerList" @confirm="setWorker"></u-select>
<u-popup v-model="showComplaint" mode="center" border-radius="10">
<view class="confirm-complaint">
<view class="text">
<view>投诉成功</view>
<view>请等待审核结果</view>
</view>
2020-07-15 11:34:43 +08:00
<view class="btn" @click="showComplaint = false">确认</view>
</view>
</u-popup>
<u-popup v-model="publishstate" mode="bottom">
<view class="publish">
<view class="list">
2020-07-16 10:02:57 +08:00
<view @click="navto('release/tosign')">
2020-07-29 15:21:40 +08:00
<image src="../../static/image/index/live.png"></image>
2020-07-15 11:34:43 +08:00
<text>直播</text>
</view>
2020-07-29 15:21:40 +08:00
<view @click="navto('release/index')">
<image src="../../static/image/index/photo.png"></image>
2020-07-16 10:02:57 +08:00
<text>图文</text>
2020-07-15 11:34:43 +08:00
</view>
2020-07-16 10:02:57 +08:00
<view @click="navto('release/video')">
2020-07-29 15:21:40 +08:00
<image src="../../static/image/index/video.png"></image>
2020-07-16 10:02:57 +08:00
<text>视频</text>
2020-07-15 11:34:43 +08:00
</view>
</view>
2020-07-29 15:21:40 +08:00
<image src="../../static/image/index/close.png" class="off" @click="close"></image>
2020-06-12 14:46:46 +08:00
</view>
</u-popup>
2020-06-11 09:16:12 +08:00
</view>
</template>
<script>
2020-07-29 15:21:40 +08:00
import OrderItem from '@/components/order-item/index';
2020-06-11 17:54:15 +08:00
export default {
data() {
return {
2020-07-29 15:21:40 +08:00
list: [
{
name: '全部订单'
},
{
name: '试穿订单'
},
{
name: '待处理订单'
},
{
name: '投诉骑手'
},
{
name: '已完成订单'
},
{
name: '退货订单'
}
2020-06-11 17:54:15 +08:00
],
2020-07-29 15:21:40 +08:00
imageList: [],
2020-06-12 14:46:46 +08:00
showSelect: false,
2020-06-11 17:54:15 +08:00
current: 0,
swiperCurrent: 0,
2020-06-12 14:46:46 +08:00
showComplaint: false,
worker: {},
workerList: [
{
label: '百世快递公司',
children: [
{
label: '小米'
},
{
label: '小亮'
}
]
},
{
label: '中通快递公司',
children: [
{
label: '小红'
}
]
},
{
label: '申通快递公司',
children: [
{
label: '小蓝'
}
]
}
2020-07-15 11:34:43 +08:00
],
2020-07-29 15:21:40 +08:00
publishstate: false,
2020-07-29 20:35:33 +08:00
num: 0,
allorder:[],//所有订单
2020-07-29 15:21:40 +08:00
};
2020-06-11 17:54:15 +08:00
},
components: {
OrderItem
},
onLoad() {
2020-07-29 15:21:40 +08:00
this.getswiper();
2020-07-29 20:35:33 +08:00
this.getallorder();
// 订单状态0:已取消 10:未付款 20:已付款 30:已发货 40:已收货
},
onReachBottom() {
this.num++
2020-06-11 17:54:15 +08:00
},
methods: {
2020-07-29 15:21:40 +08:00
// 关闭发布弹窗
close() {
this.publishstate = false;
2020-07-21 08:57:48 +08:00
},
2020-07-29 15:21:40 +08:00
// 获取全部订单
getallorder() {
let that = this;
2020-07-29 20:35:33 +08:00
this.$u.api.getorderlist({
page: that.num
}).then(res => {
console.log(res);
if (res.errCode != 0) {
this.$refs.uToast.show({
title: res.message,
type: 'error'
});
} else {
this.allorder = res.data
}
});
2020-07-29 15:21:40 +08:00
},
// 获取轮播图
getswiper() {
this.imageList =[{
image: '../../static/image/index/swiper.png'
},
{
image: '../../static/image/index/swiper.png'
},
{
image: '../../static/image/index/swiper.png'
}
]
},
// 打开发布弹窗
publish() {
this.publishstate = true;
2020-07-15 11:34:43 +08:00
},
2020-06-12 14:46:46 +08:00
setWorker(e) {
// console.log(e);
this.worker = {
company: e[0].label,
name: e[1].label
2020-07-29 15:21:40 +08:00
};
2020-06-12 14:46:46 +08:00
},
2020-06-11 17:54:15 +08:00
tabsChange(index) {
this.swiperCurrent = index;
},
animationfinish(e) {
let current = e.detail.current;
// this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
2020-06-11 09:16:12 +08:00
},
2020-07-29 15:21:40 +08:00
navto(url) {
2020-07-16 11:20:59 +08:00
this.$u.route({
2020-07-29 15:21:40 +08:00
url: `/pages/${url}`
});
2020-07-16 10:02:57 +08:00
// console.log(`/pages/${url}`)
// uni.navigateTo({
// url: `/pages/${url}`
// });
}
2020-06-11 09:16:12 +08:00
}
2020-07-29 15:21:40 +08:00
};
2020-06-11 09:16:12 +08:00
</script>
2020-06-11 17:54:15 +08:00
<style lang="scss" scoped>
.home {
min-height: calc(100vh - var(--window-top));
2020-07-29 15:21:40 +08:00
background-color: #ececec;
2020-06-11 17:54:15 +08:00
display: flex;
flex-direction: column;
2020-06-12 14:46:46 +08:00
// padding-bottom: 100rpx;
2020-06-11 17:54:15 +08:00
> uni-swiper {
flex: 1;
2020-06-11 09:16:12 +08:00
}
2020-06-11 17:54:15 +08:00
.image-swiper {
background-color: #ffffff;
padding: 0 30rpx 16rpx;
2020-06-11 09:16:12 +08:00
}
2020-06-11 17:54:15 +08:00
.tab-swiper {
margin: 2rpx 0 20rpx 0;
}
2020-06-12 14:46:46 +08:00
.swiper-item {
.complaint {
margin: 0 30rpx;
padding: 75rpx 30rpx;
background-color: #ffffff;
.select-container {
display: flex;
align-items: center;
margin-bottom: 60rpx;
.title {
font-size: 30rpx;
2020-07-29 15:21:40 +08:00
color: rgba(51, 51, 51, 1);
2020-06-12 14:46:46 +08:00
margin-right: 20rpx;
}
.select {
padding: 18rpx 20rpx;
width: 490rpx;
height: 60rpx;
2020-07-29 15:21:40 +08:00
background: rgba(236, 236, 236, 1);
2020-06-12 14:46:46 +08:00
border-radius: 6rpx;
display: flex;
align-items: center;
justify-content: space-between;
> view {
font-size: 26rpx;
color: #999999;
}
> image {
width: 24rpx;
height: 13rpx;
}
}
.worker {
display: flex;
align-items: center;
> view {
font-size: 30rpx;
2020-07-29 15:21:40 +08:00
color: rgba(51, 51, 51, 1);
2020-06-12 14:46:46 +08:00
margin-right: 20rpx;
}
}
}
.textarea {
box-sizing: border-box;
display: flex;
.title {
font-size: 30rpx;
2020-07-29 15:21:40 +08:00
color: rgba(51, 51, 51, 1);
2020-06-12 14:46:46 +08:00
margin-right: 20rpx;
}
> textarea {
padding: 20rpx;
width: 430rpx;
height: 220rpx;
border: 1rpx solid #999999;
font-size: 26rpx;
}
}
.btn {
margin: 90rpx auto 0;
width: 630rpx;
height: 88rpx;
2020-07-29 15:21:40 +08:00
background: rgba(255, 120, 15, 1);
2020-06-12 14:46:46 +08:00
border-radius: 44rpx;
font-size: 36rpx;
2020-07-29 15:21:40 +08:00
color: rgba(255, 255, 255, 1);
2020-06-12 14:46:46 +08:00
line-height: 88rpx;
text-align: center;
}
}
}
2020-06-11 17:54:15 +08:00
.release-btn {
position: fixed;
bottom: 475rpx;
right: 30rpx;
width: 100rpx;
height: 100rpx;
2020-07-29 15:21:40 +08:00
background: rgba(255, 120, 15, 1);
box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(255, 120, 15, 0.22);
2020-06-11 17:54:15 +08:00
border-radius: 50%;
2020-06-11 09:16:12 +08:00
display: flex;
2020-06-11 17:54:15 +08:00
flex-direction: column;
align-items: center;
2020-06-11 09:16:12 +08:00
justify-content: center;
2020-06-11 17:54:15 +08:00
> image {
width: 36rpx;
height: 36rpx;
flex-shrink: 0;
margin-bottom: 2rpx;
}
.text {
font-size: 20rpx;
2020-07-29 15:21:40 +08:00
color: rgba(255, 255, 255, 1);
2020-06-11 17:54:15 +08:00
}
2020-06-11 09:16:12 +08:00
}
2020-06-12 14:46:46 +08:00
.confirm-complaint {
text-align: center;
padding-bottom: 20rpx;
.text {
text-align: center;
width: 420rpx;
padding: 55rpx 112rpx;
font-size: 28rpx;
2020-07-29 15:21:40 +08:00
color: rgba(51, 51, 51, 1);
2020-06-12 14:46:46 +08:00
line-height: 4r2px;
> view:first-child {
margin-bottom: 20rpx;
}
}
.btn {
width: 200rpx;
height: 60rpx;
2020-07-29 15:21:40 +08:00
background: rgba(255, 120, 15, 1);
2020-06-12 14:46:46 +08:00
border-radius: 30rpx;
text-align: center;
line-height: 60rpx;
font-size: 28rpx;
2020-07-29 15:21:40 +08:00
color: rgba(255, 255, 255, 1);
2020-06-12 14:46:46 +08:00
margin: 0 auto;
}
}
2020-07-29 15:21:40 +08:00
.publish {
2020-07-15 11:34:43 +08:00
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
padding: 50rpx 84rpx 31rpx 78rpx;
2020-07-29 15:21:40 +08:00
image {
2020-07-16 10:02:57 +08:00
}
2020-07-29 15:21:40 +08:00
.list {
2020-07-15 11:34:43 +08:00
display: flex;
align-items: center;
justify-content: space-between;
2020-07-16 10:02:57 +08:00
width: 100%;
2020-07-29 15:21:40 +08:00
> view {
2020-07-15 11:34:43 +08:00
display: flex;
flex-direction: column;
align-items: center;
2020-07-29 15:21:40 +08:00
> image {
2020-07-15 11:34:43 +08:00
width: 94rpx;
height: 80rpx;
}
2020-07-29 15:21:40 +08:00
> text {
2020-07-16 10:02:57 +08:00
margin-top: 10rpx;
2020-07-15 11:34:43 +08:00
font-size: 28rpx;
color: #333;
font-weight: 400;
}
}
}
2020-07-29 15:21:40 +08:00
.off {
2020-07-16 10:02:57 +08:00
margin-top: 81rpx;
2020-07-15 11:34:43 +08:00
width: 37rpx;
height: 37rpx;
}
}
2020-06-11 17:54:15 +08:00
}
2020-07-29 15:21:40 +08:00
</style>