兑换记录

This commit is contained in:
duan 2025-01-15 14:49:27 +08:00
parent 1b0279655d
commit e5842b6429
5 changed files with 147 additions and 18 deletions

View File

@ -25,7 +25,14 @@ export const courseselectCourse = (data) => {
data
})
}
// 兑换
export const userPrizeExchangeexchange = (data) => {
return http.request({
url: '/userPrizeExchange/exchange',
data,
method:'post'
})
}
// 搜索
export const selectCourseTitles = (data) => {
return http.request({

View File

@ -202,6 +202,13 @@
{
"navigationBarTitleText" : "我的奖励"
}
},
{
"path" : "pages/index/prizeDraw/duihuan",
"style" :
{
"navigationBarTitleText" : "兑换"
}
}
],
"globalStyle": {

View File

@ -6,17 +6,18 @@
v-for="(item, index) in datas.tab" :key="index">{{ item.label }}</view>
</view>
<view class="item" v-for="(item, index) in datas.list" :key="index">
<view class="color-666 u-font-24">中奖时间 {{item.drawDay}}</view>
<view class="color-666 u-font-24">{{datas.tabIndex==1?'中奖时间':'兑换时间'}} {{item.createTime}}</view>
<view class="u-m-t-24 u-flex u-row-between">
<view class="u-flex-1 u-flex u-col-top">
<u-image width="128rpx" height="128rpx" src="@/static/index/redPack.png"></u-image>
<view class="u-m-l-16">
<view>大额红包</view>
<view class="color-999 u-font-24 u-m-t-16">×1</view>
<view v-if="datas.tabIndex == 1">{{item.name}}</view>
<view v-else>{{item.prizeName}}</view>
<view v-if="datas.tabIndex == 1" class="color-999 u-font-24 u-m-t-16">×{{item.number}}</view>
</view>
</view>
<view class="">
<!-- <view class="btn-circle duihuan" @click="toDuiHuan(item)">立即兑换</view> -->
<view class="" v-if="datas.tabIndex==1&&!item.targetId&&item.type==3">
<view class="btn-circle duihuan" @click="toDuiHuan(item)">立即兑换</view>
</view>
</view>
</view>
@ -86,10 +87,10 @@
}
} else {
if (datas.page == 1) {
datas.list = res.page.list;
datas.list = res.list;
} else {
if (res.records.length) {
datas.list.push(...datas.list, res.records)
datas.list.push(...datas.list, res.list)
}
}
// datas.total = res.page.totalCount;
@ -106,8 +107,8 @@
//
function toDuiHuan(item) {
uni.navigateTo({
url: `/me/gift/duihuan?source=${this.query.source}&id=${item.id}`
});
url: `/pages/index/prizeDraw/duihuan?id=${item.id}`
})
}
</script>

View File

@ -0,0 +1,110 @@
<template>
<view class="min-page bg-gray u-font-28">
<view class="block bg-fff border-r-18 default-box-padding">
<view>
<view>中奖用户手机号</view>
<view class="border u-m-t-24 u-p-l-24" style="margin-bottom: 20rpx;">
<u-input v-model="datas.query.phone" type="number" maxlength="11"
placeholder="请输入中奖用户手机号"></u-input>
</view>
<view>收货地址</view>
<view class="border u-m-t-24 u-p-l-24" style="margin-bottom: 20rpx;">
<u-input v-model="datas.query.address" type="text" placeholder="请输入收货地址"></u-input>
</view>
<view>备注</view>
<view class="border u-m-t-24 u-p-l-24">
<u-input v-model="datas.query.remark" type="text" placeholder="请输入备注"></u-input>
</view>
</view>
<view class="u-m-t-48">
<view>兑换事项</view>
<view class="u-m-t-16 color-999">
请认真核实兑换账号一但兑换成功后不予退换
</view>
</view>
</view>
<view class="u-flex u-row-center">
<view class="btn-circle duihuan" @click="exchange">确认兑换</view>
</view>
</view>
</template>
<script setup>
import {
reactive
} from 'vue'
import {
onLoad
} from '@dcloudio/uni-app'
import {
userPrizeExchangeexchange
} from '@/api/index/index.js'
let datas = reactive({
query: {
foreignId: null,
foreignType: 'spinning',
phone: "",
address: "",
remark: "",
}
})
onLoad(options => {
if (options.id) {
datas.query.foreignId = options.id
}
if (options.foreignType) {
datas.query.foreignType = options.foreignType
}
})
async function exchange() {
let url = ""
if (!datas.query.phone) {
uni.showToast({
title: '请输入中奖用户手机号',
icon: 'none'
});
return;
}
if (!datas.query.address) {
uni.showToast({
title: '请输入中奖用户地址',
icon: 'none'
});
return;
}
let res = await userPrizeExchangeexchange(datas.query)
uni.showToast({
title: '兑换成功',
icon: 'none'
});
setTimeout(() => {
uni.navigateBack()
}, 1200)
}
</script>
<style lang="scss" scoped>
.border {
border: 1px solid #999999;
border-radius: 12rpx 12rpx 12rpx 12rpx;
}
.duihuan {
background: #ED838A;
width: 556rpx;
padding: 18rpx 0;
text-align: center;
font-size: 32rpx;
font-weight: bold;
color: #fff;
margin-top: 84rpx;
}
.min-page {
padding: 32rpx 20rpx;
}
</style>

View File

@ -3,7 +3,7 @@
<view class="t-bg" style="">
<image class="t-wan" src="./luck/wenan.png"></image>
<image class="t-wan-lp" src="./luck/hengfu.png"></image>
<view class="t-choujiang t-flex-row" >
<view class="t-choujiang t-flex-row">
<l-dialer :prizeList="list" @click="onClick" @done="onDone" ref="dialer" />
</view>
</view>
@ -24,7 +24,7 @@
<view class="t-r-title t-flex-row">活动规则</view>
<view class="t-rule">
<text>1.抽奖细则每日前{{ freeNumDay }}次付款均可获得抽奖机会</text>
<text>2.奖励说明红包奖励将自动发放到红包余额已绑定支付宝账号将会自动发起提现其余奖品则需联系客服领取</text>
<text>2.奖励说明红包奖励将自动发放到红包余额已绑定银行卡账号将会自动发起提现其余奖品则需联系客服领取</text>
</view>
</view>
</view>
@ -38,7 +38,7 @@
<view class="t-xxcy-ts t-flex-row">再努力努力肯定就会中哦~</view>
</view> -->
<view class="t-tk-zj t-flex-col-s">
<image class="t-tk-zj-tip" src="./luck/wenzi.png" ></image>
<image class="t-tk-zj-tip" src="./luck/wenzi.png"></image>
<view class="t-tk-zj-desc t-flex-col">
<image class="t-zj-jp" :src="selectData.img" mode="aspectFit"></image>
<view class="t-zj-jp-desc">
@ -84,9 +84,13 @@
freeNumDay: 0,
list: [],
selectData: "",
source:1
}
},
onLoad() {
onLoad(opt) {
if (opt.source) {
this.source = opt.source
}
this.getRedPack();
this.getCount();
this.getPrizeList();
@ -105,7 +109,7 @@
async onClick() {
if (this.luckDrawTimes) {
const res = await discSpinningdraw({
source: 1
source: this.source
});
let indexs = -1
this.list.forEach((ele, index) => {
@ -121,7 +125,7 @@
//
async getCount() {
const res = await drawCount({
source: 1
source: this.source
});
this.luckDrawTimes = res.count || 0;
this.freeNumDay = res.sum || 0;
@ -134,7 +138,7 @@
//
async getPrizeList() {
const res = await selectDiscSpinning({
source: 1
source: this.source
});
res.records.forEach(res => {
res.img = res.url
@ -216,7 +220,7 @@
background-repeat: no-repeat;
margin: 0rpx auto;
position: relative;
background-image:url('./luck/BJ.png')
background-image: url('./luck/BJ.png')
}
.t-zp {