master
Phoenix 6 months ago
parent f5c70fe15a
commit 9a5d94cac7

3776
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -16,7 +16,6 @@
"url": ""
},
"devDependencies": {
"node-sass": "^4.14.0",
"sass-loader": "^8.0.2"
},
"author": "uView",
@ -27,5 +26,10 @@
"前端组件",
"通用组件"
]
},
"dependencies": {
"dayjs": "^1.11.10",
"lodash": "^4.17.21",
"sass": "^1.72.0"
}
}

@ -27,8 +27,7 @@
</div>
</div>
<div class="wrap2_2" @click="expand">
<div class="wrap2_2_1" v-if="listPaintings.length>2" :style="{transform:`${isExpand?'rotate(180deg)':''}`}">
<img src="https://cdns.fontree.cn/fonchain-main/prod/image/default/approval/13639162-2871-4187-abc5-71c2d9f01ac2.png" alt="">
<div class="wrap2_2_1" v-if="listPaintings.length>2" :style="{transform:`translate(-50%, -50%) ${isExpand?'rotate(180deg)':''}`}">
</div>
<div class="wrap2_2_2">共计{{listPaintings.length}}幅画作</div>
</div>
@ -67,7 +66,7 @@
<div class="wrap1_1_1">画作编号</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3">
<input style="color: #939393;font-size: 24rpx;" v-model="listPaintings[index].artworkNum" placeholder-style="color: #939393;font-size: 24rpx;" placeholder="请输入画作编号"/>
<input style="color: #939393;font-size: 24rpx;" v-model="listPaintings[index].artworkNum" placeholder-style="color: #939393;font-size: 24rpx;z-index:0" placeholder="请输入画作编号"/>
</div>
<div class="wrap1_1_4"></div>
</div>
@ -75,7 +74,7 @@
<div class="wrap1_1_1">画作名称</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3">
<input style="color: #939393;font-size: 24rpx;" v-model="listPaintings[index].artworkName" placeholder-style="color: #939393;font-size: 24rpx;" placeholder="请输入画作名称"/>
<input style="color: #939393;font-size: 24rpx;" v-model="listPaintings[index].artworkName" placeholder-style="color: #939393;font-size: 24rpx;z-index:0" placeholder="请输入画作名称"/>
</div>
<div class="wrap1_1_4"></div>
</div>
@ -83,7 +82,7 @@
<div class="wrap1_1_1">画家名称</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3">
<input style="color: #939393;font-size: 24rpx;" v-model="listPaintings[index].artistName" placeholder-style="color: #939393;font-size: 24rpx;" placeholder="请输入画家名称"/>
<input style="color: #939393;font-size: 24rpx;" v-model="listPaintings[index].artistName" placeholder-style="color: #939393;font-size: 24rpx;z-index:0" placeholder="请输入画家名称"/>
</div>
<div class="wrap1_1_4">
</div>
@ -92,7 +91,7 @@
<div class="wrap1_1_1">画作平尺数</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3">
<input type="number" style="color: #939393;font-size: 24rpx;" v-model="listPaintings[index].artworkSquareSize" placeholder-style="color: #939393;font-size: 24rpx;" placeholder="请输入画作平尺数"/>
<input type="number" style="color: #939393;font-size: 24rpx;" v-model="listPaintings[index].artworkSquareSize" @input="(e)=>{inputConfirm(e,index)}" placeholder-style="color: #939393;font-size: 24rpx;z-index:0" placeholder="请输入画作平尺数"/>
</div>
</div>
</div>
@ -104,9 +103,10 @@
<div class="wrap1_1_1">寄存地址</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3">
<input style="color: #939393;font-size: 24rpx;" disabled :value="listPaintings[index].warehouseID?addressList.find(x=>x.ID===listPaintings[index].warehouseID).address:''" placeholder-style="color: #939393;font-size: 24rpx;"
<input style="color: #939393;font-size: 24rpx;" disabled :value="listPaintings[index].warehouseID?addressList.find(x=>x.ID===listPaintings[index].warehouseID).address:''" placeholder-style="color: #939393;font-size: 24rpx;z-index:0"
placeholder="请选择寄存地址"/>
</div>
<div class="wrap1_1_4"></div>
<div class="wrap1_1_5">
<image src="../../static/zu611@3x.png"></image>
@ -116,7 +116,7 @@
<div class="wrap1_1_1">寄存时长</div>
<div class="wrap1_1_2"></div>
<div class="wrap1_1_3">
<input style="color: #939393;font-size: 24rpx;" :value="listPaintings[index].endAt" disabled placeholder-style="color: #939393;font-size: 24rpx;" placeholder="请选择寄存时长"/>
<input style="color: #939393;font-size: 24rpx;" :value="listPaintings[index].endAt" disabled placeholder-style="color: #939393;font-size: 24rpx;z-index:0" placeholder="请选择寄存时长"/>
</div>
<div class="wrap1_1_5">
<image src="../../static/zu612@3x.png"></image>
@ -134,25 +134,7 @@
</div>
<div class="wrap2">添加</div>
</div>
</div>
</scroll-view>
<div class="content5">
<div class="wrap4" v-show="isExpand1" :style="{top:`-${152*listPaintings.length}rpx`}">
<div class="item" v-for="(item,index) in listPaintings">
<div class="item_1">{{index+1}}</div>
<div class="item_2">{{item.artworkNum}}</div>
<div class="item_3">{{item.artworkName}}</div>
<div class="item_4">¥ {{item.expectedPayment}}</div>
</div>
</div>
<div class="wrap3" @click="expand1" :style="{transform:`${isExpand1?'':'rotate(180deg)'}`}"> <img src="https://cdns.fontree.cn/fonchain-main/prod/image/default/approval/13639162-2871-4187-abc5-71c2d9f01ac2.png" alt=""></div>
<div class="wrap1">
<div class="wrap1_1">*仅微信付款</div>
<div class="wrap1_2">预计 ¥{{totalMoney||'0'}}</div>
</div>
<div class="wrap2" @click="signContract"></div>
</div>
<u-popup :round="15" :show="show_2" mode="bottom" @open="()=>{show_2=true}">
<u-popup :round="15" :show="show_2" mode="bottom" @open="()=>{show_2=true}">
<div class="poup1" >
<div class="content1">
<div class="wrap1">更换您的寄存地址</div>
@ -163,114 +145,48 @@
</div>
<div class="content2"></div>
<div class="content3">
<div v-for="(item,index) in addressList" @click="selectAddress(item,index)"
:class="[listPaintings[currentIndex].warehouseID===item.ID?'active':'']" :key="index" class="wrap1">
<div class="wrap1_1">{{ item.address }}</div>
<div class="wrap1_2">*剩余{{ item.leftNum }}位置</div>
<div v-for="(itemaddress,index1) of addressList" @click="selectAddress(itemaddress,index)"
:class="[listPaintings[index].warehouseID===itemaddress.ID?'active':'']" :key="index1" class="wrap1">
<div class="wrap1_1">{{ itemaddress.address }}</div>
<div class="wrap1_2">*剩余{{ itemaddress.leftNum }}位置</div>
</div>
<!-- <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>-->
</div>
<div class="content2"></div>
<div class="content6" @click="confirmAddress">
<div class="wrap1">确定</div>
</div>
</div>
</u-popup>
<!-- <u-popup :round="15" :show="show_1" mode="bottom" @open="()=>{show_1=true}">
<div class="poup">
<div class="content1" style="margin-top: 20rpx">
<div class="wrap1">寄存时长</div>
<div @click="show_1=false" class="wrap2">
<image
src="https://cdns.fontree.cn/fonchain-main/prod/image/default/artwork/d84593b3-10a8-4d86-be8c-b048b03b22c7.png"></image>
</div>
</div>
<div class="content2"></div>
<div class="content7" @click="show = true">
<u-datetime-picker
:show="show"
@confirm="confirmDate"
mode="date"
@cancel="show=false"
:minDate="minDate"
></u-datetime-picker>
<u&#45;&#45;input
readonly
placeholder="点击选择"
border="surround"
v-model="listPaintings[currentIndex].endAt"
></u&#45;&#45;input>
</div>
&lt;!&ndash; <div class="content2"></div>
<div class="content4">起始日期</div>
<div class="content5">
<div class="wrap1">年份</div>
<div class="wrap2"></div>
<div class="wrap3"></div>
</div>&ndash;&gt;
&lt;!&ndash; <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>&ndash;&gt;
<div class="content6" @click="confirmCycle">
<div class="wrap1">确定</div>
</u-popup>
<u-picker v-if="show_1" :show="show_1" ref="uPicker" :columns="columns" @confirm="(e)=>{confirmDate(e,index)}" @cancel="closeClick" @change="(e)=>{changeHandler(e,index)}"></u-picker>
</div>
</scroll-view>
<div class="content5" @click="expand1">
<div class="wrap4" v-show="isExpand1" :style="{top:`-${152*listPaintings.length}rpx`}">
<div class="item" v-for="(item,index) in listPaintings">
<div class="item_1">{{index+1}}</div>
<div class="item_2">{{item.artworkNum}}</div>
<div class="item_3">{{item.artworkName}}</div>
<div class="item_4">¥ {{item.expectedPayment}}</div>
</div>
</div>
</u-popup>-->
<u-picker :show="show_1" ref="uPicker" :columns="columns" @confirm="confirmDate" @cancel="closeClick" @change="changeHandler"></u-picker>
<div class="wrap3" :style="{transform:`${isExpand1?'':'rotate(180deg)'}`}"> <img src="https://cdns.fontree.cn/fonchain-main/prod/image/default/approval/13639162-2871-4187-abc5-71c2d9f01ac2.png" alt=""></div>
<div class="wrap1">
<div class="wrap1_1">*仅微信付款</div>
<div class="wrap1_2">预计 ¥{{totalMoney||'0'}}</div>
</div>
<div class="wrap2" @click.stop="signContract">确认金额并签署合同</div>
</div>
<u-loading-page bgColor="rgba(0,0,0,0.5)" :loading="loading" loading-text="..."></u-loading-page>
</div>
</template>
<script>
import http from "@/http/api";
import {postDataByParams} from "../../http/service";
import dayjs from 'dayjs'
import _ from 'lodash';
export default {
name: "order-details",
data() {
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 {
itemHeight:0,
scrollId:'item-0',
@ -312,54 +228,17 @@ export default {
data: [],
show_1: false,
title: 'picker-view',
years,
year,
months,
month,
days,
day,
value: [9999, month - 1, day - 1],
visible: true,
url: ''
}
},
computed: {
computed:{
totalMoney(){
return this.listPaintings.reduce((total, item) => {
return total + Number(item.expectedPayment);
}, 0);
},
currentArtworkSquareSize() {
if (
this.currentIndex >= 0 &&
this.currentIndex < this.listPaintings.length
) {
return this.listPaintings[this.currentIndex].artworkSquareSize;
}
return null;
},
currentEndAt() {
if (
this.currentIndex >= 0 &&
this.currentIndex < this.listPaintings.length
) {
return this.listPaintings[this.currentIndex].endAt;
}
return null;
},
},
watch:{
currentArtworkSquareSize(newValue, oldValue) {
if (newValue !== oldValue) {
this.obtainAmount()
}
},
currentEndAt(newValue, oldValue) {
console.log(newValue,oldValue)
if (newValue !== oldValue) {
this.obtainAmount()
}
},
},
onLoad(load){
if (load.url){
@ -399,6 +278,12 @@ export default {
})
},
methods: {
inputConfirm: _.debounce(function (event,index) {
this.obtainAmount(index)
}, 1000),
addDaysToCurrentDate(days) {
return dayjs().add(days, 'day').format('YYYY-MM-DD');
},
show2Click(index){
this.currentIndex=index
this.show_2=true
@ -436,7 +321,7 @@ export default {
this.info = res1.data
}
},
changeHandler(e) {
changeHandler(e,i) {
const {
columnIndex,
value,
@ -445,7 +330,7 @@ export default {
picker = this.$refs.uPicker
} = e
if (columnIndex === 2) {
picker.setColumnValues(this.columns.length-1, [this.columns[2][e.index]*this.columns[0][0]])
picker[this.currentIndex].setColumnValues(this.columns.length-1, [this.columns[2][e.index]*this.columns[0][0]])
}
},
itemDelete(index){
@ -495,6 +380,13 @@ export default {
}).exec();
},
expand1(){
if (this.isExpand){
this.listHeight=154*2
}
if (this.isExpand){
this.isExpand=false
}
this.isExpand1=!this.isExpand1
},
expand(){
@ -504,26 +396,23 @@ export default {
this.listHeight=154*(this.listPaintings.length<=7?this.listPaintings.length:7)
}
this.isExpand=!this.isExpand
if (this.isExpand1){
this.isExpand1=false
}
},
timestampToDateString(timestamp) {
const date = new Date(timestamp ); // 1000Date
const year = date.getFullYear();
const month = ("0" + (date.getMonth() + 1)).slice(-2); // 01slice2
const day = ("0" + date.getDate()).slice(-2); // slice2
return year + "-" + month + "-" + day;
},
confirmDate(data){
confirmDate(data,index){
this.listPaintings[this.currentIndex].endAt=data.value[data.value.length-1]
if (this.currentIndex===0){
for (let listPainting of this.listPaintings) {
listPainting.endAt=data.value[data.value.length-1]
}
}
this.obtainAmount()
this.obtainAmount(this.currentIndex,this.currentIndex===0)
this.show_1=false
},
openShow1(index){
if (!this.listPaintings[this.currentIndex].artworkSquareSize){
if (!this.listPaintings[index].artworkSquareSize){
uni.showToast({
title: "请先填写画作平尺数",
duration: 2000,
@ -624,7 +513,7 @@ export default {
const data={
orders:this.listPaintings.map((x)=>{
return {
endAt:new Date(Date.now() + x.endAt * 86400000)?.toISOString()?.slice(0, 10),
endAt:this.addDaysToCurrentDate(x.endAt),
warehouseID:x.warehouseID,
artworkSquareSize:Number(x.artworkSquareSize),
artworkName: x.artworkName,
@ -647,17 +536,38 @@ export default {
this.loading=false
}
},
async obtainAmount(){
uni.setStorageSync("endAt",new Date(Date.now() + this.listPaintings[this.currentIndex].endAt * 86400000)?.toISOString()?.slice(0, 10))
const data={
async obtainAmount(index,list=false){
let data={
orders:[
{ artworkSquareSize:Number(this.listPaintings[this.currentIndex].artworkSquareSize),
endAt:new Date(Date.now() + this.listPaintings[this.currentIndex].endAt * 86400000)?.toISOString()?.slice(0, 10)}
{ artworkSquareSize:Number(this.listPaintings[index].artworkSquareSize),
endAt:this.addDaysToCurrentDate(this.listPaintings[index].endAt)
}
]
}
if (list){
data={
orders: this.listPaintings.map((x)=>{
return{
artworkSquareSize:Number(x.artworkSquareSize),
endAt:this.addDaysToCurrentDate(x.endAt)
}
})
}
}
const res = await postDataByParams('/api/v2/warehouse/calculate',data)
if (res.code===200){
this.listPaintings[this.currentIndex].expectedPayment=Number(res.data.orders?.[0]?.money)
if (list){
this.listPaintings.forEach((x,ix)=>{
res.data.orders?.forEach((y,iy)=>{
if (ix===iy){
x.expectedPayment=Number(y.money)
}
})
})
}else {
this.listPaintings[index].expectedPayment=Number(res.data.orders?.[0]?.money)
}
}
},
confirmCycle() {
@ -666,16 +576,13 @@ export default {
confirmAddress() {
this.show_2 = false
},
selectAddress(item) {
selectAddress(item,index) {
this.listPaintings[this.currentIndex].warehouseID = item.ID
if (this.currentIndex===0){
console.log(this.listPaintings,'this.listPaintings')
this.listPaintings.forEach((x)=>{
x.warehouseID=item.ID
})
}
this.$forceUpdate()
},
selectionPeriod(item) {
this.cycleId = item.ID
@ -690,6 +597,7 @@ export default {
const res = await postDataByParams('/api/warehouse/address')
if (res.code === 200) {
this.addressList = res.data.data
console.log(this.addressList,'addressList')
}
},
async getDetailUrl() {
@ -783,6 +691,7 @@ picker-view {
display: flex;
flex-direction: column;
.content-list{
top: 130rpx;
z-index: 999;
position: absolute;
@ -796,13 +705,14 @@ picker-view {
}
.wrap2{
box-sizing: border-box;
padding-top: 20rpx;
border: 2rpx dashed rgba(118, 196, 88, 1);
border-radius: 20rpx;
background-color: #fff;
padding-left: 18rpx;
padding-right: 32rpx;
padding-left: 20rpx;
padding-right: 20rpx;
.wrap2_2{
border-top: 1rpx dashed rgba(118, 196, 88, 1);
height: 60rpx;
position: relative;
.wrap2_2_2{
@ -811,20 +721,20 @@ picker-view {
font-size: 24rpx;
}
.wrap2_2_1{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-repeat: no-repeat;
transform: translate(-50%, -50%) ;
width: 30rpx;
height: 16rpx;
background-image: url("https://cdns.fontree.cn/fonchain-main/prod/image/default/approval/13639162-2871-4187-abc5-71c2d9f01ac2.png");
background-size: cover;
img{
width: 30rpx;
height: 16rpx;
}
}
}
.wrap2_1{
z-index: 999;
padding-bottom: 20rpx;
overflow-y: scroll;
.item{
height: 154rpx;
@ -905,6 +815,9 @@ color: rgba(98, 98, 98, 1);
width: 100%;
background-color: #fff;
position: absolute;
border-top-right-radius: 20rpx;
border-top-left-radius: 20rpx;
border-top: 1px dashed rgba(118, 196, 88, 1);
.item{
height: 152rpx;
display: flex;
@ -1368,6 +1281,7 @@ color: rgba(98, 98, 98, 1);
}
&>.content7{
margin: 0 auto;
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 40rpx;
width: 228rpx;

Loading…
Cancel
Save