7 changed files with 365 additions and 357 deletions
@ -1,179 +1,199 @@ |
|||||||
<template> |
<template> |
||||||
<view class="OrderCancellation"> |
<view class="OrderCancellation"> |
||||||
<view class="header"> |
<view class="header"> |
||||||
<image mode="aspectFit" src="@/static/images/writeOffBg.jpg" @click="openQRCode" /> |
<image mode="aspectFit" src="@/static/images/writeOffBg.jpg" @click="openQRCode" /> |
||||||
</view> |
</view> |
||||||
<view class="whiteBg"> |
<view class="whiteBg"> |
||||||
<view class="input"> |
<view class="input"> |
||||||
<input type="number" placeholder="0" v-model="verify_code" /> |
<input type="number" placeholder="0" v-model="verify_code" /> |
||||||
</view> |
</view> |
||||||
<view class="bnt" @click="storeCancellation">立即核销</view> |
<view class="bnt" @click="storeCancellation">立即核销</view> |
||||||
</view> |
</view> |
||||||
<!-- <view class="scan" v-if="iswechat"> |
<!-- #ifndef H5 --> |
||||||
<image src="@/static/images/scan.gif" @click="openQRCode" /> |
<view class="scan" v-if="iswechat"> |
||||||
</view> --> |
<image src="@/static/images/scan.gif" @click="openQRCode" /> |
||||||
<WriteOff :iShidden="iShidden" :orderInfo="orderInfo" @cancel="cancel" @confirm="confirm"></WriteOff> |
</view> |
||||||
</view> |
<!-- #endif --> |
||||||
|
<WriteOff :iShidden="iShidden" :orderInfo="orderInfo" @cancel="cancel" @confirm="confirm"></WriteOff> |
||||||
|
</view> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import WriteOff from "@/components/WriteOff"; |
import WriteOff from "@/components/WriteOff"; |
||||||
import { isWeixin } from "@/utils"; |
import { |
||||||
// import { wechatEvevt } from "@/libs/wechat"; |
isWeixin |
||||||
import { orderVerific } from "@/api/order"; |
} from "@/utils"; |
||||||
const NAME = "OrderCancellation"; |
// import { wechatEvevt } from "@/libs/wechat"; |
||||||
|
import { |
||||||
|
orderVerific |
||||||
|
} from "@/api/order"; |
||||||
|
const NAME = "OrderCancellation"; |
||||||
|
|
||||||
export default { |
export default { |
||||||
name: NAME, |
name: NAME, |
||||||
components: { |
components: { |
||||||
WriteOff |
WriteOff |
||||||
}, |
}, |
||||||
props: {}, |
props: {}, |
||||||
data: function() { |
data: function() { |
||||||
return { |
return { |
||||||
iShidden: true, |
iShidden: true, |
||||||
iswechat: isWeixin(), |
orderInfo: {}, |
||||||
orderInfo: {}, |
verify_code: "" |
||||||
verify_code: "" |
}; |
||||||
}; |
}, |
||||||
}, |
mounted: function() {}, |
||||||
mounted: function() {}, |
methods: { |
||||||
methods: { |
cancel: function(res) { |
||||||
cancel: function(res) { |
this.iShidden = res; |
||||||
this.iShidden = res; |
}, |
||||||
}, |
confirm: function() { |
||||||
confirm: function() { |
orderVerific(this.verify_code, 1) |
||||||
orderVerific(this.verify_code, 1) |
.then(res => { |
||||||
.then(res => { |
this.iShidden = true; |
||||||
this.iShidden = true; |
this.verify_code = ""; |
||||||
this.verify_code = ""; |
uni.showToast({ |
||||||
uni.showToast({ |
title: res.msg, |
||||||
title: res.msg, |
icon: "none", |
||||||
icon: "none", |
duration: 2000 |
||||||
duration: 2000 |
}); |
||||||
}); |
}) |
||||||
}) |
.catch(err => { |
||||||
.catch(err => { |
uni.showToast({ |
||||||
uni.showToast({ |
title: err.msg || err.response.data.msg || err.response.data.message, |
||||||
title: |
icon: "none", |
||||||
err.msg || err.response.data.msg || err.response.data.message, |
duration: 2000 |
||||||
icon: "none", |
}); |
||||||
duration: 2000 |
}); |
||||||
}); |
}, |
||||||
}); |
storeCancellation: function() { |
||||||
}, |
let ref = /[0-9]{12}/; |
||||||
storeCancellation: function() { |
if (!this.verify_code) { |
||||||
let ref = /[0-9]{12}/; |
uni.showToast({ |
||||||
if (!this.verify_code) { |
title: "请输入核销码", |
||||||
uni.showToast({ |
icon: "none", |
||||||
title: "请输入核销码", |
duration: 2000 |
||||||
icon: "none", |
}); |
||||||
duration: 2000 |
return; |
||||||
}); |
} |
||||||
return; |
if (!ref.test(this.verify_code)) { |
||||||
} |
uni.showToast({ |
||||||
if (!ref.test(this.verify_code)) { |
title: "请输入正确的核销码", |
||||||
uni.showToast({ |
icon: "none", |
||||||
title: "请输入正确的核销码", |
duration: 2000 |
||||||
icon: "none", |
}); |
||||||
duration: 2000 |
return; |
||||||
}); |
} |
||||||
return; |
uni.showLoading({ |
||||||
} |
title: "查询中" |
||||||
uni.showLoading({ |
}); |
||||||
title: "查询中" |
orderVerific(this.verify_code, 0) |
||||||
}); |
.then(res => { |
||||||
orderVerific(this.verify_code, 0) |
uni.hideLoading(); |
||||||
.then(res => { |
this.orderInfo = res.data; |
||||||
uni.hideLoading(); |
this.iShidden = false; |
||||||
this.orderInfo = res.data; |
uni.showToast({ |
||||||
this.iShidden = false; |
title: res.msg, |
||||||
uni.showToast({ |
icon: "success", |
||||||
title: res.msg, |
duration: 2000 |
||||||
icon: "success", |
}); |
||||||
duration: 2000 |
}) |
||||||
}); |
.catch(error => { |
||||||
}) |
uni.hideLoading(); |
||||||
.catch(error => { |
uni.showToast({ |
||||||
uni.hideLoading(); |
title: error.msg || |
||||||
uni.showToast({ |
error.response.data.msg || |
||||||
title: |
error.response.data.message, |
||||||
error.msg || |
icon: "none", |
||||||
error.response.data.msg || |
duration: 2000 |
||||||
error.response.data.message, |
}); |
||||||
icon: "none", |
}); |
||||||
duration: 2000 |
}, |
||||||
}); |
openQRCode: function() { |
||||||
}); |
let that = this; |
||||||
}, |
// 这里需要调用扫码功能 |
||||||
openQRCode: function() { |
uni.scanCode({ |
||||||
let that = this; |
success: (res) => { |
||||||
// 这里需要调用扫码功能 |
var result = res.result; |
||||||
} |
if (result) { |
||||||
} |
that.verify_code = res.result; |
||||||
}; |
that.storeCancellation(); |
||||||
|
} else { |
||||||
|
uni.showToast({ |
||||||
|
title: '没有扫描到什么!', |
||||||
|
icon: "none", |
||||||
|
duration: 2000 |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
}) |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
}; |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style scoped lang="less"> |
<style scoped lang="less"> |
||||||
.OrderCancellation .header { |
.OrderCancellation .header { |
||||||
width: 100%; |
width: 100%; |
||||||
height: 3 * 100rpx; |
height: 3 * 100rpx; |
||||||
background-size: 100% 100%; |
background-size: 100% 100%; |
||||||
image { |
|
||||||
width: 100%; |
image { |
||||||
height: 3 * 100rpx; |
width: 100%; |
||||||
} |
height: 3 * 100rpx; |
||||||
} |
} |
||||||
|
} |
||||||
|
|
||||||
.OrderCancellation .whiteBg { |
.OrderCancellation .whiteBg { |
||||||
width: 6.9 * 100rpx; |
width: 6.9 * 100rpx; |
||||||
background-color: #fff; |
background-color: #fff; |
||||||
margin: -0.93 * 100rpx auto 0 auto; |
margin: -0.93 * 100rpx auto 0 auto; |
||||||
padding-top: 0.8 * 100rpx; |
padding-top: 0.8 * 100rpx; |
||||||
padding-bottom: 30rpx; |
padding-bottom: 30rpx; |
||||||
z-index:20; |
z-index: 20; |
||||||
position: relative; |
position: relative; |
||||||
border-radius: 0.06 * 100rpx 0.06 * 100rpx 0 0; |
border-radius: 0.06 * 100rpx 0.06 * 100rpx 0 0; |
||||||
} |
} |
||||||
|
|
||||||
.OrderCancellation .whiteBg .input { |
.OrderCancellation .whiteBg .input { |
||||||
width: 5.8 * 100rpx; |
width: 5.8 * 100rpx; |
||||||
margin: 0 auto; |
margin: 0 auto; |
||||||
border-bottom: 0.01 * 100rpx solid #eee; |
border-bottom: 0.01 * 100rpx solid #eee; |
||||||
} |
} |
||||||
|
|
||||||
.OrderCancellation .whiteBg .input input { |
.OrderCancellation .whiteBg .input input { |
||||||
padding-bottom: 0.25 * 100rpx; |
padding-bottom: 0.25 * 100rpx; |
||||||
font-size: 0.6 * 100rpx; |
font-size: 0.6 * 100rpx; |
||||||
height: auto; |
height: auto; |
||||||
color: #282828; |
color: #282828; |
||||||
width: 100%; |
width: 100%; |
||||||
text-align: center; |
text-align: center; |
||||||
} |
} |
||||||
|
|
||||||
.OrderCancellation .whiteBg .bnt { |
.OrderCancellation .whiteBg .bnt { |
||||||
font-size: 0.32 * 100rpx; |
font-size: 0.32 * 100rpx; |
||||||
color: #fff; |
color: #fff; |
||||||
width: 5.8 * 100rpx; |
width: 5.8 * 100rpx; |
||||||
height: 0.86 * 100rpx; |
height: 0.86 * 100rpx; |
||||||
border-radius: 0.43 * 100rpx; |
border-radius: 0.43 * 100rpx; |
||||||
background-image: linear-gradient(to right, #eb3729 0%, #eb3729 100%); |
background-image: linear-gradient(to right, #eb3729 0%, #eb3729 100%); |
||||||
background-image: -webkit-linear-gradient(to right, #eb3729 0%, #eb3729 100%); |
background-image: -webkit-linear-gradient(to right, #eb3729 0%, #eb3729 100%); |
||||||
background-image: -moz-linear-gradient(to right, #eb3729 0%, #eb3729 100%); |
background-image: -moz-linear-gradient(to right, #eb3729 0%, #eb3729 100%); |
||||||
text-align: center; |
text-align: center; |
||||||
line-height: 0.86 * 100rpx; |
line-height: 0.86 * 100rpx; |
||||||
margin: 0.55 * 100rpx auto 0 auto; |
margin: 0.55 * 100rpx auto 0 auto; |
||||||
} |
} |
||||||
|
|
||||||
.OrderCancellation .scan { |
.OrderCancellation .scan { |
||||||
width: 3 * 100rpx; |
width: 3 * 100rpx; |
||||||
height: 3 * 100rpx; |
height: 3 * 100rpx; |
||||||
margin: 1.1 * 100rpx auto 0 auto; |
margin: 1.1 * 100rpx auto 0 auto; |
||||||
} |
} |
||||||
|
|
||||||
.OrderCancellation .scan image { |
.OrderCancellation .scan image { |
||||||
width: 100%; |
width: 100%; |
||||||
height: 100%; |
height: 100%; |
||||||
display: block; |
display: block; |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
After Width: | Height: | Size: 191 KiB |
Loading…
Reference in new issue