oil-station/gasStation-uni/pagesHome/oilRecharge/oilRecharge.vue

867 lines
21 KiB
Vue
Raw Normal View History

2023-11-27 09:24:16 +08:00
<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
2024-03-04 18:52:33 +08:00
<view class="my-text" v-if="actinput == 0">电子储值卡</view>
<view class="my-text" v-if="actinput == 1">电子囤油卡</view>
<view class="my-text" v-if="actinput == 2">电子礼品卡</view>
2023-11-27 09:24:16 +08:00
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
2024-03-06 13:15:40 +08:00
<view class="tap-box" v-if="actinput == 0">
2024-03-05 10:06:08 +08:00
<view class="box-tap" :class="{ 'act' :types == index }" v-for="(item,index) in taplist" :key="index"
2023-11-27 09:24:16 +08:00
@click="getindex(index)">
<view class="title">{{item.title}}</view>
2024-03-05 10:06:08 +08:00
<view class="gang" :class="{ 'actgang' : types == index }"></view>
2023-11-27 09:24:16 +08:00
</view>
2024-03-05 10:06:08 +08:00
</view>
2023-11-27 09:24:16 +08:00
<!-- 储值充值 -->
2023-12-08 13:13:21 +08:00
<view class="boxback" v-if="actinput == 0">
2024-03-04 18:52:33 +08:00
<view class="box_s" v-for="(item,index) in actList" :key="index">
{{item.discountActiveDescribe || ''}}
</view>
2024-03-05 10:06:08 +08:00
<!-- <view style="display: flex; align-items: center; justify-content: space-around;">
2024-03-04 18:52:33 +08:00
<view class="" @click="types = 0"> <u-button type="primary" text="自定义金额"></u-button></view>
<view class="" @click="types = 1"> <u-button type="primary" :plain="true" text="金额选项"></u-button>
</view>
2024-03-05 10:06:08 +08:00
</view> -->
<view class="inputbox"
style="border-bottom: 1px solid #e7f1ff; box-sizing: border-box; padding-bottom: 15px;"
v-if="types == 1">
2024-03-04 18:52:33 +08:00
<view class="cadname" style="width: 38%;">自定义金额</view>
2024-03-05 10:06:08 +08:00
<input type="text" v-model="balance" placeholder="请输入自定义金额" />
2024-03-04 18:52:33 +08:00
</view>
2024-03-05 10:06:08 +08:00
<view class="box-cz" v-if="types == 0">
2023-12-01 16:49:10 +08:00
<view class="box-jg" :class="{ 'actbox' : actindex == index }" v-for="(item,index) in cardValueList"
:key="index"
2024-01-03 10:54:36 +08:00
@click="xzindex(index,item.rechargeBalance,item.fringeBenefit,item.giftBalance,item.points,item.growthValue,item.count,item.id)">
2023-11-27 09:24:16 +08:00
<view class="s-title" :class="{ 'actsize' : actindex == index }"> <text
2023-12-01 16:49:10 +08:00
style="font-weight: bold;"></text>{{item.rechargeBalance}}</view>
<view class="min-size" :class="{ 'actsize' : actindex == index }">售价{{item.rechargeBalance}}
</view>
2023-11-27 09:24:16 +08:00
</view>
</view>
<view class="box-hui">
2023-12-01 16:49:10 +08:00
<view style="margin-bottom: 15px;">充值{{text}}元权益</view>
2023-12-08 16:24:02 +08:00
2023-12-05 09:43:37 +08:00
<view class="huisize" v-for="(item,index) in shuomingList" :key="index">
{{index+1}}.{{item || "" }}
</view>
2023-11-27 09:24:16 +08:00
</view>
2023-12-08 16:16:52 +08:00
<view class="box-gang" @click="show = true">
2023-11-27 09:24:16 +08:00
<view class="">推荐员工</view>
2024-01-15 11:39:48 +08:00
<view style="display: flex;align-items: center;">
<view class="">{{yname}}</view>
2023-11-27 09:24:16 +08:00
<uni-icons type="right" size="14"></uni-icons>
</view>
2023-12-08 16:16:52 +08:00
<!-- 底部 -->
2023-12-08 13:13:21 +08:00
2023-11-27 09:24:16 +08:00
</view>
2024-01-19 17:08:34 +08:00
2024-01-02 09:18:45 +08:00
<view class="bottom-box">
<view class="anniu" @click="addValueCarRecords()">
2023-12-08 16:16:52 +08:00
<text>立即充值</text>
</view>
<view class="dibu" @click="goRechargeRecords()">
<view class="">充值记录</view>
<uni-icons type="right" color="#1678ff" size="14"></uni-icons>
</view>
<view class="box-hui">
<view style="margin-bottom: 15px;">服务说明</view>
<view class="huisize">1.该服务为储蓄卡直充服务仅限本站使用</view>
<view class="huisize">2.请确认充值类型正确后再付款一经充值不支持退款 </view>
</view>
</view>
2023-11-27 09:24:16 +08:00
</view>
<!-- 囤油充值 -->
2023-12-08 16:16:52 +08:00
<view class="boxback" v-if="actinput == 1">
<view class="box-cz">
<view class="box-jg" :class="{ 'actbox' : actindex == index }" v-for="(item,index) in cardFuleList"
2024-01-03 18:45:35 +08:00
:key="index" @click="fuleindex(index,item.rechargeBalance,item.points,item.id)">
2023-12-08 16:16:52 +08:00
<view class="s-title" :class="{ 'actsize' : actindex == index }">油品:{{item.type}}
</view>
<view class="s-title" :class="{ 'actsize' : actindex == index }">油号:{{item.oilType}}
</view>
<view class="min-size" :class="{ 'actsize' : actindex == index }">单价<text
style="font-weight: bold;"></text>{{item.incomeLitres}}/</view>
<view class="min-size" :class="{ 'actsize' : actindex == index }">总价{{item.rechargeBalance}}
</view>
<view class="min-size" :class="{ 'actsize' : actindex == index }">升数:{{item.incomeLitres}}L
</view>
</view>
</view>
<view class="box-hui">
<view style="margin-bottom: 15px;">充值{{text}}元权益</view>
<view class="huisize" v-for="(item,index) in shuomingFList" :key="index">
{{index+1}}.{{item || "" }}
</view>
</view>
2024-01-19 17:08:34 +08:00
2024-01-25 16:43:19 +08:00
<view class="box-gang" @click="show = true">
2023-12-08 16:16:52 +08:00
<view class="">推荐员工</view>
2024-01-25 16:43:19 +08:00
<view style="display: flex;align-items: center;">
<view class="">{{yname}}</view>
2023-12-08 16:16:52 +08:00
<uni-icons type="right" size="14"></uni-icons>
</view>
2024-01-25 16:43:19 +08:00
<!-- 底部 -->
2023-12-08 16:16:52 +08:00
</view>
2024-01-19 17:08:34 +08:00
2023-12-08 16:16:52 +08:00
<!-- 底部 -->
<view class="bottom-box">
2024-01-03 18:45:35 +08:00
<view class="anniu" @click="addFuleCarRecords()">
2023-12-08 16:16:52 +08:00
<text>立即充值</text>
</view>
<view class="dibu" @click="goRechargeRecords()">
<view class="">充值记录</view>
<uni-icons type="right" color="#1678ff" size="14"></uni-icons>
</view>
<view class="box-hui">
<view style="margin-bottom: 15px;">服务说明</view>
<view class="huisize">1.该服务为储蓄卡直充服务仅限本站使用</view>
<view class="huisize">2.请确认充值类型正确后再付款一经充值不支持退款 </view>
</view>
</view>
</view>
2023-12-08 15:15:03 +08:00
<!-- 礼品兑换 -->
2023-11-27 09:24:16 +08:00
<view class="boxback" style="box-sizing: border-box; padding: 1px; " v-if="actinput == 2 ">
<view class="inputbox">
<view class="cadname">卡号</view>
2023-12-08 16:16:52 +08:00
<input type="text" v-model="number" placeholder="请输入礼品卡卡号" />
2023-11-27 09:24:16 +08:00
</view>
<view class="inputbox">
2023-12-08 16:16:52 +08:00
<view class="cadname">卡密</view>
<input type="text" v-model="cardPassword" placeholder="请输入礼品卡卡密" />
</view>
<view class="bottom-box">
<view class="anniu" @click="exchangeGift()">
<text>立即兑换</text>
</view>
2024-01-02 09:18:45 +08:00
<view class="dibu" @click="golpk()">
2023-12-08 16:16:52 +08:00
<view class="">兑换记录</view>
<uni-icons type="right" color="#1678ff" size="14"></uni-icons>
</view>
<view class="box-hui">
<view style="margin-bottom: 15px;">服务说明</view>
<view class="huisize">1.该服务为储蓄卡直充服务仅限本站使用</view>
<view class="huisize">2.请确认充值类型正确后再付款一经充值不支持退款 </view>
</view>
2023-11-27 09:24:16 +08:00
</view>
</view>
2024-01-19 17:08:34 +08:00
<!-- <u-picker :show="show" :columns="columns" keyName="realName" @confirm="confirm" @cancel="cancel"></u-picker> -->
<u-popup :show="show" :round="10" mode="bottom" @close="close" @open="open">
<view class="bottom-bb">
<view class="" v-for="(item,index) in columns" :key="index" style="margin-bottom: 10px;">
<u-button @click="confirm(item)" type="primary" :plain="true" :text="item.realName"></u-button>
</view>
<!-- <view class="" v-for="(item,index) in columns" :key="index">
{{item.realName}}
</view> -->
</view>
</u-popup>
2023-12-08 16:16:52 +08:00
<u-modal :show="shows" :title="message" :content='money' @confirm="confirms()"></u-modal>
2023-11-27 09:24:16 +08:00
</view>
</view>
</template>
<script>
2023-12-01 16:49:10 +08:00
import request from '../../utils/request'
2023-12-08 16:16:52 +08:00
import {
getValue
} from "@dcloudio/uni-ui/lib/uni-forms/utils";
2023-11-27 09:24:16 +08:00
export default {
data() {
return {
2024-03-04 18:52:33 +08:00
types: 0,
2024-01-05 15:11:53 +08:00
query: {
storeId: ''
},
2024-01-15 11:39:48 +08:00
yname: '',
2024-01-04 15:01:20 +08:00
chainStoreId: '',
2024-01-03 15:43:34 +08:00
cardRecordId: '',
cardFavorableId: '',
2024-01-03 10:54:36 +08:00
storeId: '',
staffId: '',
carValueId: '',
2024-01-03 18:45:35 +08:00
cardFuleId: '',
2023-12-08 16:16:52 +08:00
shows: false,
money: '',
message: '',
number: '',
cardPassword: '',
2023-11-27 09:24:16 +08:00
title: '',
actindex: 0,
2023-12-01 16:49:10 +08:00
actInput: 0,
index: 0,
2024-01-03 10:54:36 +08:00
text: '',
2023-12-01 16:49:10 +08:00
fringeBenefit: "",
giftBalance: "",
2024-03-05 10:06:08 +08:00
balance: '',
2023-12-08 16:16:52 +08:00
rechargeBalance: "",
incomeLitres: "",
lockupPrice: "",
type: "",
oilType: "",
2023-12-01 16:49:10 +08:00
points: "",
growthValue: "",
2023-11-27 09:24:16 +08:00
show: false,
2023-12-05 09:43:37 +08:00
shuomingList: [],
2023-12-08 13:13:21 +08:00
shuomingFList: [],
2023-12-08 15:34:38 +08:00
columns: [],
2024-03-04 18:52:33 +08:00
actList: [],
2023-11-27 09:24:16 +08:00
taplist: [{
2024-03-05 10:06:08 +08:00
title: '金额选项'
2023-11-27 09:24:16 +08:00
},
{
2024-03-05 10:06:08 +08:00
title: '自定义金额'
2023-11-27 09:24:16 +08:00
},
],
2023-12-01 16:49:10 +08:00
cardValueList: [],
2023-12-08 13:13:21 +08:00
cardFuleList: [],
2023-11-27 09:24:16 +08:00
actinput: 0,
2024-01-30 16:04:49 +08:00
// 小程序类型 微信 WECHAT 支付宝 ALIPAY
appltType: uni.getStorageSync("appltType"),
2023-11-27 09:24:16 +08:00
}
},
2024-01-03 18:45:35 +08:00
components: {},
2023-12-15 14:00:09 +08:00
onLoad(option) {
2024-01-04 15:01:20 +08:00
this.storeId = uni.getStorageSync("storeId");
2024-01-05 15:11:53 +08:00
console.log("5555555555555", this.storeId);
2024-01-04 15:01:20 +08:00
this.chainStoreId = uni.getStorageSync('chainStoreId');
console.log("66666666666", this.chainStoreId);
2023-12-15 14:00:09 +08:00
this.actinput = option.id
2024-01-03 15:43:34 +08:00
this.cardFavorableId = option.cardFavorableId
this.cardRecordId = option.cardRecordId
console.log('11111111111111', this.cardRecordId);
2023-12-18 11:14:51 +08:00
if (option.id == 0) {
this.getValueCars();
}
if (option.id == 1) {
2023-12-18 15:43:32 +08:00
console.log("囤油");
2023-12-18 11:14:51 +08:00
this.getFuelCars();
}
2024-01-05 15:11:53 +08:00
},
onShow() {
2023-12-08 16:16:52 +08:00
this.getStaffList()
2024-03-04 18:52:33 +08:00
this.activen()
2023-11-27 09:24:16 +08:00
},
methods: {
2024-03-04 18:52:33 +08:00
activen() {
request({
url: '/business/marketingActivity/cardValue/appletList?storeId=24',
method: 'get',
}).then(res => {
if (res.code == 200) {
console.log(res);
this.actList = res.data
}
})
},
2024-01-19 17:08:34 +08:00
open() {
console.log();
},
close() {
this.show = false
},
2024-01-03 18:45:35 +08:00
//囤油卡充值
addFuleCarRecords() {
2024-03-04 18:52:33 +08:00
// if (this.staffId == '') {
// uni.showToast({
// title: "员工为必填项",
// icon: Error
// })
// return
// }
2024-01-03 18:45:35 +08:00
if (this.carValueId == '') {
uni.showToast({
title: "囤油卡为必填项",
icon: Error
})
return
}
2024-01-30 16:04:49 +08:00
let _this = this
2024-01-03 18:45:35 +08:00
request({
url: 'business/marketingActivity/cardFuelRecord/addFuleCarRecords',
method: 'post',
data: {
2024-01-30 16:04:49 +08:00
payType: this.appltType,
2024-01-03 18:45:35 +08:00
mtStaffId: this.staffId,
id: this.carValueId,
storeId: this.storeId,
2024-01-04 15:01:20 +08:00
chainStoreId: this.chainStoreId,
2024-01-03 18:45:35 +08:00
cardFavorableId: this.cardFavorableId,
cardRecordId: this.cardRecordId
},
}).then(res => {
2024-01-30 16:04:49 +08:00
if (res.code == 200) {
2024-03-04 18:52:33 +08:00
console.log(res, _this.appltType)
2024-01-30 16:04:49 +08:00
if (_this.appltType == "WECHAT") {
2024-03-06 14:22:45 +08:00
if(!res.data.reservedPayInfo){
uni.showToast({
title:'支付失败,请联系商家',
icon:"none"
})
return;
}
2024-01-29 18:18:30 +08:00
let payProvider = "wxpay"
_this.orderInfo = JSON.parse(res.data.reservedPayInfo);
uni.requestPayment({
// 微信支付provider: 'wxpay' 支付宝支付 'alipay'
provider: payProvider,
timeStamp: _this.orderInfo.timeStamp,
nonceStr: _this.orderInfo.nonceStr,
package: _this.orderInfo.package,
signType: 'MD5',
paySign: _this.orderInfo.paySign,
success: function(res) {
console.log('success:', res);
uni.reLaunch({
url: '/pagesRefuel/orderSuccess/index'
2024-01-10 15:30:04 +08:00
})
2024-01-29 18:18:30 +08:00
},
fail: function(err) {
request({
url: "/business/marketingActivity/activeExchange/cardValueOrders",
method: 'put',
data: {
"orderNo": res.data.data.orderNo,
"status": "payFail"
},
}).then((res) => {
uni.showToast({
title: "支付失败!",
icon: "error"
})
})
console.log('fail:', err);
}
});
}
2024-03-04 18:52:33 +08:00
2024-01-30 16:04:49 +08:00
if (_this.appltType == "ALIPAY") {
2024-03-06 14:22:45 +08:00
if(!res.data.reservedTransactionId){
uni.showToast({
title:'支付失败,请联系商家',
icon:"none"
})
return;
}
2024-01-29 18:18:30 +08:00
my.tradePay({
2024-01-30 16:04:49 +08:00
tradeNO: res.data.reservedTransactionId
2024-01-29 18:18:30 +08:00
}, function(resp) {
if (resp.resultCode == '9000') {
console.log("支付成功")
uni.reLaunch({
url: '/pagesRefuel/orderSuccess/index'
})
} else {
request({
url: "/business/allOrderInfo/orderStatus",
method: 'post',
data: {
2024-01-30 16:04:49 +08:00
"orderNo": res.data.orderNo,
2024-01-29 18:18:30 +08:00
"status": "payFail"
},
}).then((res) => {
uni.showToast({
title: "支付失败!",
icon: "error"
})
2024-01-23 10:42:12 +08:00
})
2024-01-29 18:18:30 +08:00
console.log('支付失败,' + resp.resultCode);
}
});
}
2024-01-23 10:42:12 +08:00
}
2024-03-04 18:52:33 +08:00
2024-01-03 18:45:35 +08:00
})
},
2023-12-25 14:41:17 +08:00
//储值卡充值
addValueCarRecords() {
2024-03-04 18:52:33 +08:00
2024-01-03 10:54:36 +08:00
if (this.carValueId == '') {
uni.showToast({
title: "储值卡为必填项",
2024-01-06 18:04:36 +08:00
icon: "error"
2024-01-03 10:54:36 +08:00
})
return
}
2024-01-30 16:04:49 +08:00
let _this = this
2024-03-04 18:52:33 +08:00
2023-12-25 14:41:17 +08:00
request({
url: 'business/marketingActivity/cardValueRecord',
method: 'post',
data: {
2024-01-30 16:04:49 +08:00
payType: this.appltType,
2024-01-03 10:54:36 +08:00
mtStaffId: this.staffId,
id: this.carValueId,
2024-01-03 15:43:34 +08:00
storeId: this.storeId,
2024-01-04 15:01:20 +08:00
chainStoreId: this.chainStoreId,
2024-01-03 15:43:34 +08:00
cardFavorableId: this.cardFavorableId,
2024-03-04 18:52:33 +08:00
cardRecordId: this.cardRecordId,
2024-03-05 10:06:08 +08:00
balance: this.balance,
2024-03-04 18:52:33 +08:00
types: this.types
2023-12-25 14:41:17 +08:00
},
}).then(res => {
if (res.code === 200) {
2024-03-04 18:52:33 +08:00
2024-01-30 16:04:49 +08:00
if (_this.appltType == "WECHAT") {
2024-03-06 14:22:45 +08:00
if(!res.data.reservedPayInfo){
uni.showToast({
title:'支付失败,请联系商家',
icon:"none"
})
return;
}
2024-01-30 16:04:49 +08:00
let payProvider = "wxpay"
_this.orderInfo = JSON.parse(res.data.reservedPayInfo);
uni.requestPayment({
// 微信支付provider: 'wxpay' 支付宝支付 'alipay'
provider: payProvider,
timeStamp: _this.orderInfo.timeStamp,
nonceStr: _this.orderInfo.nonceStr,
package: _this.orderInfo.package,
signType: 'MD5',
paySign: _this.orderInfo.paySign,
success: function(res) {
console.log('success:', res);
uni.reLaunch({
url: '/pagesRefuel/orderSuccess/index'
})
},
fail: function(err) {
// request({
// url: "business/oilOrder/orderStatus",
// method: 'post',
// data: {
// "orderNo": res.data.data.orderNo,
// "status": "payFail"
// },
// }).then((res) => {
// uni.showToast({
// title: "支付失败!",
// icon: "error"
// })
// })
// console.log('fail:', err);
}
});
}
2023-12-25 14:41:17 +08:00
}
2024-01-23 10:42:12 +08:00
if (_this.appltType == "ALIPAY") {
2024-03-06 14:22:45 +08:00
if(!res.data.reservedTransactionId){
uni.showToast({
title:'支付失败,请联系商家',
icon:"none"
})
return;
}
2024-01-23 10:42:12 +08:00
my.tradePay({
2024-01-30 16:04:49 +08:00
tradeNO: res.data.reservedTransactionId
2024-01-23 10:42:12 +08:00
}, function(resp) {
if (resp.resultCode == '9000') {
console.log("支付成功")
uni.reLaunch({
url: '/pagesRefuel/orderSuccess/index'
})
} else {
request({
url: "/business/allOrderInfo/orderStatus",
method: 'post',
data: {
2024-01-30 16:04:49 +08:00
"orderNo": res.data.orderNo,
2024-01-23 10:42:12 +08:00
"status": "payFail"
},
}).then((res) => {
uni.showToast({
title: "支付失败!",
icon: "error"
})
})
console.log('支付失败,' + resp.resultCode);
}
});
}
2023-12-25 14:41:17 +08:00
})
},
2023-12-08 16:16:52 +08:00
confirms() {
this.shows = false
},
2023-11-27 09:24:16 +08:00
confirm(e) {
2023-12-08 16:16:52 +08:00
console.log(e);
2024-01-19 17:08:34 +08:00
this.staffId = e.id
this.yname = e.realName
2023-11-27 09:24:16 +08:00
this.show = false
},
cancel() {
this.show = false
},
2024-01-03 10:54:36 +08:00
xzindex(index, text, fringeBenefit, giftBalance, points, growthValue, count, id) {
console.log(text);
2023-12-05 09:43:37 +08:00
this.shuomingList = []
2024-01-03 10:54:36 +08:00
this.carValueId = id
2023-12-05 09:43:37 +08:00
console.log(this.shuomingList);
if (text) {
this.text = text
}
if (fringeBenefit) {
this.shuomingList.push(fringeBenefit)
}
if (giftBalance) {
this.shuomingList.push('赠送' + giftBalance + '金额')
}
if (points) {
this.shuomingList.push('赠送' + points + '积分')
}
if (growthValue) {
this.shuomingList.push('赠送' + growthValue + '成长值')
}
2024-01-03 09:11:56 +08:00
if (count) {
this.shuomingList.push('赠送卡券:' + count + '张')
}
2023-11-27 09:24:16 +08:00
this.actindex = index
},
2024-01-03 18:45:35 +08:00
fuleindex(index, text, points, id) {
this.shuomingFList = [];
this.carValueId = id;
console.log("1111111111", this.carValueId)
2023-12-08 16:16:52 +08:00
console.log(this.shuomingFList);
if (text) {
this.text = text
}
if (points) {
this.shuomingFList.push('赠送' + points + '积分')
}
this.actindex = index
},
2023-11-27 09:24:16 +08:00
getindex(index) {
2024-03-05 10:06:08 +08:00
// this.actinput = index
this.types = index
// if (index == 0) {
// this.getValueCars();
// }
// if (index == 1) {
// this.getFuelCars();
// }
2023-11-27 09:24:16 +08:00
},
goback() {
uni.navigateBack()
2023-12-01 16:49:10 +08:00
},
2023-12-08 16:16:52 +08:00
//储值卡
2023-12-01 16:49:10 +08:00
getValueCars() {
request({
2024-01-03 09:11:56 +08:00
url: 'business/marketingActivity/cardValue/appletL',
2023-12-01 16:49:10 +08:00
method: 'get',
data: {
2024-01-03 10:54:36 +08:00
activeStatus: '1',
storeId: this.storeId,
2023-12-01 16:49:10 +08:00
},
}).then(res => {
2023-12-05 09:43:37 +08:00
this.cardValueList = []
if (res.code == 200) {
this.cardValueList = res.data.records
2024-01-03 10:54:36 +08:00
console.log(res.data.records);
2023-12-18 15:43:32 +08:00
this.xzindex(0, res.data.records[0].rechargeBalance, res.data.records[0].fringeBenefit,
res.data.records[0].giftBalance, res.data.records[0].points, res.data.records[0]
2024-01-03 09:11:56 +08:00
.growthValue, res.data.records[0]
2024-01-03 10:54:36 +08:00
.count, res.data.records[0].id)
2023-12-05 09:43:37 +08:00
}
2023-12-01 16:49:10 +08:00
})
2023-12-08 13:13:21 +08:00
},
2023-12-08 16:16:52 +08:00
//囤油卡
getFuelCars() {
request({
2024-01-03 18:45:35 +08:00
url: 'business/marketingActivity/cardFuelDiesel/selectAllApplet',
2023-12-08 16:16:52 +08:00
method: 'get',
data: {
2024-01-03 18:45:35 +08:00
activeStatus: '1',
storeId: this.storeId,
2023-12-08 16:16:52 +08:00
},
}).then(res => {
this.cardValueList = []
if (res.code == 200) {
this.cardFuleList = res.data.records
2024-01-03 18:45:35 +08:00
this.fuleindex(0, res.data.records[0].rechargeBalance, res.data.records[0].points, res.data
.records[0].id)
2023-12-08 16:16:52 +08:00
}
})
},
//礼品卡兑换
exchangeGift() {
request({
2024-03-05 14:16:43 +08:00
url: '/business/marketingActivity/cardGift/exchange?number=' + this.number + "&cardPassword=" +
this.cardPassword + "&storeId=" + uni.getStorageSync("storeId"),
2023-12-08 16:16:52 +08:00
method: 'get',
}).then(res => {
if (res.data.id == '' || res.data.id == null) {
this.shows = true
this.message = '兑换失败!',
this.money = ''
} else {
this.shows = true
this.message = '兑换成功!',
this.money = res.data.cardAmount + '元'
}
})
},
//礼品卡兑换记录
getGiftRecords() {
request({
url: '/business/marketingActivity/cardGift/selectAllRecords',
method: 'get',
}).then(res => {
console.log(res)
})
},
goRechargeRecords() {
uni.navigateTo({
2023-12-15 17:41:25 +08:00
url: '/pagesMy/Recharge/Recharge'
2023-12-08 16:16:52 +08:00
})
},
//获取本店员工列表
getStaffList() {
request({
url: '/business/member/staff/list',
method: 'get',
2024-01-05 15:11:53 +08:00
params: {
storeId: uni.getStorageSync("storeId")
}
2023-12-08 16:16:52 +08:00
}).then(res => {
2024-01-19 17:08:34 +08:00
this.columns = res.data.records
// this.columns.push(res.data.records)
2023-12-08 16:16:52 +08:00
console.log("columns", this.columns);
})
2024-01-02 09:18:45 +08:00
},
golpk() {
uni.navigateTo({
url: '/pagesHome/RechargeRecords/RechargeRecords'
})
2023-12-08 16:16:52 +08:00
}
2023-11-27 09:24:16 +08:00
}
}
</script>
<style scoped lang="scss">
.content {
background: #f4f5f6;
}
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 88px;
}
.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;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
.tap-box {
width: 100%;
height: 50px;
display: flex;
align-items: center;
background-color: #ffffff;
}
.box-tap {
2024-03-05 10:06:08 +08:00
width: 50%;
2023-11-27 09:24:16 +08:00
text-align: center;
}
.act {
color: #2979ff;
font-weight: bold;
}
.gang {
width: 25px;
height: 5px;
// background-color: #2979ff;
border-radius: 8px;
margin: 2px auto;
margin-top: 5px;
}
.actgang {
background-color: #2979ff;
}
.bottom-box {
width: 100%;
background-color: #ffffff;
padding: 10px;
box-sizing: border-box;
}
.anniu {
width: 95%;
height: 40px;
border-radius: 50px;
background: #1678ff;
display: flex;
align-items: center;
justify-content: center;
color: white;
margin: 15px auto;
}
.dibu {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
color: #1678ff;
font-size: 14px;
}
.box-hui {
width: 95%;
border-radius: 8px;
background: #f4f5f6;
box-sizing: border-box;
padding: 15px;
margin: 15px auto;
}
.huisize {
color: #a8a8a8;
font-size: 14px;
}
.box-cz {
flex-wrap: wrap;
display: flex;
width: 100%;
background: #ffffff;
}
.box-jg {
width: 30%;
border-radius: 8px;
border: 1px solid #e2e2e2;
box-sizing: border-box;
padding: 10px;
margin: 5px;
}
.s-title {
width: 100%;
text-align: center;
2023-12-08 16:16:52 +08:00
font-size: 12px;
font-weight: bold;
2023-11-27 09:24:16 +08:00
}
.min-size {
width: 100%;
2023-12-08 13:13:21 +08:00
font-size: 10px;
//color: #e2e2e2;
2023-11-27 09:24:16 +08:00
text-align: center;
}
.actbox {
border: 1px solid #1678ff;
background: #e7f1ff;
}
.actsize {
color: #1678ff !important;
}
.boxback {
width: 100%;
background: #ffffff;
box-sizing: border-box;
padding-bottom: 1px;
2024-03-04 18:52:33 +08:00
padding-top: 1px;
2023-11-27 09:24:16 +08:00
}
.box-gang {
width: 95%;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
}
.inputbox {
width: 95%;
margin: 10px auto;
display: flex;
// align-items: center;
}
.cadname {
width: 20%;
}
2024-01-19 17:08:34 +08:00
.bottom-bb {
width: 100%;
height: 200px;
box-sizing: border-box;
padding: 10px;
background: white;
overflow: scroll;
}
2024-03-04 18:52:33 +08:00
.box_s {
width: 90%;
display: flex;
margin: 10px auto;
font-size: 14px;
color: #f40000;
2024-03-05 10:06:08 +08:00
box-sizing: border-box;
padding: 5px;
border-radius: 6px;
background: #f4f5f6;
2024-03-04 18:52:33 +08:00
}
2023-12-09 09:16:50 +08:00
</style>