2024-09-24 09:07:43 +08:00
|
|
|
<template>
|
|
|
|
<view class="content">
|
|
|
|
<view class="container">
|
|
|
|
<view class="box-hang">
|
|
|
|
<view class=""><span style="color: red;">*</span>卡类型</view>
|
2024-09-26 13:45:57 +08:00
|
|
|
<view style="color: #333333;">
|
2024-09-24 09:07:43 +08:00
|
|
|
<text>储值卡</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view style="margin: 10px 10px;font-size: 16px;font-weight: bold;">礼品卡信息</view>
|
|
|
|
<view class="box-hang">
|
|
|
|
<view class=""><span style="color: red;">*</span>卡号</view>
|
|
|
|
<view class="dis">
|
2024-09-26 13:45:57 +08:00
|
|
|
<input v-model="queryParam.number" style="text-align: right;" placeholder="请输入"></input>
|
2024-09-24 09:07:43 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="box-hang">
|
|
|
|
<view class=""><span style="color: red;">*</span>卡密码</view>
|
|
|
|
<view class="dis">
|
2024-09-26 13:45:57 +08:00
|
|
|
<input v-model="queryParam.cardPassword" style="text-align: right;" placeholder="请输入"></input>
|
2024-09-24 09:07:43 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="box-hang">
|
|
|
|
<view class=""><span style="color: red;">*</span>礼品卡金额</view>
|
|
|
|
<view class="dis">
|
2024-09-26 13:45:57 +08:00
|
|
|
{{giftAmount}}
|
2024-09-24 09:07:43 +08:00
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
2024-09-30 15:05:34 +08:00
|
|
|
<!-- <view class="but-sub" @click="show=!show">兑换</view> -->
|
|
|
|
<view class="but-sub" @click="goExchange">兑换</view>
|
2024-09-24 09:07:43 +08:00
|
|
|
|
|
|
|
<u-modal :show="show" :title="title" :content='content' :showCancelButton='true' @confirm="confirm"
|
|
|
|
@cancel="cancel" confirmColor="#FA6400"></u-modal>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import request from '../../utils/request';
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
title: '',
|
|
|
|
List: [],
|
|
|
|
pageNo: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
totalPage: '',
|
|
|
|
value: "",
|
|
|
|
show: false,
|
|
|
|
title: "温馨提示",
|
2024-09-26 13:45:57 +08:00
|
|
|
content: '礼品卡已兑换成功,请在礼品卡兑换记录中查看!',
|
|
|
|
giftAmount: 0,
|
|
|
|
queryParam: {
|
|
|
|
number: '',
|
|
|
|
cardPassword: '',
|
|
|
|
storeId: '',
|
|
|
|
}
|
2024-09-24 09:07:43 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
|
|
|
|
},
|
|
|
|
onPullDownRefresh() {
|
|
|
|
//下拉刷新
|
|
|
|
|
|
|
|
},
|
|
|
|
onReachBottom() {
|
|
|
|
// 触底加载
|
|
|
|
if (this.pageNo >= this.totalPage) {
|
|
|
|
|
|
|
|
} else {
|
|
|
|
this.pageNo++
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
components: {
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
2024-09-26 13:45:57 +08:00
|
|
|
goExchange() {
|
|
|
|
request({
|
|
|
|
url: 'business/marketingActivity/cardGift/exchange',
|
|
|
|
method: 'get',
|
|
|
|
params: this.queryParam
|
|
|
|
}).then(res => {
|
|
|
|
console.log(res, 89)
|
|
|
|
if (res.code == 200) {
|
2024-09-30 15:05:34 +08:00
|
|
|
if(res.data.id){
|
|
|
|
this.content = '礼品卡已兑换成功,请在礼品卡兑换记录中查看!'
|
|
|
|
}else {
|
|
|
|
this.content = '礼品卡兑换失败。'
|
|
|
|
}
|
|
|
|
|
2024-09-26 13:45:57 +08:00
|
|
|
} else {
|
|
|
|
this.content = '礼品卡兑换失败。'
|
|
|
|
}
|
|
|
|
this.show = !this.show
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getGiftInfo() {
|
|
|
|
this.queryParam.storeId = uni.getStorageSync('storeId')
|
|
|
|
request({
|
|
|
|
url: '/business/marketingActivity/cardGift/getCardAmount',
|
|
|
|
method: 'get',
|
|
|
|
params: this.queryParam
|
|
|
|
}).then(res => {
|
|
|
|
console.log(res, 89)
|
|
|
|
if (res.code == 200) {
|
|
|
|
this.giftAmount = res.data
|
|
|
|
} else {
|
|
|
|
this.giftAmount = 0
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
2024-09-24 09:07:43 +08:00
|
|
|
cancel() {
|
|
|
|
this.show = false
|
2024-09-26 13:45:57 +08:00
|
|
|
this.queryParam = {
|
|
|
|
number: '',
|
|
|
|
cardPassword: '',
|
|
|
|
storeId: '',
|
|
|
|
}
|
|
|
|
this.giftAmount = 0
|
2024-09-24 09:07:43 +08:00
|
|
|
},
|
|
|
|
confirm() {
|
|
|
|
this.show = false
|
2024-09-26 13:45:57 +08:00
|
|
|
this.queryParam = {
|
|
|
|
number: '',
|
|
|
|
cardPassword: '',
|
|
|
|
storeId: '',
|
|
|
|
}
|
|
|
|
this.giftAmount = 0
|
2024-09-24 09:07:43 +08:00
|
|
|
},
|
|
|
|
goback() {
|
|
|
|
uni.navigateBack()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.content {
|
|
|
|
background: #f4f5f6;
|
|
|
|
}
|
|
|
|
|
|
|
|
.container {
|
|
|
|
width: 100%;
|
|
|
|
height: 100vh;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding-top: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.my-header {
|
|
|
|
width: 100%;
|
|
|
|
height: 88px;
|
|
|
|
background: #ffffff;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
color: #000;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 0px 15px;
|
|
|
|
padding-top: 40px;
|
|
|
|
z-index: 99999;
|
|
|
|
|
|
|
|
.my-icons {
|
|
|
|
width: 20px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
position: fixed;
|
|
|
|
top: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.box-hang {
|
|
|
|
background-color: white;
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 15px 15px;
|
|
|
|
border-bottom: 1px solid #f4f5f6;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dis {
|
2024-09-26 13:45:57 +08:00
|
|
|
color: #999999;
|
2024-09-24 09:07:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.box-end {
|
|
|
|
text-align: center;
|
|
|
|
margin-top: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.but-sub {
|
|
|
|
width: 305px;
|
|
|
|
height: 40px;
|
|
|
|
line-height: 40px;
|
|
|
|
margin: 0 auto;
|
|
|
|
background-color: #FF9655;
|
|
|
|
color: white;
|
|
|
|
border-radius: 50px;
|
|
|
|
text-align: center;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 40px;
|
|
|
|
left: 11%;
|
|
|
|
}
|
|
|
|
</style>
|