Commit dba4cbce by 胡悦

提取组件

1 parent 80a61e67
......@@ -34,7 +34,7 @@
{
"path": "pages/informationEntry/informationEntry",
"style": {
"navigationBarTitleText": "",
"navigationBarTitleText": "信息录入",
"enablePullDownRefresh": false
}
},
......
<!--
* @Description:
* @Author: huyue
* @Date: 2024-04-07 14:54:28
* @LastEditors: huyue
* @LastEditTime: 2024-04-08 20:36:46
-->
<template>
<uni-popup
ref="popup"
type="bottom"
:mask-click="false"
border-radius="16px 16px 0 0"
>
<view class="popup-wrapper">
<view class="popup-box">
<view class="payment-title"
>付款二维码
<view class="icon-close" @click="close">×</view>
</view>
<view class="popup-content">
<view class="tab-list">
<view
:class="['tab-item', { active: payActive === item.type }]"
v-for="item in paymentType"
:key="item.type"
@click="handleSwitchTab(item)"
>{{ item.name }}</view
>
</view>
<view class="payment-content">
<view v-show="payActive === 1" class="qr-code-content">
<image
class="qr-code-img"
:src="payInfo.storePaymentQrcodeUrl"
mode="scaleToFill"
/>
<!-- <image
class="qr-code-img"
src="https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/11.png"
mode="scaleToFill"
/> -->
<view class="qr-code-info">扫码付款,支持多渠道付款</view>
</view>
<view v-show="payActive === 2" class="corporate-content">
<image
class="bank-logo"
src="https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/11.png"
mode="scaleToFill"
/>
<view class="bank-info">
<view
class="bank-item"
v-for="item in accountList"
:key="item.field"
>
<text class="bank-label">{{ item.label }}:</text>
<view class="bank-value">{{ accountInfo[item.field] }}</view>
</view>
</view>
</view>
</view>
</view>
<view class="payment-done" @click="done()">已支付,去上传付款凭证</view>
</view>
</view>
</uni-popup>
</template>
<script>
const PAYMENT_TYPE = [
{
name: "扫码支付",
type: 1,
},
{
name: "对公账户",
type: 2,
},
];
const ACCOUT_LIST = [
{
label: "公司名称",
field: "companyName",
},
{
label: "基本账户",
field: "basicAccount",
},
{
label: "支行账号",
field: "subBranchAccount",
},
{
label: "一般账户",
field: "generalAccount",
},
{
label: "支付账户",
field: "paymentAccount",
},
];
export default {
name: "payPop",
data() {
return {
payInfo: {}, // 支付信息
accountInfo: {}, // 对公账户信息
payActive: 1,
paymentType: PAYMENT_TYPE,
accountList: ACCOUT_LIST,
};
},
methods: {
// 切换tab
handleSwitchTab(item) {
this.payActive = item.type;
},
// 查询门店支付配置
async findPayInfo() {
const data = await uni.$api.commonApi.findPayInfo({
merchantId: 44209880,
});
this.payInfo = data.find((item) => item.paymentType == 1);
this.accountInfo = data.find((item) => item.paymentType == 2);
},
// 显示弹窗
show() {
// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center']
this.$refs.popup.open("bottom");
this.findPayInfo();
},
close() {
this.$refs.popup.close();
},
// 已支付
done() {
// uni.navigateBack({
// delta: 1,
// });
// this.stopAudio();
// pages/informationEntry/informationEntry
uni.navigateTo({
url: `/pages/informationEntry/informationEntry`,
});
this.close();
},
},
};
</script>
<style scoped lang="scss">
.popup-box {
position: relative;
margin-top: 286rpx;
background-color: #f8f9f9;
height: 1160rpx;
padding-bottom: 30rpx;
.payment-title {
position: relative;
width: 100%;
height: 96rpx;
padding: 24rpx 0 26rpx;
text-align: center;
border-bottom: 1px solid #e8e8e8;
.icon-close {
position: absolute;
right: 0;
top: 0;
width: 160rpx;
height: 96rpx;
font-size: 50rpx;
text-align: right;
padding-right: 20rpx;
line-height: 96rpx;
}
}
}
.popup-content {
.tab-list {
display: flex;
justify-content: center;
margin-top: 40rpx;
.tab-item {
width: 320rpx;
padding: 24rpx 0 28rpx;
text-align: center;
background-color: #fff;
color: #666;
&.active {
background-color: #2c66f7;
color: #fff;
}
&:first-child {
border-radius: 200rpx 0 0 200rpx;
}
&:last-child {
border-radius: 0 48rpx 48rpx 0;
}
}
}
.payment-content {
width: 100%;
display: flex;
justify-content: center;
margin-top: 40rpx;
.qr-code-content {
width: 538rpx;
background-color: #fff;
border-radius: 24rpx;
text-align: center;
padding: 59rpx 0 67rpx;
.qr-code-img {
width: 420rpx;
height: 420rpx;
}
.qr-code-info {
margin-top: 40rpx;
font-weight: 500;
font-size: 32rpx;
color: #1a1a1a;
}
}
.corporate-content {
width: 1080rpx;
background-color: #fff;
border-radius: 24rpx;
.bank-logo {
width: 100%;
height: 136rpx;
}
.bank-info {
font-weight: 500;
font-size: 32rpx;
padding: 27rpx 80rpx 39rpx;
.bank-item {
display: flex;
align-items: center;
margin-bottom: 16rpx;
&:last-child {
margin-bottom: 0;
}
.bank-label {
color: #6c6c70;
// line-height: 94rpx;
}
.bank-value {
box-sizing: border-box;
background-color: #f8f9f9;
border-radius: 8rpx;
width: 740rpx;
height: 80rpx;
line-height: 80rpx;
padding-left: 24rpx;
font-weight: 500;
font-size: 32rpx;
color: #1a1a1a;
letter-spacing: 0;
}
}
}
}
}
}
.payment-done {
position: absolute;
bottom: 30rpx;
left: 50%;
transform: translateX(-50%);
width: calc(100% - 240rpx);
height: 80rpx;
font-weight: 500;
font-size: 32rpx;
color: #ffffff;
text-align: center;
line-height: 80rpx;
background-color: #2c66f7;
border-radius: 40rpx;
}
</style>
......@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2024-04-07 14:54:28
* @LastEditors: huyue
* @LastEditTime: 2024-04-08 09:42:44
* @LastEditTime: 2024-04-08 20:39:44
-->
<template>
<view>
这是信息录入
<view class="information-entry">
<view class="information-tips">建议同步采集资源,若接待工作单一可在提单初期再进行补充。</view>
<button @tap="choose">调摄像头</button>
<view>客户付款凭证</view>
</view>
......@@ -40,5 +40,10 @@
}
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.information-entry {
.information-tips {
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!