This commit is contained in:
zpc 2025-04-12 17:34:50 +08:00
parent d97bb20ac0
commit 8fae667f64
5 changed files with 300 additions and 186 deletions

View File

@ -0,0 +1,212 @@
<!-- 修改为水平滚动的按钮布局 -->
<template>
<view class="ft-fixed">
<scroll-view class="button-scroll" scroll-x show-scrollbar="false" enhanced>
<view class="button-container">
<!-- 按钮1 -->
<view v-if="checkVisible(1)" class="btn common_bg column center"
:style="{ backgroundImage: `url(${$img1('common/chouBtn1.png')})` }" @click="handleButtonClick(1)">
</view>
<!-- 按钮3 -->
<view v-if="checkVisible(3)" class="btn common_bg column center"
:style="{ backgroundImage: `url(${$img1('common/chouBtn3.png')})` }" @click="handleButtonClick(3)">
</view>
<!-- 按钮5 -->
<view v-if="checkVisible(5)" class="btn common_bg column center"
:style="{ backgroundImage: `url(${$img1('common/chouBtn5.png')})` }" @click="handleButtonClick(5)">
</view>
<!-- 按钮10 (仅在无限模式显示) -->
<view v-if="isWuxian && checkVisible(10)" class="btn common_bg column center"
:style="{ backgroundImage: `url(${$img1('common/chouBtn10.png')})` }" @click="handleButtonClick(10)">
</view>
<!-- 无限抽 -->
<view v-if="isWuxian && checkVisible(-1)" class="btn common_bg column center"
style="background-color: #333333;border-radius: 15rpx;color: #CDEF27;font-size: 24rpx;font-family: PingFangSC, PingFang SC;letter-spacing: 2rpx;"
@click="handleButtonClick(-1)">
{{ wxtext }}
</view>
<!-- 全部按钮 (仅在非无限模式显示) -->
<view v-if="!isWuxian && checkVisible(0) && pageData.goods && pageData.goods.type != 5"
class="btn common_bg column center" :style="{ backgroundImage: `url(${$img1('common/chouBtnAll.png')})` }"
@click="handleButtonClick(0)">
</view>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
name: 'DetailButton',
props: {
pageData: {
type: Object,
default: () => ({})
},
isWuxian: {
type: Boolean,
default: false
},
checkButtonVisible: {
type: Function,
default: null
}
},
data() {
return { wxtext: '十连抽' };
},
methods: {
handleButtonClick(num) {
console.log(num);
if (num == -1) {
this.$emit('button-wx-click', [0, buyNum]);
if (this.wxtext == "十连抽") {
this.wxtext = "停止";
} else {
this.wxtext = "十连抽";
}
return;
}
// ""使
let buyNum = num === 0 ? this.pageData.goods.goodslist_surplus_stock : num;
this.$emit('button-click', [0, buyNum]);
},
checkVisible(num) {
if (num == -1) {
if (this.pageData != null && this.pageData.limitInfo != null) {
if (this.pageData.limitInfo.user_test == 2) {
return true;
}
}
return false;
}
if (num == 1) {
return true;
}
if (this.pageData != null && this.pageData.limitInfo != null) {
let limitInfo = this.pageData.limitInfo;
if (limitInfo.global_limit > 0) {
if (num == 0) {
return false;
}
if (limitInfo.user_global_remaining < num) {
return false;
}
} else if (limitInfo.daily_limit > 0) {
if (num == 0) {
return false;
}
if (limitInfo.user_daily_remaining < num) {
return false;
}
}
}
if (this.pageData.goods != null) {
if (this.pageData.goods.quanju_xiangou > 0) {
if (num == 0) {
return false;
}
if (this.pageData.goods.quanju_xiangou < num) {
return false;
}
} else
if (this.pageData.goods.daily_xiangou > 0) {
if (num == 0) {
return false;
}
if (this.pageData.goods.daily_xiangou < num) {
return false;
}
}
}
if (this.isWuxian) {
return true; //
} else {
if (num === 0) {
// ""
return this.getBtnXianShi(0);
} else {
return this.getBtnXianShi(num);
}
}
},
getBtnXianShi(num) {
// 使
if (this.checkButtonVisible) {
return this.checkButtonVisible(num);
}
//
if (!this.pageData || !this.pageData.goods) return false;
//
if (num === 0) return true;
//
if (this.pageData.goods.goodslist_surplus_stock < num) return false;
return true;
}
}
}
</script>
<style lang="scss" scoped>
.ft-fixed {
position: fixed;
z-index: 10;
left: 0;
bottom: 0;
width: 100%;
background: #FFFFFF;
padding-top: 20rpx;
padding-bottom: 30rpx;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
}
.button-scroll {
width: 100%;
white-space: nowrap;
&::-webkit-scrollbar {
display: none;
}
}
.button-container {
display: inline-flex;
// padding: 0 30rpx;
min-width: 100%;
justify-content: space-evenly;
align-items: center;
}
.btn {
width: 120rpx;
height: 68rpx;
position: relative;
margin: 0 12rpx;
flex-shrink: 0;
background-size: 100% 100% !important;
transition: transform 0.15s ease;
&:active {
transform: scale(0.95);
}
>view {
white-space: nowrap;
font-family: YouSheBiaoTiHei;
font-weight: 400;
font-size: 52rpx;
color: #FFFFFF;
position: relative;
text-shadow: #000 1px 0 0, #000 0 1px 0, #000 -1px 0 0, #000 0 -1px 0;
}
}
</style>

View File

@ -98,9 +98,6 @@
<image v-else :src="$img1('common/check.png')" lazy-load></image>
</view>
</view>
<view class="pay-type" v-if="pay_currency2" @click="changePayMethod('useMoney2')">
<view class="title flex align-center">
使用{{ currencyName2 }}{{ deduction_name }}¥{{ (orderData.use_score / 100).toFixed(2) }} <text

View File

@ -151,7 +151,7 @@
<view v-if="tabList[tabCur].id == 1" class="bt-fixed">
<template v-if="subTab[subTabCur].id != 4">
<view v-if="subTab[subTabCur].id != 6 && listData.length && is_exchange=='1'" class="btn center"
@click="open('changePop')">兑换</view>
@click="open('changePop')">达达卷</view>
<view v-if="subTab[subTabCur].id != 2" class="btn2 center" @click="open('sendPop')">发货</view>
<view v-if="subTab[subTabCur].id != 6" class="btn center" @click="open('model')">上锁</view>
</template>
@ -179,21 +179,16 @@
<view class="goods-item" v-for="(item, i) in handelList" :key="i">
<view class="pic">
<image :src="item.goodslist_imgurl" lazy-load></image>
<!-- <view class="type">{{ item.shang_title }}</view> -->
<view class="num center">{{ item.chooseNum }}</view>
</view>
<view class="title hang1">
{{ item.goodslist_title }}
</view>
<!-- <view class="price">
兑换价:{{ item.goodslist_money * item.chooseNum }}
</view> -->
</view>
</scroll-view>
<!-- <view class="bd-bt">
共计可兑换:
<text>{{ totalChangeMoney }}</text>
</view> -->
</view>
<view class="align-center justify-center mt30"
style="background-color: #FFFFFF; height: 82rpx; border-radius: 16rpx;">
@ -201,6 +196,7 @@
<text style="color: #333333;">{{nowChooseNum}}</text>
件物品合计兑换<text style="color: #333333;"></text>
<text style="color: #333333; font-size: 30rpx;">{{totalChangeMoney}}</text>
<text style="">{{ this.$config.getAppSetting('currency2_name') }}</text>
</view>
</view>
<view class="change-pop-ft" @click="$c.noDouble(submitChange)">
@ -275,12 +271,7 @@
</view>
</view>
</view>
<!-- <view class="remark border">
<view class="remark-title">备注</view>
<view class="textarea">
<textarea v-model="remark" placeholder="请输入备注说明" />
</view>
</view> -->
<view class="agree" @click="isAgree = !isAgree">
<view class="icon">
<image v-if="isAgree" :src="$img1('common/check_act.png')" lazy-load></image>

View File

@ -116,24 +116,14 @@
</mescroll-body>
</template>
<view v-if="pageData" class="ft-fixed justify-evenly">
<view class="btn common_bg column center" v-if="getBtnXianShi(1)"
:style="{ backgroundImage: `url(${$img1('common/chouBtn1.png')})` }" @click="confirmSubmit([0, 1])">
</view>
<view class="btn common_bg column center" v-if="getBtnXianShi(3)"
:style="{ backgroundImage: `url(${$img1('common/chouBtn3.png')})` }" @click="confirmSubmit([0, 3])">
</view>
<view class="btn common_bg column center" v-if="getBtnXianShi(5)"
:style="{ backgroundImage: `url(${$img1('common/chouBtn5.png')})` }" @click="confirmSubmit([0, 5])">
</view>
<view class="btn common_bg column center" v-if="pageData.goods.type != 5 && getBtnXianShi(0)"
:style="{ backgroundImage: `url(${$img1('common/chouBtnAll.png')})` }"
@click="confirmSubmit([0, pageData.goods.goodslist_surplus_stock])">
</view>
</view>
<detail-button
v-if="pageData"
:pageData="pageData"
:isWuxian="false" @button-click="confirmSubmit"
></detail-button>
<!-- 确认订单弹窗 -->
<order-confirm-popup ref="buyPop" :order-data="orderData" :page-data="pageData" :use-money="useMoney"
<order-confirm-popup ref="buyPop" v-if="orderData" :order-data="orderData" :page-data="pageData" :use-money="useMoney"
:use-money2="useMoney2" :use-integral="useIntegral" :coupon-data="couponData" :is-agree="isAgree"
:send-rule-data="sendRuleData" :buy-num="buyNum" @close="close('buyPop')" @change-pay="changePay"
@toggle-agree="isAgree = !isAgree" @to-coupon="toCoupon"
@ -189,11 +179,13 @@
<script>
import OrderConfirmPopup from '@/components/order-confirm-popup/order-confirm-popup.vue'
import DetailListItem from '@/components/detail-list-item/detail-list-item.vue'
import DetailButton from '@/components/detail-button/detail-button.vue'
export default {
components: {
OrderConfirmPopup,
DetailListItem
DetailListItem,
DetailButton
},
data() {
return {
@ -429,11 +421,7 @@ export default {
return;
}
}
if (!this.getBtnXianShi(0)) {
this.useMoney = false;
this.useIntegral = false;
this.useMoney2 = false;
}
this.buyNum = num;
let coupon_id = (this.couponData && this.couponData.id) || ''
if (coupon_id != '' && this.useIntegral) {
@ -657,30 +645,7 @@ export default {
},
});
},
getBtnXianShi(type) {
if (this.pageData == null || this.pageData["xuangou"] == null) {
// this.pageData
return true;
}
let xuangou = this.pageData["xuangou"];
if (xuangou.quanju_xiangou == 0) {
return true;
}
if (type == 0) {
return false;
}
if (type == 1) {
return true;
}
let yuxia = xuangou.quanju_xiangou - xuangou.user_xiangou_count;
console.log(yuxia);
if (yuxia >= type) {
return true;
}
return false;
},
close(e) {
console.log('关闭弹窗:', e, this.$refs[e]);
if (e === 'buyPop') {

View File

@ -1,8 +1,3 @@
<!--
* @Date: 2023-11-13 15:46:52
* @LastEditTime: 2024-03-09 14:08:27
* @Description: content
-->
<template>
<view class="content minHeight100">
<view class="navLeft align-center" :style="{ top: $sys().statusBarHeight + 'px' }" @tap="$c.back(1)">
@ -152,11 +147,8 @@
</view>
</view>
</view>
<!-- 中赏记录 -->
<template v-if="tabCur == 2">
<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="getLog" :down="downOption"
:up="upOption">
<scroll-view class="sub-tab" scroll-x>
@ -200,39 +192,8 @@
</mescroll-body>
</template>
<!-- <view class="fixed-btns">
<view class="btn" @click="doRefresh">
<image :src="$img('/static/img/refresh.png')" lazy-load></image>
</view>
<view class="btn relative">
<button class="hide" open-type="share"></button>
<image :src="$img('/static/img/share.png')" lazy-load></image>
</view>
<view class="btn" @click="toBag">
<image :src="$img('/static/img/bag.png')" lazy-load></image>
</view>
</view> -->
<view v-if="pageData" class="ft-fixed justify-evenly">
<view class="btn common_bg column center"
:style="{ backgroundImage: `url(${$img1('common/chouBtn1.png')})` }" @click="confirmSubmit([0, 1])">
<!-- <view>冲一发</view> -->
</view>
<view class="btn common_bg column center"
:style="{ backgroundImage: `url(${$img1('common/chouBtn3.png')})` }" @click="confirmSubmit([0, 3])">
<!-- <view>冲三发</view> -->
</view>
<view class="btn common_bg column center"
:style="{ backgroundImage: `url(${$img1('common/chouBtn5.png')})` }" @click="confirmSubmit([0, 5])">
<!-- <view>冲五发</view> -->
</view>
<view class="btn common_bg column center"
:style="{ backgroundImage: `url(${$img1('common/chouBtn10.png')})` }" @click="confirmSubmit([0, 10])">
<!-- <view>冲十发</view> -->
</view>
</view>
<detail-button v-if="pageData" :pageData="pageData" :isWuxian="true" @button-click="confirmSubmit"
@button-wx-click="wuxianchou"></detail-button>
<uni-popup ref="resPop" type="center" mask-background-color="rgba(0,0,0,0.8)">
<view class="res-pop common_bg column center" @click="close('resPop')">
@ -254,13 +215,6 @@
<view class="title hang1" style="text-align: center;">
<text> {{ item.goodslist_title }}</text>
</view>
<!-- <view class="exchange">
{{
item.goodslist_money * 1 > 0
? `可兑换:${item.goodslist_money}`
: `不可兑换`
}}
</view> -->
</view>
</view>
</scroll-view>
@ -448,10 +402,12 @@
<script>
import OrderConfirmPopup from '@/components/order-confirm-popup/order-confirm-popup.vue'
import DetailListItem from '@/components/detail-list-item/detail-list-item.vue'
import DetailButton from '@/components/detail-button/detail-button.vue'
export default {
components: {
OrderConfirmPopup,
DetailListItem
DetailListItem,
DetailButton
},
data() {
return {
@ -607,7 +563,7 @@ export default {
imgurl: a.imgurl,
title: a.title,
// shang_title: item.shang_title,
pro: '概率:' + this.$c.removeTrailingZeros(a.real_pro) +'%',
pro: '概率:' + this.$c.removeTrailingZeros(a.real_pro) + '%',
shang_info: {
title: item.shang_title,
color: item.shang_color
@ -731,10 +687,7 @@ export default {
return
}
// this.aniShow = true
// setTimeout(() => {
// this.aniShow = false
this.bgmCtx.openBgm.stop()
this.bgmCtx.openBgm.play()
this.open('resPop')
// }, 1300)
@ -748,7 +701,7 @@ export default {
if (type === 'useMoney') {
this.useMoney = !this.useMoney;
} else if (type === 'useIntegral') {
if (this.couponData!=null&&this.couponData.id!='') {
if (this.couponData != null && this.couponData.id != '') {
this.couponData = null;
}
this.useIntegral = !this.useIntegral;
@ -786,7 +739,7 @@ export default {
}
this.buyNum = num;
let coupon_id = (this.couponData && this.couponData.id) || ''
if (coupon_id != '' && this.useIntegral) {
this.useIntegral = false;
@ -1062,8 +1015,69 @@ export default {
return "#FFEFB4";
break;
}
}
},
async wuxianchou() {
this.useMoney = true;
this.useIntegral = false;
this.useMoney2 = false;
if (this.choujiangloading) {
this.choujiangloading = false;
} else {
this.choujiangloading = true;
this.wuxianchou1();
}
},
async wuxianchou1() {
uni.showLoading({
title: '加载中'
});
let url = 'infinite_orderbuy'
this.buyNum = 10;
const { status, data, msg } = await this.req({
url,
data: {
goods_id: this.pageData.goods.id,
prize_num: this.buyNum,
use_money_is: this.useMoney ? 1 : 2,
use_integral_is: this.useIntegral ? 1 : 2,
use_money2_is: this.useMoney2 ? 1 : 2,
coupon_id: 0,
}
});
if (status == 0) {
this.$c.msg(msg);
return;
}
if (status == 1) {
if (data.status == 1) {
const status = await this.$c.wxMpPay({
data: data.res
})
if (status == 'success') {
this.getPrize(data.order_num)
}
} else {
this.$c.toast({
title: msg,
duration: 500,
success: () => {
this.getPrize(data.order_num)
setTimeout(() => {
if (this.choujiangloading) {
this.close('resPop');
this.wuxianchou1();
}
}, 2000)
}
})
}
}
}
}
}
</script>
@ -1779,71 +1793,6 @@ export default {
}
}
.ft-fixed {
position: fixed;
z-index: 10;
left: 0;
bottom: 0;
width: 100%;
display: flex;
flex-flow: row wrap;
justify-content: center;
padding-bottom: 50rpx;
background: #FFFFFF;
padding-top: 20rpx;
.lt-btn {
width: 690rpx;
height: 80rpx;
background: linear-gradient(90deg, #2dcbff 0%, #ff95fb 100%);
border-radius: 40rpx;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20rpx;
font-size: 32rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #ffffff;
}
.btn {
width: 120rpx;
height: 68rpx;
position: relative;
>view {
white-space: nowrap;
font-family: YouSheBiaoTiHei;
font-weight: 400;
font-size: 52rpx;
color: #FFFFFF;
position: relative;
text-shadow: #000 1px 0 0, #000 0 1px 0, #000 -1px 0 0, #000 0 -1px 0;
// &::before {
// content: '';
// position: absolute;
// bottom: 10rpx;
// left: -8rpx;
// width: 22rpx;
// height: 22rpx;
// background: url($imgurl+'common/jiantou1.png') no-repeat 0 0 / 100% 100%;
// }
// &::after {
// content: '';
// position: absolute;
// top: 0rpx;
// right: -10rpx;
// width: 22rpx;
// height: 22rpx;
// background: url($imgurl+'common/jiantou2.png') no-repeat 0 0 / 100% 100%;
// }
}
}
}
.res-pop {
width: 100%;
height: 100vh;