1.新增卡包功能

yj-dev
杨杰 3 years ago
parent f4de516383
commit 04f3b699a6
  1. 16
      App.vue
  2. 30
      Utils/Api.js
  3. 23
      pages.json
  4. 207
      pages/goods/refuel-confirm/refuel-confirm.vue
  5. 53
      pages/goods/refuel-details/refuel-details.vue
  6. 216
      pages/pay/payment/payment.vue
  7. 2
      pages/tabBar/home/home.vue
  8. 10
      pages/tabBar/user/user.vue
  9. 563
      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. 36
      uni.scss

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

@ -185,6 +185,14 @@ export const getGasDetailByStoreKey = params => {
export const getDictionaryByCodeTypeOl = params => { export const getDictionaryByCodeTypeOl = params => {
return POST('GET', `${base}/common/getDictionaryByCodeTypeOl`, params).then(res => res.data); 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 => { export const getDredgeProvince = params => {
return POST('GET', `${base}/common/getDredgeProvince`, params).then(res => res.data); return POST('GET', `${base}/common/getDredgeProvince`, params).then(res => res.data);
@ -217,7 +225,12 @@ export const getDiscountPackageDetail = params => {
//根据卡号查询 //根据卡号查询
export const getHuiLianTongCardByCardNo = params => { export const getHuiLianTongCardByCardNo = params => {
return POST('GET', `${base}/highUserCard/getHuiLianTongCardByCardNo`, params).then(res => res.data); 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 => { export const getUserCardList = params => {
return POST('GET', `${base}/highUserCard/getUserCardList`, params).then(res => res.data); return POST('GET', `${base}/highUserCard/getUserCardList`, params).then(res => res.data);
@ -225,7 +238,11 @@ export const getUserCardList = params => {
// 根据手机号获取汇联通工会卡列表 // 根据手机号获取汇联通工会卡列表
export const getHuiLianTongCardByPhone = params => { export const getHuiLianTongCardByPhone = params => {
return POST('GET', `${base}/highUserCard/getHuiLianTongCardByPhone`, params).then(res => res.data); 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 => { export const delUserCard = params => {
return POST('POST', `${base}/highUserCard/delUserCard`, params).then(res => res.data); return POST('POST', `${base}/highUserCard/delUserCard`, params).then(res => res.data);
@ -241,9 +258,10 @@ export const getHuiLianTongCardConsume = params => {
// 汇联通工会卡支付 // 汇联通工会卡支付
export const hltUnionCardPay = params => { export const hltUnionCardPay = params => {
return POST('POST', `${base}/order/hltUnionCardPay`, params).then(res => res.data); return POST('POST', `${base}/order/hltUnionCardPay`, params).then(res => res.data);
} }
//绑定卡包
export const bindHuiLianTongCard = params => { 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 => { export const loginByTel = params => {
@ -388,6 +406,10 @@ export const orderToGoldPayunion = params => {
//提交订单 //提交订单
export const addOrderPay = params => { export const addOrderPay = params => {
return POST('POST', `${base}/outRechargeOrder/addOrder`, params).then(res => res.data); 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 => { export const getListOutRechargePrice = params => {

@ -472,6 +472,7 @@
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
} }
], ],
"subpackages": [{ "subpackages": [{
"root": "subPages", "root": "subPages",
@ -649,6 +650,28 @@
"navigationBarTextStyle": "white" "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"
}
} }
] ]
}], }],

@ -46,16 +46,16 @@
</view> </view>
</view> </view>
<view class="width94 line1 mart5 marb5"></view> --> <view class="width94 line1 mart5 marb5"></view> -->
<view class="line1"></view> <view class="line1"></view>
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='jifen'"> <view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='jifen'">
<view class="width60 flleft fontwig6"> <view class="width60 flleft fontwig6">
积分支付 积分支付
</view> </view>
<view class="flright width30 fotct"> <view class="flright width30 fotct">
<radio :checked="paytype=='jifen'" color="#0083f5" /> <radio :checked="paytype=='jifen'" color="#0083f5" />
</view> </view>
</view> </view>
<view class="line1"></view> <view class="line1"></view>
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='weixin'"> <view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='weixin'">
@ -67,6 +67,16 @@
</view> </view>
</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="line1"></view>
<view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='gonghuika'"> <view class="heightl60 paddleft10 fcor666 width100 backcorfff" @tap="paytype='gonghuika'">
<view class="width60 flleft fontwig6"> <view class="width60 flleft fontwig6">
@ -102,7 +112,9 @@
orderToPay, orderToPay,
getHuiLianTongCardBalance, getHuiLianTongCardBalance,
hltUnionCardPay, hltUnionCardPay,
orderToGoldPay orderToGoldPay,
findUser,
oilCardPay
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue'; import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue';
let app = getApp(); let app = getApp();
@ -121,6 +133,7 @@
orderList: '', orderList: '',
refulAdress: '', refulAdress: '',
tongCardPrice: 0, tongCardPrice: 0,
oilPirce: 0, //
user: '', user: '',
paytype: '', paytype: '',
PaymentPassword: '', PaymentPassword: '',
@ -136,10 +149,27 @@
onShow() { onShow() {
let that = this; let that = this;
that.paytype = ''; that.paytype = '';
that.user = app.globalData.userInfo; // that.user = app.globalData.userInfo;
that.findUser();
// that.getHuiLianTongCardBalance(); // that.getHuiLianTongCardBalance();
}, },
methods: { 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) { submitHandle(e) {
this.PaymentPassword = e.value; this.PaymentPassword = e.value;
@ -184,39 +214,87 @@
return; return;
} }
let params = { if (this.paytype == 'jifen') {
"orderId": this.orderNo, let params = {
"cardNo": this.user.hltCardNo.cardNo, "orderId": this.orderNo,
"password": this.PaymentPassword "cardNo": this.user.hltCardNo.cardNo,
} "password": this.PaymentPassword
hltUnionCardPay(params).then(res => { }
uni.hideLoading(); hltUnionCardPay(params).then(res => {
if (res.return_code == '000000') { 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({ 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') { oilCardPay(params).then(res => {
uni.navigateTo({ uni.hideLoading();
url: '../../login/updatePas/updatePas' 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() { 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({ uni.showToast({
icon: 'none', icon: 'none',
title: '当前账号还未绑定,前往绑定', title: '当前账号还未绑定,前往绑定',
@ -269,22 +347,22 @@
}) })
return; return;
} }
if (that.paytype == 'weixin') { if (that.paytype == 'weixin') {
// #ifdef H5 // #ifdef H5
let params = { let params = {
"orderId": that.orderNo, "orderId": that.orderNo,
"openId": app.globalData.openId, "openId": app.globalData.openId,
"orderScene": "GOODS_ORDER", "orderScene": "GOODS_ORDER",
"openIdType": 2 "openIdType": 2
} }
// #endif // #endif
// #ifdef MP // #ifdef MP
let params = { let params = {
"orderId": that.orderNo, "orderId": that.orderNo,
"openId": app.globalData.openId, "openId": app.globalData.openId,
"orderScene": "GOODS_ORDER" "orderScene": "GOODS_ORDER"
} }
// #endif // #endif
orderToPay(params).then(res => { orderToPay(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
// #ifdef MP // #ifdef MP
@ -330,6 +408,31 @@
return; return;
} }
if (that.paytype == 'gonghuika') { 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) { if (!that.user.isSetPayPwd) {
uni.navigateTo({ uni.navigateTo({
url: '../../login/updatePas/updatePas' url: '../../login/updatePas/updatePas'

@ -124,7 +124,8 @@
import { import {
getGasDetailByStoreKey, getGasDetailByStoreKey,
addOrder, addOrder,
getDictionaryByCodeTypeOl getDictionaryByCodeTypeOl,
oilPriceCompute
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue'; import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
let app = getApp(); let app = getApp();
@ -299,15 +300,15 @@
this.gunNo = item.gunNo; this.gunNo = item.gunNo;
this.$refs.popup.hide(); this.$refs.popup.hide();
}, },
select(amount) { // select(amount) {
this.inputMoney = amount.price; // this.inputMoney = amount.price;
this.litre = parseFloat(amount.price / this.priceGun).toFixed(2); // this.litre = parseFloat(amount.price / this.priceGun).toFixed(2);
this.totalPrice = parseFloat(amount.price / this.priceGun * this.priceVip).toFixed(2); // this.totalPrice = parseFloat(amount.price / this.priceGun * this.priceVip).toFixed(2);
if (this.priceVip != this.priceGun) { // if (this.priceVip != this.priceGun) {
let gbprice = parseFloat(this.litre * this.priceOfficial).toFixed(2); // let gbprice = parseFloat(this.litre * this.priceOfficial).toFixed(2);
this.discountPrice = parseFloat(gbprice - this.inputMoney).toFixed(2); // this.discountPrice = parseFloat(gbprice - this.inputMoney).toFixed(2);
} // }
}, // },
// H5 // H5
jumpH5Bding() { jumpH5Bding() {
uni.navigateTo({ uni.navigateTo({
@ -327,7 +328,7 @@
}); });
this.totalPrice = '0.00'; this.totalPrice = '0.00';
this.discountPrice = '0.00'; this.discountPrice = '0.00';
this.litre = ''; this.litre = '';
this.inputMoney = ''; this.inputMoney = '';
return; return;
} }
@ -348,18 +349,14 @@
duration: 2000 duration: 2000
}); });
this.inputMoney = this.xzMoney; this.inputMoney = this.xzMoney;
return;
} }
// //
this.litre = parseFloat(this.inputMoney / this.priceOfficial).toFixed(2); this.litre = parseFloat(this.inputMoney / this.priceOfficial).toFixed(2);
var arr1 = parseFloat(this.inputMoney / this.priceOfficial * this.priceVip).toFixed(4); // var arr1 = parseFloat(this.inputMoney / this.priceOfficial * this.priceVip).toFixed(4);
this.totalPrice = this.numFilter(arr1); // this.totalPrice = this.numFilter(arr1);
if (this.priceVip != this.priceOfficial) { this.oilPriceCompute();
// 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);
}
// //
// this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2); // this.litre = parseFloat(this.inputMoney / this.priceGun).toFixed(2);
// this.totalPrice = parseFloat(this.inputMoney / this.priceGun * this.priceVip).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); // 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() { jumpPhone() {
uni.navigateTo({ uni.navigateTo({

@ -40,6 +40,17 @@
<radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" /> <radio :checked="paytype=='gonghuika'" @click="changeRiado()" color="#0083f5" />
</view> </view>
</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="row" @tap="paytype='wxpay'">
<view class="left"> <view class="left">
<image :src="imagewxUrl+imgadres"></image> <image :src="imagewxUrl+imgadres"></image>
@ -72,7 +83,9 @@
orderToPay, orderToPay,
orderToGoldPay, orderToGoldPay,
getHuiLianTongCardBalance, getHuiLianTongCardBalance,
hltUnionCardPay hltUnionCardPay,
oilCardPay,
findUser
} from '../../../Utils/Api.js' } from '../../../Utils/Api.js'
import ssPaymentPassword from '../../../components/sanshui-payment-password' import ssPaymentPassword from '../../../components/sanshui-payment-password'
let app = getApp(); let app = getApp();
@ -87,7 +100,8 @@
return { return {
amount: 0, amount: 0,
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres: 'wxpay.png', imgadres: 'wxpay.png',
imgadres1: 'oilcard.png',
pryType: '', pryType: '',
paytype: '', // paytype: '', //
orderNo: '', orderNo: '',
@ -96,6 +110,7 @@
jumpType: '', jumpType: '',
PaymentPassword: '', PaymentPassword: '',
tongCardPrice: 0, tongCardPrice: 0,
oilPirce: 0, //
goodsType: '' goodsType: ''
}; };
}, },
@ -111,33 +126,36 @@
this.paytype = 'jinbi' this.paytype = 'jinbi'
} else { } else {
this.paytype = '' this.paytype = ''
} }
if (!app.globalData.userInfo) { if (!app.globalData.userInfo) {
this.findUser() this.findUser()
} }
this.amount = parseFloat(e.amount).toFixed(2); this.amount = parseFloat(e.amount).toFixed(2);
}, },
onShow() { onShow() {
let that = this; let that = this;
that.user = app.globalData.userInfo; that.user = app.globalData.userInfo;
that.getHuiLianTongCardBalance(); that.getHuiLianTongCardBalance();
if (app.globalData.userInfo) { if (app.globalData.userInfo) {
this.findUser(); this.findUser();
} }
}, },
methods: { methods: {
findUser() { findUser() {
let params; let params;
findUser(params).then(res => { findUser(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data; app.globalData.userInfo = res.return_data;
this.user = res.return_data; this.user = res.return_data;
uni.setStorage({ if (res.return_data.oilCard) {
key: "user", this.oilPirce = res.return_data.oilCard.amount;
data: res.return_data }
}) uni.setStorage({
} key: "user",
}); data: res.return_data
})
}
});
}, },
// //
changeRiado() { changeRiado() {
@ -157,6 +175,24 @@
return; return;
} }
}, },
//
changeRiado1() {
if (!this.user.isSetOilCard) {
uni.showToast({
icon: 'none',
title: '当前账号还未绑定,前往绑定',
duration: 2000,
success() {
setTimeout(() => {
uni.navigateTo({
url: '../../user/bindingCard/bindingCard'
})
}, 1000)
}
});
return;
}
},
// //
// //
getHuiLianTongCardBalance() { getHuiLianTongCardBalance() {
@ -174,20 +210,20 @@
orderToPay() { orderToPay() {
let that = this; let that = this;
if (that.paytype == 'wxpay') { if (that.paytype == 'wxpay') {
// #ifdef H5 // #ifdef H5
let params = { let params = {
"orderId": that.orderNo, "orderId": that.orderNo,
"openId": app.globalData.openId, "openId": app.globalData.openId,
"orderScene": "GOODS_ORDER", "orderScene": "GOODS_ORDER",
"openIdType": 2 "openIdType": 2
} }
// #endif // #endif
// #ifdef MP // #ifdef MP
let params = { let params = {
"orderId": that.orderNo, "orderId": that.orderNo,
"openId": app.globalData.openId, "openId": app.globalData.openId,
"orderScene": "GOODS_ORDER" "orderScene": "GOODS_ORDER"
} }
// #endif // #endif
orderToPay(params).then(res => { orderToPay(params).then(res => {
if (res.return_code == '000000') { if (res.return_code == '000000') {
@ -241,13 +277,13 @@
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '积分不足', title: '积分不足',
duration: 2000, duration: 2000,
success() { success() {
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url:'../../user/deposit/deposit' url: '../../user/deposit/deposit'
}) })
}, 1000) }, 1000)
} }
}); });
return; return;
@ -290,6 +326,29 @@
return; return;
} }
that.$refs.paymentPassword.modalFun('show'); 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 { } else {
uni.showToast({ uni.showToast({
title: '请选择支付方式', title: '请选择支付方式',
@ -339,33 +398,66 @@
}) })
return; return;
} }
let params = { if (this.paytype == 'gonghuika') {
"orderId": this.orderNo, let params = {
"cardNo": this.user.hltCardNo.cardNo, "orderId": this.orderNo,
"password": this.PaymentPassword "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') { hltUnionCardPay(params).then(res => {
uni.navigateTo({ uni.hideLoading();
url: '../../login/updatePas/updatePas' 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: res.return_msg,
icon: 'none'
}) })
return; })
} return;
uni.showToast({ }
title: res.return_msg, if (this.paytype == 'oilcard') {
icon: 'none' 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:'../../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;
}
}, },
payRequest: function(self) { payRequest: function(self) {
uni.showLoading({ uni.showLoading({

@ -244,7 +244,7 @@
methods: { methods: {
jumpcdx() { jumpcdx() {
location.href = 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() { getCmsContentcmsContent() {

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

@ -1,246 +1,319 @@
<template> <template>
<view> <view>
<view class="form re" style="top: 100rpx;"> <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" <view class="username paddtop10">
@change="bindUserCard"> <picker mode="selector" style="width: 90%;" :range="cardList" range-key="codeName"
<view class="date text1">{{cardNoNumber}}</view> @change="changeUserCard">
</picker> <view class="date text1" style="padding: 0 25rpx;">{{typeName}}</view>
<image class="flright" style="width: 15px;height: 15px;" src="../../../static/img/downj.png"></image> </picker>
</view> <image class="flright" style="width: 15px;height: 15px;" src="../../../static/img/downj.png"></image>
<view class="username" v-if="!UserCard"> </view>
<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">
</view> <picker mode="selector" style="width: 90%;" :range="UserCard" range-key="cardNo" @change="bindUserCard">
<view class="username" v-if="phoneNumber"> <view class="date text1">{{cardNoNumber}}</view>
<view class="get-code" :style="{'color':getCodeBtnColor}" @click.stop="getCode()">{{getCodeText}}</view> </picker>
<input disabled="true" v-model="phoneNumber" placeholder-style="color: #333333;" /> <image class="flright" style="width: 15px;height: 15px;" src="../../../static/img/downj.png"></image>
</view> </view> -->
<view class="code" v-if="phoneNumber">
<input placeholder="请输入验证码" v-model="code" placeholder-style="color: #333333;" />
</view> <view class="username">
<view class="btn mart50" @tap="bindHuiLianTongCard" v-if="phoneNumber">绑定卡号</view> <input style="width: 100%;" :disabled="disStute" maxlength="19" placeholder="请输入卡号"
<view class="btn mart50" @tap="doCardNonum" v-else>获取预留手机号</view> v-model="cardNoNumber" placeholder-style="color: #333333;" />
</view> </view>
<view class="width90 mart20 height120 backcorfff fotct" style="position: absolute;top: 390px;"> <view class="username" v-if="phoneNumber">
<view class="fontlet font20 fcor666 fontwig6 height45l " style="border-bottom: 1px solid #F4F4F4;">温馨提示</view> <view class="get-code" :style="{'color':getCodeBtnColor}" @click.stop="getCode()">{{getCodeText}}</view>
<view class="fontlet font20 fcor666 fontwig6 height45l paddtop10">1元可抵扣100积分</view> <input disabled="true" v-model="phoneNumber" placeholder-style="color: #333333;" />
</view> </view>
</view> <view class="code" v-if="phoneNumber">
</template> <input placeholder="请输入验证码" v-model="code" placeholder-style="color: #333333;" />
</view>
<script> <view class="btn mart50" @tap="bindHuiLianTongCard" v-if="phoneNumber">绑定卡号</view>
import md5 from "@/common/SDK/md5.min.js"; <view class="btn mart50" @tap="doCardNonum" v-else>获取预留手机号</view>
import { </view>
sendSmsCode, <view class="width90 mart20 height120 backcorfff fotct" style="position: absolute;top: 390px;" v-if="type == 1">
getHuiLianTongCardByCardNo, <view class="fontlet font20 fcor666 fontwig6 height45l " style="border-bottom: 1px solid #F4F4F4;">温馨提示
bindHuiLianTongCard, </view>
getUserCardList, <view class="fontlet font20 fcor666 fontwig6 height45l paddtop10">1元可抵扣100积分</view>
getHuiLianTongCardByPhone </view>
} from '../../../Utils/Api.js'; </view>
let app = getApp(); </template>
export default {
data() { <script>
return { import md5 from "@/common/SDK/md5.min.js";
cardNoNumber: "", import {
phoneNumber: "", sendSmsCode,
code: '', getHuiLianTongCardByCardNo,
getCodeText: '获取验证码', getDetailByCardNo,
getCodeBtnColor: "#0083f5", bindHuiLianTongCard,
getCodeisWaiting: false, getUserCardList,
disStute: false, getHuiLianTongCardByPhone,
UserCard:'' getDictionaryByCodeType
} } from '../../../Utils/Api.js';
}, let app = getApp();
onLoad(options) { export default {
this.user = app.globalData.userInfo; data() {
this.getHuiLianTongCardByPhone(); return {
}, cardNoNumber: "",
phoneNumber: "",
methods: { code: '',
Timer() {}, getCodeText: '获取验证码',
// getCodeBtnColor: "#0083f5",
getHuiLianTongCardByPhone() { getCodeisWaiting: false,
let params = { disStute: false,
phone : this.user.phone UserCard: '',
} cardList: [], //
uni.showLoading(); typeName: '', //
getHuiLianTongCardByPhone(params).then(res => { type: '' //
uni.hideLoading(); }
if (res.return_code == '000000' && res.return_data !='') { },
this.UserCard = res.return_data; onLoad(options) {
this.cardNoNumber = res.return_data[0].cardNo; this.user = app.globalData.userInfo;
return; // this.getHuiLianTongCardByPhone();
} this.getDictionaryByCodeType();
this.UserCard = ''; },
});
}, methods: {
// Timer() {},
bindUserCard(e) { getDictionaryByCodeType() {
this.cardNoNumber = this.UserCard[e.target.value].cardNo; let datas = {
}, codeType: 'USER_CARD_TYPE'
getCode() { }
uni.hideKeyboard() getDictionaryByCodeType(datas).then(res => {
if (this.getCodeisWaiting) { if (res.return_code == '000000') {
return; this.cardList = res.return_data;
} this.type = res.return_data[0].codeValue;
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) { this.typeName = res.return_data[0].codeName;
uni.showToast({ }
title: '请填写正确手机号码', })
icon: "none" },
}); //
return false; getHuiLianTongCardByPhone() {
} let params = {
uni.showLoading({ phone: this.user.phone
title: '发送中...' }
}) uni.showLoading();
let params = { getHuiLianTongCardByPhone(params).then(res => {
phone: this.phoneNumber uni.hideLoading();
} if (res.return_code == '000000' && res.return_data != '') {
sendSmsCode(params).then(res => { this.UserCard = res.return_data;
if (res.return_code == '000000') { this.cardNoNumber = res.return_data[0].cardNo;
this.getCodeisWaiting = true; return;
this.getCodeBtnColor = "#999999" }
uni.showToast({ this.UserCard = '';
title: '验证码已发送', });
icon: "none" },
}); //
this.setTimer(); changeUserCard(e) {
} else { this.type = this.cardList[e.target.value].codeValue;
uni.hideLoading() this.typeName = this.cardList[e.target.value].codeName;
} },
}) //
}, bindUserCard(e) {
setTimer() { this.cardNoNumber = this.UserCard[e.target.value].cardNo;
let holdTime = 60; },
this.getCodeText = "重新获取(60)" getCode() {
this.Timer = setInterval(() => { uni.hideKeyboard()
if (holdTime <= 0) { if (this.getCodeisWaiting) {
this.getCodeisWaiting = false; return;
this.getCodeBtnColor = "#333333"; }
this.getCodeText = "获取验证码" if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) {
clearInterval(this.Timer); uni.showToast({
return; title: '请填写正确手机号码',
} icon: "none"
this.getCodeText = "重新获取(" + holdTime + ")" });
holdTime--; return false;
}
}, 1000) uni.showLoading({
}, title: '发送中...'
// })
doCardNonum() { let params = {
if (!this.cardNoNumber) { phone: this.phoneNumber
uni.showToast({ }
title: '请填写卡号', sendSmsCode(params).then(res => {
icon: "none" if (res.return_code == '000000') {
}); this.getCodeisWaiting = true;
return false; this.getCodeBtnColor = "#999999"
} uni.showToast({
if (this.cardNoNumber.length != 19) { title: '验证码已发送',
uni.showToast({ icon: "none"
title: '请填写正确的19位卡号', });
icon: "none" this.setTimer();
}); } else {
return false; uni.hideLoading()
} }
uni.showLoading({ })
title: '查询中...' },
}) setTimer() {
let params = { let holdTime = 60;
cardNo: this.cardNoNumber this.getCodeText = "重新获取(60)"
} this.Timer = setInterval(() => {
getHuiLianTongCardByCardNo(params).then(res => { if (holdTime <= 0) {
uni.hideLoading() this.getCodeisWaiting = false;
if (res.return_code == '000000') { this.getCodeBtnColor = "#333333";
this.phoneNumber = res.return_data.userMobile; this.getCodeText = "获取验证码"
// this.phoneNumber = 15583658692; clearInterval(this.Timer);
this.disStute = true return;
} else { }
uni.showToast({ this.getCodeText = "重新获取(" + holdTime + ")"
title: res.return_msg, holdTime--;
icon: "none"
}); }, 1000)
} },
}) //
}, doCardNonum() {
// if (!this.cardNoNumber) {
bindHuiLianTongCard() { uni.showToast({
uni.hideKeyboard() title: '请填写卡号',
// icon: "none"
if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) { });
uni.showToast({ return;
title: '请填写正确手机号码', }
icon: "none" if (this.cardNoNumber.length != 19 && this.type == 1) {
}); uni.showToast({
return false; title: '请填写正确的19位工会卡号',
} icon: "none"
if (!this.code) { });
uni.showToast({ return;
title: '请填写验证码', }
icon: "none" if (this.cardNoNumber.length != 16 && this.type == 2) {
}); uni.showToast({
return false; title: '请填写正确的16位油卡号',
} icon: "none"
uni.showLoading({ });
title: '提交中...' return;
}) }
let params = {
cardNo: this.cardNoNumber, let params = {
phone: this.phoneNumber, cardNo: this.cardNoNumber
smsCode: this.code }
} if (this.type == 1) {
bindHuiLianTongCard(params).then(res => { this.getHuiLianTongCardByCardNo(params);
uni.hideLoading() }
if (res.return_code == '000000') { if (this.type == 2) {
app.globalData.userInfo = res.return_data this.getDetailByCardNo(params);
.object }
.highUser;
app.globalData.token = res.return_data.uniqueCode; },
uni.setStorage({ //
key: "user", getHuiLianTongCardByCardNo(items) {
data: res.return_data uni.showLoading({
.object title: '查询中...'
.highUser })
}) getHuiLianTongCardByCardNo(items).then(res => {
uni.showToast({ uni.hideLoading()
title: '绑定成功', if (res.return_code == '000000') {
icon: "success", this.phoneNumber = res.return_data.userMobile;
duration: 2000, // this.phoneNumber = 15583658692;
success() { this.disStute = true
setTimeout(() => { } else {
uni.navigateBack({ uni.showToast({
delta: 2 title: res.return_msg,
}) icon: "none"
}, 1000) });
} }
}); })
} else { },
uni.showToast({ //
title: res.return_msg, getDetailByCardNo(items) {
icon: "none" uni.showLoading({
}); title: '查询中...'
} })
}) getDetailByCardNo(items).then(res => {
uni.hideLoading()
}, if (res.return_code == '000000') {
} this.phoneNumber = res.return_data.contactPhone;
} // this.phoneNumber = 15583658692;
</script> this.disStute = true
} else {
<style lang="scss"> uni.showToast({
@import "../../../static/css/login.scss"; title: res.return_msg,
.wximg { icon: "none"
width: 50px; });
height: 50px; }
margin-left: 40%; })
margin-top: 250upx; },
} //
.flex1 { bindHuiLianTongCard() {
flex: 1; uni.hideKeyboard()
text-align: right; //
width: 70%; if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))) {
padding-right: 25rpx; uni.showToast({
color: #999999; title: '请填写正确手机号码',
font-size: 32rpx; 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> </style>

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

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

Loading…
Cancel
Save