11.18 充值退款功能添加

formal_basic
shilei 6 days ago
parent a99f060fd9
commit 13e5beaf97

@ -233,6 +233,14 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path": "billingPage/addInvoice/addInvoice",
"style": {
"navigationBarTitleText": "开发票",
"enablePullDownRefresh": false
}
}, },
{ {
"path": "billingPage/billingMean/billingMean", "path": "billingPage/billingMean/billingMean",

@ -236,7 +236,19 @@
}); });
istipsonly.value++ istipsonly.value++
} }
} else if (res.data.data.orderStatus == 5) {
uni.showModal({
title: '支付结果',
showCancel: false,
content: '已自动支付完成,请点击确认退出当前页面',
success: function(res) {
if (res.confirm) {
uni.switchTab({
url: '/pages/index/index'
})
}
}
});
} }
}).catch((err) => { }).catch((err) => {
uni.showToast({ uni.showToast({

@ -113,6 +113,14 @@
</view> </view>
<view><text class="lg text-gray cuIcon-right padding-top-xs"></text></view> <view><text class="lg text-gray cuIcon-right padding-top-xs"></text></view>
</view> </view>
<view class="flex padding-tb-sm justify-between" @click="goAddinvoice">
<view class="flex">
<uv-icon name="setting" color="#2cc06c" size="20"></uv-icon>
<!-- <view class="titleFont">其他设置</view> -->
<view class="titleFont">开发票</view>
</view>
<view><text class="lg text-gray cuIcon-right padding-top-xs"></text></view>
</view>
<view class="flex padding-tb-sm justify-between" @click="goSetting"> <view class="flex padding-tb-sm justify-between" @click="goSetting">
<view class="flex"> <view class="flex">
<uv-icon name="setting" color="#2cc06c" size="20"></uv-icon> <uv-icon name="setting" color="#2cc06c" size="20"></uv-icon>
@ -232,6 +240,26 @@
url: '/pages/userCenter/about/about' url: '/pages/userCenter/about/about'
}) })
} }
const goAddinvoice = () => {
if (!uni.getStorageSync("userInfo")) {
uni.showToast({
title: '请先完成登录',
duration: 2000,
icon: 'error'
});
return;
} else {
uni.navigateTo({
url: '/pagesCenter/billingPage/addInvoice/addInvoice'
})
}
// else if (realNameAuthFlag.value != 1) {
// errornotify.value.show()
// return
// }
}
const gologin = () => { const gologin = () => {
uni.navigateTo({ uni.navigateTo({
url: '../../pagesCenter/login/enter' url: '../../pagesCenter/login/enter'

@ -23,6 +23,7 @@
<view class="tab_cls"> <view class="tab_cls">
<uv-subsection :list="tab_list" :current="tab_current" @change="tab_change"></uv-subsection> <uv-subsection :list="tab_list" :current="tab_current" @change="tab_change"></uv-subsection>
</view> </view>
<!-- refundStatus == 0 才可以退款 -->
<!-- <view class="action padding-lr-sm padding-bottom-sm"><text class="cuIcon-titles textBlue"></text>充值明细</view> --> <!-- <view class="action padding-lr-sm padding-bottom-sm"><text class="cuIcon-titles textBlue"></text>充值明细</view> -->
<view class="content_pay"> <view class="content_pay">
<view class="cu-card " v-for="(item,index) in payData" :key="index" v-if="payData.length!=0"> <view class="cu-card " v-for="(item,index) in payData" :key="index" v-if="payData.length!=0">
@ -30,12 +31,13 @@
<view class="flex padding-sm justify-between"> <view class="flex padding-sm justify-between">
<!-- left --> <!-- left -->
<view> <view>
<view class="flex"> <view class="flex" style="align-items: center;">
<!-- <view class="pay">{{item.tradeType== 3?'平台充值':'个人充值'}}</view> -->
<view class="payState"> <view class="payState">
付款成功 付款成功
</view> </view>
<text class="refund_moneny"
v-if="tab_current == 0 && money >= item.payPrice / 100 && item.refundStatus == 0"
@click="handle_refund(item.id)">退款</text>
</view> </view>
<view class="margin-top-sm payTime" v-if="tab_current == 0">{{item.payTime}}</view> <view class="margin-top-sm payTime" v-if="tab_current == 0">{{item.payTime}}</view>
<view class="margin-top-sm payTime" v-else>{{item.createTime}}</view> <view class="margin-top-sm payTime" v-else>{{item.createTime}}</view>
@ -43,7 +45,8 @@
<!-- right --> <!-- right -->
<view> <view>
<view class="text-price payMoney"> <view class="text-price payMoney">
{{tab_current == 0? (item.payPrice / 100): (item.price / 100) }}</view> {{tab_current == 0? (item.payPrice / 100): (item.price / 100) }}
</view>
<view class="allMoney" v-if="tab_current == 0"> <view class="allMoney" v-if="tab_current == 0">
<text>实际到账金额</text> <text>实际到账金额</text>
{{item.totalPrice?item.totalPrice / 100: 0}} {{item.totalPrice?item.totalPrice / 100: 0}}
@ -91,7 +94,7 @@
const tab_current = ref(0) const tab_current = ref(0)
onLoad(() => { onLoad(() => {
handle_bindType() handle_bindType()
getPayconsumption() // getPayconsumption()
}) })
onShow(() => { onShow(() => {
getPayList(0) getPayList(0)
@ -122,6 +125,59 @@
url: '/pages/index/recharge/recharge' url: '/pages/index/recharge/recharge'
}) })
} }
const handle_refund = (id) => {
uni.showModal({
title: '提示',
content: '是否确认提交退款申请?',
success: function(res) {
if (res.confirm) {
handle_refund_submit(id)
} else if (res.cancel) {
// console.log('');
}
}
});
}
const handle_refund_submit = async (id) => {
await uni.$request({
url: config.baseUrl +
`app-api/pay/wallet-recharge/refund?id=${id}`
}).then(res => {
// console.log(res, '退');
uni.showLoading({
title: '申请中...请稍后'
})
if (res.data.code == 0) {
setTimeout(() => {
uni.showToast({
title: '申请成功',
duration: 2000,
icon: 'success'
});
}, 2000)
setTimeout(() => {
handle_bindType()
uni.hideLoading()
}, 4000)
} else {
setTimeout(() => {
uni.showToast({
title: res.data.msg,
duration: 2000,
icon: 'error'
});
}, 2000)
setTimeout(() => {
handle_bindType()
uni.hideLoading()
}, 4000)
}
// if()
})
}
const getPayList = async (type) => { const getPayList = async (type) => {
let param = { let param = {
pageNo: pageNo.value, pageNo: pageNo.value,
@ -168,7 +224,7 @@
data, data,
code code
} = await PayWalletApi.getWalletTransactionPage(param) } = await PayWalletApi.getWalletTransactionPage(param)
console.log(data, 'data') // console.log(data, 'data')
} }
onReachBottom(async () => { onReachBottom(async () => {
if (payData.value.length == totalPages.value) { if (payData.value.length == totalPages.value) {
@ -303,6 +359,13 @@
overflow: hidden; overflow: hidden;
overflow-y: scroll; overflow-y: scroll;
} }
.refund_moneny {
font-size: 13px;
text-decoration: underline;
margin-left: 10rpx;
color: red;
}
</style> </style>
<style lang="scss"> <style lang="scss">
page { page {

@ -15,33 +15,33 @@
</view> </view>
</view> </view>
<view class="line line-icon "> <view class="line line-icon ">
<u-form-item :required="true" label="发票抬头" prop="userInfo.invoiceHeader" borderBottom ref="item1"> <u-form-item :required="true" label="发票抬头" prop="userInfo.invoiceTitle" borderBottom ref="item1">
<u--input v-model="model1.userInfo.invoiceHeader" border="none" inputAlign='right' <u--input v-model="model1.userInfo.invoiceTitle" border="none" inputAlign='right'
placeholder="请填写发票抬头"></u--input> placeholder="请填写发票抬头"></u--input>
</u-form-item> </u-form-item>
</view> </view>
<view v-if="checked==1"> <view v-if="checked==1">
<view class="line"> <view class="line">
<u-form-item :required="true" label="税号" prop="userInfo.taxId" borderBottom ref="item1"> <u-form-item :required="true" label="税号" prop="userInfo.dutyNumber" borderBottom ref="item1">
<u--input v-model="model1.userInfo.taxId" border="none" inputAlign='right' <u--input v-model="model1.userInfo.dutyNumber" border="none" inputAlign='right'
placeholder="请填写纳税人识别号"></u--input> placeholder="请填写纳税人识别号"></u--input>
</u-form-item> </u-form-item>
</view> </view>
<view class="line"> <view class="line">
<u-form-item label="注册地址" prop="userInfo.address" borderBottom ref="item1"> <u-form-item label="注册地址" prop="userInfo.registeredAddress" borderBottom ref="item1">
<u--input v-model="model1.userInfo.address" border="none" inputAlign='right' <u--input v-model="model1.userInfo.registeredAddress" border="none" inputAlign='right'
placeholder="请填写公司注册地址"></u--input> placeholder="请填写公司注册地址"></u--input>
</u-form-item> </u-form-item>
</view> </view>
<view class="line"> <view class="line">
<u-form-item label="公司开户行" prop="userInfo.bank" borderBottom ref="item1"> <u-form-item label="公司开户行" prop="userInfo.bankOfDeposit" borderBottom ref="item1">
<u--input v-model="model1.userInfo.bank" border="none" inputAlign='right' <u--input v-model="model1.userInfo.bankOfDeposit" border="none" inputAlign='right'
placeholder="请填写银行名称"> </u--input> placeholder="请填写银行名称"> </u--input>
</u-form-item> </u-form-item>
</view> </view>
<view class="line"> <view class="line">
<u-form-item label="开户行账户" prop="userInfo.cardNo" borderBottom ref="item1"> <u-form-item label="开户行账户" prop="userInfo.openBankAccount" borderBottom ref="item1">
<u--input v-model="model1.userInfo.cardNo" border="none" inputAlign='right' <u--input v-model="model1.userInfo.openBankAccount" border="none" inputAlign='right'
placeholder="请填写银行账号"></u--input> placeholder="请填写银行账号"></u--input>
</u-form-item> </u-form-item>
</view> </view>
@ -49,7 +49,7 @@
</u--form> </u--form>
</view> </view>
<!-- 邮寄信息 --> <!-- 邮寄信息 -->
<view class="content-title"> <!-- <view class="content-title">
<view class="content-name"> <view class="content-name">
<view class="orders-line"></view> <view class="orders-line"></view>
<view>邮寄信息</view> <view>邮寄信息</view>
@ -88,7 +88,7 @@
<view class=""> <view class="">
<u-switch v-model="switchValue" @change="switchVhange"></u-switch> <u-switch v-model="switchValue" @change="switchVhange"></u-switch>
</view> </view>
</view> </view> -->
<!-- position bottom --> <!-- position bottom -->
<view class="footer-box"> <view class="footer-box">
<view> <view>
@ -127,11 +127,11 @@
const formAddress = ref(null); const formAddress = ref(null);
const model1 = reactive({ const model1 = reactive({
userInfo: { userInfo: {
invoiceHeader: '', invoiceTitle: '',
taxId: '', dutyNumber: '',
address: '', registeredAddress: '',
bank: '', bankOfDeposit: '',
cardNo: '', openBankAccount: '',
} }
}) })
const model2 = reactive({ const model2 = reactive({
@ -147,12 +147,12 @@
const saveTaxid = ref('') const saveTaxid = ref('')
// //
const rules = ref({ const rules = ref({
'userInfo.invoiceHeader': { 'userInfo.invoiceTitle': {
required: true, required: true,
message: '请填写发票抬头', message: '请填写发票抬头',
trigger: ['blur', 'change'] trigger: ['blur', 'change']
}, },
'userInfo.taxId': { 'userInfo.dutyNumber': {
required: true, required: true,
pattern: /^[0-9a-zA-Z]*$/g, pattern: /^[0-9a-zA-Z]*$/g,
transform(value) { transform(value) {
@ -187,33 +187,34 @@
// //
onLoad((option) => { onLoad((option) => {
console.log(option, 'option'); // console.log(option, 'option');
if (option.detail) { // if (option.detail) {
let detail = JSON.parse(option.detail) // let detail = JSON.parse(option.detail)
model1.userInfo.invoiceHeader = detail.invoiceHeader // model1.userInfo.invoiceHeader = detail.invoiceHeader
model1.userInfo.taxId = detail.taxId // model1.userInfo.taxId = detail.taxId
model1.userInfo.address = detail.address // model1.userInfo.address = detail.address
model1.userInfo.bank = detail.bank // model1.userInfo.bank = detail.bank
model1.userInfo.cardNo = detail.cardNo // model1.userInfo.cardNo = detail.cardNo
model2.userInfo2.address = detail.shippingAddress // model2.userInfo2.address = detail.shippingAddress
model2.userInfo2.phone = detail.contactPhone // model2.userInfo2.phone = detail.contactPhone
model2.userInfo2.contacts = detail.recipient // model2.userInfo2.contacts = detail.recipient
email.value = detail.email // email.value = detail.email
if (detail.type === 1) { // if (detail.type === 1) {
isChecked.value = 0 // isChecked.value = 0
checked.value = 1 // checked.value = 1
} else { // } else {
isChecked.value = 1 // isChecked.value = 1
checked.value = 2 // checked.value = 2
} // }
if (detail.isDefault === 1) { // if (detail.isDefault === 1) {
switchValue.value = true // switchValue.value = true
} else { // } else {
switchValue.value = false // switchValue.value = false
} // }
updataId.value = detail.id // updataId.value = detail.id
console.log('JSON.parse(option.detail)', JSON.parse(option.detail)); // console.log('JSON.parse(option.detail)', JSON.parse(option.detail));
} // }
handle_start_access_token()
}) })
// //
watch(checked, (newVal, oldVal) => { watch(checked, (newVal, oldVal) => {
@ -248,6 +249,15 @@
} }
}) })
const handle_start_access_token = async () => {
uni.$request({
url: "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx7b910c0c240c2676&secret=APPSECRET",
method: 'GET'
}).then(res => {
console.log(res, '===发票步骤1====?');
})
}
// //
const onChange = (e) => { const onChange = (e) => {
@ -276,68 +286,49 @@
console.log(err, '校验失败1'); console.log(err, '校验失败1');
}) })
}) })
let p2 = new Promise((resolve, reject) => { // let p2 = new Promise((resolve, reject) => {
formAddress.value.validate().then(res => { // formAddress.value.validate().then(res => {
resolve() // resolve()
}).catch(err => { // }).catch(err => {
console.log(err, '校验失败2'); // console.log(err, '2');
}) // })
}) // })
Promise.all([p1, p2]).then((result) => { // Promise.all([p1, p2]).then((result) => {
console.log('xxxxxxxxx', model1.userInfo.invoiceHeader); Promise.all([p1]).then((result) => {
if (checked.value == 2) { // console.log('xxxxxxxxx', model1.userInfo.invoiceHeader);
model1.userInfo.taxId = '' // if (checked.value == 2) {
model1.userInfo.address = '' // model1.userInfo.taxId = ''
model1.userInfo.bank = '' // model1.userInfo.address = ''
model1.userInfo.cardNo = '' // model1.userInfo.bank = ''
} // model1.userInfo.cardNo = ''
// }
let data = { let data = {
id: updataId.value, orderNo: 12,
invoiceStatus: 0,
type: checked.value, type: checked.value,
isDefault: isDefault.value, orderType: 1,
email: email.value,
// 1 // 1
invoiceHeader: model1.userInfo.invoiceHeader, invoiceTitle: model1.userInfo.invoiceTitle,
taxId: model1.userInfo.taxId, dutyNumber: model1.userInfo.dutyNumber,
address: model1.userInfo.address, registeredAddress: model1.userInfo.registeredAddress,
bank: model1.userInfo.bank, bankOfDeposit: model1.userInfo.bankOfDeposit,
cardNo: model1.userInfo.cardNo, openBankAccount: model1.userInfo.openBankAccount,
// 2
shippingAddress: model2.userInfo2.address,
contactPhone: model2.userInfo2.phone,
recipient: model2.userInfo2.contacts,
} }
// uni.$u.toast('') // uni.$u.toast('')
if (updataId.value) { uni.$request({
uni.$request({ url: config.baseUrl + "app-api/cloud/invoice/create",
url: config.wxUrl_pay + "pay/invoice/modifyHeader", method: 'POST',
method: 'POST', data: data,
data: data, }).then(res => {
}).then(res => { uni.$u.toast(res.data.msg)
uni.$u.toast(res.data.msg) // setTimeout(function() {
setTimeout(function() { // uni.navigateBack({
uni.navigateBack({ // delta: 1,
delta: 1, // });
}); // }, 500)
}, 500) console.log(res.data.msg, '=======?');
console.log(res.data.msg, '=======?'); })
})
} else {
uni.$request({
url: config.wxUrl_pay + "pay/invoice/addHeader",
method: 'POST',
data: data,
}).then(res => {
uni.$u.toast(res.data.msg)
setTimeout(function() {
uni.navigateBack({
delta: 1,
});
}, 500)
console.log(res.data.msg, '=======?');
})
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)

@ -261,7 +261,7 @@
data, data,
code code
} = await PayOrderApi.getOrder(id); } = await PayOrderApi.getOrder(id);
console.log(data, '设置支付订单信息') // console.log(data, '')
if (code !== 0 || !data) { if (code !== 0 || !data) {
state.payStatus = -2; state.payStatus = -2;
return; return;

@ -75,7 +75,7 @@ http.interceptors.request.use(
showAuthModal(); showAuthModal();
return Promise.reject(); return Promise.reject();
} }
console.log(config,'config') // console.log(config,'config')
// 自定义处理【loading 加载中】:如果需要显示 loading则显示 loading // 自定义处理【loading 加载中】:如果需要显示 loading则显示 loading
if (config.custom.showLoading) { if (config.custom.showLoading) {
LoadingInstance.count++; LoadingInstance.count++;

Loading…
Cancel
Save