Merge remote-tracking branch 'origin/master'

pull/5/head
YunaiV 2023-10-05 17:22:45 +08:00
commit ae95b0def7
2 changed files with 18 additions and 28 deletions

View File

@ -206,14 +206,6 @@ export function postOrderComputed(data) {
return request.post("order/computed/price", data); return request.post("order/computed/price", data);
} }
/**
* 将字符串 转base64
* @param object data
*/
export function qrcodeApi(data) {
return request.post('qrcode/str2base64', data, {}, 1);
}
/** /**
* 微信订单支付 * 微信订单支付
* @param object data * @param object data

View File

@ -66,20 +66,18 @@
</view> </view>
</view> </view>
<!-- TODO 芋艿核销的情况 -->
<view v-if="orderInfo.deliveryType === 2 && orderInfo.payStatus" class="writeOff borRadius14"> <view v-if="orderInfo.deliveryType === 2 && orderInfo.payStatus" class="writeOff borRadius14">
<view class="title">核销信息</view> <view class="title">核销信息</view>
<view class="grayBg"> <view class="grayBg">
<view class="pictrue"> <view class="pictrue">
<!-- <div class="qrcode" ref="qrcode"></div> --> <div class="qrcode" ref="qrcode"></div>
<!-- <canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}100%`, height: `${qrcodeSize}100%`}"/> --> <canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}"/>
<image :src="codeImg"></image>
</view> </view>
</view> </view>
<view class="gear"> <view class="gear">
<image src="../../static/images/writeOff.jpg"></image> <image src="../../static/images/writeOff.jpg"></image>
</view> </view>
<view class="num">{{ orderInfo.verifyCode }}</view> <view class="num">{{ orderInfo.pickUpVerifyCode }}</view>
<view class="rules" v-if='system_store.id'> <view class="rules" v-if='system_store.id'>
<view class="item"> <view class="item">
<view class="rulesTitle acea-row row-middle"> <view class="rulesTitle acea-row row-middle">
@ -259,7 +257,6 @@
</view> </view>
</template> </template>
<script> <script>
import { qrcodeApi } from '@/api/order.js';
import * as OrderApi from '@/api/trade/order.js'; import * as OrderApi from '@/api/trade/order.js';
import * as DeliveryApi from '@/api/trade/delivery.js'; import * as DeliveryApi from '@/api/trade/delivery.js';
import { openOrderRefundSubscribe } from '@/utils/SubscribeMessage.js'; import { openOrderRefundSubscribe } from '@/utils/SubscribeMessage.js';
@ -271,6 +268,8 @@
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import dayjs from '@/plugin/dayjs/dayjs.min.js'; import dayjs from '@/plugin/dayjs/dayjs.min.js';
import * as Util from '@/utils/util.js'; import * as Util from '@/utils/util.js';
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js';
export default { export default {
components: { components: {
payment, payment,
@ -291,10 +290,7 @@
// ========== ========== // ========== ==========
system_store: {}, // system_store: {}, //
qrcodeSize: 145
// TODO
codeImg: '',
qrcodeSize: 100
}; };
}, },
computed: mapGetters(['isLogin', 'chatUrl', 'userInfo']), computed: mapGetters(['isLogin', 'chatUrl', 'userInfo']),
@ -363,7 +359,7 @@
}); });
} }
if (this.orderInfo.deliveryType === 2 && this.orderInfo.payStatus) { if (this.orderInfo.deliveryType === 2 && this.orderInfo.payStatus) {
this.markCode(res.data.verifyCode); this.markCode(res.data.pickUpVerifyCode);
} }
}).catch(err => { }).catch(err => {
uni.hideLoading(); uni.hideLoading();
@ -458,19 +454,21 @@
}); });
}, },
// TODO
/** /**
* 生成二维码 * 生成核销二维码
*/ */
markCode(text) { markCode(text) {
qrcodeApi({ uQRCode.make({
height: '145', canvasId: 'qrcode',
text: text, text: text,
width: '145' size: this.qrcodeSize,
}).then(res => { margin: 10,
this.codeImg = res.data.code fail: res => {
this.$util.Tips({
title: '核销二维码生成失败!'
}); });
}
})
}, },
/** /**
* 去拼团详情 * 去拼团详情