diff --git a/components/YifanSelector.vue b/components/YifanSelector.vue
index 6d86d73..ca4e5e3 100644
--- a/components/YifanSelector.vue
+++ b/components/YifanSelector.vue
@@ -34,8 +34,8 @@
-
-
+
+
@@ -59,7 +59,9 @@ import PaymentPopup from '@/components/PaymentPopup.vue'
const props = defineProps({
activityId: { type: [String, Number], required: true },
issueId: { type: [String, Number], required: true },
- pricePerDraw: { type: Number, default: 0 } // 单抽价格,用于计算总价
+ pricePerDraw: { type: Number, default: 0 },
+ disabled: { type: Boolean, default: false },
+ disabledText: { type: String, default: '' }
})
const emit = defineEmits(['payment-success'])
@@ -76,6 +78,9 @@ const totalAmount = computed(() => {
return (selectedItems.value.length * props.pricePerDraw).toFixed(2)
})
+const disabled = computed(() => !!props.disabled)
+const disabledMessage = computed(() => props.disabledText || '暂不可下单')
+
watch(() => props.issueId, (newVal) => {
if (newVal) {
loadChoices()
@@ -83,6 +88,12 @@ watch(() => props.issueId, (newVal) => {
}
})
+watch(() => props.disabled, (v) => {
+ if (v && paymentVisible.value) {
+ paymentVisible.value = false
+ }
+})
+
onMounted(() => {
if (props.issueId) {
loadChoices()
@@ -136,6 +147,10 @@ function isSelected(item) {
}
function handleSelect(item) {
+ if (disabled.value) {
+ uni.showToast({ title: disabledMessage.value, icon: 'none' })
+ return
+ }
if (item.status === 'sold' || item.is_sold) {
return
}
@@ -149,12 +164,20 @@ function handleSelect(item) {
}
function handleBuy() {
+ if (disabled.value) {
+ uni.showToast({ title: disabledMessage.value, icon: 'none' })
+ return
+ }
if (selectedItems.value.length === 0) return
paymentVisible.value = true
fetchCoupons()
}
function handleRandomOne() {
+ if (disabled.value) {
+ uni.showToast({ title: disabledMessage.value, icon: 'none' })
+ return
+ }
const available = choices.value.filter(item =>
!item.is_sold && item.status !== 'sold' && !isSelected(item)
)
@@ -201,6 +224,11 @@ async function fetchCoupons() {
}
async function onPaymentConfirm(paymentData) {
+ if (disabled.value) {
+ paymentVisible.value = false
+ uni.showToast({ title: disabledMessage.value, icon: 'none' })
+ return
+ }
paymentVisible.value = false
const selectedSlots = selectedItems.value.map(item => item.id || item.position)
diff --git a/pages/activity/yifanshang/index.vue b/pages/activity/yifanshang/index.vue
index 588eec7..d0446f5 100644
--- a/pages/activity/yifanshang/index.vue
+++ b/pages/activity/yifanshang/index.vue
@@ -8,7 +8,7 @@
-
+
@@ -20,7 +20,7 @@
+
+
+
+
+
+
+
+
+
+
+ {{ item.title || '-' }}
+ BOSS
+
+ 概率 {{ formatPercent(item.percent) }}
+
+
+ 暂无奖品数据
+
+
+
diff --git a/pages/mine/index.vue b/pages/mine/index.vue
index 3a44ecf..d335080 100644
--- a/pages/mine/index.vue
+++ b/pages/mine/index.vue
@@ -589,7 +589,20 @@ export default {
uni.navigateTo({ url: '/pages/address/index' })
},
toHelp() {
- uni.showToast({ title: '功能开发中', icon: 'none' })
+ uni.showActionSheet({
+ itemList: ['购买协议', '用户协议'],
+ success: (res) => {
+ const idx = Number(res && res.tapIndex)
+ if (idx === 0) {
+ uni.navigateTo({ url: '/pages/agreement/purchase' })
+ return
+ }
+ if (idx === 1) {
+ uni.navigateTo({ url: '/pages/agreement/user' })
+ return
+ }
+ }
+ })
},
handleInvite() {
const code = this.getInviteCode()