This commit is contained in:
@QQNZX 2023-12-08 16:16:52 +08:00
parent e5535b1968
commit 7d06b718bf
3 changed files with 265 additions and 183 deletions

View File

@ -201,7 +201,7 @@
getUserAuthority() { getUserAuthority() {
let _this = this; let _this = this;
// this.getAddress(); // this.getAddress();
wx.getSetting({ wx.getSetting({
success(res) { success(res) {
if (!res.authSetting['scope.userLocation']) { if (!res.authSetting['scope.userLocation']) {
@ -234,8 +234,8 @@
}).then((response) => { }).then((response) => {
_this.store = response.data _this.store = response.data
let welfare = response.data.welfare let welfare = response.data.welfare
uni.setStorageSync("storeId",response.data.id) uni.setStorageSync("storeId", response.data.id)
uni.setStorageSync("chainStoreId",response.data.chainStoreId) uni.setStorageSync("chainStoreId", response.data.chainStoreId)
if (welfare != undefined && welfare != null && welfare != "") { if (welfare != undefined && welfare != null && welfare != "") {
if (welfare.includes(",")) { if (welfare.includes(",")) {
_this.welfare = response.data.welfare.split(",") _this.welfare = response.data.welfare.split(",")
@ -271,7 +271,7 @@
_this.distance = (Math.ceil(response.data.distance)).toFixed(1) _this.distance = (Math.ceil(response.data.distance)).toFixed(1)
_this.store = response.data.store _this.store = response.data.store
uni.setStorageSync("storeId", response.data.store.id) uni.setStorageSync("storeId", response.data.store.id)
uni.setStorageSync("chainStoreId",response.data.store.chainStoreId) uni.setStorageSync("chainStoreId", response.data.store.chainStoreId)
let welfare = response.data.store.welfare let welfare = response.data.store.welfare
if (welfare != undefined && welfare != null && welfare != "") { if (welfare != undefined && welfare != null && welfare != "") {
if (welfare.includes(",")) { if (welfare.includes(",")) {
@ -281,15 +281,16 @@
} }
} }
}) })
uni.showToast({ uni.showToast({
title:"获取位置信息成功" title: "获取位置信息成功",
icon: "none"
}) })
}, },
fail: function(err) { fail: function(err) {
_this.getStore(2); _this.getStore(2);
uni.showToast({ uni.showToast({
title:"获取位置信息失败" title: "获取位置信息失败"
}) })
console.log('获取位置信息失败: ' + err.errMsg); console.log('获取位置信息失败: ' + err.errMsg);
} }

View File

@ -0,0 +1,69 @@
<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>
<view class="my-text">充值记录</view>
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: '',
}
},
components: {
},
methods: {
goback() {
uni.navigateBack()
}
}
}
</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;
}
</style>

View File

@ -32,128 +32,129 @@
{{index+1}}.{{item || "" }} {{index+1}}.{{item || "" }}
</view> </view>
</view> </view>
<view class="box-gang" @click="show = true">
<view class="">推荐员工</view>
<view class=""></view>
<view class="">
<uni-icons type="right" size="14"></uni-icons>
</view>
<!-- 底部 -->
</view>
<view class="bottom-box">
<view class="anniu">
<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>
<!-- 囤油充值 -->
<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"
:key="index" @click="fuleindex(index,item.rechargeBalance,item.points)">
<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>
<view class="box-gang"> <view class="box-gang">
<view class="">推荐员工</view> <view class="">推荐员工</view>
<view class=""></view> <view class=""></view>
<view class="" @click="show = true"> <view class="" @click="show = true">
<uni-icons type="right" size="14"></uni-icons> <uni-icons type="right" size="14"></uni-icons>
</view> </view>
<!-- 底部 -->
</view> </view>
<view class="bottom-box">
<view class="anniu">
<text>立即充值</text>
</view>
<view class="dibu">
<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="bottom-box">
<view class="huisize">1.该服务为储蓄卡直充服务仅限本站使用</view> <view class="anniu">
<view class="huisize">2.请确认充值类型正确后再付款一经充值不支持退款 </view> <text>立即充值</text>
</view> </view>
</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> </view>
<!-- 囤油充值 -->
<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"
:key="index"
@click="fuleindex(index,item.rechargeBalance,item.points)">
<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>
<view class="box-gang">
<view class="">推荐员工</view>
<view class=""></view>
<view class="" @click="show = true">
<uni-icons type="right" size="14"></uni-icons>
</view>
</view>
<!-- 底部 -->
<view class="bottom-box">
<view class="anniu">
<text>立即充值</text>
</view>
<view class="dibu">
<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>
<!-- 礼品兑换 --> <!-- 礼品兑换 -->
<view class="boxback" style="box-sizing: border-box; padding: 1px; " v-if="actinput == 2 "> <view class="boxback" style="box-sizing: border-box; padding: 1px; " v-if="actinput == 2 ">
<view class="inputbox"> <view class="inputbox">
<view class="cadname">卡号</view> <view class="cadname">卡号</view>
<input type="text" v-model="number" placeholder="请输入礼品卡卡号" /> <input type="text" v-model="number" placeholder="请输入礼品卡卡号" />
</view> </view>
<view class="inputbox"> <view class="inputbox">
<view class="cadname" >卡密</view> <view class="cadname">卡密</view>
<input type="text" v-model="cardPassword" placeholder="请输入礼品卡卡密" /> <input type="text" v-model="cardPassword" placeholder="请输入礼品卡卡密" />
</view> </view>
<view class="bottom-box" > <view class="bottom-box">
<view class="anniu" @click="exchangeGift()"> <view class="anniu" @click="exchangeGift()">
<text>立即兑换</text> <text>立即兑换</text>
</view> </view>
<view class="dibu"> <view class="dibu" @click="goRechargeRecords()">
<view class="">兑换记录</view> <view class="">兑换记录</view>
<uni-icons type="right" color="#1678ff" size="14"></uni-icons> <uni-icons type="right" color="#1678ff" size="14"></uni-icons>
</view> </view>
<view class="box-hui"> <view class="box-hui">
<view style="margin-bottom: 15px;">服务说明</view> <view style="margin-bottom: 15px;">服务说明</view>
<view class="huisize">1.该服务为储蓄卡直充服务仅限本站使用</view> <view class="huisize">1.该服务为储蓄卡直充服务仅限本站使用</view>
<view class="huisize">2.请确认充值类型正确后再付款一经充值不支持退款 </view> <view class="huisize">2.请确认充值类型正确后再付款一经充值不支持退款 </view>
</view> </view>
</view> </view>
</view> </view>
<u-picker :show="show" :columns="columns" @confirm="confirm" @cancel="cancel"></u-picker> <u-picker :show="show" :columns="columns" keyName="realName" @confirm="confirm" @cancel="cancel"></u-picker>
<u-modal :show="shows" :title="message" :content='money' @confirm="confirms()" ></u-modal> <u-modal :show="shows" :title="message" :content='money' @confirm="confirms()"></u-modal>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import request from '../../utils/request' import request from '../../utils/request'
import {getValue} from "@dcloudio/uni-ui/lib/uni-forms/utils"; import {
getValue
} from "@dcloudio/uni-ui/lib/uni-forms/utils";
export default { export default {
data() { data() {
return { return {
shows:false, shows: false,
money:'', money: '',
message:'', message: '',
number:'', number: '',
cardPassword:'', cardPassword: '',
title: '', title: '',
actindex: 0, actindex: 0,
actInput: 0, actInput: 0,
@ -161,11 +162,11 @@
text: "", text: "",
fringeBenefit: "", fringeBenefit: "",
giftBalance: "", giftBalance: "",
rechargeBalance: "", rechargeBalance: "",
incomeLitres: "", incomeLitres: "",
lockupPrice: "", lockupPrice: "",
type: "", type: "",
oilType: "", oilType: "",
points: "", points: "",
growthValue: "", growthValue: "",
show: false, show: false,
@ -194,13 +195,15 @@
}, },
onShow() { onShow() {
this.getValueCars(); this.getValueCars();
this.getStaffList()
//this.getFuelCars(); //this.getFuelCars();
}, },
methods: { methods: {
confirms(){ confirms() {
this.shows = false this.shows = false
}, },
confirm(e) { confirm(e) {
console.log(e);
this.show = false this.show = false
}, },
cancel() { cancel() {
@ -226,30 +229,30 @@
} }
this.actindex = index this.actindex = index
}, },
fuleindex(index, text, points,) { fuleindex(index, text, points, ) {
this.shuomingFList = [] this.shuomingFList = []
console.log(this.shuomingFList); console.log(this.shuomingFList);
if (text) { if (text) {
this.text = text this.text = text
} }
if (points) { if (points) {
this.shuomingFList.push('赠送' + points + '积分') this.shuomingFList.push('赠送' + points + '积分')
} }
this.actindex = index this.actindex = index
}, },
getindex(index) { getindex(index) {
this.actinput = index this.actinput = index
if (index==0){ if (index == 0) {
this.getValueCars(); this.getValueCars();
} }
if (index==1){ if (index == 1) {
this.getFuelCars(); this.getFuelCars();
} }
}, },
goback() { goback() {
uni.navigateBack() uni.navigateBack()
}, },
// //
getValueCars() { getValueCars() {
request({ request({
url: 'business/marketingActivity/cardValue', url: 'business/marketingActivity/cardValue',
@ -268,60 +271,69 @@
}) })
}, },
// //
getFuelCars() { getFuelCars() {
request({ request({
url: 'business/marketingActivity/cardFuelDiesel', url: 'business/marketingActivity/cardFuelDiesel',
method: 'get', method: 'get',
data: { data: {
activeStatus: '1' activeStatus: '1'
}, },
}).then(res => { }).then(res => {
this.cardValueList = [] this.cardValueList = []
if (res.code == 200) { if (res.code == 200) {
this.cardFuleList = res.data.records this.cardFuleList = res.data.records
this.fuleindex(0, this.cardValueList[0].rechargeBalance, this.cardValueList[0].fringeBenefit, this.fuleindex(0, this.cardValueList[0].rechargeBalance, this.cardValueList[0]
this.cardFuleList[0].rechargeBalance, this.cardFuleList[0].points, this .fringeBenefit,
.cardFuleList[0].lockupPrice, this this.cardFuleList[0].rechargeBalance, this.cardFuleList[0].points, this
.cardFuleList[0].incomeLitres) .cardFuleList[0].lockupPrice, this
} .cardFuleList[0].incomeLitres)
}) }
}, })
// },
exchangeGift(){ //
request({ exchangeGift() {
url:'/business/marketingActivity/cardGift/exchange?number='+this.number+"&cardPassword="+this.cardPassword, request({
method:'get', url: '/business/marketingActivity/cardGift/exchange?number=' + this.number + "&cardPassword=" +
}).then(res=>{ this.cardPassword,
if (res.data.id == '' || res.data.id == null){ method: 'get',
this.shows = true }).then(res => {
this.message = '兑换失败!', if (res.data.id == '' || res.data.id == null) {
this.money = '' this.shows = true
}else { this.message = '兑换失败!',
this.shows = true this.money = ''
this.message = '兑换成功!', } else {
this.money = res.data.cardAmount+'元' this.shows = true
} this.message = '兑换成功!',
}) this.money = res.data.cardAmount + '元'
}, }
// })
getGiftRecords(){ },
request({ //
url:'/business/marketingActivity/cardGift/selectAllRecords', getGiftRecords() {
method:'get', request({
}).then(res=>{ url: '/business/marketingActivity/cardGift/selectAllRecords',
console.log(res) method: 'get',
}) }).then(res => {
}, console.log(res)
// })
getStaffList(){ },
request({ goRechargeRecords() {
url:'/business/member/staff/list', uni.navigateTo({
method:'get', url: '/pagesMy/Recharge/Recharge'
}).then(res=>{ })
this.columns = res.data.records },
}) //
} getStaffList() {
request({
url: '/business/member/staff/list',
method: 'get',
}).then(res => {
this.columns.push(res.data.records)
console.log("columns", this.columns);
})
}
} }
} }
</script> </script>
@ -454,8 +466,8 @@
.s-title { .s-title {
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 12px; font-size: 12px;
font-weight: bold; font-weight: bold;
} }
.min-size { .min-size {
@ -501,4 +513,4 @@
width: 20%; width: 20%;
} }
</style> </style>