You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
279 lines
6.1 KiB
279 lines
6.1 KiB
<template> |
|
<view class="container" style="padding-bottom: 150rpx;"> |
|
<view class="main"> |
|
<view class="order-des"> |
|
<view class="title">订餐手机号</view> |
|
<view class="textarea-wrap"> |
|
<input type="number" v-model="phone" class="input" maxlength="11" placeholder="请输入订单手机号" /> |
|
</view> |
|
</view> |
|
<view class="order-des"> |
|
<view class="title">支付金额</view> |
|
<view class="textarea-wrap"> |
|
<input type="digit" v-model="money" class="input" readonly="readonly" placeholder="请输入支付金额" /> |
|
</view> |
|
</view> |
|
<view class="order-des"> |
|
<view class="title">上传订单凭证(最少两张)</view> |
|
<shmily-drag-image :list.sync="imageList" number="3"></shmily-drag-image> |
|
</view> |
|
<view class="order-des"> |
|
<view class="title">上传订单凭证示例图</view> |
|
<shmily-drag-image :select="false" :list.sync="imageList1" number="2"></shmily-drag-image> |
|
</view> |
|
</view> |
|
<view class="btns"> |
|
<button class="tui-button-primar qr" @tap="addSave">提交</button> |
|
<button class="tui-button-primar qx" @tap="fangqi">放弃</button> |
|
</view> |
|
</view> |
|
</template> |
|
|
|
<script> |
|
import shmilyDragImage from '@/components/shmily-drag-image/shmily-drag-image.vue' |
|
export default { |
|
components: { |
|
shmilyDragImage |
|
}, |
|
data() { |
|
return { |
|
phone: '', |
|
money: "", |
|
imageList: [], |
|
imageList1: ['https://h5.canmoujiang.com/img/20210531/dceedf8061294b1d99043ca78ff57090.png', |
|
'https://h5.canmoujiang.com/img/20210531/3ff0fa04f1cb4debb6ec017293bf6c6f.jpg' |
|
], |
|
orderId: '' //修改是用到的ID |
|
} |
|
}, |
|
onLoad(e) { |
|
this.orderId = e.orderId; |
|
}, |
|
methods: { |
|
// 放弃任务 |
|
fangqi() { |
|
uni.showModal({ |
|
title: '温馨提示', |
|
content: '您是否要放弃当前任务?', |
|
showCancel: true, |
|
cancelText: '取消', |
|
confirmText: '确认', |
|
success: d => { |
|
var that = this; |
|
if (d.confirm) { |
|
console.log('用户点击确定'); |
|
that.$queue.showLoading('提交中...'); |
|
that.$Request.postT('/wm/abandonOrders?orderId=' + this.orderId).then(res => { |
|
if (res.code === 0) { |
|
that.$queue.showToast('已放弃当前任务!'); |
|
setTimeout(d => { |
|
uni.navigateBack(); |
|
uni.hideLoading(); |
|
}, 1000); |
|
} else { |
|
that.$queue.showToast(res.msg); |
|
uni.hideLoading(); |
|
} |
|
}) |
|
} |
|
} |
|
}); |
|
}, |
|
// 发布 |
|
addSave() { |
|
let that = this; |
|
this.$queue.showLoading('提交中...'); |
|
var images = ''; |
|
if (this.phone.length != 11) { |
|
uni.hideLoading(); |
|
this.$queue.showToast('请输入正确手机号!'); |
|
return; |
|
} |
|
if (this.money === '') { |
|
uni.hideLoading(); |
|
this.$queue.showToast('请输入正确金额'); |
|
return; |
|
} |
|
|
|
if (this.imageList.length > 1) { |
|
for (var i = 0; i < this.imageList.length; i++) { |
|
if (i === 0) { |
|
images = this.imageList[i]; |
|
} else { |
|
images = images + ',' + this.imageList[i]; |
|
} |
|
} |
|
} else { |
|
uni.hideLoading(); |
|
this.$queue.showToast('请最少上传两张订单凭证!'); |
|
return; |
|
} |
|
|
|
this.$Request.postT('/wm/submitOrders?orderId=' + this.orderId + '&phone=' + this.phone + '&money=' + |
|
this.money + '&img=' + images).then(res => { |
|
if (res.code === 0) { |
|
this.$queue.showToast("提交成功!"); |
|
setTimeout(d => { |
|
uni.navigateBack(); |
|
uni.hideLoading(); |
|
}, 1000); |
|
} else { |
|
uni.hideLoading(); |
|
this.$queue.showToast(res.msg); |
|
} |
|
}); |
|
}, |
|
} |
|
} |
|
</script> |
|
|
|
<style lang="scss"> |
|
page { |
|
width: 100%; |
|
} |
|
|
|
.container { |
|
width: 100%; |
|
padding-bottom: calc(98upx + env(safe-area-inset-bottom)); |
|
padding-bottom: calc(98upx + constant(safe-area-inset-bottom)); |
|
|
|
.main { |
|
padding: 20upx 20upx 20upx; |
|
|
|
.order-des { |
|
padding: 30upx; |
|
// border-radius: 20upx; |
|
background-color: #fff; |
|
// margin-bottom: 20upx; |
|
|
|
.title { |
|
font-size: 34upx; |
|
font-weight: bold; |
|
color: #333333; |
|
line-height: 32upx; |
|
padding-bottom: 20upx; |
|
border-bottom: 1upx solid #E6E6E6; |
|
} |
|
|
|
.textarea-wrap { |
|
padding-top: 20upx; |
|
width: 100%; |
|
|
|
.textarea { |
|
width: 100%; |
|
font-size: 28upx; |
|
line-height: 35upx; |
|
color: #333; |
|
} |
|
} |
|
|
|
.textarea-counter { |
|
text-align: right; |
|
font-size: 28upx; |
|
font-weight: 500; |
|
color: #999999; |
|
margin-top: 10upx; |
|
} |
|
} |
|
|
|
.order-list { |
|
margin-top: 20upx; |
|
padding: 0 30upx; |
|
border-radius: 20upx; |
|
background-color: #fff; |
|
|
|
.order-list-item { |
|
width: 100%; |
|
height: 110upx; |
|
border-bottom: 1upx solid #E6E6E6; |
|
display: flex; |
|
align-items: center; |
|
justify-content: space-between; |
|
|
|
.tit { |
|
font-size: 34upx; |
|
font-weight: 500; |
|
color: #333333; |
|
} |
|
|
|
.right { |
|
font-size: 34upx; |
|
font-weight: 500; |
|
color: #666; |
|
display: flex; |
|
align-items: center; |
|
|
|
.input { |
|
flex: 1; |
|
display: flex; |
|
align-items: center; |
|
text-align: right; |
|
padding-right: 10upx; |
|
} |
|
} |
|
} |
|
|
|
.order-list-item:last-child { |
|
border-bottom: 0; |
|
} |
|
} |
|
|
|
} |
|
|
|
.btns { |
|
button { |
|
// width: 80%; |
|
margin: 22upx; |
|
color: #fff; |
|
border: none; |
|
border-radius: 10upx; |
|
} |
|
|
|
.qr { |
|
background: #FF4701; |
|
} |
|
|
|
.qx { |
|
background: #CCCCCC; |
|
} |
|
} |
|
|
|
.footer { |
|
width: 100%; |
|
height: calc(98upx + env(safe-area-inset-bottom)); |
|
height: calc(98upx + constant(safe-area-inset-bottom)); |
|
padding-bottom: env(safe-area-inset-bottom); |
|
/*兼容IOS>11.2*/ |
|
padding-bottom: constant(safe-area-inset-bottom); |
|
/*兼容IOS<11.2*/ |
|
background: #FFFFFF; |
|
position: fixed; |
|
bottom: 0; |
|
padding: 0 30upx; |
|
z-index: 10; |
|
display: flex; |
|
align-items: center; |
|
justify-content: space-between; |
|
|
|
.payinfo { |
|
font-size: 32upx; |
|
font-weight: bold; |
|
color: #333333; |
|
|
|
text { |
|
color: #FF3737; |
|
} |
|
} |
|
|
|
.tui-button-primar { |
|
width: 300upx; |
|
height: 78upx; |
|
line-height: 78upx; |
|
background: #FF332F; |
|
border-radius: 10upx; |
|
margin: 0; |
|
} |
|
} |
|
|
|
} |
|
</style>
|
|
|