| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <template>
- <view class="manual">
- <view class="top"></view>
- <view class="head">
- <span class="cuIcon-back" @click="back"></span>
- <view class="case">
- 输码核销
- </view>
- </view>
- <view class="content">
- <view class="bgc">
- </view>
- <view class="import">
- 请输入核销码
- <view class="inp">
- <!-- {{value}} -->
- <u-input v-model="voucherCode" placeholder="请输入核销码" />
- </view>
- </view>
- <view class="keyboard" style="margin-top: 30px;">
- <view class="qrcode" @click="scan">
- <image src="/static/scan/qrcode.png" mode=""></image>去扫码
- </view>
- <view class="qrcode ticket" @click="verify">
- <image src="/static/scan/ticket.png" mode=""></image>验券核销
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- voucherCode: '',
- merchantId:''
- }
- },
- methods: {
- //返回
- back() {
- uni.navigateBack({
- delta: 1
- });
- },
- verify(){
- console.log(111)
- if(this.voucherCode == ''){
- uni.showToast({
- title: '请输入核销码',
- icon:'none'
- });
- }
- let data = {
- merchantId:this.merchantId,
- voucherCode:this.voucherCode
- }
- this.$http.post("/app/writeOff/details",data).then(res => {
- if (res.data.code == 200) {
- console.log()
- const params = encodeURIComponent(JSON.stringify(res.data.result));
- uni.navigateTo({
- url:`/pages/scan/details?params=${params}`
- })
- }else{
- uni.showToast({
- title: res.data.message,
- icon:'none'
- });
- }
- })
- },
- scan(){
- let that = this
- uni.scanCode({
- success: function (res) {
- console.log('条码内容:' + res.result);
- if(res.result){
- that.voucherCode = res.result
- that.verify()
- }
- }
- });
- }
- },
- onShow() {
- let that = this
- uni.getStorage({
- key: 'login_user_info',
- success: function(res) {
- that.merchantId = res.data.merchantId
- }
- })
- }
- }
- </script>
- <style lang="scss" scoped>
- .manual {
- width: 100vw;
- height: 100vh;
- background: #F7F8FC;
- /*#ifdef APP-PLUS*/
- .top {
- width: 100%;
- height: var(--status-bar-height);
- background: linear-gradient(90deg, #E6FFFF 0%, #CEF7FF 40%, #A3CEFE 73%, #BCD6FF 100%), linear-gradient(0, #F7F8FC 0%, rgba(255, 255, 255, 0) 100%);
- }
- /*#endif*/
- .head {
- width: 100%;
- height: 112rpx;
- padding: 20rpx;
- display: flex;
- align-items: center;
- background: linear-gradient(90deg, #E6FFFF 0%, #CEF7FF 40%, #A3CEFE 73%, #BCD6FF 100%), linear-gradient(0, #F7F8FC 0%, rgba(255, 255, 255, 0) 100%);
- position: relative;
- .cuIcon-back {
- font-size: 40rpx;
- margin-right: 40rpx;
- }
- .case {
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
- font-size: 36rpx;
- font-weight: 600;
- }
- }
- .content {
- width: 100%;
- position: relative;
- .bgc {
- width: 100%;
- height: 160rpx;
- background: linear-gradient(90deg, #E6FFFF 0%, #CEF7FF 40%, #A3CEFE 73%, #BCD6FF 100%);
- }
- .import {
- width: 100%;
- margin: 20rpx 0px;
- padding: 0px 20rpx;
- box-sizing: border-box;
- position: absolute;
- top: 0rpx;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- font-size: 40rpx;
- color: #333333;
- .inp {
- width: 656rpx;
- height: 132rpx;
- background: #FFFFFF;
- border-radius: 12rpx;
- border: 2rpx solid #449AFF;
- margin-top: 28rpx;
- padding: 0px 20rpx;
- display: flex;
- align-items: center;
- u-input {
- width: 100%;
- height: 100%;
- }
- }
- }
- .keyboard {
- width: 100%;
- height: 112rpx;
- position: fixed;
- bottom: 0;
- display: flex;
- align-items: center;
- justify-content: space-around;
- background-color: #fff;
- .qrcode {
- width: 324rpx;
- height: 76rpx;
- background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
- border-radius: 12rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 28rpx;
- color: #FFFFFF;
- image {
- width: 40rpx;
- height: 40rpx;
- margin-right: 10rpx;
- }
- }
- .ticket {
- background: linear-gradient(90deg, #FFA05B 0%, #FF7918 100%);
- }
- }
- }
- }
- </style>
|