覆盖11.20的代码
This commit is contained in:
@@ -85,7 +85,8 @@
|
||||
import {
|
||||
defineProps,
|
||||
reactive,
|
||||
ref
|
||||
ref,
|
||||
defineEmits
|
||||
} from 'vue';
|
||||
|
||||
import {
|
||||
@@ -101,6 +102,10 @@
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
detailtype: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
memberOpen: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
@@ -340,9 +345,21 @@
|
||||
phone: formInfo.telephone,
|
||||
birthDay: formInfo.birthDay
|
||||
})
|
||||
if (res.code == 0) {
|
||||
|
||||
}
|
||||
// 定义自定义事件
|
||||
let APIshopUserInfores = await APIshopUserInfo({
|
||||
shopId: uni.cache.get('shopId')
|
||||
})
|
||||
uni.cache.set('orderVIP', APIshopUserInfores)
|
||||
uni.cache.set('ordershopUserInfo', APIshopUserInfores.shopInfo)
|
||||
uni.showToast({
|
||||
title: '会员加入成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
if (props.detailtype == 'detail') {
|
||||
uni.navigateBack()
|
||||
}
|
||||
}, 1500)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
</view>
|
||||
<view class="recharge" @tap="$u.debounce(userbalancerechangesub, 500)">立即充值</view>
|
||||
</view>
|
||||
<registermember :memberOpen="infoForn.show" :shopUserInfo="infoForn.shopUserInfo">
|
||||
<registermember :memberOpen="infoForn.show" :shopUserInfo="infoForn.shopUserInfo" :detailtype='detailtype' >
|
||||
</registermember>
|
||||
</view>
|
||||
|
||||
@@ -159,6 +159,7 @@
|
||||
infoForn.listdata = res;
|
||||
infoForn.couponList = infoForn.listdata[0].couponList;
|
||||
infoForn.giftAmount = infoForn.listdata[0].giftAmount
|
||||
infoForn.id = infoForn.listdata[0].id
|
||||
if (infoForn.type == 'topUpActivity') {
|
||||
infoForn.amountChange()
|
||||
} else {
|
||||
@@ -288,11 +289,11 @@
|
||||
|
||||
// 充值金额切换
|
||||
const clickinput = (a, b) => {
|
||||
console.log(a, b)
|
||||
infoForn.inputshow = b;
|
||||
infoForn.couponList = a.couponList;
|
||||
infoForn.amount = a.amount;
|
||||
infoForn.giftAmount = a.giftAmount;
|
||||
infoForn.id = a.id;
|
||||
}
|
||||
|
||||
// 充值
|
||||
@@ -319,8 +320,17 @@
|
||||
});
|
||||
return false;
|
||||
}
|
||||
console.log({
|
||||
shopId: infoForn.shopId,
|
||||
activateId: infoForn.id,
|
||||
shopUserId: infoForn.userInfo.id,
|
||||
amount: infoForn.amount, //金额
|
||||
returnUrl: '', //跳转地址
|
||||
buyerRemark: ''
|
||||
})
|
||||
let res = await store.actionspayltPayVip({
|
||||
shopId: infoForn.shopId,
|
||||
activateId: infoForn.id,
|
||||
shopUserId: infoForn.userInfo.id,
|
||||
amount: infoForn.amount, //金额
|
||||
returnUrl: '', //跳转地址
|
||||
@@ -329,6 +339,19 @@
|
||||
console.log(res)
|
||||
}
|
||||
|
||||
// 会员总信息
|
||||
const asyncshopUserInfo = async () => {
|
||||
let res = await APIshopUserInfo({
|
||||
shopId: uni.cache.get('shopId')
|
||||
})
|
||||
uni.cache.set('orderVIP', res)
|
||||
uni.cache.set('ordershopUserInfo', res.shopInfo)
|
||||
infoForn.show = res.isVip == 1 ? false : true
|
||||
|
||||
}
|
||||
|
||||
const detailtype = ref('')
|
||||
|
||||
onMounted(async () => {
|
||||
// 获取当前页面栈
|
||||
const pages = getCurrentPages();
|
||||
@@ -349,21 +372,17 @@
|
||||
// }
|
||||
// uni.cache.set('shopId', infoForn.shopId)
|
||||
// // #endif
|
||||
|
||||
|
||||
if (options.shopId) {
|
||||
uni.cache.set('shopId', options.shopId, 30)
|
||||
infoForn.shopId = options.shopId ? options.shopId : uni.cache.get('shopId')
|
||||
let resone = await APIusershopInfodetail({
|
||||
shopId: options.shopId
|
||||
})
|
||||
infoForn.shopUserInfo = resone.shopInfo
|
||||
|
||||
// 根据传的shopInfo来返回上面的值
|
||||
infoForn.userInfo = await APIshopUserInfo({
|
||||
shopId: options.shopId
|
||||
})
|
||||
infoForn.show == infoForn.userInfo.isVip == 1 ? true : false
|
||||
|
||||
asyncshopUserInfo()
|
||||
}
|
||||
if (options.type == 'detail') {
|
||||
detailtype.value = 'detail'
|
||||
}
|
||||
if (options.type) {
|
||||
infoForn.type = options.type
|
||||
|
||||
@@ -159,6 +159,18 @@
|
||||
this.init()
|
||||
}
|
||||
|
||||
// 会员总信息
|
||||
const asyncshopUserInfo = async () => {
|
||||
let res = await APIshopUserInfo({
|
||||
shopId: shopUserInfo.shopId
|
||||
})
|
||||
uni.cache.set('orderVIP', res)
|
||||
uni.cache.set('ordershopUserInfo', res.shopInfo)
|
||||
form.memberOpen = res.isVip == 1 ? false : true
|
||||
|
||||
}
|
||||
|
||||
|
||||
onMounted(async () => {
|
||||
// 获取当前页面栈
|
||||
const pages = getCurrentPages();
|
||||
@@ -171,16 +183,17 @@
|
||||
const currentPage = pages[pages.length - 1];
|
||||
// 获取页面参数
|
||||
const pageParams = currentPage.options;
|
||||
let res = await APIusershopInfodetail({
|
||||
shopId: pageParams.shopId
|
||||
})
|
||||
// 根据传的shopInfo来返回上面的值
|
||||
shopUserInfo.shopInfo = await APIshopUserInfo({
|
||||
shopId: pageParams.shopId
|
||||
})
|
||||
shopUserInfo.shopExtend = res.shopExtend.member_bg
|
||||
shopUserInfo.shopId = pageParams.shopId
|
||||
form.memberOpen = shopUserInfo.shopInfo.isVip == 1 ? false : true
|
||||
if (pageParams.shopId) {
|
||||
asyncshopUserInfo()
|
||||
uni.cache.set('shopId', pageParams.shopId, 30)
|
||||
let res = await APIusershopInfodetail({
|
||||
shopId: pageParams.shopId
|
||||
})
|
||||
// 根据传的shopInfo来返回上面的值
|
||||
shopUserInfo.shopExtend = res.shopExtend.member_bg
|
||||
shopUserInfo.shopId = pageParams.shopId
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -59,36 +59,42 @@
|
||||
console.log(formInfo.shopInfo)
|
||||
if (res) {
|
||||
formInfo.url = res;
|
||||
nextTick(() => {
|
||||
const barcodeText = '1234567890';
|
||||
const query = uni.createSelectorQuery();
|
||||
query.select('#barcodeCanvas')
|
||||
.fields({ node: true, size: true })
|
||||
.exec((res) => {
|
||||
if (res[0]) {
|
||||
const canvas = res[0].node;
|
||||
const ctx = canvas.getContext('2d');
|
||||
const dpr = uni.getSystemInfoSync().pixelRatio;
|
||||
canvas.width = res[0].width * dpr;
|
||||
canvas.height = res[0].height * dpr;
|
||||
ctx.scale(dpr, dpr);
|
||||
|
||||
JsBarcode(canvas, barcodeText, {
|
||||
width: 2,
|
||||
height: 100,
|
||||
displayValue: true,
|
||||
fontOptions: 'bold',
|
||||
font: 'monospace',
|
||||
textAlign: 'center',
|
||||
textPosition: 'bottom',
|
||||
textMargin: 2,
|
||||
fontSize: 20,
|
||||
background: '#ffffff',
|
||||
lineColor: '#000000'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
try {
|
||||
nextTick(() => {
|
||||
const query = uni.createSelectorQuery();
|
||||
query.select('#barcodeCanvas')
|
||||
.fields({
|
||||
node: true,
|
||||
size: true
|
||||
})
|
||||
.exec((res) => {
|
||||
if (res[0]) {
|
||||
const canvas = res[0].node;
|
||||
const ctx = canvas.getContext('2d');
|
||||
const dpr = uni.getSystemInfoSync().pixelRatio;
|
||||
canvas.width = res[0].width * dpr;
|
||||
canvas.height = res[0].height * dpr;
|
||||
ctx.scale(dpr, dpr);
|
||||
|
||||
JsBarcode(canvas, formInfo.url, {
|
||||
width: 2,
|
||||
height: 100,
|
||||
displayValue: true,
|
||||
fontOptions: 'bold',
|
||||
font: 'monospace',
|
||||
textAlign: 'center',
|
||||
textPosition: 'bottom',
|
||||
textMargin: 2,
|
||||
fontSize: 20,
|
||||
background: '#ffffff',
|
||||
lineColor: '#000000'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user