427 lines
7.7 KiB
Vue

<template>
<view class="content">
<form @submit="formSubmit" report-submit='true'>
<view class="release_content">
<view class="release_item">
<view class="release_item-one">
<view class="item-one">
被委托商家
</view>
<e-select v-model="value1" :options="options1" placeholder="选择选项"></e-select>
</view>
<view class="release_item-one">
<view class="item-one">
委托周期
</view>
<view class="" @click="calendar">
<input type="number" v-model="date" />
</view>
<!-- <e-select v-model="value1" :options="options1" placeholder="选择选项"></e-select> -->
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'><text class="iconfont icon-baobeilianjie"></text>添加产品({{productList.length}})
</view>
<view class="select">
<view class="select_count" @click.stop="addProduct">
<text v-if="productList.length == 0" class="text">选择产品</text>
<view v-else class="text">
<image class="image" v-for="(item,index) in productList" :key="index"
:src="item.image || (item.spu && item.spu.image)"></image>
</view>
<text class="iconfont icon-xiangyou"></text>
</view>
</view>
</view>
<view class="content_center-one" v-for="(item,i) in productList" :key="i">
<view class="center-one">
<view class="center-one-img">
<image :src="item.image" mode=""></image>
</view>
<view class="center-one-txt">
<view class="one-txta">
{{item.store_name}}
</view>
<view class="one-txtb">
<view class="">
委托价:¥<span>{{item.price}}</span>
</view>
<view class="">
数量:{{item.number}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</form>
<button class="release_btn button" form-type="submit">提交</button>
<uni-calendar ref="calendar" :date="info.date" :insert="info.insert" :lunar="info.lunar"
:startDate="info.startDate" :endDate="info.endDate" :range="info.range" @confirm="confirm"
:showMonth="info.showMonth" @close="close" />
<!-- 提到的宝贝弹窗 -->
<uni-popup ref="associated" type="bottom">
<associated @close="close" @getProduct="getProduct" :checkedObj="productList"></associated>
</uni-popup>
</view>
</template>
<script>
import associated from '@/components/realselist/realselist.vue';
import eselect from '@/components/e-select/e-select.vue';
// import {} from '@/api/sale.js'
export default {
components: {
associated,
eselect
},
data() {
return {
value1: 1,
value2: "",
options1: [{
text: "Shenzhen1",
value: 1
}, {
text: "Shenzhen2",
value: 2
}, {
text: "Shenzhen3",
value: 3
}],
date: 1,
productList: [],
info: {
startDate: '',
endDate: '',
lunar: false,
range: true,
insert: false,
selected: [],
showMonth: false
},
};
},
computed: {
},
onLoad(options) {
},
methods: {
// 日历确定
confirm(e) {
let self = this
if (e.range.after && e.range.before) {
let star = new Date(e.range.after).getTime()
let stop = new Date(e.range.before).getTime()
let arr = stop - star
this.date = Math.floor(arr / (24 * 3600 * 1000));
// console.log(days)
if (this.date < 0) {
this.date = this.date * -1
}
}
},
calendar() {
this.$refs.calendar.open()
},
//关闭商品弹窗
close() {
this.$refs.associated.close()
},
//打开商品弹窗
addProduct() {
this.$refs.associated.open()
},
//获取商品信息
getProduct(data) {
this.$refs.associated.close()
},
//提交
formSubmit(e) {
console.log(e)
this.$util.Tips({
title: res.message,
icon: 'success'
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background: #F5F5F5;
}
.content {
height: 100vh;
position: relative;
}
.release_content {
padding: 0 28rpx;
margin-top: 28rpx;
.content_center-one {
display: flex;
.center-one {
margin-top: 32rpx;
margin-bottom: 32rpx;
display: flex;
.center-one-img {
width: 154rpx;
height: 154rpx;
margin-right: 21rpx;
image {
width: 154rpx;
height: 154rpx;
}
}
.center-one-txt {
.one-txta {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.one-txtb {
display: flex;
margin-top: 28rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
span {
color: #F84221;
margin-right: 30rpx;
}
}
}
}
}
.release_item {
background: #ffffff;
padding: 0 30rpx;
border-radius: 10rpx;
padding-top: 20rpx;
.release_item-one {
.item-one {
margin-top: 32rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
}
}
}
.photo_count {
padding: 30rpx 0;
}
}
/deep/.loading-img {
width: 180rpx;
height: 180rpx;
border-radius: 12rpx;
}
.input_photo .pictrue {
margin-bottom: 20rpx;
.videoHover {
width: 180rpx;
height: 180rpx;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
left: 0;
z-index: 10;
>view {
width: 50rpx;
height: 50rpx;
background: #000000;
border-radius: 50rpx;
display: flex;
align-items: center;
justify-content: center;
.iconfont {
color: #ffffff;
font-size: 21rpx;
}
}
}
.video-text {
display: block;
width: 180rpx;
text-align: center;
color: #ffffff;
font-size: 18rpx;
z-index: 13;
position: absolute;
bottom: 20rpx;
}
video {
width: 180rpx;
height: 180rpx;
border-radius: 12rpx;
}
}
.input_photo .add {
background: #f6f6f6;
color: #666666;
.iconfont {
font-size: 50rpx;
}
.text {
margin-top: 20rpx;
font-size: 27rpx;
}
}
.textarea textarea {
font-size: 28rpx;
padding-bottom: 38rpx;
width: 100%;
box-sizing: border-box;
height: 400rpx;
overflow: hidden;
}
.textarea .placeholder {
color: #BBBBBB;
}
.release_item .item {
height: 106rpx;
border-bottom: 1rpx solid #eee;
position: relative;
font-size: 30rpx;
&:last-child {
border-bottom: none;
}
.name {
color: #333333;
.iconfont {
margin-right: 10rpx;
font-size: 28rpx;
}
}
.select {
color: #bbbbbb;
.select_count {
display: flex;
align-items: center;
}
.text {
margin-right: 15rpx;
display: flex;
align-items: center;
.image,
image,
uni-image {
width: 60rpx;
height: 60rpx;
margin-right: 5rpx;
}
}
.iconfont {
font-size: 24rpx;
}
.text_name {
color: var(--view-theme);
padding: 5rpx 12rpx;
background: var(--view-minorColor);
border-radius: 23rpx;
font-size: 24rpx;
margin-right: 10rpx;
.icon {
color: var(--view-theme);
font-weight: bold;
font-size: 24rpx;
}
.title {
margin: 0 10rpx;
}
.iconfont {
font-size: 16rpx;
}
}
}
}
.button {
width: 694rpx;
height: 84rpx;
line-height: 84rpx;
text-align: center;
background: linear-gradient(84deg, #F98649 0%, #F34E45 100%);
border-radius: 42px 42px 42px 42px;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
.release_btn {
position: absolute;
bottom: 150rpx;
left: 50%;
margin-left: -347rpx;
}
</style>