parent
8afa122693
commit
2a2f395f65
@ -0,0 +1,55 @@ |
||||
const isNullOrEmpty = function(val) { |
||||
if (val == null || val == "" || typeof(val) == undefined) { |
||||
return true; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
const timeFormat = (value, format) => { |
||||
let date = new Date(value); |
||||
let y = date.getFullYear(); |
||||
let m = date.getMonth() + 1; |
||||
let d = date.getDate(); |
||||
let h = date.getHours(); |
||||
let min = date.getMinutes(); |
||||
let s = date.getSeconds(); |
||||
let result = ""; |
||||
if (format == undefined) { |
||||
result = `${y}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d} ${ |
||||
h < 10 ? "0" + h : h |
||||
}:${min < 10 ? "0" + min : min}:${s < 10 ? "0" + s : s}`;
|
||||
} |
||||
if (format == "yyyy-mm-dd hh:mm") { |
||||
result = `${y}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d} `; |
||||
} |
||||
if (format == "yyyy-mm-dd") { |
||||
result = `${y}-${m < 10 ? "0" + m : m}-${d < 10 ? "0" + d : d}`; |
||||
} |
||||
if (format == "yyyy-mm") { |
||||
result = `${y}-${m < 10 ? "0" + m : m}`; |
||||
} |
||||
if (format == "mm-dd") { |
||||
result = ` ${mm < 10 ? "0" + mm : mm}:${ddmin < 10 ? "0" + dd : dd}`; |
||||
} |
||||
if (format == "hh:mm") { |
||||
result = ` ${h < 10 ? "0" + h : h}:${min < 10 ? "0" + min : min}`; |
||||
} |
||||
if (format == "yyyy") { |
||||
result = `${y}`; |
||||
} |
||||
return result; |
||||
}; |
||||
|
||||
|
||||
// {{date|isNullOrEmpty}}
|
||||
// {{date|timeFormat('yyyy-mm-dd')}}
|
||||
// {{date|timeFormat('yyyy-mm')}}
|
||||
// {{date|timeFormat('hh:mm')}}
|
||||
// {{date|timeFormat('yyyy')}}
|
||||
// {{date|timeFormat}}
|
||||
|
||||
export { |
||||
isNullOrEmpty, |
||||
timeFormat |
||||
} |
@ -1,313 +1,399 @@ |
||||
<template> |
||||
<view> |
||||
<!-- 头部 --> |
||||
<view class="width100 height120 backcorfff"> |
||||
<image :src="orderList.goodsImg" class="flleft conImg mart10 margle10"></image> |
||||
<view class="conCont paddtop15"> |
||||
<view class="font20 fontwig6 fcor333 text1 paddtright10">{{orderList.goodsName}}</view> |
||||
<view class="font14 fcor999 text2 paddtop5 paddtright10">{{refulAdress}}</view> |
||||
<view class="font20 fontwig6 fcoreb5 paddtop5">¥{{orderList.gasPriceVip}} |
||||
<text class="margle10 slogan font14">¥{{orderList.gasPriceGun}}</text> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<!-- //订单详情 --> |
||||
<view class="mart10 heightl60 paddleft10 fcor333 fontwig6 font18 width100 backcorfff">订单详情</view> |
||||
<view class="line1"></view> |
||||
<view class="heightl60 paddleft10 fcor666 font16 width100 backcorfff"> |
||||
<view class="flleft width50"> |
||||
油号\油枪 |
||||
</view> |
||||
<view class="flright width40 fotct"> |
||||
{{orderList.gasOilNo}}#/{{orderList.gasGunNo}}号 |
||||
</view> |
||||
</view> |
||||
<view class="line1"></view> |
||||
<view class="heightl60 paddleft10 fcor666 font16 width100 backcorfff"> |
||||
<view class="flleft width50"> |
||||
加油金额 |
||||
</view> |
||||
<view class="flright width40 fotct"> |
||||
{{orderList.totalPrice}} |
||||
</view> |
||||
</view> |
||||
|
||||
<!-- //支付方式 --> |
||||
<!-- <view class="mart10 heightl60 paddleft10 fcor333 fontwig6 font18 width100 backcorfff">支付方式</view> |
||||
<view class="line1"></view> |
||||
<view class="width100 backcorfff"> |
||||
<view class="line1"></view> |
||||
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='weixin'"> |
||||
<view class="width60 flleft fontwig6"> |
||||
银联支付 |
||||
</view> |
||||
<view class="flright width30 fotct"> |
||||
<radio :checked="paytype=='weixin'" color="#0083f5" /> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="line1"></view> |
||||
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='gonghuika'"> |
||||
<view class="width60 flleft fontwig6"> |
||||
积分<text class="font14 fcor666 margle">(积分:{{user.gold}})</text> |
||||
</view> |
||||
<view class="flright width30 fotct"> |
||||
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" /> |
||||
</view> |
||||
</view> |
||||
</view> --> |
||||
|
||||
<view class="width100 mart15 fcor333 font16 fontwig6 paddleft10">重要说明</view> |
||||
<view class="width95 paddleft10 font14 fcor999 mart5">1.<text |
||||
class="fcor089 fontwig6">请先加油后下单</text>,即您到站后,与工作人员确认油号,抢号后再付款。</view> |
||||
<view class="width95 paddleft10 font14 fcor999 mart5"> |
||||
2.请勿先付款后加油,若您已下单付款。请于24小时内到加油站完成加油;若您48小时内未完成加油,请及时发起退单;逾期退单可能会退单失败。</view> |
||||
<view class="height80 width100"></view> |
||||
<!-- 底部按钮 --> |
||||
<view class="footer"> |
||||
<view class="width50 flleft fcoreb5 padleft15 font15"> |
||||
合计: ¥<text class="font24">{{payprice}}</text> |
||||
</view> |
||||
<button class="reBtn flright" @click="unionPay">去支付</button> |
||||
</view> |
||||
|
||||
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle"/> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getOrderById, |
||||
orderToPay, |
||||
unionPay, |
||||
orderToGoldPay, |
||||
hltUnionCardPay |
||||
} from '../../../Utils/Api.js'; |
||||
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue'; |
||||
let app = getApp(); |
||||
export default { |
||||
components: { |
||||
ssPaymentPassword |
||||
}, |
||||
data() { |
||||
return { |
||||
orderNo: '', |
||||
couponId: '', |
||||
payprice: '', |
||||
orderList: '', |
||||
refulAdress: '', |
||||
tongCardPrice: 0, |
||||
user: '', |
||||
paytype: '', |
||||
PaymentPassword: '', |
||||
} |
||||
}, |
||||
onLoad(e) { |
||||
this.payprice = e.payprice; |
||||
this.orderNo = e.orderId; |
||||
this.couponId = e.couponId; |
||||
this.refulAdress = e.adres; |
||||
this.getOrderById(); |
||||
}, |
||||
onShow() { |
||||
let that = this; |
||||
that.paytype = ''; |
||||
that.user = app.globalData.userInfo; |
||||
}, |
||||
methods: { |
||||
//密码支付完成 |
||||
submitHandle(e) { |
||||
this.PaymentPassword = e.value; |
||||
if(this.PaymentPassword == ''){ |
||||
uni.showToast({ |
||||
title: '请勿手动关闭弹窗', |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
return; |
||||
} |
||||
uni.showLoading({ |
||||
title: '支付中...' |
||||
}) |
||||
let params = { |
||||
"orderId": this.orderNo, |
||||
"password": this.PaymentPassword |
||||
} |
||||
orderToGoldPay(params).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
uni.showToast({ |
||||
title: '支付成功' |
||||
}) |
||||
uni.reLaunch({ |
||||
url: '/pages/goods/refuel-succes/refuel-succes?id=' +this.orderNo |
||||
}); |
||||
return; |
||||
} |
||||
if (res.return_code == '102130') { |
||||
uni.navigateTo({ |
||||
url: '../../login/updatePas/updatePas' |
||||
}) |
||||
return; |
||||
} |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none' |
||||
}) |
||||
}) |
||||
|
||||
|
||||
}, |
||||
//获取选择支付方式 |
||||
changeRiado() { |
||||
if (!this.user.isSetHltCard) { |
||||
uni.showToast({ |
||||
icon: 'none', |
||||
title: '当前账号还未绑定,前往绑定', |
||||
duration: 2000, |
||||
success() { |
||||
setTimeout(() => { |
||||
uni.navigateTo({ |
||||
url: '../../user/bindingCard/bindingCard' |
||||
}) |
||||
}, 1000) |
||||
} |
||||
}); |
||||
return; |
||||
} |
||||
}, |
||||
getOrderById() { |
||||
uni.showLoading({ |
||||
title: '加载中...' |
||||
}) |
||||
let params = { |
||||
orderId: this.orderNo, |
||||
} |
||||
getOrderById(params).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
this.orderList = res.return_data.highChildOrderList[0]; |
||||
} |
||||
}) |
||||
}, |
||||
|
||||
//获取订单数据 |
||||
orderToPay() { |
||||
let that = this; |
||||
if (that.paytype == '') { |
||||
uni.showToast({ |
||||
title: '请选择支付方式', |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
return; |
||||
} |
||||
if (that.paytype == 'weixin') { |
||||
that.unionPay(); |
||||
return; |
||||
} |
||||
if(that.paytype == 'gonghuika'){ |
||||
if (!that.user.isSetPayPwd) { |
||||
uni.navigateTo({ |
||||
url: '../../login/updatePas/updatePas' |
||||
}) |
||||
return; |
||||
} |
||||
that.$refs.paymentPassword.modalFun('show'); |
||||
} |
||||
|
||||
}, |
||||
//银联获取信息 |
||||
unionPay() { |
||||
let goods = { |
||||
"orderId": this.orderNo |
||||
} |
||||
unionPay(goods).then(res => { |
||||
if (res.return_code == '000000') { |
||||
this.uniontopay(res.return_data.prepayid); |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}); |
||||
} |
||||
}) |
||||
}, |
||||
//银联支付 |
||||
uniontopay(item) { |
||||
let that = this; |
||||
upsdk.pluginReady(function() { |
||||
upsdk.pay({ |
||||
tn: item, |
||||
success: function(res) { |
||||
uni.showToast({ |
||||
title: '支付成功' |
||||
}) |
||||
uni.reLaunch({ |
||||
url: '/pages/goods/refuel-succes/refuel-succes?id=' +that.orderNo |
||||
}); |
||||
}, |
||||
fail: function(err) { |
||||
uni.showToast({ |
||||
title: err.msg, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
// 支付失败, err.msg 是失败原因描述, 比如TN号不合法, 或者用户取消了交易 等等。 |
||||
} |
||||
}); |
||||
}); |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="less"> |
||||
page { |
||||
background-color: #f7f7f7; |
||||
} |
||||
|
||||
.conImg { |
||||
width: 100px; |
||||
height: 100px; |
||||
border-radius: 8px; |
||||
} |
||||
|
||||
.conCont { |
||||
margin-left: 115px; |
||||
} |
||||
|
||||
.slogan { |
||||
color: #807c87; |
||||
text-decoration: line-through; |
||||
} |
||||
|
||||
.footer { |
||||
position: fixed; |
||||
bottom: 0upx; |
||||
width: 100%; |
||||
height: 100rpx; |
||||
color: #FFFFFF; |
||||
border-top: solid 1upx #eee; |
||||
background-color: #FFFFFF; |
||||
z-index: 2; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
|
||||
.reBtn { |
||||
width: 120px; |
||||
background-color: #089bf5; |
||||
color: #FFFFFF; |
||||
text-align: center; |
||||
padding: 0; |
||||
font-size: 16px; |
||||
border-radius: 0px; |
||||
height: 50px; |
||||
line-height: 50px; |
||||
position: absolute; |
||||
right: 0px; |
||||
} |
||||
} |
||||
<template> |
||||
<view> |
||||
<!-- 头部 --> |
||||
<view class="width100 height120 backcorfff"> |
||||
<image :src="orderList.goodsImg" class="flleft conImg mart10 margle10"></image> |
||||
<view class="conCont paddtop15"> |
||||
<view class="font20 fontwig6 fcor333 text1 paddtright10">{{orderList.goodsName}}</view> |
||||
<view class="font14 fcor999 text2 paddtop5 paddtright10">{{refulAdress}}</view> |
||||
<view class="font20 fontwig6 fcoreb5 paddtop5">¥{{orderList.gasPriceVip}} |
||||
<text class="margle10 slogan font14">¥{{orderList.gasPriceGun}}</text> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<!-- //订单详情 --> |
||||
<view class="mart10 heightl60 paddleft10 fcor333 fontwig6 font18 width100 backcorfff">订单详情</view> |
||||
<view class="line1"></view> |
||||
<view class="heightl60 paddleft10 fcor666 font16 width100 backcorfff"> |
||||
<view class="flleft width50"> |
||||
油号\油枪 |
||||
</view> |
||||
<view class="flright width40 fotct"> |
||||
{{orderList.gasOilNo}}#/{{orderList.gasGunNo}}号 |
||||
</view> |
||||
</view> |
||||
<view class="line1"></view> |
||||
<view class="heightl60 paddleft10 fcor666 font16 width100 backcorfff"> |
||||
<view class="flleft width50"> |
||||
加油金额 |
||||
</view> |
||||
<view class="flright width40 fotct"> |
||||
{{orderList.totalPrice}} |
||||
</view> |
||||
</view> |
||||
|
||||
<!-- //支付方式 --> |
||||
<view class="mart10 heightl60 paddleft10 fcor333 fontwig6 font18 width100 backcorfff">支付方式</view> |
||||
<view class="line1"></view> |
||||
<view class="width100 backcorfff"> |
||||
<view class="line1"></view> |
||||
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='weixin'"> |
||||
<view class="width60 flleft fontwig6"> |
||||
银联支付 |
||||
</view> |
||||
<view class="flright width30 fotct"> |
||||
<radio :checked="paytype=='weixin'" color="#0083f5" /> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="line1"></view> |
||||
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='oilcard'"> |
||||
<view class="width60 flleft fontwig6"> |
||||
油卡支付<text class="font14 fcor666 margle">余额: {{oilPirce}}元</text> |
||||
</view> |
||||
<view class="flright width30 fotct"> |
||||
<radio :checked="paytype=='oilcard'" @click="changeRiado()" color="#0083f5" /> |
||||
</view> |
||||
</view> |
||||
<!-- <view class="line1"></view> |
||||
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='gonghuika'"> |
||||
<view class="width60 flleft fontwig6"> |
||||
积分<text class="font14 fcor666 margle">(积分:{{user.gold}})</text> |
||||
</view> |
||||
<view class="flright width30 fotct"> |
||||
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" /> |
||||
</view> |
||||
</view> --> |
||||
</view> |
||||
|
||||
<view class="width100 mart15 fcor333 font16 fontwig6 paddleft10">重要说明</view> |
||||
<view class="width95 paddleft10 font14 fcor999 mart5">1.<text |
||||
class="fcor089 fontwig6">请先加油后下单</text>,即您到站后,与工作人员确认油号,抢号后再付款。</view> |
||||
<view class="width95 paddleft10 font14 fcor999 mart5"> |
||||
2.请勿先付款后加油,若您已下单付款。请于24小时内到加油站完成加油;若您48小时内未完成加油,请及时发起退单;逾期退单可能会退单失败。</view> |
||||
<view class="height80 width100"></view> |
||||
<!-- 底部按钮 --> |
||||
<view class="footer"> |
||||
<view class="width50 flleft fcoreb5 padleft15 font15"> |
||||
合计: ¥<text class="font24">{{payprice}}</text> |
||||
</view> |
||||
<button class="reBtn flright" @click="orderToPay">去支付</button> |
||||
</view> |
||||
|
||||
<ssPaymentPassword ref="paymentPassword" :mode="1" @submit="submitHandle" /> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getOrderById, |
||||
orderToPay, |
||||
unionPay, |
||||
orderToGoldPay, |
||||
hltUnionCardPay, |
||||
findUser, |
||||
oilCardPay |
||||
} from '../../../Utils/Api.js'; |
||||
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue'; |
||||
let app = getApp(); |
||||
export default { |
||||
components: { |
||||
ssPaymentPassword |
||||
}, |
||||
data() { |
||||
return { |
||||
orderNo: '', |
||||
couponId: '', |
||||
payprice: '', |
||||
orderList: '', |
||||
refulAdress: '', |
||||
tongCardPrice: 0, |
||||
oilPirce: 0, //油卡余额 |
||||
user: '', |
||||
paytype: '', |
||||
PaymentPassword: '', |
||||
} |
||||
}, |
||||
onLoad(e) { |
||||
this.payprice = e.payprice; |
||||
this.orderNo = e.orderId; |
||||
this.couponId = e.couponId; |
||||
this.refulAdress = e.adres; |
||||
this.getOrderById(); |
||||
}, |
||||
onShow() { |
||||
let that = this; |
||||
that.paytype = ''; |
||||
that.findUser(); |
||||
// that.user = app.globalData.userInfo; |
||||
}, |
||||
methods: { |
||||
findUser() { |
||||
let params; |
||||
findUser(params).then(res => { |
||||
if (res.return_code == '000000') { |
||||
app.globalData.userInfo = res.return_data; |
||||
this.user = res.return_data; |
||||
if (res.return_data.oilCard) { |
||||
this.oilPirce = res.return_data.oilCard.amount; |
||||
} |
||||
uni.setStorage({ |
||||
key: "user", |
||||
data: res.return_data |
||||
}) |
||||
} |
||||
}); |
||||
}, |
||||
//密码支付完成 |
||||
submitHandle(e) { |
||||
this.PaymentPassword = e.value; |
||||
if (this.PaymentPassword == '') { |
||||
uni.showToast({ |
||||
title: '请勿手动关闭弹窗', |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
return; |
||||
} |
||||
uni.showLoading({ |
||||
title: '支付中...' |
||||
}) |
||||
if (this.paytype == 'jifen') { |
||||
let params = { |
||||
"orderId": this.orderNo, |
||||
"password": this.PaymentPassword |
||||
} |
||||
orderToGoldPay(params).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
uni.showToast({ |
||||
title: '支付成功' |
||||
}) |
||||
uni.reLaunch({ |
||||
url: '/pages/goods/refuel-succes/refuel-succes?id=' + this.orderNo |
||||
}); |
||||
return; |
||||
} |
||||
if (res.return_code == '102130') { |
||||
uni.navigateTo({ |
||||
url: '../../login/updatePas/updatePas' |
||||
}) |
||||
return; |
||||
} |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none' |
||||
}) |
||||
}) |
||||
return; |
||||
} |
||||
if (this.paytype == 'oilcard') { |
||||
let params = { |
||||
"orderId": this.orderNo, |
||||
"cardNo": this.user.oilCard.cardNo, |
||||
"password": this.PaymentPassword |
||||
} |
||||
oilCardPay(params).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
uni.showToast({ |
||||
title: '支付成功' |
||||
}) |
||||
uni.reLaunch({ |
||||
url: '/pages/goods/refuel-succes/refuel-succes?id=' + this.orderNo |
||||
}); |
||||
return; |
||||
} |
||||
if (res.return_code == '102130') { |
||||
uni.navigateTo({ |
||||
url: '../../login/updatePas/updatePas' |
||||
}) |
||||
return; |
||||
} |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none' |
||||
}) |
||||
}) |
||||
return; |
||||
} |
||||
|
||||
}, |
||||
//获取选择支付方式 |
||||
changeRiado() { |
||||
if (!this.user.isSetHltCard) { |
||||
uni.showToast({ |
||||
icon: 'none', |
||||
title: '当前账号还未绑定,前往绑定', |
||||
duration: 2000, |
||||
success() { |
||||
setTimeout(() => { |
||||
uni.navigateTo({ |
||||
url: '../../user/bindingCard/bindingCard' |
||||
}) |
||||
}, 1000) |
||||
} |
||||
}); |
||||
return; |
||||
} |
||||
}, |
||||
getOrderById() { |
||||
uni.showLoading({ |
||||
title: '加载中...' |
||||
}) |
||||
let params = { |
||||
orderId: this.orderNo, |
||||
} |
||||
getOrderById(params).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
this.orderList = res.return_data.highChildOrderList[0]; |
||||
} |
||||
}) |
||||
}, |
||||
|
||||
//获取订单数据 |
||||
orderToPay() { |
||||
let that = this; |
||||
if (that.paytype == '') { |
||||
uni.showToast({ |
||||
title: '请选择支付方式', |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
return; |
||||
} |
||||
if (that.paytype == 'weixin') { |
||||
that.unionPay(); |
||||
return; |
||||
} |
||||
if (that.paytype == 'gonghuika') { |
||||
if (!that.user.isSetPayPwd) { |
||||
uni.navigateTo({ |
||||
url: '../../login/updatePas/updatePas' |
||||
}) |
||||
return; |
||||
} |
||||
that.$refs.paymentPassword.modalFun('show'); |
||||
} |
||||
if (that.paytype == 'oilcard') { |
||||
if (!that.user.isSetPayPwd) { |
||||
uni.navigateTo({ |
||||
url: '../../login/updatePas/updatePas' |
||||
}) |
||||
return; |
||||
} |
||||
if (!that.user.isSetHltCard) { |
||||
uni.showToast({ |
||||
icon: 'none', |
||||
title: '当前账号还未绑定,前往绑定', |
||||
duration: 2000, |
||||
success() { |
||||
setTimeout(() => { |
||||
uni.navigateTo({ |
||||
url: '../../user/bindingCard/bindingCard' |
||||
}) |
||||
}, 1000) |
||||
} |
||||
}); |
||||
return; |
||||
} |
||||
that.$refs.paymentPassword.modalFun('show'); |
||||
} |
||||
|
||||
}, |
||||
//银联获取信息 |
||||
unionPay() { |
||||
let goods = { |
||||
"orderId": this.orderNo |
||||
} |
||||
unionPay(goods).then(res => { |
||||
if (res.return_code == '000000') { |
||||
this.uniontopay(res.return_data.prepayid); |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}); |
||||
} |
||||
}) |
||||
}, |
||||
//银联支付 |
||||
uniontopay(item) { |
||||
let that = this; |
||||
upsdk.pluginReady(function() { |
||||
upsdk.pay({ |
||||
tn: item, |
||||
success: function(res) { |
||||
uni.showToast({ |
||||
title: '支付成功' |
||||
}) |
||||
uni.reLaunch({ |
||||
url: '/pages/goods/refuel-succes/refuel-succes?id=' + that |
||||
.orderNo |
||||
}); |
||||
}, |
||||
fail: function(err) { |
||||
uni.showToast({ |
||||
title: err.msg, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
// 支付失败, err.msg 是失败原因描述, 比如TN号不合法, 或者用户取消了交易 等等。 |
||||
} |
||||
}); |
||||
}); |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="less"> |
||||
page { |
||||
background-color: #f7f7f7; |
||||
} |
||||
|
||||
.conImg { |
||||
width: 100px; |
||||
height: 100px; |
||||
border-radius: 8px; |
||||
} |
||||
|
||||
.conCont { |
||||
margin-left: 115px; |
||||
} |
||||
|
||||
.slogan { |
||||
color: #807c87; |
||||
text-decoration: line-through; |
||||
} |
||||
|
||||
.footer { |
||||
position: fixed; |
||||
bottom: 0upx; |
||||
width: 100%; |
||||
height: 100rpx; |
||||
color: #FFFFFF; |
||||
border-top: solid 1upx #eee; |
||||
background-color: #FFFFFF; |
||||
z-index: 2; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
|
||||
.reBtn { |
||||
width: 120px; |
||||
background-color: #089bf5; |
||||
color: #FFFFFF; |
||||
text-align: center; |
||||
padding: 0; |
||||
font-size: 16px; |
||||
border-radius: 0px; |
||||
height: 50px; |
||||
line-height: 50px; |
||||
position: absolute; |
||||
right: 0px; |
||||
} |
||||
} |
||||
</style> |
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,488 +1,359 @@ |
||||
<template> |
||||
<view> |
||||
<view class="width100 backcorfff"> |
||||
<image mode="widthFix" class=" flleft sear mart15" :src="imagewxUrl+imgadres"></image> |
||||
<uSearchBar @confirm="search" @input="input"></uSearchBar> |
||||
</view> |
||||
<!-- <slFilter :independence="true" :color="titleColor" :themeColor="themeColor" :menuList.sync="menuList" |
||||
@result="result"></slFilter> --> |
||||
<view class="width100 height40 backcorfff"> |
||||
<view class="stuMenu flleft fotct" @click="showPopup(1)">{{distance}} |
||||
<image mode="widthFix" class="stuimg margle" :src="imagewxUrl+imgadres2"></image> |
||||
</view> |
||||
<view class="stuMenu flleft fotct" @click="showPopup(2)">{{distanceName}} |
||||
<image mode="widthFix" class="stuimg margle" :src="imagewxUrl+imgadres2"></image> |
||||
</view> |
||||
<view class="stuMenu flleft fotct" @click="showPopup(3)">{{onilName}} |
||||
<image mode="widthFix" class="stuimg margle" :src="imagewxUrl+imgadres2"></image> |
||||
</view> |
||||
</view> |
||||
|
||||
<view v-if="refuelList == '' " class="mart60 fotct font14 fcor666"> |
||||
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres3"></image> |
||||
</view> |
||||
<view class="width96 height100p backcorfff border-r mart10" v-for="(item,index) in refuelList" :key="index"> |
||||
<image mode="widthFix" :src="item.store_logo" class="recontleft flleft mart10 border-r" |
||||
style="max-height: 80px;" @click="goDetails(item.store_key,item.id)"> |
||||
</image> |
||||
<view class="recontright"> |
||||
<view class="text1 width100 font18 fontwig6 paddtop10" @click="goDetails(item.store_key,item.id)"> |
||||
{{item.store_name}}</view> |
||||
<view class="width100 mart5 height22"> |
||||
<view class="width70 flleft text1 font13 fcor999" @click="goDetails(item.store_key,item.id)"> |
||||
{{item.address}} |
||||
</view> |
||||
<view class="width30 flright font13 fcor666 fotct" @click="seeloaction(item)"> |
||||
<image mode="widthFix" :src="imagewxUrl+imgadres1" style="width: 10px;"></image> |
||||
{{item.distance}}km |
||||
</view> |
||||
</view> |
||||
<view class="font14 width100 fcoreb5 mart5 height22" @click="goDetails(item.store_key,item.id)"> |
||||
<text class="font18 fontwig6">{{item.price_vip}}</text>起<text |
||||
class="fcor999 margle">油站价¥{{item.price_gun}}</text> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
|
||||
<wybPopup ref="popup" type="bottom" height="800" width="500" radius="6" :showCloseIcon="false"> |
||||
<view class="fotct font18 fontwig6 fcor333 mart10 height30" v-if="typeId == 1">筛选距离</view> |
||||
<view class="fotct font18 fontwig6 fcor333 mart10 height30" v-if="typeId == 2">优先条件</view> |
||||
<view class="fotct font18 fontwig6 fcor333 mart10 height30" v-if="typeId == 3">油号选择</view> |
||||
<view class="mart15" v-if="typeId == 1"> |
||||
<view :class="item.name == distance?'activeRefuel':'refuel'" v-for="(item,index) in gunnumber" |
||||
:key="index" @click="changeValue(item)"> |
||||
{{item.name}} |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="mart15" v-if="typeId == 2"> |
||||
<view :class="item.name == distanceName?'activeRefuel':'refuel'" v-for="(item,index) in detailList" |
||||
:key="index" @click="changeValue1(item)"> |
||||
{{item.name}} |
||||
</view> |
||||
</view> |
||||
<view class="mart15" v-if="typeId == 3"> |
||||
<view v-for="(item,index) in oilList" :key="index"> |
||||
<view class="font15 fcor666 width90 mart10 height22">{{item.name}}</view> |
||||
<view :class="items.name == onilName?'activeRefuel':'refuel'" |
||||
v-for="(items,indexs) in item.nillist" :key="indexs" @click="changeValue2(items)"> |
||||
{{items.name}} |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</wybPopup> |
||||
<!-- <authorize></authorize> --> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getGasStoreList |
||||
} from '../../../Utils/Api.js'; |
||||
import slFilter from '@/components/sl-filter/sl-filter.vue'; |
||||
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; |
||||
import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue'; |
||||
// import authorize from '../../../components/Authorize.vue' |
||||
let app = getApp(); |
||||
export default { |
||||
components: { |
||||
slFilter, |
||||
// authorize, |
||||
uSearchBar, |
||||
wybPopup |
||||
}, |
||||
data() { |
||||
return { |
||||
themeColor: '#089bf5', |
||||
titleColor: '#666666', |
||||
filterResult: '', |
||||
imagewxUrl: app.globalData.imageWxImg, |
||||
imgadres:'btjy.png', |
||||
imgadres1:'dh.png', |
||||
imgadres2:'xiala.png', |
||||
imgadres3:'noorder.png', |
||||
menuList: [ |
||||
{ |
||||
'title': '油号', |
||||
'key': 'single2', |
||||
'isMutiple': false, |
||||
'detailTitle': '', |
||||
'reflexTitle': true, |
||||
'defaultSelectedIndex': 0, |
||||
'detailList': [{ |
||||
'title': '90#', |
||||
'value': '' |
||||
}, { |
||||
'title': '92#', |
||||
'value': '92#' |
||||
}, { |
||||
'title': '95#', |
||||
'value': '95#' |
||||
}, { |
||||
'title': '98#', |
||||
'value': '98#' |
||||
}, { |
||||
'title': '101#', |
||||
'value': '101#' |
||||
}, ] |
||||
}, |
||||
{ |
||||
'title': '距离', |
||||
'key': 'single3', |
||||
'isMutiple': false, |
||||
'detailTitle': '', |
||||
'reflexTitle': true, |
||||
'defaultSelectedIndex': 0, |
||||
'detailList': [{ |
||||
'title': '6km内', |
||||
'value': '' |
||||
}, |
||||
{ |
||||
'title': '10km内', |
||||
'value': '10km内' |
||||
}, |
||||
{ |
||||
'title': '15km内', |
||||
'value': '15km内' |
||||
}, |
||||
{ |
||||
'title': '20km内', |
||||
'value': '20km内' |
||||
}, |
||||
{ |
||||
'title': '50km内', |
||||
'value': '50km内' |
||||
}, { |
||||
'title': '2000km内', |
||||
'value': '2000' |
||||
} |
||||
] |
||||
}, { |
||||
'title': '距离', |
||||
'key': 'single1', |
||||
'isMutiple': false, |
||||
'detailTitle': '', |
||||
'reflexTitle': true, |
||||
'defaultSelectedIndex': 0, |
||||
'detailList': [{ |
||||
'title': '距离最近', |
||||
'value': '' |
||||
}] |
||||
|
||||
} |
||||
], |
||||
refuelList: [], |
||||
pageNum: 1, |
||||
pageSize: 10, |
||||
isNoMoreData: false, |
||||
searname: '', |
||||
gunnumber: [{ |
||||
id: 1, |
||||
name: '6km内', |
||||
value: 6 |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '10km内', |
||||
value: 10 |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '15km内', |
||||
value: 15 |
||||
}, |
||||
{ |
||||
id: 4, |
||||
name: '20km内', |
||||
value: 20 |
||||
}, |
||||
{ |
||||
id: 5, |
||||
name: '50km内', |
||||
value: 50 |
||||
}, { |
||||
id: 6, |
||||
name: '2000km内', |
||||
value: 2000 |
||||
} |
||||
], |
||||
distance: '50km内', |
||||
distanceNum: '50', |
||||
distanceName: '距离最近', |
||||
detailList: [{ |
||||
id: 1, |
||||
name: '距离最近' |
||||
}], |
||||
typeId: '', |
||||
oilList: [{ |
||||
id: 1, |
||||
name: '汽油', |
||||
nillist: [{ |
||||
id: 1, |
||||
name: '90#' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '92#' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '95#' |
||||
}, |
||||
{ |
||||
id: 4, |
||||
name: '98#' |
||||
}, |
||||
{ |
||||
id: 5, |
||||
name: '101#' |
||||
}, |
||||
{ |
||||
id: 6, |
||||
name: '95(甲醇)#' |
||||
}, |
||||
{ |
||||
id: 7, |
||||
name: '92(甲醇)#' |
||||
} |
||||
] |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '柴油', |
||||
nillist: [{ |
||||
id: 1, |
||||
name: '-40#' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '-35#' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '-30#' |
||||
}, |
||||
{ |
||||
id: 4, |
||||
name: '-20#' |
||||
}, |
||||
{ |
||||
id: 5, |
||||
name: '-10#' |
||||
}, |
||||
{ |
||||
id: 6, |
||||
name: '车队0#' |
||||
}, |
||||
{ |
||||
id: 7, |
||||
name: '0#' |
||||
}, |
||||
{ |
||||
id: 8, |
||||
name: '柴油#' |
||||
}, |
||||
] |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '天然气', |
||||
nillist: [{ |
||||
id: 1, |
||||
name: 'CNG' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: 'LNG' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: 'LPG' |
||||
} |
||||
] |
||||
} |
||||
], |
||||
onilName: '92#' |
||||
} |
||||
}, |
||||
onLoad() { |
||||
this.getGasStoreList(); |
||||
}, |
||||
onReachBottom() { |
||||
this.getGasStoreList(); |
||||
}, |
||||
methods: { |
||||
//筛选距离 |
||||
changeValue(item) { |
||||
this.distance = item.name; |
||||
this.distanceNum = item.value; |
||||
this.pageNum = 1; |
||||
this.isNoMoreData = false; |
||||
this.refuelList = []; |
||||
this.getGasStoreList(); |
||||
this.$refs.popup.hide(); |
||||
}, |
||||
|
||||
seeloaction(item) { |
||||
uni.openLocation({ |
||||
latitude: Number(item.latitude), //目的地的定位 |
||||
longitude: Number(item.longitude), //目的地的定位 |
||||
name: item.store_name, |
||||
address: item.address |
||||
}) |
||||
}, |
||||
changeValue1(item) { |
||||
this.distanceName = item.name; |
||||
this.pageNum = 1; |
||||
this.isNoMoreData = false; |
||||
this.refuelList = []; |
||||
this.getGasStoreList(); |
||||
this.$refs.popup.hide(); |
||||
}, |
||||
|
||||
changeValue2(item) { |
||||
this.onilName = item.name; |
||||
this.pageNum = 1; |
||||
this.isNoMoreData = false; |
||||
this.refuelList = []; |
||||
this.getGasStoreList(); |
||||
this.$refs.popup.hide(); |
||||
}, |
||||
//显示弹出 |
||||
showPopup(item) { |
||||
this.typeId = item; |
||||
this.$refs.popup.show(); |
||||
}, |
||||
search(res) { |
||||
uni.showToast({ |
||||
title: '搜索:' + res.value, |
||||
icon: 'none' |
||||
}) |
||||
}, |
||||
input(res) { |
||||
this.searname = res; |
||||
this.pageNum = 1; |
||||
this.isNoMoreData = false; |
||||
this.refuelList = []; |
||||
this.getGasStoreList(); |
||||
}, |
||||
//查询列表 |
||||
getGasStoreList() { |
||||
uni.showLoading({ |
||||
title: '加载中...' |
||||
}) |
||||
if (this.isNoMoreData) { |
||||
uni.hideLoading() |
||||
return false; |
||||
} |
||||
let pagenum = this.pageNum; |
||||
let params = { |
||||
storeName: this.searname, |
||||
distance: this.distanceNum, |
||||
regionId: app.globalData.cityId, |
||||
// regionId: '510000', |
||||
oilNoName: this.onilName, |
||||
latitude: app.globalData.latitude, |
||||
longitude: app.globalData.longitude, |
||||
// latitude: '30.83876', |
||||
// longitude: '106.129505', |
||||
pageNum: pagenum, |
||||
pageSize: this.pageSize |
||||
} |
||||
getGasStoreList(params).then(res => { |
||||
if (res.return_code == '000000') { |
||||
uni.hideLoading(); |
||||
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true; |
||||
if (res.return_data.total == (this.pageNum * this.pageSize)) { |
||||
this.isNoMoreData = true; |
||||
} |
||||
this.refuelList = this.refuelList.concat(res.return_data.list); |
||||
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; |
||||
} else { |
||||
this.refuelList = []; |
||||
uni.hideLoading() |
||||
} |
||||
}) |
||||
}, |
||||
//跳转详情 |
||||
goDetails(items, itemId) { |
||||
uni.navigateTo({ |
||||
url: '../refuel-details/refuel-details?id=' + items + '&desId=' + itemId |
||||
}) |
||||
}, |
||||
result(val) { |
||||
console.log('filter_result:' + JSON.stringify(val)); |
||||
this.filterResult = JSON.stringify(val, null, 2) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
page { |
||||
background-color: #f1f3f5; |
||||
} |
||||
|
||||
.refuel { |
||||
padding: 6px 5px; |
||||
border-radius: 5px; |
||||
background-color: #f6f6f6; |
||||
color: #666666; |
||||
margin-left: 10px; |
||||
margin-top: 15px; |
||||
display: inline-block; |
||||
font-size: 13px; |
||||
width: 18%; |
||||
text-align: center; |
||||
} |
||||
|
||||
.activeRefuel { |
||||
padding: 6px 5px; |
||||
border-radius: 5px; |
||||
border: 1px solid #089bf5; |
||||
color: #089bf5; |
||||
margin-left: 10px; |
||||
margin-top: 15px; |
||||
display: inline-block; |
||||
font-size: 13px; |
||||
width: 18%; |
||||
text-align: center; |
||||
} |
||||
|
||||
.stuMenu { |
||||
width: 33%; |
||||
height: 30px; |
||||
line-height: 30px; |
||||
font-size: 14px; |
||||
color: #333333; |
||||
|
||||
.stuimg { |
||||
width: 10px; |
||||
vertical-align: middle; |
||||
} |
||||
} |
||||
|
||||
.sear { |
||||
margin-left: 10px; |
||||
width: 50px; |
||||
} |
||||
|
||||
.searImg { |
||||
margin-left: 55px; |
||||
} |
||||
|
||||
.recontleft { |
||||
width: 80px; |
||||
margin-left: 10px; |
||||
} |
||||
|
||||
.recontright { |
||||
margin-left: 95px; |
||||
} |
||||
|
||||
.text { |
||||
margin-top: 50px; |
||||
margin-left: 20px; |
||||
width: 100%; |
||||
} |
||||
<template> |
||||
<view> |
||||
<view class="width100 backcorfff"> |
||||
<image mode="widthFix" class=" flleft sear mart15" :src="imagewxUrl+imgadres"></image> |
||||
<uSearchBar @confirm="search" @input="input"></uSearchBar> |
||||
</view> |
||||
<!-- <slFilter :independence="true" :color="titleColor" :themeColor="themeColor" :menuList.sync="menuList" |
||||
@result="result"></slFilter> --> |
||||
<view class="width100 height40 backcorfff"> |
||||
<view class="width90"> |
||||
<view class="stuMenu flleft fotct" @click="showPopup(3)">{{onilName}} |
||||
<image mode="widthFix" class="stuimg margle" :src="imagewxUrl+imgadres2"></image> |
||||
</view> |
||||
<view class="stuMenu flleft fotct" @click="showPopup(1)">{{distance}} |
||||
<image mode="widthFix" class="stuimg margle" :src="imagewxUrl+imgadres2"></image> |
||||
</view> |
||||
<!-- <view class="stuMenu flleft fotct" @click="showPopup(2)">{{distanceName}} |
||||
<image mode="widthFix" class="stuimg margle" :src="imagewxUrl+imgadres2"></image> |
||||
</view> --> |
||||
|
||||
</view> |
||||
</view> |
||||
|
||||
<view v-if="refuelList == '' " class="mart60 fotct font14 fcor666"> |
||||
<image mode="widthFix" style="width: 70vw;" :src="imagewxUrl+imgadres3"></image> |
||||
</view> |
||||
<view class="width96 height100p backcorfff border-r mart10" v-for="(item,index) in refuelList" :key="index"> |
||||
<image mode="widthFix" :src="item.store_logo" class="recontleft flleft mart10 border-r" |
||||
style="max-height: 80px;" @click="goDetails(item.store_key,item.id)"> |
||||
</image> |
||||
<view class="recontright"> |
||||
<view class="text1 width100 font18 fontwig6 paddtop10" @click="goDetails(item.store_key,item.id)"> |
||||
{{item.store_name}} |
||||
</view> |
||||
<view class="width100 mart5 height22"> |
||||
<view class="width70 flleft text1 font13 fcor999" @click="goDetails(item.store_key,item.id)"> |
||||
{{item.address}} |
||||
</view> |
||||
<view class="width30 flright font13 fcor666 fotct" @click="seeloaction(item)"> |
||||
<image mode="widthFix" :src="imagewxUrl+imgadres1" style="width: 10px;"></image> |
||||
{{item.distance}}km |
||||
</view> |
||||
</view> |
||||
<view class="font14 width100 fcoreb5 mart5 height22" @click="goDetails(item.store_key,item.id)"> |
||||
<text class="font18 fontwig6">{{item.price_vip}}</text>起<text |
||||
class="fcor999 margle">油站价¥{{item.price_gun}}</text> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
|
||||
<wybPopup ref="popup" type="bottom" height="800" width="500" radius="6" :showCloseIcon="false"> |
||||
<view class="fotct font18 fontwig6 fcor333 mart10 height30" v-if="typeId == 1">筛选距离</view> |
||||
<!-- <view class="fotct font18 fontwig6 fcor333 mart10 height30" v-if="typeId == 2">优先条件</view> --> |
||||
<view class="fotct font18 fontwig6 fcor333 mart10 height30" v-if="typeId == 3">油号选择</view> |
||||
<view class="mart15" v-if="typeId == 1"> |
||||
<view :class="item.name == distance?'activeRefuel':'refuel'" v-for="(item,index) in gunnumber" |
||||
:key="index" @click="changeValue(item)"> |
||||
{{item.name}} |
||||
</view> |
||||
</view> |
||||
|
||||
<!-- <view class="mart15" v-if="typeId == 2"> |
||||
<view :class="item.name == distanceName?'activeRefuel':'refuel'" v-for="(item,index) in detailList" |
||||
:key="index" @click="changeValue1(item)"> |
||||
{{item.name}} |
||||
</view> |
||||
</view> --> |
||||
<view class="mart15" v-if="typeId == 3"> |
||||
<view class="font15 fcor666 width90 mart10 height22">油品</view> |
||||
<view :class="items.codeName == onilName?'activeRefuel':'refuel'" v-for="(items,indexs) in oilList" |
||||
:key="indexs" @click="changeValue2(items)"> |
||||
{{items.codeName}} |
||||
</view> |
||||
</view> |
||||
</wybPopup> |
||||
<!-- <authorize></authorize> --> |
||||
|
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getGasStoreList, |
||||
getDictionaryByCodeType |
||||
} from '../../../Utils/Api.js'; |
||||
import slFilter from '@/components/sl-filter/sl-filter.vue'; |
||||
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; |
||||
import uSearchBar from '../../../components/uni-search-bar/components/uni-search-bar/uni-search-bar.vue'; |
||||
// import authorize from '../../../components/Authorize.vue' |
||||
let app = getApp(); |
||||
export default { |
||||
components: { |
||||
slFilter, |
||||
// authorize, |
||||
uSearchBar, |
||||
wybPopup |
||||
}, |
||||
data() { |
||||
return { |
||||
themeColor: '#089bf5', |
||||
titleColor: '#666666', |
||||
filterResult: '', |
||||
imagewxUrl: app.globalData.imageWxImg, |
||||
imgadres: 'btjy.png', |
||||
imgadres1: 'dh.png', |
||||
imgadres2: 'xiala.png', |
||||
imgadres3: 'noorder.png', |
||||
refuelList: [], |
||||
pageNum: 1, |
||||
pageSize: 10, |
||||
isNoMoreData: false, |
||||
searname: '', |
||||
gunnumber: [{ |
||||
id: 1, |
||||
name: '6km内', |
||||
value: 6 |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '10km内', |
||||
value: 10 |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '15km内', |
||||
value: 15 |
||||
}, |
||||
{ |
||||
id: 4, |
||||
name: '20km内', |
||||
value: 20 |
||||
}, |
||||
{ |
||||
id: 5, |
||||
name: '50km内', |
||||
value: 50 |
||||
}, { |
||||
id: 6, |
||||
name: '2000km内', |
||||
value: 2000 |
||||
} |
||||
], |
||||
distance: '50km内', |
||||
distanceNum: '50', |
||||
distanceName: '距离最近', |
||||
detailList: [{ |
||||
id: 1, |
||||
name: '距离最近' |
||||
}], |
||||
typeId: '', |
||||
oilList: [], |
||||
onilName: '0#', |
||||
latitudeful: '', |
||||
longitudeful: '', |
||||
isTyAgent: false //是否是代理商 |
||||
} |
||||
}, |
||||
onLoad() { |
||||
let that = this; |
||||
that.getDictionaryByCodeType(); |
||||
if (app.globalData.accountId) { |
||||
that.isTyAgent = true; |
||||
} |
||||
uni.getLocation({ |
||||
type: 'wgs84', |
||||
success: function(res) { |
||||
that.latitudeful = res.latitude; |
||||
that.longitudeful = res.longitude; |
||||
that.getGasStoreList(); |
||||
} |
||||
}) |
||||
}, |
||||
onReachBottom() { |
||||
this.getGasStoreList(); |
||||
}, |
||||
methods: { |
||||
//查询油品 |
||||
getDictionaryByCodeType() { |
||||
let datas = { |
||||
codeType: 'GAS_OIL_TYPE' |
||||
} |
||||
getDictionaryByCodeType(datas).then(res => { |
||||
if (res.return_code == '000000') { |
||||
this.oilList = res.return_data; |
||||
} |
||||
}) |
||||
}, |
||||
//筛选距离 |
||||
changeValue(item) { |
||||
this.distance = item.name; |
||||
this.distanceNum = item.value; |
||||
this.pageNum = 1; |
||||
this.isNoMoreData = false; |
||||
this.refuelList = []; |
||||
this.getGasStoreList(); |
||||
this.$refs.popup.hide(); |
||||
}, |
||||
|
||||
seeloaction(item) { |
||||
uni.openLocation({ |
||||
latitude: Number(item.latitude), //目的地的定位 |
||||
longitude: Number(item.longitude), //目的地的定位 |
||||
name: item.store_name, |
||||
address: item.address |
||||
}) |
||||
}, |
||||
changeValue1(item) { |
||||
this.distanceName = item.name; |
||||
this.pageNum = 1; |
||||
this.isNoMoreData = false; |
||||
this.refuelList = []; |
||||
this.getGasStoreList(); |
||||
this.$refs.popup.hide(); |
||||
}, |
||||
|
||||
changeValue2(item) { |
||||
this.onilName = item.codeName; |
||||
this.pageNum = 1; |
||||
this.isNoMoreData = false; |
||||
this.refuelList = []; |
||||
this.getGasStoreList(); |
||||
this.$refs.popup.hide(); |
||||
}, |
||||
//显示弹出 |
||||
showPopup(item) { |
||||
this.typeId = item; |
||||
this.$refs.popup.show(); |
||||
}, |
||||
search(res) { |
||||
uni.showToast({ |
||||
title: '搜索:' + res.value, |
||||
icon: 'none' |
||||
}) |
||||
}, |
||||
input(res) { |
||||
this.searname = res; |
||||
this.pageNum = 1; |
||||
this.isNoMoreData = false; |
||||
this.refuelList = []; |
||||
this.getGasStoreList(); |
||||
}, |
||||
//查询列表 |
||||
getGasStoreList() { |
||||
uni.showLoading({ |
||||
title: '加载中...' |
||||
}) |
||||
if (this.isNoMoreData) { |
||||
uni.hideLoading() |
||||
return false; |
||||
} |
||||
let pagenum = this.pageNum; |
||||
let params = { |
||||
storeName: this.searname, |
||||
distance: this.distanceNum, |
||||
regionId: app.globalData.cityId, |
||||
oilNoName: this.onilName, |
||||
latitude: this.latitudeful, |
||||
longitude: this.longitudeful, |
||||
pageNum: pagenum, |
||||
pageSize: this.pageSize, |
||||
isTyAgent: this.isTyAgent |
||||
} |
||||
getGasStoreList(params).then(res => { |
||||
if (res.return_code == '000000') { |
||||
uni.hideLoading(); |
||||
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true; |
||||
if (res.return_data.total == (this.pageNum * this.pageSize)) { |
||||
this.isNoMoreData = true; |
||||
} |
||||
this.refuelList = this.refuelList.concat(res.return_data.list); |
||||
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; |
||||
} else { |
||||
this.refuelList = []; |
||||
uni.hideLoading() |
||||
} |
||||
}) |
||||
}, |
||||
//跳转详情 |
||||
goDetails(items, itemId) { |
||||
uni.navigateTo({ |
||||
url: '../refuel-details/refuel-details?id=' + items + '&desId=' + itemId |
||||
}) |
||||
}, |
||||
result(val) { |
||||
console.log('filter_result:' + JSON.stringify(val)); |
||||
this.filterResult = JSON.stringify(val, null, 2) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
page { |
||||
background-color: #f1f3f5; |
||||
} |
||||
|
||||
.refuel { |
||||
padding: 6px 5px; |
||||
border-radius: 5px; |
||||
background-color: #f6f6f6; |
||||
color: #666666; |
||||
margin-left: 10px; |
||||
margin-top: 15px; |
||||
display: inline-block; |
||||
font-size: 13px; |
||||
width: 18%; |
||||
text-align: center; |
||||
} |
||||
|
||||
.activeRefuel { |
||||
padding: 6px 5px; |
||||
border-radius: 5px; |
||||
border: 1px solid #089bf5; |
||||
color: #089bf5; |
||||
margin-left: 10px; |
||||
margin-top: 15px; |
||||
display: inline-block; |
||||
font-size: 13px; |
||||
width: 18%; |
||||
text-align: center; |
||||
} |
||||
|
||||
.stuMenu { |
||||
width: 33.3%; |
||||
height: 30px; |
||||
line-height: 30px; |
||||
font-size: 14px; |
||||
color: #333333; |
||||
|
||||
.stuimg { |
||||
width: 10px; |
||||
vertical-align: middle; |
||||
} |
||||
} |
||||
|
||||
.sear { |
||||
margin-left: 10px; |
||||
width: 50px; |
||||
} |
||||
|
||||
.searImg { |
||||
margin-left: 55px; |
||||
} |
||||
|
||||
.recontleft { |
||||
width: 80px; |
||||
margin-left: 10px; |
||||
} |
||||
|
||||
.recontright { |
||||
margin-left: 95px; |
||||
} |
||||
|
||||
.text { |
||||
margin-top: 50px; |
||||
margin-left: 20px; |
||||
width: 100%; |
||||
} |
||||
</style> |
||||
|
@ -1,246 +1,323 @@ |
||||
<template> |
||||
<view> |
||||
<view class="form re" style="top: 100rpx;"> |
||||
<view class="username paddtop10" v-if="UserCard"> |
||||
<picker mode="selector" style="width: 90%;" :range="UserCard" range-key="cardNo" |
||||
@change="bindUserCard"> |
||||
<view class="date text1">{{cardNoNumber}}</view> |
||||
</picker> |
||||
<image class="flright" style="width: 15px;height: 15px;" src="../../../static/img/downj.png"></image> |
||||
</view> |
||||
<view class="username" v-if="!UserCard"> |
||||
<input style="width: 100%;" :disabled="disStute" maxlength="19" placeholder="请输入工会卡号" v-model="cardNoNumber" |
||||
placeholder-style="color: #333333;"/> |
||||
</view> |
||||
<view class="username" v-if="phoneNumber"> |
||||
<view class="get-code" :style="{'color':getCodeBtnColor}" @click.stop="getCode()">{{getCodeText}}</view> |
||||
<input disabled="true" v-model="phoneNumber" placeholder-style="color: #333333;" /> |
||||
</view> |
||||
<view class="code" v-if="phoneNumber"> |
||||
<input placeholder="请输入验证码" v-model="code" placeholder-style="color: #333333;" /> |
||||
</view> |
||||
<view class="btn mart50" @tap="bindHuiLianTongCard" v-if="phoneNumber">绑定卡号</view> |
||||
<view class="btn mart50" @tap="doCardNonum" v-else>获取预留手机号</view> |
||||
</view> |
||||
<view class="width90 mart20 height120 backcorfff fotct" style="position: absolute;top: 390px;"> |
||||
<view class="fontlet font20 fcor666 fontwig6 height45l " style="border-bottom: 1px solid #F4F4F4;">【温馨提示】</view> |
||||
<view class="fontlet font20 fcor666 fontwig6 height45l paddtop10">1元可抵扣100积分</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import md5 from "@/common/SDK/md5.min.js"; |
||||
<template> |
||||
<view> |
||||
<view class="form re" style="top: 100rpx;"> |
||||
|
||||
<view class="username paddtop10"> |
||||
<picker mode="selector" style="width: 90%;" :range="cardList" range-key="codeName" |
||||
@change="changeUserCard"> |
||||
<view class="date text1" style="padding: 0 25rpx;">{{typeName}}</view> |
||||
</picker> |
||||
<image class="flright" style="width: 15px;height: 15px;" src="../../../static/img/downj.png"></image> |
||||
</view> |
||||
|
||||
<!-- <view class="username paddtop10" v-if="UserCard && type == 2"> |
||||
<picker mode="selector" style="width: 90%;" :range="UserCard" range-key="cardNo" @change="bindUserCard"> |
||||
<view class="date text1">{{cardNoNumber}}</view> |
||||
</picker> |
||||
<image class="flright" style="width: 15px;height: 15px;" src="../../../static/img/downj.png"></image> |
||||
</view> --> |
||||
|
||||
|
||||
<view class="username"> |
||||
<input style="width: 100%;" :disabled="disStute" maxlength="19" placeholder="请输入卡号" |
||||
v-model="cardNoNumber" placeholder-style="color: #333333;" /> |
||||
</view> |
||||
<view class="username" v-if="phoneNumber"> |
||||
<view class="get-code" :style="{'color':getCodeBtnColor}" @click.stop="getCode()">{{getCodeText}}</view> |
||||
<input disabled="true" v-model="phoneNumber" placeholder-style="color: #333333;" /> |
||||
</view> |
||||
<view class="code" v-if="phoneNumber"> |
||||
<input placeholder="请输入验证码" v-model="code" placeholder-style="color: #333333;" /> |
||||
</view> |
||||
<view class="btn mart50" @tap="bindHuiLianTongCard" v-if="phoneNumber">绑定卡号</view> |
||||
<view class="btn mart50" @tap="doCardNonum" v-else>获取预留手机号</view> |
||||
</view> |
||||
<view class="width90 mart20 height120 backcorfff fotct" style="position: absolute;top: 70%;" v-if="type == 1"> |
||||
<view class="fontlet font20 fcor666 fontwig6 height45l " style="border-bottom: 1px solid #F4F4F4;">【温馨提示】 |
||||
</view> |
||||
<view class="fontlet font20 fcor666 fontwig6 height45l paddtop10">1元可抵扣100积分</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import md5 from "@/common/SDK/md5.min.js"; |
||||
import { |
||||
sendSmsCode, |
||||
getHuiLianTongCardByCardNo, |
||||
bindHuiLianTongCard, |
||||
getUserCardList, |
||||
getHuiLianTongCardByPhone |
||||
} from '../../../Utils/Api.js'; |
||||
let app = getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
cardNoNumber: "", |
||||
phoneNumber: "", |
||||
code: '', |
||||
getCodeText: '获取验证码', |
||||
getCodeBtnColor: "#0083f5", |
||||
getCodeisWaiting: false, |
||||
disStute: false, |
||||
UserCard:'' |
||||
} |
||||
}, |
||||
onLoad(options) { |
||||
this.user = app.globalData.userInfo; |
||||
this.getHuiLianTongCardByPhone(); |
||||
}, |
||||
|
||||
methods: { |
||||
Timer() {}, |
||||
//查询我的卡号列表 |
||||
getHuiLianTongCardByPhone() { |
||||
let params = { |
||||
phone : this.user.phone |
||||
} |
||||
uni.showLoading(); |
||||
getHuiLianTongCardByPhone(params).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000' && res.return_data !='') { |
||||
this.UserCard = res.return_data; |
||||
this.cardNoNumber = res.return_data[0].cardNo; |
||||
return; |
||||
} |
||||
this.UserCard = ''; |
||||
}); |
||||
}, |
||||
//选择卡号 |
||||
bindUserCard(e) { |
||||
this.cardNoNumber = this.UserCard[e.target.value].cardNo; |
||||
}, |
||||
getCode() { |
||||
uni.hideKeyboard() |
||||
if (this.getCodeisWaiting) { |
||||
return; |
||||
} |
||||
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) { |
||||
uni.showToast({ |
||||
title: '请填写正确手机号码', |
||||
icon: "none" |
||||
}); |
||||
return false; |
||||
} |
||||
uni.showLoading({ |
||||
title: '发送中...' |
||||
}) |
||||
let params = { |
||||
phone: this.phoneNumber |
||||
} |
||||
sendSmsCode(params).then(res => { |
||||
if (res.return_code == '000000') { |
||||
this.getCodeisWaiting = true; |
||||
this.getCodeBtnColor = "#999999" |
||||
uni.showToast({ |
||||
title: '验证码已发送', |
||||
icon: "none" |
||||
}); |
||||
this.setTimer(); |
||||
} else { |
||||
uni.hideLoading() |
||||
} |
||||
}) |
||||
}, |
||||
setTimer() { |
||||
let holdTime = 60; |
||||
this.getCodeText = "重新获取(60)" |
||||
this.Timer = setInterval(() => { |
||||
if (holdTime <= 0) { |
||||
this.getCodeisWaiting = false; |
||||
this.getCodeBtnColor = "#333333"; |
||||
this.getCodeText = "获取验证码" |
||||
clearInterval(this.Timer); |
||||
return; |
||||
} |
||||
this.getCodeText = "重新获取(" + holdTime + ")" |
||||
holdTime--; |
||||
|
||||
}, 1000) |
||||
}, |
||||
//获取预留手机号 |
||||
doCardNonum() { |
||||
if (!this.cardNoNumber) { |
||||
uni.showToast({ |
||||
title: '请填写卡号', |
||||
icon: "none" |
||||
}); |
||||
return false; |
||||
} |
||||
if (this.cardNoNumber.length != 19) { |
||||
uni.showToast({ |
||||
title: '请填写正确的19位卡号', |
||||
icon: "none" |
||||
}); |
||||
return false; |
||||
} |
||||
uni.showLoading({ |
||||
title: '查询中...' |
||||
}) |
||||
let params = { |
||||
cardNo: this.cardNoNumber |
||||
} |
||||
getHuiLianTongCardByCardNo(params).then(res => { |
||||
uni.hideLoading() |
||||
if (res.return_code == '000000') { |
||||
this.phoneNumber = res.return_data.userMobile; |
||||
// this.phoneNumber = 15583658692; |
||||
this.disStute = true |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: "none" |
||||
}); |
||||
} |
||||
}) |
||||
}, |
||||
//绑定卡号 |
||||
bindHuiLianTongCard() { |
||||
uni.hideKeyboard() |
||||
//模板示例部分验证规则 |
||||
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) { |
||||
uni.showToast({ |
||||
title: '请填写正确手机号码', |
||||
icon: "none" |
||||
}); |
||||
return false; |
||||
} |
||||
if (!this.code) { |
||||
uni.showToast({ |
||||
title: '请填写验证码', |
||||
icon: "none" |
||||
}); |
||||
return false; |
||||
} |
||||
uni.showLoading({ |
||||
title: '提交中...' |
||||
}) |
||||
let params = { |
||||
cardNo: this.cardNoNumber, |
||||
sendSmsCodeByHw, |
||||
getHuiLianTongCardByCardNo, |
||||
getDetailByCardNo, |
||||
bindHuiLianTongCard, |
||||
getUserCardList, |
||||
getHuiLianTongCardByPhone, |
||||
getDictionaryByCodeType |
||||
} from '../../../Utils/Api.js'; |
||||
let app = getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
cardNoNumber: "", |
||||
phoneNumber: "", |
||||
code: '', |
||||
getCodeText: '获取验证码', |
||||
getCodeBtnColor: "#0083f5", |
||||
getCodeisWaiting: false, |
||||
disStute: false, |
||||
UserCard: '', |
||||
cardList: [], // 卡列表 |
||||
typeName: '', // 卡名称 |
||||
type: '' //区分类型 |
||||
} |
||||
}, |
||||
onLoad(options) { |
||||
this.user = app.globalData.userInfo; |
||||
// this.getHuiLianTongCardByPhone(); |
||||
this.getDictionaryByCodeType(); |
||||
}, |
||||
|
||||
methods: { |
||||
Timer() {}, |
||||
getDictionaryByCodeType() { |
||||
let datas = { |
||||
codeType: 'USER_CARD_TYPE' |
||||
} |
||||
getDictionaryByCodeType(datas).then(res => { |
||||
if (res.return_code == '000000') { |
||||
this.cardList = res.return_data; |
||||
this.type = res.return_data[0].codeValue; |
||||
this.typeName = res.return_data[0].codeName; |
||||
} |
||||
}) |
||||
}, |
||||
//查询我的卡号列表 |
||||
getHuiLianTongCardByPhone() { |
||||
let params = { |
||||
phone: this.user.phone |
||||
} |
||||
uni.showLoading(); |
||||
getHuiLianTongCardByPhone(params).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000' && res.return_data != '') { |
||||
this.UserCard = res.return_data; |
||||
this.cardNoNumber = res.return_data[0].cardNo; |
||||
return; |
||||
} |
||||
this.UserCard = ''; |
||||
}); |
||||
}, |
||||
//选择卡类型 |
||||
changeUserCard(e) { |
||||
this.type = this.cardList[e.target.value].codeValue; |
||||
this.typeName = this.cardList[e.target.value].codeName; |
||||
this.cardNoNumber = ''; |
||||
this.phoneNumber = ''; |
||||
this.disStute = false; |
||||
}, |
||||
//选择卡号 |
||||
bindUserCard(e) { |
||||
this.cardNoNumber = this.UserCard[e.target.value].cardNo; |
||||
}, |
||||
getCode() { |
||||
uni.hideKeyboard() |
||||
if (this.getCodeisWaiting) { |
||||
return; |
||||
} |
||||
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) { |
||||
uni.showToast({ |
||||
title: '请填写正确手机号码', |
||||
icon: "none" |
||||
}); |
||||
return false; |
||||
} |
||||
uni.showLoading({ |
||||
title: '发送中...' |
||||
}) |
||||
let params = { |
||||
phone: this.phoneNumber, |
||||
smsCode: this.code |
||||
} |
||||
bindHuiLianTongCard(params).then(res => { |
||||
uni.hideLoading() |
||||
if (res.return_code == '000000') { |
||||
app.globalData.userInfo = res.return_data |
||||
.object |
||||
.highUser; |
||||
app.globalData.token = res.return_data.uniqueCode; |
||||
uni.setStorage({ |
||||
key: "user", |
||||
data: res.return_data |
||||
.object |
||||
.highUser |
||||
}) |
||||
uni.showToast({ |
||||
title: '绑定成功', |
||||
icon: "success", |
||||
duration: 2000, |
||||
success() { |
||||
setTimeout(() => { |
||||
uni.navigateBack({ |
||||
delta: 2 |
||||
}) |
||||
}, 1000) |
||||
} |
||||
}); |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: "none" |
||||
}); |
||||
} |
||||
}) |
||||
|
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
@import "../../../static/css/login.scss"; |
||||
.wximg { |
||||
width: 50px; |
||||
height: 50px; |
||||
margin-left: 40%; |
||||
margin-top: 250upx; |
||||
} |
||||
.flex1 { |
||||
flex: 1; |
||||
text-align: right; |
||||
width: 70%; |
||||
padding-right: 25rpx; |
||||
color: #999999; |
||||
font-size: 32rpx; |
||||
} |
||||
HWMSG:1 |
||||
} |
||||
sendSmsCodeByHw(params).then(res => { |
||||
if (res.return_code == '000000') { |
||||
this.getCodeisWaiting = true; |
||||
this.getCodeBtnColor = "#999999" |
||||
uni.showToast({ |
||||
title: '验证码已发送', |
||||
icon: "none" |
||||
}); |
||||
this.setTimer(); |
||||
} else { |
||||
uni.hideLoading() |
||||
} |
||||
}) |
||||
}, |
||||
setTimer() { |
||||
let holdTime = 60; |
||||
this.getCodeText = "重新获取(60)" |
||||
this.Timer = setInterval(() => { |
||||
if (holdTime <= 0) { |
||||
this.getCodeisWaiting = false; |
||||
this.getCodeBtnColor = "#333333"; |
||||
this.getCodeText = "获取验证码" |
||||
clearInterval(this.Timer); |
||||
return; |
||||
} |
||||
this.getCodeText = "重新获取(" + holdTime + ")" |
||||
holdTime--; |
||||
|
||||
}, 1000) |
||||
}, |
||||
//获取预留手机号 |
||||
doCardNonum() { |
||||
if (!this.cardNoNumber) { |
||||
uni.showToast({ |
||||
title: '请填写卡号', |
||||
icon: "none" |
||||
}); |
||||
return; |
||||
} |
||||
if (this.cardNoNumber.length != 19 && this.type == 1) { |
||||
uni.showToast({ |
||||
title: '请填写正确的19位工会卡号', |
||||
icon: "none" |
||||
}); |
||||
return; |
||||
} |
||||
if (this.cardNoNumber.length != 16 && this.type == 2) { |
||||
uni.showToast({ |
||||
title: '请填写正确的16位油卡号', |
||||
icon: "none" |
||||
}); |
||||
return; |
||||
} |
||||
|
||||
let params = { |
||||
cardNo: this.cardNoNumber |
||||
} |
||||
if (this.type == 1) { |
||||
this.getHuiLianTongCardByCardNo(params); |
||||
} |
||||
if (this.type == 2) { |
||||
this.getDetailByCardNo(params); |
||||
} |
||||
|
||||
}, |
||||
//查询工会卡 |
||||
getHuiLianTongCardByCardNo(items) { |
||||
uni.showLoading({ |
||||
title: '查询中...' |
||||
}) |
||||
getHuiLianTongCardByCardNo(items).then(res => { |
||||
uni.hideLoading() |
||||
if (res.return_code == '000000') { |
||||
this.phoneNumber = res.return_data.userMobile; |
||||
// this.phoneNumber = 15583658692; |
||||
this.disStute = true |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: "none" |
||||
}); |
||||
} |
||||
}) |
||||
}, |
||||
//查询油卡 |
||||
getDetailByCardNo(items) { |
||||
uni.showLoading({ |
||||
title: '查询中...' |
||||
}) |
||||
getDetailByCardNo(items).then(res => { |
||||
uni.hideLoading() |
||||
if (res.return_code == '000000') { |
||||
this.phoneNumber = res.return_data.contactPhone; |
||||
// this.phoneNumber = 15583658692; |
||||
this.disStute = true |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: "none" |
||||
}); |
||||
} |
||||
}) |
||||
}, |
||||
//绑定卡号 |
||||
bindHuiLianTongCard() { |
||||
uni.hideKeyboard() |
||||
//模板示例部分验证规则 |
||||
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) { |
||||
uni.showToast({ |
||||
title: '请填写正确手机号码', |
||||
icon: "none" |
||||
}); |
||||
return false; |
||||
} |
||||
if (!this.code) { |
||||
uni.showToast({ |
||||
title: '请填写验证码', |
||||
icon: "none" |
||||
}); |
||||
return false; |
||||
} |
||||
uni.showLoading({ |
||||
title: '提交中...' |
||||
}) |
||||
let params = { |
||||
type: this.type, |
||||
cardNo: this.cardNoNumber, |
||||
phone: this.phoneNumber, |
||||
smsCode: this.code |
||||
} |
||||
bindHuiLianTongCard(params).then(res => { |
||||
uni.hideLoading() |
||||
if (res.return_code == '000000') { |
||||
app.globalData.userInfo = res.return_data |
||||
.object |
||||
.highUser; |
||||
app.globalData.token = res.return_data.uniqueCode; |
||||
uni.setStorage({ |
||||
key: "user", |
||||
data: res.return_data |
||||
.object |
||||
.highUser |
||||
}) |
||||
uni.showToast({ |
||||
title: '绑定成功', |
||||
icon: "success", |
||||
duration: 2000, |
||||
success() { |
||||
setTimeout(() => { |
||||
uni.navigateBack({ |
||||
}) |
||||
}, 1000) |
||||
} |
||||
}); |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: "none" |
||||
}); |
||||
} |
||||
}) |
||||
|
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
@import "../../../static/css/login.scss"; |
||||
|
||||
.wximg { |
||||
width: 50px; |
||||
height: 50px; |
||||
margin-left: 40%; |
||||
margin-top: 250upx; |
||||
} |
||||
|
||||
.flex1 { |
||||
flex: 1; |
||||
text-align: right; |
||||
width: 70%; |
||||
padding-right: 25rpx; |
||||
color: #999999; |
||||
font-size: 32rpx; |
||||
} |
||||
</style> |
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 2.7 KiB |
@ -0,0 +1,407 @@ |
||||
<template> |
||||
<view> |
||||
<view class="backcorf06 height220 width100 fotct"> |
||||
<image src="../static/unioncard.png" v-if="types == 1" mode="widthFix" style="width: 120rpx;"></image> |
||||
<image src="../static/oilcard.png" v-if="types == 2" mode="widthFix" style="width: 120rpx;"></image> |
||||
<view class="mart10 font18 fontwig6 fcorfff" v-if="types == 1">工会卡</view> |
||||
<view class="mart10 font18 fontwig6 fcorfff" v-if="types == 2">油卡 |
||||
<text class="fcor41c font14 margle" v-if="cardList.status == 1">(正常)</text> |
||||
<text class="fcorred font14 margle" v-if="cardList.status == 2">(禁用)</text> |
||||
</view> |
||||
<view class="mart5 font18 fontwig6 fcorfff fontspec">余额: {{tongCardPrice}}</view> |
||||
<view class="mart5 font18 fontwig6 fcorfff fontspec">{{cardNo}}</view> |
||||
<view class="width40w height30 font16 fontlet fcorfff mart10 fotct border-r" |
||||
style="background-color: #b2b2b2;" @click="delUserCard()">解绑</view> |
||||
</view> |
||||
<!-- <view class="width90 mart20 fcor666 font12"> |
||||
支付限额 |
||||
</view> |
||||
<view class="width90 mart20 fcor666 font14 height25"> |
||||
<view class="width50 font14 fcor333 flleft">单笔限额</view> |
||||
<view class="width50 font14 fcor666 flright fotrt">¥20000</view> |
||||
</view> |
||||
<view class="width90 mart20 fcor666 font14 mart5 height25"> |
||||
<view class="width50 font14 fcor333 flleft">每日限额</view> |
||||
<view class="width50 font14 fcor666 flright fotrt">¥50000</view> |
||||
</view> --> |
||||
|
||||
<view class="leave_cont"> |
||||
<view class="ul"> |
||||
<view class="li" v-if="types == 1"> |
||||
<text class="font15 fcor333">业务类型</text> |
||||
<view class="flex1"> |
||||
<picker mode="selector" :range="title_list" range-key="name" @change="bindtitleList"> |
||||
<view class="date text1 margle10">{{titleName}}</view> |
||||
</picker> |
||||
</view> |
||||
</view> |
||||
<view class="li"> |
||||
<text class="font15 fcor333">开始时间</text> |
||||
<view class="flex1"> |
||||
<picker mode="date" :value="start_date" :start="startDate" :end="endDate" |
||||
@change="bindDateChange"> |
||||
<view class="date">{{start_date}}</view> |
||||
</picker> |
||||
</view> |
||||
</view> |
||||
<view class="li"> |
||||
<text class="font15 fcor333">结束时间</text> |
||||
<view class="flex1"> |
||||
<picker mode="date" :value="end_date" :start="startDate" :end="endDate" |
||||
@change="bindDateChange2"> |
||||
<view class="date">{{end_date}}</view> |
||||
</picker> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<view class="width90 mart30 fcor666 font12"> |
||||
订单列表 |
||||
</view> |
||||
<view class="width90 mart20 alijusstart fcor666 font12"> |
||||
<view class="width40">订单号</view> |
||||
<view class="width10 fotct">类型</view> |
||||
<view class="width20 fotct">金额</view> |
||||
<view class="width30">时间</view> |
||||
</view> |
||||
<view class="width100" v-if="types == 1"> |
||||
<view class="width90 mart5 alijusstart fcor666 font12" v-for="(item,index) in orderList" :key="index" |
||||
@click="popupOrderNo(item.orderNo)"> |
||||
<view class="width40 fcor333 text1">{{item.orderNo}}</view> |
||||
<view class="width10 fotct">支出</view> |
||||
<view class="width20 fotct">¥{{item.tranAmount}}</view> |
||||
<view class="width30">{{item.tranTime}}</view> |
||||
<!-- {{phoneorderdes.createTimed | timeFormat('yyyy-mm-dd')}} {{phoneorderdes.createTimed | timeFormat('hh:mm')}} --> |
||||
</view> |
||||
</view> |
||||
|
||||
<view class="width100" v-if="types == 2"> |
||||
<view class="width90 mart5 alijusstart fcor666 font12" v-for="(item,index) in orderList" :key="index" |
||||
@click="popupOrderNo(item.sourceOrderNo)"> |
||||
<view class="width40 fcor333 text1">{{item.sourceOrderNo}}</view> |
||||
<view class="width10 fotct fcor41c" v-if="item.type == 1">收入</view> |
||||
<view class="width10 fotct fcoreb5" v-if="item.type == 2">支出</view> |
||||
<view class="width20 fotct fcor41c" v-if="item.type == 1">+{{item.amount}}</view> |
||||
<view class="width20 fotct fcoreb5" v-if="item.type == 2">-{{item.amount}}</view> |
||||
<view class="width30"> |
||||
<view class="width100">{{item.createTime | timeFormat('yyyy-mm-dd')}}</view> |
||||
<view class="width100">{{item.createTime | timeFormat('hh:mm')}}</view> |
||||
|
||||
</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
delUserCard, |
||||
getDetailByCardNo, |
||||
getHuiLianTongCardBalance, |
||||
getOilCardRecordList, |
||||
getHuiLianTongCardConsume |
||||
} from '../../Utils/Api.js'; |
||||
export default { |
||||
data() { |
||||
const currentDate = this.getDate({ |
||||
format: true |
||||
}) |
||||
return { |
||||
types: '', //卡类型 |
||||
orderList: [], //消费列表 |
||||
cardNo: '', //卡号 |
||||
tongCardPrice: 0, //账户余额 |
||||
start_date: currentDate, //开始时间 |
||||
end_date: currentDate, //结束时间 |
||||
pageNum: 1, |
||||
pageSize: 10, |
||||
titleValue: 'sinopec_oil_code', //工会卡 |
||||
titleName: '中石化加油券', |
||||
title_list: [{ |
||||
name: '中石化加油券', |
||||
value: 'sinopec_oil_code' |
||||
}, |
||||
{ |
||||
name: '其他商品或服务', |
||||
value: 'hisen_consume' |
||||
} |
||||
], |
||||
isNoMoreData: false, |
||||
cardList: '' |
||||
} |
||||
}, |
||||
|
||||
onLoad(options) { |
||||
let that = this; |
||||
that.cardNo = options.cardNo; |
||||
that.types = options.des; |
||||
if (options.des == 1) { |
||||
that.getHuiLianTongCardBalance(); |
||||
that.getHuiLianTongCardConsume(); |
||||
} |
||||
if (options.des == 2) { |
||||
that.getDetailByCardNo(); |
||||
that.getOilCardRecordList(); |
||||
} |
||||
}, |
||||
//上滑刷新 |
||||
onReachBottom() { |
||||
if (this.types == 1) { |
||||
this.getHuiLianTongCardConsume(); |
||||
} |
||||
if (this.types == 2) { |
||||
this.getOilCardRecordList(); |
||||
} |
||||
}, |
||||
computed: { |
||||
startDate() { |
||||
return this.getDate('start'); |
||||
}, |
||||
endDate() { |
||||
return this.getDate('end'); |
||||
} |
||||
}, |
||||
methods: { |
||||
// 获取当前时间 |
||||
getDate(type) { |
||||
const date = new Date(); |
||||
let year = date.getFullYear(); |
||||
let month = date.getMonth() + 1; |
||||
let day = date.getDate(); |
||||
|
||||
if (type === 'start') { |
||||
year = year - 60; |
||||
} else if (type === 'end') { |
||||
year = year + 2; |
||||
} |
||||
month = month > 9 ? month : '0' + month; |
||||
day = day > 9 ? day : '0' + day; |
||||
return `${year}-${month}-${day}`; |
||||
}, |
||||
//弹出二维码 |
||||
popupOrderNo(item) { |
||||
uni.showToast({ |
||||
title: item, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
}, |
||||
// 选择日期 |
||||
bindDateChange: function(e) { |
||||
this.start_date = e.target.value; |
||||
this.pageNum = 1; |
||||
this.isNoMoreData = false; |
||||
this.orderList = []; |
||||
if (this.types == 1) { |
||||
this.getHuiLianTongCardConsume(); |
||||
} |
||||
if (this.types == 2) { |
||||
this.getOilCardRecordList(); |
||||
} |
||||
}, |
||||
bindDateChange2: function(e) { |
||||
this.end_date = e.target.value; |
||||
this.pageNum = 1; |
||||
this.isNoMoreData = false; |
||||
this.orderList = []; |
||||
if (this.types == 1) { |
||||
this.getHuiLianTongCardConsume(); |
||||
} |
||||
if (this.types == 2) { |
||||
this.getOilCardRecordList(); |
||||
} |
||||
}, |
||||
//选择类型 |
||||
bindtitleList(e) { |
||||
this.titleName = this.title_list[e.target.value].name; |
||||
this.titleValue = this.title_list[e.target.value].value; |
||||
this.pageNum = 1; |
||||
this.isNoMoreData = false; |
||||
this.orderList = []; |
||||
this.getHuiLianTongCardConsume(); |
||||
}, |
||||
//解除绑定我的卡号列表 |
||||
delUserCard() { |
||||
let that = this; |
||||
uni.showModal({ |
||||
content: '是否确定解除当前绑定卡号?', |
||||
success: (res) => { |
||||
if (res.confirm) { |
||||
let params = { |
||||
cardNo: that.cardNo |
||||
} |
||||
delUserCard(params).then(res => { |
||||
if (res.return_code == '000000') { |
||||
uni.showToast({ |
||||
title: '解除成功', |
||||
duration: 2000, |
||||
icon: 'success', |
||||
success() { |
||||
setTimeout(() => { |
||||
uni.navigateBack({}) |
||||
}, 1000) |
||||
} |
||||
}) |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
duration: 2000, |
||||
icon: 'none' |
||||
}) |
||||
} |
||||
}); |
||||
} else if (res.cancel) { |
||||
console.log('用户点击取消'); |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
//查询油卡 |
||||
getDetailByCardNo() { |
||||
uni.showLoading({ |
||||
title: '查询中...' |
||||
}) |
||||
let params = { |
||||
cardNo: this.cardNo |
||||
} |
||||
getDetailByCardNo(params).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
this.tongCardPrice = res.return_data.amount; |
||||
this.cardList = res.return_data; |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: "none" |
||||
}); |
||||
} |
||||
}) |
||||
}, |
||||
//查询详情 |
||||
getHuiLianTongCardBalance() { |
||||
uni.showLoading({ |
||||
title: '查询中...' |
||||
}) |
||||
let params = { |
||||
cardNo: this.cardNo |
||||
} |
||||
getHuiLianTongCardBalance(params).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
this.tongCardPrice = res.return_data.balance; |
||||
} else { |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: "none" |
||||
}); |
||||
} |
||||
}); |
||||
}, |
||||
//查询油卡列表 |
||||
getOilCardRecordList() { |
||||
uni.showLoading({ |
||||
title: '加载中...' |
||||
}) |
||||
if (this.isNoMoreData) { |
||||
uni.hideLoading() |
||||
return; |
||||
} |
||||
let pagenum = this.pageNum; |
||||
let Time1 = new Date(this.start_date.split('-').join('/')); |
||||
let timestemp1 = Time1.getTime(); |
||||
let Time2 = new Date(this.end_date.split('-').join('/')); |
||||
let timestemp2 = Time2.getTime() + 86399000; |
||||
let params = { |
||||
pageNum: pagenum, |
||||
createTimeS: timestemp1, |
||||
createTimeE: timestemp2, |
||||
cardNo: this.cardNo, |
||||
pageSize: this.pageSize |
||||
} |
||||
getOilCardRecordList(params).then(res => { |
||||
if (res.return_code == '000000' && res.return_data.list != '') { |
||||
uni.hideLoading(); |
||||
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true; |
||||
this.orderList = this.orderList.concat(res.return_data.list); |
||||
if (res.return_data.total == (this.pageNum * this.pageSize)) { |
||||
this.isNoMoreData = true; |
||||
} |
||||
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; |
||||
} else { |
||||
this.orderList = []; |
||||
uni.hideLoading() |
||||
} |
||||
}) |
||||
}, |
||||
//查询消费记录 |
||||
getHuiLianTongCardConsume() { |
||||
uni.showLoading({ |
||||
title: '加载中...' |
||||
}) |
||||
if (this.isNoMoreData) { |
||||
return false; |
||||
} |
||||
let pagenum = this.pageNum; |
||||
let Time1 = new Date(this.start_date.split('-').join('/')); |
||||
let timestemp1 = Time1.getTime(); |
||||
let Time2 = new Date(this.end_date.split('-').join('/')); |
||||
let timestemp2 = Time2.getTime() + 86399000; |
||||
let params = { |
||||
businessType: this.titleValue, |
||||
sdate: timestemp1, |
||||
edate: timestemp2, |
||||
cardNo: this.cardNo, |
||||
pageNum: pagenum, |
||||
pageSize: this.pageSize |
||||
} |
||||
getHuiLianTongCardConsume(params).then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000' && res.return_data.records != '') { |
||||
this.isNoMoreData = res.return_data.records.length == this.pageSize ? false : true; |
||||
this.orderList = this.orderList.concat(res.return_data.records); |
||||
this.pageNum = res.return_data.records.length == this.pageSize ? ++pagenum : pagenum; |
||||
} else { |
||||
this.orderList = []; |
||||
uni.hideLoading(); |
||||
uni.showToast({ |
||||
title: res.return_msg, |
||||
icon: 'none', |
||||
duration: 2000 |
||||
}) |
||||
this.isNoMoreData = true; |
||||
} |
||||
}); |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
.leave_cont { |
||||
background: #FFFFFF; |
||||
} |
||||
|
||||
.leave_cont .ul { |
||||
width: 90%; |
||||
margin-left: 5%; |
||||
} |
||||
|
||||
.leave_cont .ul .li { |
||||
display: flex; |
||||
align-items: center; |
||||
border-bottom: 1px solid #efefef; |
||||
} |
||||
|
||||
.leave_cont .ul .li text { |
||||
padding: 40rpx 0; |
||||
} |
||||
|
||||
.leave_cont .ul .li .flex1 { |
||||
flex: 1; |
||||
text-align: right; |
||||
width: 70%; |
||||
padding-right: 25rpx; |
||||
color: #999999; |
||||
font-size: 32rpx; |
||||
} |
||||
</style> |
@ -0,0 +1,100 @@ |
||||
<template> |
||||
<view> |
||||
<view class="width100 mart20" v-for="(item,index) in cardList" :key="index"> |
||||
<view class="width90 conts backcolorb9" v-if="item.type == 1"> |
||||
<view class="width90 alijusstart"> |
||||
<image src="../static/unioncard.png" mode="widthFix" style="width: 80rpx;"></image> |
||||
<text class="font18 fontwig6 fcorfff">工会卡</text> |
||||
</view> |
||||
<view class="width90 font18 fontwig6 fcorfff"> |
||||
卡号:<text class="margle">{{item.cardNo}}</text> |
||||
</view> |
||||
<!-- <view class="width90 font18 fontwig6 fcorfff"> |
||||
余额:<text class="margle">122</text> |
||||
</view> --> |
||||
<view class="width90 mart10 alijusstart font14"> |
||||
<view class="width30 height30 backcorfff colorb9 fotct border-r" |
||||
@click="jumpDetails(item.cardNo,item.type)">查看详情</view> |
||||
</view> |
||||
</view> |
||||
<view class="width90 conts backcolor32" v-if="item.type == 2"> |
||||
<view class="width90 alijusstart"> |
||||
<image src="../static/oilcard.png" mode="widthFix" style="width: 80rpx;"></image> |
||||
<text class="font18 fontwig6 fcorfff">油卡</text> |
||||
</view> |
||||
<view class="width90 font18 fontwig6 fcorfff"> |
||||
卡号:<text class="margle">{{item.cardNo}}</text> |
||||
</view> |
||||
<!-- <view class="width90 font18 fontwig6 fcorfff"> |
||||
余额:<text class="margle">122</text> |
||||
</view> --> |
||||
<view class="width90 mart10 alijusstart font14"> |
||||
<view class="width30 height30 backcorfff color32 fotct border-r" |
||||
@click="jumpDetails(item.cardNo,item.type)">查看详情</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<view class="width90 height70w border-r mart20 alijusstart backcorfff" @click="jumpBindCard()"> |
||||
<image src="../static/addcards.png" mode="widthFix" class="margle10" style="width: 40rpx;"></image> |
||||
<text class="margle font16 fcor333">添加新卡</text> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
getUserCardList |
||||
} from '../../Utils/Api.js'; |
||||
let app = getApp(); |
||||
export default { |
||||
data() { |
||||
return { |
||||
cardList: [] //绑定卡列表 |
||||
} |
||||
}, |
||||
onLoad() { |
||||
this.user = app.globalData.userInfo; |
||||
}, |
||||
onShow() { |
||||
this.getUserCardList(); |
||||
}, |
||||
methods: { |
||||
//查询卡列表 |
||||
getUserCardList() { |
||||
uni.showLoading({ |
||||
title: '加载中...' |
||||
}) |
||||
getUserCardList().then(res => { |
||||
uni.hideLoading(); |
||||
if (res.return_code == '000000') { |
||||
this.cardList = res.return_data; |
||||
return; |
||||
} |
||||
}); |
||||
}, |
||||
//跳转详情 |
||||
jumpDetails(item, item1) { |
||||
uni.navigateTo({ |
||||
url: '../cardsDetails/cardsDetails?cardNo=' + item + '&des=' + item1 |
||||
}) |
||||
}, |
||||
//跳转绑定卡 |
||||
jumpBindCard() { |
||||
uni.navigateTo({ |
||||
url: '../../pages/user/bindingCard/bindingCard' |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
page { |
||||
background-color: #f8f8f8; |
||||
} |
||||
|
||||
.conts { |
||||
border-radius: 12rpx; |
||||
padding: 12px 0; |
||||
} |
||||
</style> |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 36 KiB |
Loading…
Reference in new issue