Commit 47ce31de authored by xieyishang's avatar xieyishang

~~~~

parent 8f1f1351
......@@ -21,6 +21,7 @@
"element-plus": "2.8.4",
"nprogress": "0.2.0",
"pinyin-match": "^1.2.4",
"qr-code-styling": "^1.9.1",
"qrcodejs2": "0.0.2",
"sortablejs": "1.15.0",
"vue": "^3.4.21",
......
......@@ -37,6 +37,13 @@ export default {
post: async function(params){
return await http.post(this.url, params);
}
},
nativepc:{
url: `${config.API_URL_TWO}wechat/pay/nativepc`,
name: "支付订单",
post: async function(params){
return await http.post(this.url, params);
}
},
}
}
\ No newline at end of file
<template>
<div ref="qrcode" class="qrcodetags">
</div>
</template>
<script>
import QRCodeStyling from "qr-code-styling";
export default {
name: "QrCode",
props: {
value: {
type: String,
required: true
},
width: {
type: Number,
default: 200
}
},
data() {
return {
qrCode: null // 用于存储二维码实例
};
},
mounted() {
// this.initQRCode();
},
methods: {
initQRCode() {
console.info("initQRCode");
if (this.qrCode) {
this.qrCode.clear(); // 清除已存在的二维码
}
this.qrCode = new QRCodeStyling({
width: this.width,
data: this.value,
image: "", // 如果你想添加logo到二维码中间,可以在这里提供图片URL
dotsOptions: {
color: "#000000"
},
backgroundOptions: {
color: "#ffffff"
},
imageOptions: {
crossOrigin: "anonymous",
margin: 10
}
});
this.qrCode.append(this.$refs.qrcode);
},
updateQRCode(newValue) {
if (this.qrCode) {
this.qrCode.update({ data: newValue }); // 更新二维码的数据
} else {
this.initQRCode(); // 如果还没有初始化,则初始化
}
}
},
watch: {
value(newVal, oldVal) {
if (newVal !== oldVal) {
this.updateQRCode(newVal);
}
}
},
beforeDestroy() {
if (this.qrCode) {
this.qrCode.clear(); // 在组件销毁前清除二维码
}
}
};
</script>
<style scoped>
.qrcodetags{
margin: 0 auto;
width: 200px;
/* height: 200px; */
}
</style>
\ No newline at end of file
......@@ -14,6 +14,8 @@ const DEFAULT_CONFIG = {
//接口地址
API_URL: "https://juwu.xicheda.cn/admin/",
API_URL_TWO: "https://juwu.xicheda.cn/api/",
//请求超时
TIMEOUT: 50000,
......
......@@ -312,3 +312,7 @@ text-align: center;
}
}
}
.qrcodepup{
text-align: center;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment