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

829 lines
21 KiB
Vue

1 year ago
<template>
<div class="order-details">
<title-block title="寄存画作">
<template #left>
1 year ago
<div>
<image style="width: 112rpx;height: 52rpx"
src="https://cdns.fontree.cn/fonchain-main/prod/image/default/artwork/785cf885-c4c9-44b3-8155-4b39988c7ef8.png"
@click="back"></image>
</div>
1 year ago
</template>
</title-block>
<div class="content2">
1 year ago
<u-upload
:fileList="fileList1"
@afterRead="afterRead"
@delete="deletePic"
1 year ago
name="6"
1 year ago
multiple
1 year ago
:maxCount="1"
width="250"
height="150"
>
<image src="https://cdn.uviewui.com/uview/demo/upload/positive.png"
mode="widthFix" style="width: 404rpx;height: 306rpx;"></image>
</u-upload>
1 year ago
<!-- <image :src="info.artworkImg"></image>-->
1 year ago
</div>
1 year ago
<tm-poup height="700" v-model="show_2" position="bottom">
<div class="poup1">
<div class="content1">
<div class="wrap1">更换您的寄存地址</div>
1 year ago
<div @click="show_2=false" class="wrap2">
1 year ago
<image
src="https://cdns.fontree.cn/fonchain-main/prod/image/default/artwork/d84593b3-10a8-4d86-be8c-b048b03b22c7.png"></image>
1 year ago
</div>
</div>
<div class="content2"></div>
<div class="content3">
1 year ago
<div v-for="(item,index) in addressList" @click="selectAddress(item)"
:class="[warehouseID===item.ID?'active':'']" :key="index" class="wrap1">
<div class="wrap1_1">{{ item.address }}</div>
<div class="wrap1_2">*剩余{{ item.leftNum }}位置</div>
1 year ago
</div>
1 year ago
<!-- <div class="wrap1 active">
<div class="wrap1_1">某某某某某某某地方</div>
<div class="wrap1_2">剩余12位置</div>
</div>-->
<!-- <div class="wrap1 disabled">
<div class="wrap1_1">某某某某某某某地方</div>
<div class="wrap1_2">*已满员</div>
</div>-->
1 year ago
</div>
<div class="content2"></div>
1 year ago
<div class="content6" @click="confirmAddress">
1 year ago
<div class="wrap1">确定</div>
</div>
</div>
</tm-poup>
1 year ago
<tm-poup height="1200" v-model="show_1" position="bottom">
1 year ago
<div class="poup">
<div class="content1">
<div class="wrap1">请选择您的寄存时限</div>
1 year ago
<div @click="show_1=false" class="wrap2">
1 year ago
<image
src="https://cdns.fontree.cn/fonchain-main/prod/image/default/artwork/d84593b3-10a8-4d86-be8c-b048b03b22c7.png"></image>
1 year ago
</div>
</div>
<div class="content2"></div>
<div class="content3">
1 year ago
<div v-for="(item,index) in cycleList" @click="selectionPeriod(item)" :key="index"
:class="[cycleId===item.ID?'active':'']" class="wrap1">{{ item.name }}
1 year ago
</div>
1 year ago
<!-- <div class="wrap1"></div>
<div class="wrap1 active">6个月</div>-->
<!-- <div class="wrap4">
<div class="wrap4_1">12个月</div>
<div class="wrap4_2">*暂时不可选</div>
</div>-->
1 year ago
</div>
1 year ago
<!-- <div class="content2"></div>
<div class="content4">起始日期</div>
<div class="content5">
<div class="wrap1">年份</div>
<div class="wrap2"></div>
<div class="wrap3"></div>
</div>-->
<!-- <div style="margin-left: -30rpx;margin-right: -30rpx">
<picker-view indicator-class="test" :value="value" @change="changeData" class="picker-view">
<picker-view-column>
<view style="display: flex;align-items: center;justify-content: center" class="item"
:class="[isDateFont(item,0)?'fontDate':'']" v-for="(item,index) in years" :key="index">{{ item }}
</view>
</picker-view-column>
<picker-view-column>
<view style="display: flex;align-items: center;justify-content: center" class="item"
:class="[isDateFont(item,1)?'fontDate':'']" v-for="(item,index) in months" :key="index">{{ item }}
</view>
</picker-view-column>
<picker-view-column>
<view style="display: flex;align-items: center;justify-content: center" class="item"
:class="[isDateFont(item,2)?'fontDate':'']" v-for="(item,index) in days" :key="index">{{ item }}
</view>
</picker-view-column>
</picker-view>
</div>
<div class="content2"></div>-->
<div class="content6" @click="confirmCycle">
1 year ago
<div class="wrap1">确定</div>
</div>
1 year ago
</div>
</tm-poup>
<div class="content3">
<div class="prompt">*扫描自动填入</div>
<div class="wrap1">
<div class="wrap1_1">
<div class="wrap1_1_1">画作编号</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3">
1 year ago
<input placeholder-style="color: #939393;font-size: 24rpx;" :placeholder="info.artworkNum"/>
1 year ago
</div>
<div class="wrap1_1_4"></div>
</div>
<div class="wrap1_1">
<div class="wrap1_1_1">画作名称</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3">
1 year ago
<input placeholder-style="color: #939393;font-size: 24rpx;" :placeholder="info.artworkName"/>
1 year ago
</div>
<div class="wrap1_1_4"></div>
</div>
<div class="wrap1_1">
<div class="wrap1_1_1">画家名称</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3">
1 year ago
<input placeholder-style="color: #939393;font-size: 24rpx;" :placeholder="info.artistName"/>
1 year ago
</div>
<div class="wrap1_1_4">
</div>
</div>
<div class="wrap1_1">
<div class="wrap1_1_1">画作平尺数</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3">
1 year ago
<input placeholder-style="color: #939393;font-size: 24rpx;" :placeholder="info.artworkSquareSize"/>
1 year ago
</div>
</div>
</div>
<div class="wrap2"></div>
</div>
<div class="content4">
<div class="wrap1">
<div class="wrap1_1">
<div class="wrap1_1_1">寄存地址</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3">
1 year ago
<input placeholder-style="color: #939393;font-size: 24rpx;"
:placeholder="warehouseID?addressList.find(x=>x.ID===warehouseID).address:'寄存地址'"/>
1 year ago
</div>
<div class="wrap1_1_4"></div>
1 year ago
<div @click="show_2=true" class="wrap1_1_5">
1 year ago
<image src="../../static/zu611@3x.png"></image>
</div>
</div>
<div class="wrap1_1">
<div class="wrap1_1_1">寄存时限</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3">
1 year ago
<input placeholder-style="color: #939393;font-size: 24rpx;" :placeholder="cycleId?cycleList.find(x=>x.ID===cycleId).name:'寄存时限'"/>
1 year ago
</div>
<div @click="show_1=true" class="wrap1_1_5">
<image src="../../static/zu612@3x.png"></image>
</div>
<div class="wrap1_1_4">
</div>
</div>
</div>
<div class="wrap2"></div>
</div>
1 year ago
<div class="content5">
<div class="wrap1">
<div class="wrap1_1">*仅微信付款</div>
1 year ago
<div class="wrap1_2">预计 ¥{{expectedPayment}}</div>
1 year ago
</div>
1 year ago
<div class="wrap2" @click="signContract"></div>
1 year ago
</div>
1 year ago
</div>
</template>
<script>
1 year ago
import {postDataByParams} from "../../http/service";
1 year ago
export default {
name: "order-details",
1 year ago
data() {
1 year ago
const date = new Date()
const years = []
const year = date.getFullYear()
const months = []
const month = date.getMonth() + 1
const days = []
const day = date.getDate()
for (let i = 1990; i <= date.getFullYear(); i++) {
years.push(i)
}
for (let i = 1; i <= 12; i++) {
months.push(i)
}
for (let i = 1; i <= 31; i++) {
days.push(i)
}
return {
1 year ago
fileList1:[],
1 year ago
dayMoney:'',
1 year ago
expectedPayment:'',
1 year ago
warehouseID: '',
cycleId: '',
cycleList: [],
addressList: [],
1 year ago
info: {},
show_2: false,
data: [],
show_1: false,
1 year ago
title: 'picker-view',
years,
year,
months,
month,
days,
day,
value: [9999, month - 1, day - 1],
visible: true,
1 year ago
url: ''//二维码扫码的结果用户发起请求的body体
1 year ago
}
},
onLoad(e) {
1 year ago
if (e) {
1 year ago
this.url = e.url
1 year ago
}
},
1 year ago
watch:{
cycleId(newValue){
this.obtainAmount()
}
},
1 year ago
mounted() {
1 year ago
this.getCycle()
1 year ago
if (this.url){
this.getDetailUrl()
}
1 year ago
this.getAddress()
1 year ago
const today = new Date();
1 year ago
this.value = [today.getFullYear() - 1990, today.getMonth(), today.getDate() - 1]
this.data = [today.getFullYear(), today.getMonth() + 1, today.getDate()]
1 year ago
},
1 year ago
methods: {
1 year ago
// 删除图片
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
// 新增图片
async afterRead(event) {
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
1 year ago
async signContract(){
1 year ago
1 year ago
const data={
cycleId:this.cycleId,
warehouseID:this.warehouseID,
artworkSquareSize:this.info.artworkSquareSize
}
const res = await postDataByParams('/api/warehouse/fdd/contract/h5',data)
if (res.code===200){
uni.setStorageSync("jumpUrl", res.data.jumpUrl)
1 year ago
uni.setStorageSync("orderingInfo", {
1 year ago
cycleID:this.cycleId,
warehouseID:this.warehouseID,
1 year ago
transactionId:res.data.transactionId,
dayMoney:this.dayMoney,
info:this.info,
expectedPayment:this.expectedPayment,
addressName:this.addressList.find(x=>x.ID===this.warehouseID).address,
cycleName:this.cycleList.find(x=>x.ID===this.cycleId).name
})
1 year ago
uni.navigateTo({
url: `/pages/signwebview/index`,
});
}
},
1 year ago
async obtainAmount(){
const data={
cycleID:this.cycleId,
artworkSquareSize:this.info.artworkSquareSize
}
const res = await postDataByParams('/api/warehouse/calculate',data)
if (res.code===200){
this.expectedPayment=res.data.money
1 year ago
this.dayMoney=res.data.dayMoney
1 year ago
}
},
1 year ago
confirmCycle() {
this.show_1 = false
},
confirmAddress() {
this.show_2 = false
},
selectAddress(item) {
this.warehouseID = item.ID
},
selectionPeriod(item) {
this.cycleId = item.ID
},
async getCycle() {
const res = await postDataByParams('/api/warehouse/cycle')
if (res.code === 200) {
this.cycleList = res.data.data
}
},
1 year ago
async getAddress() {
const res = await postDataByParams('/api/warehouse/address')
1 year ago
if (res.code === 200) {
this.addressList = res.data.data
1 year ago
}
},
async getDetailUrl() {
const data = {
url: this.url
}
const res = await postDataByParams('/api/warehouse/ocr', data)
if (res.code === 200) {
this.info = res.data
1 year ago
this.fileList1=[{url:this.info.artworkImg}]
1 year ago
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
console.log(res, 'getDetailUrl')
},
isDateFont(item, num) {
if (Array.isArray && this.data.length === 3) {
return this.data[num] === item
1 year ago
}
},
1 year ago
changeData(e) {
this.data = [e.detail.value[0] + 1990, e.detail.value[1] + 1, e.detail.value[2] + 1]
1 year ago
},
1 year ago
back() {
uni.navigateBack({delta: 2})
1 year ago
}
}
}
</script>
<style scoped lang="scss">
1 year ago
.fontDate {
1 year ago
color: #fff;
}
1 year ago
1 year ago
/deep/ .pickerSelected {
color: #ffffff !important;
z-index: 2;
}
1 year ago
/deep/ .test {
1 year ago
display: flex;
justify-content: center;
align-items: center;
1 year ago
z-index: -1;
1 year ago
background: #A9D897;
color: #fff;
1 year ago
height: 62rpx;
1 year ago
}
1 year ago
1 year ago
uni-picker-view {
display: block;
}
1 year ago
1 year ago
uni-picker-view .uni-picker-view-wrapper {
display: flex;
position: relative;
overflow: hidden;
height: 100%;
background-color: white;
}
1 year ago
1 year ago
uni-picker-view[hidden] {
display: none;
}
1 year ago
1 year ago
picker-view {
width: 100%;
// height: 600upx;
height: 400rpx;
1 year ago
margin-top: 20 upx;
1 year ago
}
1 year ago
1 year ago
.item {
1 year ago
line-height: 100 upx;
1 year ago
text-align: center;
}
1 year ago
.order-details {
1 year ago
background-image: url("https://cdns.fontree.cn/fonchain-main/prod/image/default/artwork/4fdc9a0f-d72a-46b6-a04d-ed56d5465213.png");
box-sizing: border-box;
overflow: hidden;
padding-left: 30rpx;
padding-right: 30rpx;
background-size: cover;
width: 100vw;
height: 100vh;
1 year ago
& > .content5 {
1 year ago
1 year ago
align-items: center;
1 year ago
left: 0;
1 year ago
background: #fff;
width: 750rpx;
position: fixed;
bottom: 0;
height: 172rpx;
display: flex;
1 year ago
1 year ago
.wrap2 {
1 year ago
border-radius: 40rpx;
display: flex;
justify-content: center;
align-items: center;
width: 392rpx;
height: 56rpx;
color: #fff;
font-size: 32rpx;
1 year ago
background: #76C458;
1 year ago
}
1 year ago
.wrap1 {
1 year ago
margin-left: 58rpx;
margin-right: 70rpx;
1 year ago
display: flex;
1 year ago
flex-direction: column;
align-items: start;
1 year ago
.wrap1_1 {
1 year ago
color: #939393;
font-size: 16rpx;
}
1 year ago
.wrap1_2 {
1 year ago
font-size: 32rpx;
color: #76C458;
}
}
}
1 year ago
.poup1 {
1 year ago
padding-top: 28rpx;
padding-left: 30rpx;
padding-right: 30rpx;
1 year ago
& > .content6 {
1 year ago
margin-top: 26rpx;
display: flex;
justify-content: center;
1 year ago
.wrap1 {
1 year ago
color: #fff;
font-size: 28rpx;
width: 436rpx;
height: 60rpx;
display: flex;
justify-content: center;
align-items: center;
background: #76C458;
border-radius: 30rpx;
}
}
1 year ago
& > .content3 {
1 year ago
margin-bottom: 70rpx;
1 year ago
.wrap1 {
margin-bottom: 18rpx;
border-radius: 32rpx;
height: 80rpx;
box-sizing: border-box;
border: 2px solid #76C458;
padding-left: 44rpx;
padding-right: 42rpx;
display: flex;
justify-content: space-between;
align-items: center;
.wrap1_2 {
color: #76C458;
font-size: 26rpx;
}
.wrap1_1 {
font-size: 28rpx;
color: #000;
}
&.disabled {
border: none;
background: #D8D8D8;
.wrap1_1 {
color: #626262;
font-size: 28rpx;
}
.wrap1_2 {
color: #626262;
font-size: 16rpx;
}
}
&.active {
background: #76C458;
.wrap1_2 {
color: #fff;
font-size: 26rpx;
}
.wrap1_1 {
font-size: 28rpx;
color: #fff;
}
}
}
1 year ago
}
1 year ago
& > .content1 {
1 year ago
margin-bottom: 36rpx;
display: flex;
justify-content: space-between;
1 year ago
.wrap1 {
1 year ago
color: #000;
font-size: 32rpx;
}
1 year ago
.wrap2 {
image {
1 year ago
width: 48rpx;
height: 48rpx;
}
}
}
1 year ago
& > .content2 {
1 year ago
margin-bottom: 36rpx;
height: 1rpx;
1 year ago
background: #626262;
1 year ago
}
}
1 year ago
.poup {
1 year ago
padding-top: 28rpx;
padding-left: 30rpx;
padding-right: 30rpx;
1 year ago
& > .content3 {
1 year ago
display: flex;
flex-wrap: wrap;
1 year ago
.wrap4 {
1 year ago
margin-bottom: 40rpx;
1 year ago
border-radius: 32rpx;
margin-top: 30rpx;
width: 220rpx;
height: 84rpx;
background: #D8D8D8;
display: flex;
flex-direction: column;
1 year ago
align-items: center;
1 year ago
justify-content: center;
1 year ago
.wrap4_1 {
1 year ago
color: #626262;
1 year ago
font-size: 28rpx;
}
1 year ago
.wrap4_2 {
1 year ago
color: #BE7E7E;
font-size: 16rpx;
}
}
1 year ago
.wrap1 {
1 year ago
box-sizing: border-box;
flex-shrink: 0;
margin-right: 16rpx;
font-size: 28rpx;
border-radius: 32rpx;
border: 2rpx solid #76C458;
display: flex;
justify-content: center;
align-items: center;
width: 220rpx;
height: 84rpx;
1 year ago
&:nth-child(3) {
1 year ago
margin-right: 0;
}
1 year ago
&.active {
1 year ago
color: #fff;
1 year ago
background: #76C458;
1 year ago
}
}
}
1 year ago
& > .content6 {
1 year ago
margin-top: 26rpx;
display: flex;
justify-content: center;
1 year ago
.wrap1 {
1 year ago
color: #fff;
font-size: 28rpx;
width: 436rpx;
height: 60rpx;
display: flex;
justify-content: center;
align-items: center;
background: #76C458;
border-radius: 30rpx;
}
}
1 year ago
& > .content5 {
1 year ago
margin-top: 36rpx;
height: 66rpx;
display: flex;
align-items: center;
border-bottom: 1rpx solid #BABABA;
border-top: 1rpx solid #BABABA;
1 year ago
.wrap1 {
1 year ago
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
color: #4E964D;
font-size: 28rpx;
}
1 year ago
.wrap2 {
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
color: #4E964D;
font-size: 28rpx;
}
.wrap3 {
1 year ago
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
color: #4E964D;
font-size: 28rpx;
}
}
1 year ago
& > .content4 {
1 year ago
font-size: 32rpx;
color: #000;
}
1 year ago
& > .content2 {
1 year ago
margin-bottom: 36rpx;
1 year ago
height: 1rpx;
1 year ago
background: #626262;
1 year ago
}
1 year ago
& > .content1 {
1 year ago
margin-bottom: 36rpx;
display: flex;
justify-content: space-between;
1 year ago
.wrap1 {
1 year ago
color: #000;
font-size: 32rpx;
}
1 year ago
.wrap2 {
image {
1 year ago
width: 48rpx;
height: 48rpx;
}
}
}
}
1 year ago
& > .content4 {
1 year ago
margin-top: 60rpx;
1 year ago
.wrap1 {
1 year ago
border: 1rpx dashed #DFE9F0;
background-color: #fff;
1 year ago
.wrap1_1 {
1 year ago
position: relative;
height: 114rpx;
display: flex;
align-items: center;
1 year ago
.wrap1_1_4 {
1 year ago
left: 50%;
transform: translateX(-50%);
bottom: 0;
position: absolute;
height: 0;
width: 636rpx;
border-bottom: 0.5px solid #626262;
}
1 year ago
.wrap1_1_5 {
1 year ago
right: 42rpx;
position: absolute;
1 year ago
image {
1 year ago
width: 46.34rpx;
height: 20rpx;
}
}
1 year ago
.wrap1_1_2 {
1 year ago
margin-right: 36rpx;
width: 0;
height: 66rpx;
border-left: 0.5px solid #626262;
}
1 year ago
.wrap1_1_1 {
1 year ago
width: 210rpx;
padding-left: 32rpx;
color: #626262;
font-size: 24rpx;
}
}
}
}
1 year ago
& > .content3 {
1 year ago
margin-top: 60rpx;
1 year ago
.prompt {
1 year ago
color: #4E964D;
font-size: 16rpx;
margin-bottom: 4rpx;
}
1 year ago
.wrap1 {
1 year ago
border: 1rpx dashed #DFE9F0;
background-color: #fff;
1 year ago
.wrap1_1 {
1 year ago
position: relative;
height: 114rpx;
display: flex;
align-items: center;
1 year ago
.wrap1_1_4 {
1 year ago
left: 50%;
transform: translateX(-50%);
bottom: 0;
position: absolute;
height: 0;
width: 636rpx;
border-bottom: 0.5px solid #626262;
}
1 year ago
.wrap1_1_2 {
1 year ago
margin-right: 36rpx;
width: 0;
height: 66rpx;
border-left: 0.5px solid #626262;
}
1 year ago
.wrap1_1_1 {
1 year ago
width: 210rpx;
padding-left: 32rpx;
color: #626262;
font-size: 24rpx;
}
}
}
}
1 year ago
& > .content2 {
1 year ago
margin-top: 42rpx;
display: flex;
justify-content: center;
1 year ago
image {
1 year ago
width: 404rpx;
height: 306rpx;
}
}
}
</style>