1.新增卡包功能

yj-dev
杨杰 3 years ago
parent f4de516383
commit 04f3b699a6
  1. 16
      App.vue
  2. 24
      Utils/Api.js
  3. 23
      pages.json
  4. 155
      pages/goods/refuel-confirm/refuel-confirm.vue
  5. 51
      pages/goods/refuel-details/refuel-details.vue
  6. 140
      pages/pay/payment/payment.vue
  7. 2
      pages/tabBar/home/home.vue
  8. 10
      pages/tabBar/user/user.vue
  9. 119
      pages/user/bindingCard/bindingCard.vue
  10. 6
      pages/user/order_details/order_details.vue
  11. BIN
      static/img/ghkpay.png
  12. 407
      subPages/cardsDetails/cardsDetails.vue
  13. 109
      subPages/cardsList/cardsList.vue
  14. BIN
      subPages/static/addcards.png
  15. BIN
      subPages/static/oilcard.png
  16. BIN
      subPages/static/unioncard.png
  17. 34
      uni.scss

@ -5,15 +5,15 @@
// brestUrl: 'http://192.168.3.4:9302/brest',
// imgUrl: 'https://192.168.3.4:9301/filesystem/',
//
url: 'https://hsg.dctpay.com/crest',
imgUrl: 'https://hsg.dctpay.com/filesystem/',
brestUrl : 'https://hsg.dctpay.com/brest',
imageWxImg:'https://hsg.dctpay.com/filesystem/wxApplets/',
// url: 'https://hsg.dctpay.com/crest',
// imgUrl: 'https://hsg.dctpay.com/filesystem/',
// brestUrl : 'https://hsg.dctpay.com/brest',
// imageWxImg:'https://hsg.dctpay.com/filesystem/wxApplets/',
//
// url: 'https://hsgcs.dctpay.com/crest',
// brestUrl : 'https://hsgcs.dctpay.com/brest',
// imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
// imageWxImg:'https://hsgcs.dctpay.com/filesystem/wxApplets/',
url: 'https://hsgcs.dctpay.com/crest',
brestUrl : 'https://hsgcs.dctpay.com/brest',
imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
imageWxImg:'https://hsgcs.dctpay.com/filesystem/wxApplets/',
userInfo: "",
brestUserInfo : '',
openId: '',

@ -185,6 +185,14 @@ export const getGasDetailByStoreKey = params => {
export const getDictionaryByCodeTypeOl = params => {
return POST('GET', `${base}/common/getDictionaryByCodeTypeOl`, params).then(res => res.data);
}
//团油计算价格
export const oilPriceCompute = params => {
return POST('GET', `${base}/highGas/oilPriceCompute`, params).then(res => res.data);
}
//查询卡数据字典
export const getDictionaryByCodeType = params => {
return POST('GET', `${base}/common/getDictionaryByCodeType`, params).then(res => res.data);
}
//获取已开通的省份
export const getDredgeProvince = params => {
return POST('GET', `${base}/common/getDredgeProvince`, params).then(res => res.data);
@ -218,6 +226,11 @@ export const getDiscountPackageDetail = params => {
export const getHuiLianTongCardByCardNo = params => {
return POST('GET', `${base}/highUserCard/getHuiLianTongCardByCardNo`, params).then(res => res.data);
}
//查询油卡详情
export const getDetailByCardNo = params => {
return POST('GET', `${base}/oilCard/getDetailByCardNo`, params).then(res => res.data);
}
// 获取用户卡号列表
export const getUserCardList = params => {
return POST('GET', `${base}/highUserCard/getUserCardList`, params).then(res => res.data);
@ -226,6 +239,10 @@ export const getUserCardList = params => {
export const getHuiLianTongCardByPhone = params => {
return POST('GET', `${base}/highUserCard/getHuiLianTongCardByPhone`, params).then(res => res.data);
}
//查询油卡消费
export const getOilCardRecordList = params => {
return POST('GET', `${base}/oilCard/getOilCardRecordList`, params).then(res => res.data);
}
// 删除用户卡号
export const delUserCard = params => {
return POST('POST', `${base}/highUserCard/delUserCard`, params).then(res => res.data);
@ -242,8 +259,9 @@ export const getHuiLianTongCardConsume = params => {
export const hltUnionCardPay = params => {
return POST('POST', `${base}/order/hltUnionCardPay`, params).then(res => res.data);
}
//绑定卡包
export const bindHuiLianTongCard = params => {
return POST('POST', `${base}/highUserCard/bindHuiLianTongCard`, params).then(res => res.data);
return POST('POST', `${base}/highUserCard/bindCard`, params).then(res => res.data);
}
//手机短信登录
export const loginByTel = params => {
@ -389,6 +407,10 @@ export const orderToGoldPayunion = params => {
export const addOrderPay = params => {
return POST('POST', `${base}/outRechargeOrder/addOrder`, params).then(res => res.data);
}
//油卡支付
export const oilCardPay = params => {
return POST('POST', `${base}/order/oilCardPay`, params).then(res => res.data);
}
//话费充值查询
export const getListOutRechargePrice = params => {
return POST('GET', `${base}/outRechargePrice/getListOutRechargePrice`, params).then(res => res.data);

@ -472,6 +472,7 @@
"navigationBarTextStyle": "white"
}
}
],
"subpackages": [{
"root": "subPages",
@ -649,6 +650,28 @@
"navigationBarTextStyle": "white"
}
}, {
"path": "cardsList/cardsList",
"style": {
"navigationBarTitleText": "卡包",
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white"
}
}, {
"path": "cardsDetails/cardsDetails",
"style": {
"navigationBarTitleText": "卡详情",
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white"
}
}
]
}],

@ -67,6 +67,16 @@
</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">
@ -102,7 +112,9 @@
orderToPay,
getHuiLianTongCardBalance,
hltUnionCardPay,
orderToGoldPay
orderToGoldPay,
findUser,
oilCardPay
} from '../../../Utils/Api.js';
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue';
let app = getApp();
@ -121,6 +133,7 @@
orderList: '',
refulAdress: '',
tongCardPrice: 0,
oilPirce: 0, //
user: '',
paytype: '',
PaymentPassword: '',
@ -136,10 +149,27 @@
onShow() {
let that = this;
that.paytype = '';
that.user = app.globalData.userInfo;
// that.user = app.globalData.userInfo;
that.findUser();
// that.getHuiLianTongCardBalance();
},
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;
@ -184,39 +214,87 @@
return;
}
let params = {
"orderId": this.orderNo,
"cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword
}
hltUnionCardPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
if (this.paytype == 'jifen') {
let params = {
"orderId": this.orderNo,
"cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword
}
hltUnionCardPay(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: '支付成功'
title: res.return_msg,
icon: 'none'
})
uni.reLaunch({
url: '/pages/goods/refuel-succes/refuel-succes?id=' + this.orderNo
});
return;
})
return;
}
if (this.paytype == 'oilcard') {
let params = {
"orderId": this.orderNo,
"cardNo": this.user.oilCard.cardNo,
"password": this.PaymentPassword
}
if (res.return_code == '102130') {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
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;
}
uni.showToast({
title: res.return_msg,
icon: 'none'
})
})
return;
}
},
//
changeRiado() {
if (!this.user.isSetHltCard) {
// if (!this.user.isSetHltCard && this.paytype == 'gonghuika') {
// uni.showToast({
// icon: 'none',
// title: ',',
// duration: 2000,
// success() {
// setTimeout(() => {
// uni.navigateTo({
// url: '../../user/bindingCard/bindingCard'
// })
// }, 1000)
// }
// });
// return;
// }
if (!this.user.isSetOilCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
@ -330,6 +408,31 @@
return;
}
if (that.paytype == 'gonghuika') {
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
})
return;
}
if (!that.user.isSetOilCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../../user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
that.$refs.paymentPassword.modalFun('show');
}
if (that.paytype == 'oilcard') {
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../../login/updatePas/updatePas'

@ -124,7 +124,8 @@
import {
getGasDetailByStoreKey,
addOrder,
getDictionaryByCodeTypeOl
getDictionaryByCodeTypeOl,
oilPriceCompute
} from '../../../Utils/Api.js';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
let app = getApp();
@ -299,15 +300,15 @@
this.gunNo = item.gunNo;
this.$refs.popup.hide();
},
select(amount) {
this.inputMoney = amount.price;
this.litre = parseFloat(amount.price / this.priceGun).toFixed(2);
this.totalPrice = parseFloat(amount.price / this.priceGun * this.priceVip).toFixed(2);
if (this.priceVip != this.priceGun) {
let gbprice = parseFloat(this.litre * this.priceOfficial).toFixed(2);
this.discountPrice = parseFloat(gbprice - this.inputMoney).toFixed(2);
}
},
// select(amount) {
// this.inputMoney = amount.price;
// this.litre = parseFloat(amount.price / this.priceGun).toFixed(2);
// this.totalPrice = parseFloat(amount.price / this.priceGun * this.priceVip).toFixed(2);
// if (this.priceVip != this.priceGun) {
// let gbprice = parseFloat(this.litre * this.priceOfficial).toFixed(2);
// this.discountPrice = parseFloat(gbprice - this.inputMoney).toFixed(2);
// }
// },
// H5
jumpH5Bding() {
uni.navigateTo({
@ -348,18 +349,14 @@
duration: 2000
});
this.inputMoney = this.xzMoney;
return;
}
//
this.litre = parseFloat(this.inputMoney / this.priceOfficial).toFixed(2);
var arr1 = parseFloat(this.inputMoney / this.priceOfficial * this.priceVip).toFixed(4);
this.totalPrice = this.numFilter(arr1);
if (this.priceVip != this.priceOfficial) {
// let gbprice = parseFloat(this.litre * this.priceOfficial).toFixed(2);
// this.discountPrice = parseFloat(gbprice - this.totalPrice).toFixed(2);
this.discountPrice = parseFloat(this.inputMoney - this.totalPrice).toFixed(2);
}
// var arr1 = parseFloat(this.inputMoney / this.priceOfficial * this.priceVip).toFixed(4);
// this.totalPrice = this.numFilter(arr1);
this.oilPriceCompute();
//
// this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2);
// this.totalPrice = parseFloat(this.inputMoney / this.priceGun * this.priceVip).toFixed(2);
@ -368,6 +365,24 @@
// this.discountPrice = parseFloat(gbprice - this.totalPrice).toFixed(0);
// }
},
//
oilPriceCompute() {
let datas = {
"price": this.inputMoney,
"gasPriceGun": this.priceOfficial,
"gasPriceVip": this.priceVip
}
oilPriceCompute(datas).then(res => {
if (res.return_code == '000000') {
this.totalPrice = res.return_data;
if (this.priceVip != this.priceOfficial) {
// let gbprice = parseFloat(this.litre * this.priceOfficial).toFixed(2);
// this.discountPrice = parseFloat(gbprice - this.totalPrice).toFixed(2);
this.discountPrice = parseFloat(this.inputMoney - this.totalPrice).toFixed(2);
}
}
})
},
//
jumpPhone() {
uni.navigateTo({

@ -40,6 +40,17 @@
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" />
</view>
</view>
<view class="row" @tap="paytype='oilcard'" v-if="goodsType == 3">
<view class="left">
<image :src="imagewxUrl+imgadres1"></image>
</view>
<view class="center">
油卡支付(余额:{{oilPirce}})
</view>
<view class="right">
<radio :checked="paytype=='oilcard'" @click="changeRiado1()" color="#0083f5" />
</view>
</view>
<view class="row" @tap="paytype='wxpay'">
<view class="left">
<image :src="imagewxUrl+imgadres"></image>
@ -72,7 +83,9 @@
orderToPay,
orderToGoldPay,
getHuiLianTongCardBalance,
hltUnionCardPay
hltUnionCardPay,
oilCardPay,
findUser
} from '../../../Utils/Api.js'
import ssPaymentPassword from '../../../components/sanshui-payment-password'
let app = getApp();
@ -88,6 +101,7 @@
amount: 0,
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'wxpay.png',
imgadres1: 'oilcard.png',
pryType: '',
paytype: '', //
orderNo: '',
@ -96,6 +110,7 @@
jumpType: '',
PaymentPassword: '',
tongCardPrice: 0,
oilPirce: 0, //
goodsType: ''
};
},
@ -132,6 +147,9 @@
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
@ -157,6 +175,24 @@
return;
}
},
//
changeRiado1() {
if (!this.user.isSetOilCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../../user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
},
//
//
getHuiLianTongCardBalance() {
@ -245,7 +281,7 @@
success() {
setTimeout(() => {
uni.navigateTo({
url:'../../user/deposit/deposit'
url: '../../user/deposit/deposit'
})
}, 1000)
}
@ -290,6 +326,29 @@
return;
}
that.$refs.paymentPassword.modalFun('show');
} else if (that.paytype == 'oilcard') {
if (!that.user.isSetPayPwd) {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
})
return;
}
if (!that.user.isSetOilCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../../user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
that.$refs.paymentPassword.modalFun('show');
} else {
uni.showToast({
title: '请选择支付方式',
@ -339,33 +398,66 @@
})
return;
}
let params = {
"orderId": this.orderNo,
"cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword
}
hltUnionCardPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
if (this.paytype == 'gonghuika') {
let params = {
"orderId": this.orderNo,
"cardNo": this.user.hltCardNo.cardNo,
"password": this.PaymentPassword
}
hltUnionCardPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url: '../success/success?id=' + this.couponId
});
return;
}
if (res.return_code == '102130') {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
})
return;
}
uni.showToast({
title: '支付成功'
title: res.return_msg,
icon: 'none'
})
uni.reLaunch({
url: '../success/success?id=' + this.couponId
});
return;
})
return;
}
if (this.paytype == 'oilcard') {
let params = {
"orderId": this.orderNo,
"cardNo": this.user.oilCard.cardNo,
"password": this.PaymentPassword
}
if (res.return_code == '102130') {
uni.navigateTo({
url: '../../login/updatePas/updatePas'
oilCardPay(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
title: '支付成功'
})
uni.reLaunch({
url:'../../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;
}
uni.showToast({
title: res.return_msg,
icon: 'none'
})
})
return;
}
},
payRequest: function(self) {
uni.showLoading({

@ -244,7 +244,7 @@
methods: {
jumpcdx() {
location.href =
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsgcs.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect';
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https%3A%2F%2Fhsg.dctpay.com%2FhsgH5%2Findex.html%23%2F&response_type=code&scope=snsapi_base&state=1#wechat_redirect';
},
//
getCmsContentcmsContent() {

@ -289,8 +289,8 @@
if (!app.globalData.userInfo.isSetPayPwd) {
this.czList = [{
url: '../../user/cardDes/cardDes',
text: '工会卡',
url: '../../../subPages/cardsList/cardsList',
text: '卡',
img: '../../../static/img/ghkpay.png'
},
{
@ -303,8 +303,8 @@
}
// '../../user/unionCard/unionCard'
this.czList = [{
url: '../../user/cardDes/cardDes',
text: '工会卡',
url: '../../../subPages/cardsList/cardsList',
text: '卡',
img: '../../../static/img/ghkpay.png'
},
{
@ -568,7 +568,7 @@
}
.place-bottom {
height: 300upx;
height: 200upx;
}
.user {

@ -1,16 +1,26 @@
<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>
<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" v-if="!UserCard">
<input style="width: 100%;" :disabled="disStute" maxlength="19" placeholder="请输入工会卡号" v-model="cardNoNumber"
placeholder-style="color: #333333;"/>
<!-- <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>
@ -22,8 +32,9 @@
<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="width90 mart20 height120 backcorfff fotct" style="position: absolute;top: 390px;" 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>
@ -34,9 +45,11 @@
import {
sendSmsCode,
getHuiLianTongCardByCardNo,
getDetailByCardNo,
bindHuiLianTongCard,
getUserCardList,
getHuiLianTongCardByPhone
getHuiLianTongCardByPhone,
getDictionaryByCodeType
} from '../../../Utils/Api.js';
let app = getApp();
export default {
@ -49,25 +62,41 @@
getCodeBtnColor: "#0083f5",
getCodeisWaiting: false,
disStute: false,
UserCard:''
UserCard: '',
cardList: [], //
typeName: '', //
type: '' //
}
},
onLoad(options) {
this.user = app.globalData.userInfo;
this.getHuiLianTongCardByPhone();
// 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
phone: this.user.phone
}
uni.showLoading();
getHuiLianTongCardByPhone(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000' && res.return_data !='') {
if (res.return_code == '000000' && res.return_data != '') {
this.UserCard = res.return_data;
this.cardNoNumber = res.return_data[0].cardNo;
return;
@ -75,6 +104,11 @@
this.UserCard = '';
});
},
//
changeUserCard(e) {
this.type = this.cardList[e.target.value].codeValue;
this.typeName = this.cardList[e.target.value].codeName;
},
//
bindUserCard(e) {
this.cardNoNumber = this.UserCard[e.target.value].cardNo;
@ -134,22 +168,40 @@
title: '请填写卡号',
icon: "none"
});
return false;
return;
}
if (this.cardNoNumber.length != 19) {
if (this.cardNoNumber.length != 19 && this.type == 1) {
uni.showToast({
title: '请填写正确的19位卡号',
title: '请填写正确的19位工会卡号',
icon: "none"
});
return false;
return;
}
uni.showLoading({
title: '查询中...'
})
if (this.cardNoNumber.length != 16 && this.type == 2) {
uni.showToast({
title: '请填写正确的16位油卡号',
icon: "none"
});
return;
}
let params = {
cardNo: this.cardNoNumber
}
getHuiLianTongCardByCardNo(params).then(res => {
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;
@ -163,6 +215,25 @@
}
})
},
//
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()
@ -185,6 +256,7 @@
title: '提交中...'
})
let params = {
type: this.type,
cardNo: this.cardNoNumber,
phone: this.phoneNumber,
smsCode: this.code
@ -209,7 +281,6 @@
success() {
setTimeout(() => {
uni.navigateBack({
delta: 2
})
}, 1000)
}
@ -229,12 +300,14 @@
<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;

@ -74,6 +74,9 @@
<view class="right" v-if="recinfo.payModel == 3">
混合
</view>
<view class="right" v-if="recinfo.payModel == 4">
油卡
</view>
</view>
<view class="row" v-if="recinfo.payType">
@ -95,6 +98,9 @@
<view class="right" v-if="recinfo.payType == 5">
银联支付
</view>
<view class="right" v-if="recinfo.payType == 7">
嗨森逛油卡
</view>
</view>
<view class="row" v-if="recinfo.totalPrice">
<view class="left">

Binary file not shown.

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,109 @@
<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 class="width30 height30 backcorfff colorb9 fotct border-r margle20"
@click="unionCardPay(item.cardNo)">
充值余额</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;
}
});
},
//
unionCardPay(item) {
uni.navigateTo({
url: '../trade-union-recharge/trade-union-recharge?cardId=' + item + '&RechargeType=1'
})
},
//
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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

@ -230,11 +230,25 @@ $uni-font-size-paragraph:30upx;
color: #41cda2;
}
.colorb9 {
color: #b95859;
}
.color32 {
color: #32649d;
}
/* 背景颜色 */
.backcor9 {
background-color: #f6f6f6;
}
.backcolorb9 {
background-color: #b85958;
}
.backcolor32 {
background-color: #32649d;
}
//渐变
.backcorlr{
background: linear-gradient(to right, #fe1a1a, #ff722e);
@ -328,6 +342,11 @@ $uni-font-size-paragraph:30upx;
margin-left: 30%;
}
.width30w {
width: 30%;
margin-left: 3%;
}
.width20w {
width: 20%;
margin-left: 40%;
@ -352,6 +371,9 @@ $uni-font-size-paragraph:30upx;
.width15 {
width: 15%;
}
.width10 {
width: 10%;
}
.width8 {
width: 8%;
}
@ -395,6 +417,10 @@ $uni-font-size-paragraph:30upx;
height: 60px;
}
.height70w {
height: 70px;
line-height: 70px;
}
.height70 {
height: 70px;
@ -439,6 +465,14 @@ $uni-font-size-paragraph:30upx;
height: 180px;
}
.height200{
height: 200px;
}
.height220{
height: 220px;
}
.height30 {
height: 30px;
line-height: 30px;

Loading…
Cancel
Save