|
@@ -2,12 +2,12 @@
|
|
|
<div class="check-container">
|
|
|
<div class="width-335">
|
|
|
<p class="status-wrap">
|
|
|
- <span>04月19日 周一 19:45</span>
|
|
|
- <span>已支付</span>
|
|
|
+ <span>{{ objPlaceCheck.order_pre_time }}</span>
|
|
|
+ <span>{{ ['待支付', '已支付', '已退款', '部分退款', '已取消'][objPlaceCheck.order_status] }}</span>
|
|
|
</p>
|
|
|
- <p class="place-name">10人卡座(舞台左侧)</p>
|
|
|
- <p class="outlet">AF House音乐现场(西子广场山姆会员店)</p>
|
|
|
- <p class="count">订位人数:1</p>
|
|
|
+ <p class="place-name">{{ objPlaceCheck.place_name }}</p>
|
|
|
+ <p class="outlet">{{ objPlaceCheck.bar_name }}</p>
|
|
|
+ <p class="count">订位人数:{{ objPlaceCheck.order_user_num }}</p>
|
|
|
</div>
|
|
|
<div class="line-wrap">
|
|
|
<div class="left-circle"></div>
|
|
@@ -15,15 +15,65 @@
|
|
|
<div class="right-circle"></div>
|
|
|
</div>
|
|
|
<div class="code">
|
|
|
- <img src="" alt="">
|
|
|
+ <img :src="codeUrl" alt="">
|
|
|
</div>
|
|
|
- <p class="tip">二维码编号:DZ-202104191945-001</p>
|
|
|
+ <p class="tip">二维码编号:{{ objPlaceCheck.order_number }}</p>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { Dialog } from 'vant'
|
|
|
+import QRCode from 'qrcodejs2'
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
+
|
|
|
export default {
|
|
|
- name: 'index'
|
|
|
+ name: 'index',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ codeUrl: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ objPlaceCheck: 'placeCheck/objPlaceCheck'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async mounted () {
|
|
|
+ await this.$nextTick()
|
|
|
+ this.createQRCode()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ createQRCode () {
|
|
|
+ const orderNumber = this.objPlaceCheck.order_number
|
|
|
+ if (!orderNumber) {
|
|
|
+ Dialog.alert({
|
|
|
+ title: '提示',
|
|
|
+ message: '订单编号不存在, 点击:我的订座 - 我的订座二维码,然后重试',
|
|
|
+ messageAlign: 'left'
|
|
|
+ }).then(() => {
|
|
|
+ this.$router.replace({ name: 'PlaceReserve' })
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.qrcode) {
|
|
|
+ this.qrcode = new QRCode('af-qrcode', {
|
|
|
+ width: 140,
|
|
|
+ height: 140,
|
|
|
+ text: orderNumber,
|
|
|
+ colorDark: '#000',
|
|
|
+ colorLight: '#fff'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.qrcode.clear()
|
|
|
+ this.qrcode.makeCode(orderNumber)
|
|
|
+ }
|
|
|
+ this.codeUrl = ''
|
|
|
+ setTimeout(() => {
|
|
|
+ const canvas = document.getElementById('af-qrcode').getElementsByTagName('canvas')[0]
|
|
|
+ this.codeUrl = canvas.toDataURL('image/png', 1)
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|