|
|
@ -2,33 +2,105 @@ |
|
|
|
<view class="operate-container"> |
|
|
|
<view class="store-bar"> |
|
|
|
<text>当前门店</text> |
|
|
|
<picker> |
|
|
|
<picker mode="selector" :range="stadiumList" range-key="name" @change="stadiumChange"> |
|
|
|
<view> |
|
|
|
<input /> |
|
|
|
<image></image> |
|
|
|
<input disabled v-model="curStadium.name" /> |
|
|
|
<image mode="aspectFit" src="/static/images/icon/arrow_c33.png"></image> |
|
|
|
</view> |
|
|
|
</picker> |
|
|
|
</view> |
|
|
|
<view class="c-scan-btn"> |
|
|
|
<image></image> |
|
|
|
<view class="c-scan-btn" @click="scanCodeBtn"> |
|
|
|
<image mode="aspectFit" src="/static/images/icon/scan_code_btn.png"></image> |
|
|
|
</view> |
|
|
|
<view class="c-verification-code"> |
|
|
|
<view><input placeholder="输入订单验证码" /></view> |
|
|
|
<view><input placeholder="输入订单验证码" v-model="iptCode" /></view> |
|
|
|
<view @click="confirmBtn">确认核销</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import util from '../../../utils/util' |
|
|
|
import util from '../../../utils/util'; |
|
|
|
import { API } from '../../../js/api'; |
|
|
|
import { servers } from '../../../js/server'; |
|
|
|
import { WRITE_OFF_STORE_NAME, WRITE_OFF_ORDER_INFO } from '../../../js/once_name'; |
|
|
|
import { mapState } from 'vuex'; |
|
|
|
export default { |
|
|
|
data(){ |
|
|
|
return { |
|
|
|
iptCode: '', |
|
|
|
stadiumList: [], |
|
|
|
curStadium: {}, |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapState([ 'brandInfo' ]), |
|
|
|
}, |
|
|
|
onLoad(){ |
|
|
|
util.$_once(WRITE_OFF_STORE_NAME, data => { |
|
|
|
this.curStadium = data.curStadium; |
|
|
|
this.stadiumList = data.stadiumList; |
|
|
|
}) |
|
|
|
console.warn(this.brandInfo) |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
confirmBtn(){ |
|
|
|
scanCodeBtn: util.debounce(function(){ |
|
|
|
uni.scanCode({ |
|
|
|
onlyFromCamera: true, |
|
|
|
scanType: 'qrCode', |
|
|
|
success: res=> { |
|
|
|
console.warn('success--->', res); |
|
|
|
if(util.changeLowerCase(res.scanType) !== 'qr_code')return util.showNone('不支持此类型!'); |
|
|
|
console.warn(res.result) |
|
|
|
this.analysisOrder({ decrypt_text: res.result }); |
|
|
|
}, |
|
|
|
fail: function(err) { |
|
|
|
util.showNone('扫码失败!'); |
|
|
|
console.warn('扫码失败--->', err); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, 300, true), |
|
|
|
stadiumChange(e){ |
|
|
|
let { stadiumList } = this; |
|
|
|
this.curStadium = stadiumList[e.detail.value]; |
|
|
|
}, |
|
|
|
confirmBtn: util.debounce(function(){ |
|
|
|
this.analysisOrder({ verify_code: this.iptCode }); |
|
|
|
return |
|
|
|
let _timeSta = new Date().getTime(); |
|
|
|
if(_timeSta%3 == 0)return util.routeTo(`/pages/write_off/confirm_order/confirm_order`, 'nT'); |
|
|
|
if(_timeSta%2 < 1)return util.routeTo(`/pages/write_off/null/null`, 'nT'); |
|
|
|
return util.routeTo(`/pages/write_off/confirm_order/confirm_order`, 'nT'); |
|
|
|
}, 300, true), |
|
|
|
|
|
|
|
analysisOrder({ verify_code, decrypt_text }){ |
|
|
|
let { curStadium, brandInfo } = this; |
|
|
|
if(!verify_code&!decrypt_text)return; |
|
|
|
let _query = { |
|
|
|
brand_id: brandInfo.brand.id, |
|
|
|
stadium_id: curStadium.id, |
|
|
|
} |
|
|
|
if(!!verify_code)_query['verify_code'] = verify_code; |
|
|
|
if(!!decrypt_text)_query['decrypt_text'] = decrypt_text; |
|
|
|
servers.get({ |
|
|
|
url: API.writeOff.enterVerifyOrder, |
|
|
|
data: _query, |
|
|
|
isDefaultGet: false |
|
|
|
}) |
|
|
|
.then(res=>{ |
|
|
|
if(res.data.code == 0){ |
|
|
|
let _data = res.data.data || {} |
|
|
|
util.$_emit(WRITE_OFF_ORDER_INFO, {..._data}) |
|
|
|
util.routeTo(`/pages/write_off/confirm_order/confirm_order`, 'nT'); |
|
|
|
}else{ |
|
|
|
if(!!verify_code)return util.routeTo(`/pages/write_off/null/null?type=${'verify_code'}`, 'nT'); |
|
|
|
if(!!decrypt_text)return util.routeTo(`/pages/write_off/null/null?type=${'decrypt_text'}`, 'nT'); |
|
|
|
} |
|
|
|
console.log('订单查询---->', res); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
@ -71,7 +143,6 @@ export default { |
|
|
|
flex-grow: 0; |
|
|
|
width: 28upx; |
|
|
|
height: 28upx; |
|
|
|
background-color: skyblue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -85,7 +156,6 @@ export default { |
|
|
|
>image{ |
|
|
|
width: 172upx; |
|
|
|
height: 172upx; |
|
|
|
background-color: skyblue; |
|
|
|
} |
|
|
|
} |
|
|
|
.c-verification-code{ |
|
|
|