This commit is contained in:
2026-10-08 18:36:23 +08:00
commit 8a1da677e4
904 changed files with 111327 additions and 0 deletions
+189
View File
@@ -0,0 +1,189 @@
<template> <!-- 账户管理 -->
<view>
<view class="layout layout-account">
<view class="account-title m-top-20">用户名管理</view>
<!-- <view class="account-head m-top-30">-->
<!-- <view class="flex justify-center direction-column align-center">-->
<!-- <u&#45;&#45;image :showLoading="true" src="https://cdn.uviewui.com/uview/album/1.jpg" width="100rpx" height="100rpx" radius="10rpx"></u&#45;&#45;image>-->
<!-- <view class="xiu">修改头像</view>-->
<!-- </view>-->
<!-- <view class="tip m-top-30">选择你喜欢的图片,格式为jpg、png、jpeg,大小不超过2M。</view>-->
<!-- </view>-->
<view class="account-form m-top-30">
<view class="group">
<u-icon name="account" color="#666" size="26"></u-icon>
<view class="lb">用户名</view>
<view class="vl">{{ userData.nickname }}</view>
<!-- <view class="op">修改</view>-->
</view>
<view class="group">
<u-icon name="phone" color="#666" size="26"></u-icon>
<view class="lb">绑定手机号</view>
<view class="vl">{{ userData.mobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") }}</view>
<!-- <view class="op">修改</view>-->
</view>
<!-- <view class="group">-->
<!-- <u-icon name="email" color="#666" size="26"></u-icon>-->
<!-- <view class="lb">绑定邮箱</view>-->
<!-- <view class="vl">649077859@163.com</view>-->
<!-- <view class="op">修改</view>-->
<!-- </view>-->
<view class="group">
<u-icon name="lock" color="#666" size="26"></u-icon>
<view class="lb">登录密码</view>
<view class="vl">已设置</view>
<view class="op" @click="showPopup = true">修改</view>
</view>
</view>
</view>
<u-popup closeable :show="showPopup"
round="10"
mode="center"
:custom-style="{width: '80%'}"
@close="showPopup = false">
<view class="p-20 m-20 flex flex-center">
<u-text text="修改登录密码" size="17" align="center"/>
</view>
<view class="mt-15">
<u-cell-group :border="false">
<u-cell title="原密码">
<u-input v-model="formData.oldPassword" slot="value" placeholder="请输入原密码"/>
</u-cell>
<u-cell title="新密码">
<u-input v-model="formData.newPassword" slot="value" placeholder="请输入新密码"/>
</u-cell>
<u-cell title="确认密码" :border="false">
<u-input v-model="formData.passwordConfirmation" slot="value" placeholder="请输入确认密码"/>
</u-cell>
</u-cell-group>
</view>
<view class="mt-15">
<u-button type="primary" shapre="circle" @click="submit"
:disabled="!formData.oldPassword || !formData.newPassword || !formData.passwordConfirmation">
确定
</u-button>
</view>
</u-popup>
</view>
</template>
<script>
export default {
props: {
userData: {
type: Object
}
},
data() {
return {
showPopup: false,
formData: {
oldPassword: null,
newPassword: null,
passwordConfirmation: null,
},
};
},
methods: {
submit() {
if (!this.formData.oldPassword) return this.$message.error('请输入原密码');
if (!this.formData.newPassword) return this.$message.error('请输入原密码');
if (!this.formData.passwordConfirmation) return this.$message.error('请输入原密码');
if (this.formData.newPassword !== this.formData.passwordConfirmation) return this.$message.error('两次输入的密码不一致!');
if (this.formData.newPassword === this.formData.oldPassword) return this.$message.error('新密码不能与原密码相同!');
if (this.formData.newPassword.length < 6) return this.$message.error('密码长度在 6 到 16 个字符');
const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+$/
if (!reg.test(this.formData.newPassword)) {
return this.$message({
message: '密码必须由数字和字母组成',
type: 'error'
})
}
vk.callFunction({
url: 'user/kh/updatePwd',
data: this.formData
}).then(res => {
this.$message.success('修改成功')
this.formData = {
oldPassword: null,
newPassword: null,
passwordConfirmation: null,
}
this.showPopup = false
})
},
}
}
</script>
<style lang="scss">
.layout-account {
padding: 10rpx 30rpx;
.account-title {
position: relative;
padding-left: 20rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 6rpx;
height: 28rpx;
background: #A92924;
}
}
.tip {
font-size: 24rpx;
line-height: 48rpx;
color: #999999;
text-align: center;
}
.xiu {
font-size: 24rpx;
line-height: 48rpx;
color: #A92924;
text-align: center;
}
.group {
display: flex;
justify-content: flex-start;
align-items: center;
padding: 20rpx 0;
border-bottom: 1px solid #f2f2f2;
.lb {
width: 150rpx;
padding: 0 20rpx;
font-size: 24rpx;
line-height: 48rpx;
color: #666666;
}
.vl {
flex: 1;
font-size: 24rpx;
line-height: 48rpx;
color: #333333;
}
.op {
font-size: 24rpx;
line-height: 48rpx;
color: #A92924;
}
}
}
</style>
+131
View File
@@ -0,0 +1,131 @@
<template>
<view class="p-30">
<view class="flex justify-end items-center">
<u-button type="primary" @click="isAdd = !isAdd" v-if="!isAdd">新增业务联系人</u-button>
</view>
<view class="mt-20" v-if="isAdd">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="姓名" required>
<el-input v-model="form.name" placeholder="请输入姓名"/>
</el-form-item>
<el-form-item label="手机号" required>
<el-input v-model="form.phone" placeholder="请输入手机号"/>
</el-form-item>
<el-form-item label="邮箱" required>
<el-input v-model="form.email" placeholder="请输入邮箱"/>
</el-form-item>
<el-form-item label="职位" required>
<el-input v-model="form.position" placeholder="请输入职位"/>
</el-form-item>
</el-form>
<view class="mt-30 flex justify-center items-center">
<view class="flex-1 px-20">
<u-button plain @click="isAdd = !isAdd">取消</u-button>
</view>
<view class="flex-1 px-20">
<u-button type="primary" @click="addContact">确定</u-button>
</view>
</view>
</view>
<view v-else>
<view class="p-20 my-20 shadow rounded flex justify-between items-center" v-for="(item, index) in list"
:key="index">
<view class="flex flex-col justify-start items-start">
<view>
<text class="font-bold text-40">{{ item.name }}</text>
<text class="ml-20 text-gray">({{ item.position }})</text>
</view>
<view class="my-20">手机号:{{ item.phone }}</view>
<view class="my-20">邮箱:{{ item.email }}</view>
</view>
<view class="flex flex-col justify-end">
<u-button type="primary" size="small" @click="edit(item)">编辑</u-button>
<view class="mt-20">
<u-button type="primary" size="small" @click="del(item._id)" plain>删除</u-button>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: "business-contact",
data() {
return {
isAdd: false,
form: {
_id: null,
phone: '',
name: '',
email: '',
position: '',
},
list: []
}
},
methods: {
async addContact() {
if (!this.form.name) {
this.$message.error('请输入姓名')
return
}
if (!this.form.phone) {
this.$message.error('请输入手机号')
return
}
if (!this.form.email) {
this.$message.error('请输入邮箱')
return
}
if (!this.form.position) {
this.$message.error('请输入职位')
return
}
await vk.callFunction({
url: 'client/businessContact/kh/action',
data: this.form
})
this.$message.success(this.form._id ? '修改成功' : '新增成功')
await this.getList()
this.isAdd = false
this.form = {
_id: null,
phone: '',
name: '',
email: '',
position: '',
}
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.list = rows
},
del(_id) {
uni.showModal({
title: '提示',
content: '确认删除该业务联系人吗?',
success: async res => {
if (res.confirm) {
await vk.callFunction({
url: 'client/businessContact/kh/delete',
data: {_id}
})
await this.getList()
}
}
})
},
edit(item) {
for (let key in this.form) this.form[key] = item[key]
this.isAdd = true
}
},
mounted() {
this.getList()
}
}
</script>
File diff suppressed because one or more lines are too long
+309
View File
@@ -0,0 +1,309 @@
<template>
<view>
<view class="layout layout-equity">
<view class="equity-title">
尊敬的平台商家您好,目前您是我们平台的
<text class="vip">{{ userLevelStr }}</text>
客户,可享受相应的会员权益~
</view>
<view class="equity-main m-top-30">
<!-- <view class="rule">会员规则</view>-->
<view class="title flex justify-start align-center">
<view class="vip">
{{ userLevelStr }}
<!-- <text class="lv m-left-10 m-right-20">LV1</text>-->
</view>
<u-tag text="当前等级" plain size="mini" color="#999" borderColor="#999"></u-tag>
</view>
<view class="date m-top-30" v-if="userInfo.upgradeExpiredAt">有效期至:{{ dayjs(userInfo.upgradeExpiredAt).format('YYYY-MM-DD HH:mm:ss') }}</view>
<view class="m-top-30">
<u--text suffixIcon="play-right-fill" color="#bfbfbf" iconStyle="font-size: 14px;color:#bfbfbf"
text="当前交易总额"></u--text>
<view class="text-30 font-bold text-white mt-20">{{ userInfo.transactionAmount }}</view>
</view>
<view class="flex justify-between align-center m-top-20">
<view class="custom-style" @click="jump('/pages/user/grade')">去续费</view>
</view>
</view>
<!-- 保证金 -->
<view class="equity-bail m-top-30 p-top-20">
<view class="title">
当前缴纳保证金
<text class="strong">{{ userInfo.paidEnsure }}</text>
元
</view>
<view class="text m-top-20">
<u--text type="info"
text="金久信携手千万采购商和供应商,承诺为买家和卖家打造更优质的服务平台,缴纳诚信保证金会冻结在平台,最低保证金额度5000.00元 。"></u--text>
</view>
<view class="op flex justify-center m-top-30">
<view class="o active" @click="jump('/pages/user/grade')">升级会员 &gt;</view>
<!-- <view class="o active" @click="jump('/pages/user/grade')">去缴纳保证金 &gt;</view>-->
<!-- <view class="o" @click="jump('/pages/user/grade')">购买增值权益 &gt;</view>-->
</view>
</view>
<!-- 权益 -->
<view class="equity-info m-top-30 p-top-30">
<view class="divider">
<u-divider text="可享受一下权益"></u-divider>
</view>
<view class="divider-box flex justify-start flex-wrap">
<view class="item">
<view class="icon">
<image class="full" src="/static/img/di-1.png" mode=""></image>
</view>
<view class="big m-top-10">9折报价</view>
<view class="small">精准寻找买家</view>
</view>
<view class="item">
<view class="icon">
<image class="full" src="/static/img/di-2.png" mode=""></image>
</view>
<view class="big m-top-10">10次/月询价</view>
<view class="small">每成交50万送10次</view>
</view>
<view class="item">
<view class="icon">
<image class="full" src="/static/img/di-3.png" mode=""></image>
</view>
<view class="big m-top-10">可自主交易</view>
<view class="small">交易更方便</view>
</view>
<view class="item">
<view class="icon">
<image class="full" src="/static/img/di-1.png" mode=""></image>
</view>
<view class="big m-top-10">黄页展示更丰富</view>
<view class="small">让买家快速了解我</view>
</view>
<view class="item">
<view class="icon">
<image class="full" src="/static/img/di-2.png" mode=""></image>
</view>
<view class="big m-top-10">平台增值服务享9折</view>
<view class="small">交易更划算</view>
</view>
<view class="item">
<view class="icon">
<image class="full" src="/static/img/di-3.png" mode=""></image>
</view>
<view class="big m-top-10">9折购买广告位</view>
<view class="small">平台广告位购买</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import dayjs from "dayjs";
export default {
props: {
userData: {
type: Object
}
},
data() {
return {
userInfo: {
userLevel: -1,
userGrade: 0,
upgradeExpiredAt: '',
transactionAmount: 0,
paidEnsure: 0,
},
userLevelList: [],
userLevelStr: '普通用户',
userPayEnsureList: [],
pageSize: 10,
total: 0
};
},
methods: {
dayjs,
async getUserLevelList() {
vk.callFunction({
url: 'client/userLevel/pub/getList',
data: {
pageIndex: 1,
pageSize: 200
},
success: async (data) => {
this.userLevelList = data.rows
const {userInfo} = await vk.userCenter.getCurrentUserInfo()
this.userInfo = userInfo
if (this.userInfo.userLevel > -1) {
this.userLevelStr = this.userLevelList.find(level => parseInt(level.level) === parseInt(this.userInfo.userLevel)).name
}
}
});
},
async getUserPayEnsureList(pageIndex = 1) {
const {rows} = vk.callFunction({
url: 'client/order/kh/getList',
data: {
pageIndex,
pageSize: 500,
type: [2, 3]
},
});
this.userPayEnsureList = rows
},
jump(url) {
vk.navigateTo({url})
}
},
async mounted() {
await this.getUserLevelList()
await this.getUserPayEnsureList()
}
}
</script>
<style lang="scss">
.layout-equity {
padding: 20rpx 30rpx;
.equity-title {
font-size: 24rpx;
line-height: 36rpx;
color: #101010;
.vip {
font-weight: 600;
color: #A92924;
}
}
.equity-main {
position: relative;
height: 300rpx;
padding: 30rpx 30rpx;
border-radius: 10rpx;
background: url('~@/static/img/equity.png') center no-repeat;
background-size: 100% 100%;
box-shadow: 0px 5px 10px 0px rgba(145, 145, 145, 1);
.rule {
position: absolute;
right: 30rpx;
top: 20rpx;
z-index: 9;
font-size: 24rpx;
line-height: 32rpx;
color: rgba(255, 255, 255, 0.68);
}
.vip {
font-size: 36rpx;
font-weight: 600;
line-height: 32rpx;
color: #DFBA8B;
.lv {
font-size: 24rpx;
}
}
.date {
font-size: 26rpx;
line-height: 32rpx;
color: rgba(223, 186, 139, 0.5);
}
.baibi {
width: 420rpx;
.lv {
font-size: 24rpx;
line-height: 40rpx;
color: #bfbfbf;
}
.w {
font-size: 30rpx;
font-weight: 600;
line-height: 44rpx;
color: #bfbfbf;
}
}
.custom-style {
width: 140rpx;
height: 60rpx;
font-size: 28rpx;
line-height: 60rpx;
text-align: center;
color: #9B7341;
border-radius: 10rpx;
background: linear-gradient(rgba(223, 186, 139, 1), rgba(255, 243, 207, 1));
}
}
.equity-bail {
.title {
font-size: 30rpx;
line-height: 44rpx;
color: #101010;
.strong {
font-weight: 600;
color: #A92924;
}
}
}
.o {
width: 210rpx;
height: 68rpx;
font-size: 26rpx;
line-height: 68rpx;
color: #A92924;
text-align: center;
border: 1px solid #A92924;
}
.active {
color: #ffffff;
background: #A92924;
}
.divider {
margin: 0 auto;
width: 60%;
}
.divider-box {
padding: 20rpx 0;
.item {
width: 33.333%;
height: auto;
padding: 20rpx 0;
overflow: hidden;
.icon {
margin: 0 auto;
width: 52rpx;
height: 52rpx;
}
.big {
font-size: 26rpx;
line-height: 44rpx;
color: #5a5a5a;
text-align: center;
}
.small {
font-size: 24rpx;
line-height: 32rpx;
color: #bfbfbf;
text-align: center;
}
}
}
}
</style>
+484
View File
@@ -0,0 +1,484 @@
<template>
<view class="layout layout-ident">
<text class="text-main font-bold mb-20">加工商状态: {{
(isNaN(factoryStatus) || factoryStatus === -1) ? '未提交审核' : (factoryStatus === 0 ? '审核中' : (factoryStatus === 1 ? '审核通过' : `审核不通过:${refuseReason}`))
}}
</text>
<view class="form-box">
<el-divider>
<text class="text-50 text-main font-bold">工厂信息</text>
</el-divider>
<view class="group flex align-center m-top-30">
<view class="lb need">成立年限</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
:dis="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.year"
>
<template #suffix>年</template>
</u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">年产值</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.yearsIncome"
>
<template #suffix>万元</template>
</u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">员工人数</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.employeeNum"
>
<template #suffix>人</template>
</u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">流水线数量</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.flowNum"
>
<template #suffix>条</template>
</u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">厂房归属</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.blongTo"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">厂房面积</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.size"
>
<template #suffix>平方米</template>
</u--input>
</view>
</view>
<view class="group flex align-center m-top-30" @click="showAddress">
<view class="lb need">所在地</view>
<view class="vl flex-1">
<u--input
placeholder="请选择公司所在地"
v-model="addressRegion"
suffixIcon="arrow-down"
suffixIconStyle="color: #909399"
disabled
disabledColor="#fff"
style="pointer-events:none"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">主营工艺和业务范围</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.mainProcess"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">服务信息</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.serviceInfo"
></u--input>
</view>
</view>
<el-divider>
<text class="text-50 text-main font-bold">视频</text>
</el-divider>
<view class="m-top-20">
<u-upload
accept="video"
:fileList="form.video"
@afterRead="afterReadVideo"
@delete="deletePicVideo"
:maxCount="1"
width="70"
height="70"
></u-upload>
</view>
<el-divider>
<text class="text-50 text-main font-bold">设备信息</text>
</el-divider>
<view v-for="(item, index) in form.deviceList" :key="index" class="rounded shadow p-30 mb-20">
<view class="group flex align-center m-top-30">
<view class="lb need">设备名称</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.deviceList[index].name"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">设备数量</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.deviceList[index].num"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">设备来源</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.deviceList[index].source"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">设备类型</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.deviceList[index].type"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">品牌</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.deviceList[index].brand"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">型号</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.deviceList[index].model"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">投产年限</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.deviceList[index].year"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">特点描述</view>
<view class="vl flex-1">
<u--input
:readonly="factoryStatus === 0"
placeholder="请输入内容"
v-model="form.deviceList[index].desc"
></u--input>
</view>
</view>
<view class="flex justify-center mt-20">
<view class="flex-1 px-20">
<u-button size="small" color="#A92924" :plain="true" text="删除"
@click="remove(index)"></u-button>
</view>
</view>
</view>
<u-button size="small" color="#A92924" text="添加设备"
@click="addDevice"></u-button>
<el-divider>
<text class="text-50 text-main font-bold">工厂实景</text>
</el-divider>
<view class="m-top-20">
<u-upload
:fileList="album"
@afterRead="afterRead"
@delete="deletePic"
multiple
:maxCount="10"
width="70"
height="70"
></u-upload>
</view>
<u-button size="small" color="#A92924" text="提交"
@click="submit"></u-button>
</view>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
</view>
</template>
<script>
import AddressSelect from "@/components/AddressSelect.vue";
import dayjs from "dayjs";
import md5 from "js-md5";
export default {
name: "factory",
components: {AddressSelect},
props: {
userData: {
type: Object
}
},
data() {
return {
formData: {
test: ''
},
form: {
year: null,
yearsIncome: null,
employeeNum: null,
flowNum: null,
blongTo: null,
size: null,
addressRegion: {
province: null,
city: null,
},
mainProcess: null,
serviceInfo: null,
deviceList: [],
album: [],
video: [],
},
options: [],
addressRegion: '',
deviceSource: ['国产', '进口'],
deviceType: ['生产设备', '维护设备'],
userLevel: {
factoryPicNum: 0
},
factoryStatus: this.userData.factoryStatus,
refuseReason: '',
album: []
}
},
methods: {
showAddress() {
this.$refs.AddressSelect.open(this.form.addressRegion, 2);
},
regionConfirm({province, city}) {
this.form.addressRegion = {province, city}
this.addressRegion = `${province.name}${city.name}`
},
addDevice() {
this.form.deviceList.push({
name: null,
num: null,
source: null,
type: null,
brand: null,
model: null,
year: null,
desc: null
})
},
remove(index) {
this.form.deviceList.splice(index, 1)
},
async getUserLevelInfo() {
const res = await vk.callFunction({
url: "client/userLevel/kh/getInfoByUser",
})
if (res) {
if (!res.data) {
this.$message.error('请先完成认证')
setTimeout(() => {
uni.navigateBack()
}, 1000)
return
}
}
},
async submit() {
if (!this.form.year) return this.$message.error('请输入投产年限')
if (!this.form.yearsIncome) return this.$message.error('请输入年收入')
if (!this.form.employeeNum) return this.$message.error('请选输入员工人数')
if (!this.form.flowNum) return this.$message.error('请输入流水线数量')
if (!this.form.blongTo) return this.$message.error('请输入厂房归属')
if (!this.form.size) return this.$message.error('请输入厂房面积')
if (!this.addressRegion) return this.$message.error('请选择所在地')
if (this.form.deviceList.length === 0) return this.$message.error('请添加设备信息')
if (this.form.album.length === 0) return this.$message.error('请上传工厂实景图')
if (this.form.video.length > 0) this.form.video = this.form.video.map(item => item.url)
await vk.callFunction({
url: "client/factory/kh/addUpdate",
data: this.form
})
this.$message.success('提交成功')
this.factoryStatus = 0
},
async getInfo() {
const res = await vk.callFunction({
url: "client/factory/kh/getInfo",
})
if (res) {
for (let key in this.form) this.form[key] = res[key]
this.addressRegion = `${res.addressRegion.province.name}${res.addressRegion.city.name}`
if (res.status === 2) this.refuseReason = res.refuseReason
if (this.form.album && this.form.album.length > 0) {
this.album = this.form.album.map(url => {
return {
url
}
})
}
if (this.form.video) this.form.video = [{url: this.form.video[0]}]
console.log(this.form.video)
}
},
afterRead({file}) {
file.forEach(item => {
console.log(item)
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + item.name,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.album.push({url: res.fileList[0].tempFileURL})
this.form.album.push(res.fileList[0].tempFileURL)
})
}
})
})
},
deletePic({index}) {
this.album.splice(index, 1)
this.form.album.splice(index, 1)
},
afterReadVideo({file}) {
console.log(file.type)
if (file.type !== 'video/mp4' && file.type !== 'video') {
uni.showToast({
title: '请上传MP4文件',
icon: 'none'
})
return
}
uniCloud.uploadFile({
filePath: file.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(file.name + Date.now().toString()) + '.mp4',
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this.form.video = [{url: res.fileList[0].tempFileURL}]
})
}
})
},
deletePicVideo() {
this.form.video = []
},
},
mounted() {
this.getUserLevelInfo()
vk.userCenter.getCurrentUserInfo({
success: (data) => {
const factoryStatus = parseInt(data.userInfo.factoryStatus)
this.factoryStatus = (isNaN(factoryStatus) || factoryStatus === -1) ? -1 : factoryStatus
if (this.factoryStatus > -1) this.getInfo()
}
})
},
computed: {
deviceNum() {
let num = 0
this.form.deviceList.forEach(item => {
if (item.num && !isNaN(parseInt(item.num))) num += parseInt(item.num)
})
return num
}
}
}
</script>
<style lang="scss">
.layout-ident {
padding: 20rpx 30rpx;
.group {
display: flex;
justify-content: flex-start;
align-items: center;
}
.lb, .fix {
position: relative;
min-width: 150rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.lbx {
font-size: 24rpx;
color: #999999;
}
.download {
padding: 8rpx 20rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #ffffff;
background: #A92924;
}
.need::before {
position: absolute;
left: -16rpx;
top: 50%;
z-index: 9;
margin-top: -12rpx;
content: '*';
color: #A92924;
font-size: 32rpx;
line-height: 1;
}
}
.public-btn {
width: 100%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
</style>
+873
View File
@@ -0,0 +1,873 @@
<template> <!-- 企业认证 -->
<view>
<view class="layout layout-ident">
<!-- 企业认证 -->
<u--text prefixIcon="calendar" iconStyle="font-size: 28px;color:#A92924" size="20" color="#A92924"
:text="userInfo.accountType === 2 ? '企业认证' : '个人认证'"></u--text>
<u--text prefixIcon="checkmark-circle" iconStyle="font-size: 18px;color:#A92924" size="15" color="#A92924"
:text="statusLabel" v-if="userInfo.authStatus > -1 || userInfo.fadadaConfirm"></u--text>
<view style="margin: 30rpx 0">
<el-radio-group v-model="userType" @change="changeUserType">
<!-- <el-radio :label="0">-->
<!-- <text class="text-28">平台交易功能用户注册</text>-->
<!-- </el-radio>-->
<view class="mt-15">
<el-radio :label="1">
<text class="text-28">金久信签约宝用户</text>
</el-radio>
</view>
</el-radio-group>
</view>
<view class="mt-15 flex justify-center items-center">
<view class="mx-15">
<u-button @click="getCertUrl()" type="primary" size="small" v-if="!userInfo.fadadaConfirm">去认证
</u-button>
</view>
<!-- <view class="mx-15">-->
<!-- <u-button @click="getCertUrl()" type="primary" size="small" v-if="userInfo.authStatus > -1">-->
<!-- 获取认证结果-->
<!-- </u-button>-->
<!-- </view>-->
<view class="mx-15">
<u-button @click="getCertUrl(true)" plain type="primary" size="small" v-if="userInfo.authStatus > -1">
信息变更
</u-button>
</view>
</view>
<template v-if="userType === 0">
<view class="form-box" v-if="userInfo.authStatus > -1 || userInfo.fadadaConfirm">
<template v-if="userInfo.accountType === 2">
<view class="group flex align-center m-top-30">
<view class="lb need">公司名称</view>
<view class="vl flex-1">
<u--input
disabled
placeholder="请输入内容"
v-model="userInfo.company.companyName"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">信用代码</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.company.organization"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30" @click="showAddress">
<view class="lb need">公司所在地</view>
<view class="vl flex-1">
<u--input
placeholder="请选择公司所在地"
v-model="addressRegion"
suffixIcon="arrow-down"
suffixIconStyle="color: #909399"
disabled
disabledColor="#fff"
style="pointer-events:none"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">详细地址</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.company.addressDetail"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">法定代表人</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.company.legalName"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">公司电话</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.company.mobile"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">有效通信地址</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.company.mailAddress"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">邮箱地址</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.company.contactEmail"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">对公账户</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.company.companyAccount"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">开户行</view>
<view class="vl flex-1">
<u--input
placeholder="请输入内容"
v-model="form.company.companyBankName"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30" @click="showIndustry = true">
<view class="lb need">行业分类</view>
<view class="vl flex-1">
<u--input
style="pointer-events:none"
placeholder="请选择公司行业分类"
v-model="form.company.businessType"
suffixIcon="arrow-down"
suffixIconStyle="color: #909399"
disabled
disabledColor="#fff"
></u--input>
</view>
</view>
<view class="group flex flex-col items-start justify-start m-top-30" style="align-items: flex-start">
<view class="lb need mb-15">主营商品</view>
<view class="vl flex-1">
<!-- <u-checkbox-group v-model="form.company.mainSpotCategoryIds">-->
<!-- <view class="u-flex u-flex-wrap justify-start items-start w-100p">-->
<!-- <view class="w-50p" v-for="(item, index) in goodsCate" :key="index">-->
<!-- <u-checkbox-->
<!-- :customStyle="{marginBottom: '8px'}"-->
<!-- :label="item.name"-->
<!-- :name="item._id"-->
<!-- >-->
<!-- </u-checkbox>-->
<!-- </view>-->
<!-- </view>-->
<!-- </u-checkbox-group>-->
<view class="flex justify-start items-start flex-wrap">
<text class="text-25 mb-25 w-33p" @click="changeMainSpot(item._id)"
:class="{'text-main': form.company.mainSpotCategoryIds.includes(item._id)}"
v-for="(item, index) in goodsCate" :key="index">
{{ item.name }}
</text>
</view>
</view>
</view>
<view class="group m-top-30">
<view class="lb need">上传营业执照</view>
</view>
<view class="flex justify-between align-center m-top-10">
<view class="lbx flex-1">请您上传盖章的扫描件或者复印件</view>
</view>
<view class="m-top-20">
<u-upload
:fileList="organizationPath"
@afterRead="afterRead($event, 'organizationPath', 'company')"
@delete="deletePic($event, 'organizationPath', 'company')"
:maxCount="1"
width="70"
height="70"
></u-upload>
</view>
<view class="group m-top-30">
<view class="lb need">上传开票资料</view>
</view>
<view class="flex justify-between align-center m-top-10">
<view class="lbx flex-1">加盖公章</view>
</view>
<view class="m-top-20">
<u-upload
:fileList="invoiceInfo"
@afterRead="afterRead($event, 'invoiceInfo', 'company')"
@delete="deletePic($event, 'invoiceInfo', 'company')"
:maxCount="1"
width="70"
height="70"
></u-upload>
</view>
<!-- <view class="group m-top-30">-->
<!-- <view class="lb need">纳税资格</view>-->
<!-- </view>-->
<!-- <view class="m-top-20">-->
<!-- <el-radio-group v-model="form.company.taxType">-->
<!-- <el-radio label="一般纳税人">一般纳税人</el-radio>-->
<!-- <el-radio label="小规模纳税人">小规模纳税人</el-radio>-->
<!-- <el-radio label="其他">其他</el-radio>-->
<!-- </el-radio-group>-->
<!-- </view>-->
<!-- <view class="group m-top-30">-->
<!-- <view class="lb">纳税人资格</view>-->
<!-- </view>-->
<!-- <view class="flex justify-between align-center m-top-10">-->
<!-- <view class="lbx flex-1">加盖公章</view>-->
<!-- &lt;!&ndash; <view class="download">电子版文件下载</view>&ndash;&gt;-->
<!-- </view>-->
<!-- <view class="m-top-20">-->
<!-- <u-upload-->
<!-- :fileList="taxImage"-->
<!-- @afterRead="afterRead($event, 'taxImage', 'company', true)"-->
<!-- @delete="deletePic($event, 'taxImage', 'company', true)"-->
<!-- multiple-->
<!-- :maxCount="10"-->
<!-- width="70"-->
<!-- height="70"-->
<!-- ></u-upload>-->
<!-- </view>-->
<view class="group m-top-30">
<view class="lb">管理员授权委托书</view>
</view>
<view class="m-top-20">
<u-upload
:fileList="taxImage"
@afterRead="afterRead($event, 'taxImage', 'company', true)"
@delete="deletePic($event, 'taxImage', 'company', true)"
multiple
:maxCount="10"
width="70"
height="70"
></u-upload>
</view>
<!-- 企业授权人信息 -->
<view class="m-top-30">
<u--text prefixIcon="calendar" iconStyle="font-size: 28px;color:#A92924" size="20" color="#A92924"
text="企业授权人信息"></u--text>
</view>
<view class="group flex align-center m-top-30" @click="showManageType = true">
<view class="lb need">{{ `${form.manager.type === 1 ? '法人姓名' : '授权人'}` }}类型</view>
<view class="vl flex-1">
<u--input
placeholder="请选择授权人类型"
v-model="managerType"
suffixIcon="arrow-down"
suffixIconStyle="color: #909399"
disabled
disabledColor="#fff"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">{{ `${form.manager.type === 1 ? '法人姓名' : '授权人'}` }}姓名</view>
<view class="vl flex-1">
<u--input v-model="form.manager.personName" placeholder="请输入内容"></u--input>
</view>
</view>
<view class="group flex align-center m-top-30" @click="showCertType = true">
<view class="lb need">证件类型</view>
<view class="vl flex-1">
<u--input
placeholder="请选择证件类型"
v-model="certType"
suffixIcon="arrow-down"
suffixIconStyle="color: #909399"
disabled
disabledColor="#fff"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">{{ `${form.manager.type === 1 ? '法人姓名' : '授权人'}` }}证件号</view>
<view class="vl flex-1">
<u--input v-model="form.manager.idCard" placeholder="请输入内容"></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">{{ `${form.manager.type === 1 ? '法人姓名' : '授权人'}` }}电话</view>
<view class="vl flex-1">
<u--input v-model="form.manager.mobile" placeholder="请输入内容"></u--input>
</view>
</view>
<view class="group m-top-30">
<view class="lb need">身份证头像面</view>
</view>
<view class="m-top-20">
<u-upload
:fileList="headPhotoPath"
@afterRead="afterRead($event,'headPhotoPath', 'manager')"
@delete="deletePic($event, 'headPhotoPath', 'company')"
:maxCount="1"
width="70"
height="70"
></u-upload>
</view>
<view class="group m-top-30">
<view class="lb need">身份证国徽面</view>
</view>
<view class="m-top-20">
<u-upload
:fileList="backgroundIdCardPath"
@afterRead="afterRead($event,'backgroundIdCardPath', 'manager')"
@delete="deletePic($event, 'backgroundIdCardPath', 'company')"
:maxCount="1"
width="70"
height="70"
></u-upload>
</view>
</template>
<template v-else>
<view class="group flex align-center m-top-30">
<view class="lb need">真实姓名</view>
<view class="vl flex-1">
<u--input
:disabled="userInfo.authStatus === 0"
placeholder="请输入内容"
v-model="userInfo.person.personName"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30" @click="showIndustry = true">
<view class="lb need">行业分类</view>
<view class="vl flex-1">
<u--input
style="pointer-events:none"
placeholder="请选择行业分类"
v-model="form.person.businessType"
suffixIcon="arrow-down"
suffixIconStyle="color: #909399"
disabled
disabledColor="#fff"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30" @click="showAddress">
<view class="lb need">现居住所在地</view>
<view class="vl flex-1">
<u--input
placeholder="请选择现居住所在地"
v-model="addressRegion"
suffixIcon="arrow-down"
suffixIconStyle="color: #909399"
disabled
disabledColor="#fff"
style="pointer-events:none"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">详细地址</view>
<view class="vl flex-1">
<u--input
:disabled="userInfo.authStatus === 0"
placeholder="请输入内容"
v-model="form.person.addressDetail"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">有效通信地址</view>
<text class="ml-10 text-25">{{ form.person.address }}</text>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">个人账号</view>
<view class="vl flex-1">
<u--input
:disabled="userInfo.authStatus === 0"
placeholder="请输入内容"
v-model="form.person.personAccount"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">个人开户行</view>
<view class="vl flex-1">
<u--input
:disabled="userInfo.authStatus === 0"
placeholder="请输入内容"
v-model="form.person.personBankName"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">个人账户名</view>
<view class="vl flex-1">
<u--input
:disabled="userInfo.authStatus === 0"
placeholder="请输入内容"
v-model="form.person.accountName"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">手机号码</view>
<view class="vl flex-1">
<u--input
:disabled="userInfo.authStatus === 0"
placeholder="请输入内容"
v-model="form.person.mobile"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb">QQ号</view>
<view class="vl flex-1">
<u--input
:disabled="userInfo.authStatus === 0"
placeholder="请输入内容"
v-model="form.person.qq"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb">邮箱地址</view>
<view class="vl flex-1">
<u--input
:disabled="userInfo.authStatus === 0"
placeholder="请输入内容"
v-model="form.person.contactEmail"
></u--input>
</view>
</view>
<view class="group flex align-center m-top-30">
<view class="lb need">短信验证码</view>
<view class="vl flex-1 flex justify-start items-center">
<u--input
:disabled="userInfo.authStatus === 0"
placeholder="请输入内容"
v-model="form.smsCode"
></u--input>
<view class="ml-20">
<u-button type="primary" :disabled="!form.person.mobile || codeDisabled || userInfo.authStatus === 0"
@click="sendSmsCode">
{{ smsTips }}
</u-button>
</view>
</view>
</view>
</template>
<u-button class="public-btn" text="提交认证" @click="submitAuth"
:disabled="userInfo.authStatus === 0"></u-button>
</view>
</template>
</view>
<AddressSelect ref="AddressSelect" @confirm="regionConfirm"/>
<u-picker :show="showIndustry" :columns="[industryList]" keyName="name"
:default-index="defaultIndustryIndex"
@cancel="showIndustry = false" @close="showIndustry = false" closeOnClickOverlay
@confirm="confirmIndustry"></u-picker>
<u-picker :show="showManageType" :columns="[managerTypeList]" keyName="label"
:default-index="defaultManagerTypeIndex"
@cancel="showManageType = false" @close="showManageType = false" closeOnClickOverlay
@confirm="confirmManagerType"></u-picker>
<u-picker :show="showCertType" :columns="[certTypeList]"
:default-index="defaultCertTypeIndex"
@cancel="showCertType = false" @close="showCertType = false" closeOnClickOverlay
@confirm="confirmCertType"></u-picker>
</view>
</template>
<script>
import AddressSelect from "@/components/AddressSelect.vue";
import dayjs from "dayjs";
let timer = null
let timeS = 60
export default {
components: {AddressSelect},
props: {
userData: {
type: Object
}
},
data() {
return {
statusLabel: '',
userInfo: {
company: {
organization: '',
addressRegion: {},
addressDetail: '',
mobile: '',
legalName: '',
mailAddress: '',
contactEmail: '',
companyAccount: '',
companyBankName: '',
personAccount: '',
personBankName: '',
accountName: '',
businessType: '',
invoiceInfo: '',
taxType: '',
taxImage: [],
mainSpotCategoryIds: [],
},
},
form: {
authType: 2,
company: {
organization: '',
addressRegion: {},
addressDetail: '',
mobile: '',
legalName: '',
mailAddress: '',
contactEmail: '',
companyAccount: '',
companyBankName: '',
personAccount: '',
personBankName: '',
accountName: '',
businessType: '',
invoiceInfo: '',
taxType: '',
taxImage: [],
mainSpotCategoryIds: [],
organizationPath: ''
},
manager: {
type: null,
personName: '',
certType: '',
idCard: '',
mobile: '',
headPhotoPath: '',
backgroundIdCardPath: '',
},
smsCode: null,
},
addressRegion: '',
industryList: [],
defaultIndustryIndex: [0],
showIndustry: false,
goodsCate: [],
organizationPath: [],
invoiceInfo: [],
taxImage: [],
checked: [],
showManageType: false,
managerTypeList: [
{
value: 1,
label: '法人'
},
{
value: 2,
label: '授权人'
}
],
defaultManagerTypeIndex: [0],
managerType: '',
certTypeList: ['身份证', '护照'],
showCertType: false,
certType: '',
defaultCertTypeIndex: [0],
headPhotoPath: [],
backgroundIdCardPath: [],
codeDisabled: false,
smsTips: '点击获取',
userType: 1
};
},
methods: {
getCertUrl(reset = false) {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
data: {
reset,
isMobile: true,
isSignOnly: true,
},
success: (res) => {
window.location.href = res.data.url
// window.open(res.data.url)
}
});
},
async getIndustryList() {
const {rows} = await vk.callFunction({
url: 'client/industry/pub/getList'
})
this.industryList = rows
},
async getGoodsCate() {
const {data} = await vk.callFunction({
url: 'client/spot/category/pub/getList',
data: {
whereJson: {
level: 2
}
}
});
this.goodsCate = data
},
showAddress() {
const addressRegion = this.userInfo.accountType === 2 ? this.form.company.addressRegion : this.form.person.addressRegion
this.$refs.AddressSelect.open(addressRegion);
},
regionConfirm({province, city, area}) {
if (this.userInfo.accountType === 2) this.form.company.addressRegion = {province, city, area}
else this.form.person.addressRegion = {province, city, area}
this.addressRegion = `${province.name}${city.name}${area.name}`
},
confirmIndustry({value}) {
if (this.userInfo.accountType === 2) {
this.form.company.businessType = value[0].name
} else {
this.form.person.businessType = value[0].name
}
this.showIndustry = false
},
confirmManagerType({value}) {
this.form.manager.type = value[0].value
this.showManageType = false
},
confirmCertType({value}) {
this.form.manager.certType = value[0]
this.showCertType = false
},
afterRead({file}, field, formField, multi = false) {
if (multi) {
file.forEach(item => {
uniCloud.uploadFile({
filePath: item.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + item.name,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this[field].push({url: res.fileList[0].tempFileURL})
this.form[formField][field].push(res.fileList[0].tempFileURL)
})
}
})
})
} else {
uniCloud.uploadFile({
filePath: file.url,
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + file.name,
success: ({fileID}) => {
uniCloud.getTempFileURL({
fileList: [fileID]
}).then(res => {
this[field].push({url: res.fileList[0].tempFileURL})
this.form[formField][field] = res.fileList[0].tempFileURL
})
}
})
}
},
deletePic({index}, field, formFiled, multi = false) {
if (multi) {
this[field].splice(index, 1)
this.form[formFiled][field].splice(index, 1)
} else {
this[field] = []
this.form[formFiled][field] = null
}
},
async submitAuth(authStatus = 0) {
if (this.userInfo.accountType === 2) {
if (!this.form.company.addressDetail) return this.$message.error('请完善公司所在地')
if (this.form.company.mainSpotCategoryIds.length === 0) return this.$message.error('请选择主营商品')
if (!this.form.company.mailAddress) return this.$message.error('请完善有效通信地址')
if (!this.form.company.contactEmail) return this.$message.error('请完善联系邮箱')
if (!this.form.company.legalName) return this.$message.error('请完善法人姓名')
if (!this.form.company.addressRegion) this.form.company.addressRegion = {}
} else {
if (!this.form.person.personName) return this.$message.error('请输入真实姓名')
if (!this.form.person.mobile) return this.$message.error('请输入联系方式')
if (!this.form.person.personAccount) return this.$message.error('请填写个人账号')
if (!this.form.person.personBankName) return this.$message.error('请选择个人开户行')
if (!this.form.person.accountName) return this.$message.error('请选择个人账户名')
if (!this.form.smsCode) return this.$message.error('请输入短信验证码')
}
await vk.callFunction({
url: 'client/user/kh/addAuth',
title: '提交中...',
data: {...this.form, ...{authStatus}, isBusinessCard: false},
})
this.$message.success('提交成功')
this.iniData()
// setTimeout(() => {
// window.location.reload()
// }, 1500)
},
changeMainSpot(id) {
const index = this.form.company.mainSpotCategoryIds.findIndex(item => item === id)
if (index > -1) this.form.company.mainSpotCategoryIds.splice(index, 1)
else this.form.company.mainSpotCategoryIds.push(id)
},
sendSmsCode() {
if (timer != null) return
this.codeDisabled = true
vk.userCenter.sendSmsCode({
loading: true,
data: {
mobile: this.form.person.mobile,
type: 'verify',
},
success: (data) => {
this.codeDisabled = false
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
},
fail: () => {
this.codeDisabled = false
}
})
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
iniData() {
this.userInfo = JSON.parse(JSON.stringify(this.userData))
if (this.userInfo.fadadaConfirm && (this.userInfo.authStatus === null || this.userInfo.authStatus === -1))
this.statusLabel = '您已完成法大大认证,请在下方完善资料提交平台审核'
if (this.userInfo.authStatus === 0) this.statusLabel = '平台审核中'
else if (this.userInfo.authStatus === 1) this.statusLabel = '恭喜您已通过已通过金久信平台认证'
else if (this.userInfo.authStatus === 2) this.statusLabel = `审核不通过:${this.userInfo.refuseReason}`
if (!this.userInfo.userType) this.userType = 1
else this.userType = parseInt(this.userInfo.userType)
this.form = this.userData
if (this.userInfo.accountType === 2) {
if (this.userInfo.company.addressRegion)
this.addressRegion = `${this.userInfo.company.addressRegion.province.name}${this.userInfo.company.addressRegion.city.name}${this.userInfo.company.addressRegion.area.name}`
if (this.userInfo.company.businessType) {
const defaultIndustryIndex = this.industryList.findIndex(item => item.name === this.userInfo.company.businessType)
if (defaultIndustryIndex > -1) this.defaultIndustryIndex = [defaultIndustryIndex]
}
if (this.form.company.organizationPath) this.organizationPath = [{
url: this.form.company.organizationPath,
}]
if (this.form.company.invoiceInfo) this.invoiceInfo = [{
url: this.form.company.invoiceInfo,
}]
if (this.form.company.taxImage && this.form.company.taxImage.length > 0) {
this.taxImage = this.form.company.taxImage.map(url => {
return {
url
}
})
}
if (this.form.manager.type !== null) {
const defaultManagerTypeIndex = this.managerTypeList.findIndex(item => item.value === this.form.manager.type)
if (defaultManagerTypeIndex > -1) {
this.defaultManagerTypeIndex = [defaultManagerTypeIndex]
this.managerType = this.managerTypeList[defaultManagerTypeIndex].label
}
}
if (this.form.manager.certType !== null) {
this.defaultCertTypeIndex = [this.form.manager.certType]
this.certType = this.certTypeList[this.form.manager.certType]
}
if (this.form.manager.headPhotoPath) {
this.headPhotoPath = [{url: this.form.manager.headPhotoPath}]
}
if (this.form.manager.backgroundIdCardPath) {
this.backgroundIdCardPath = [{url: this.form.manager.backgroundIdCardPath}]
}
} else {
if (this.userInfo.person.addressRegion)
this.addressRegion = `${this.userInfo.person.addressRegion.province.name}${this.userInfo.person.addressRegion.city.name}${this.userInfo.person.addressRegion.area.name}`
}
},
changeUserType() {
vk.callFunction({
url: 'client/user/kh/changeUserType',
data: {
userType: this.userType
}
})
}
},
async mounted() {
await this.getIndustryList()
await this.getGoodsCate()
this.iniData()
}
}
</script>
<style lang="scss">
.layout-ident {
padding: 20rpx 30rpx;
.group {
display: flex;
justify-content: flex-start;
align-items: center;
}
.lb, .fix {
position: relative;
min-width: 150rpx;
font-size: 26rpx;
line-height: 40rpx;
color: #666666;
}
.lbx {
font-size: 24rpx;
color: #999999;
}
.download {
padding: 8rpx 20rpx;
font-size: 24rpx;
line-height: 36rpx;
color: #ffffff;
background: #A92924;
}
.need::before {
position: absolute;
left: -16rpx;
top: 50%;
z-index: 9;
margin-top: -12rpx;
content: '*';
color: #A92924;
font-size: 32rpx;
line-height: 1;
}
}
.public-btn {
width: 100%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
</style>
+235
View File
@@ -0,0 +1,235 @@
<template> <!-- 我的邀请 -->
<view>
<view class="layout layout-invite">
<template v-if="isInvite">
<view class="flex justify-between align-center p-top-20">
<view class="invite-title">邀请新用户免费兑换会员</view>
<!-- <u-button class="rule" text="活动规则"></u-button>-->
</view>
<view class="gong flex align-center m-top-30">
<view class="m-right-20">共邀请
<text class="red">{{ userData.inviteNum }}</text>
人
</view>
<u-tag text="邀请列表" type="warning" size="mini"></u-tag>
<view class="flex-1"></view>
<view>我的邀请码:
<text class="red">{{ userData.my_invite_code }}</text>
</view>
</view>
<view class="invite-info flex justify-around m-top-20">
<view class="item" v-if="item.recommendUpgrade && parseInt(item.recommendUpgrade) > 0" v-for="(item, index) in userLevelList" :key="index">
<view class="b">{{ item.name }}</view>
<view class="s">{{ item.upgradeDesc }}</view>
</view>
</view>
<view class="invite-progress m-top-30">
<u-line-progress :percentage="progress" activeColor="#A92924" height="16"></u-line-progress>
<view class="flex justify-between m-top-10">
<view class="lv red">已邀请{{ userData.inviteNum }}人</view>
<!-- <view class="lv red">9人</view>-->
</view>
</view>
<view class="invite-btn flex justify-center">
<u-button class="btn-style" color="#A92924" :plain="true" text="复制邀请码" @click="copy"></u-button>
<u-button class="btn-style" color="#A92924" text="兑换会员" @click="isInvite = false"></u-button>
</view>
</template>
<template v-if="!isInvite">
<view class="flex justify-between align-center p-top-20">
<view class="invite-title">请选择要兑换的会员!</view>
<view class="invited text-right">
<text>已邀请
<text class="red">10</text>
人
</text>
,
<text>已兑换
<text class="red">10</text>
人
</text>
,
<text>剩余
<text class="red">10</text>
人可兑换
</text>
</view>
</view>
<view class="invite-info flex justify-between m-top-20">
<view v-for="(item, index) in userLevelList" :key="index"
v-if="item.recommendUpgrade && parseInt(item.recommendUpgrade) > 0"
:class="['item', {active: inviteIndex === index}]" @click="onSelect(item, index)">
<view class="b">{{ item.name }}</view>
<view class="s">{{ item.upgradeDesc }}</view>
</view>
</view>
<view class="invite-btn flex justify-center">
<u-button
class="btn-style"
color="#A92924"
:plain="true"
text="取消兑换"
@click="isInvite = true"
></u-button>
<u-button
class="btn-style"
color="#A92924"
text="确认"
@click="exchangeUpgrade"
></u-button>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
props: {
userData: {
type: Object
}
},
data() {
return {
isInvite: true,
inviteIndex: null,
userLevelList: [],
maxUpgradeNum: 100,
progress: 0,
};
},
methods: {
onSelect(item, index) {
if (parseInt(this.userData.inviteNum) >= item.recommendUpgrade && item.level > parseInt(this.userData.userLevel))
this.inviteIndex = index
else this.$message.error('您的邀请人数不足')
},
copy() {
const url = window.location.origin + `/#/pages/auth/register/register?code=${this.userData.my_invite_code}`
document.oncopy = function (e) {
e.clipboardData.setData('text', url);
e.preventDefault();
document.oncopy = null;
}
document.execCommand('Copy');
this.$message({
type: 'success',
message: '邀请码已复制'
})
},
async getUserLevelList() {
const {rows} = await vk.callFunction({
url: 'client/userLevel/pub/getList',
data: {
pageIndex: 1,
pageSize: 200
},
});
this.userLevelList = rows
this.userLevelList.forEach(item => {
if (item.recommendUpgrade && parseInt(item.recommendUpgrade) > 0)
this.maxUpgradeNum = Math.max(this.maxUpgradeNum, item.recommendUpgrade)
})
console.log(this.userLevelList)
this.progress = parseInt(this.userData.inviteNum) / this.maxUpgradeNum * 100
},
async exchangeUpgrade(){
await vk.callFunction({
url: 'client/user/kh/exchangeUpgrade',
data: {
id: this.userLevelList[this.inviteIndex]._id
}
});
this.$message.success('兑换成功')
this.isInvite = true
}
},
mounted() {
this.getUserLevelList()
}
}
</script>
<style lang="scss">
.layout-invite {
padding: 20rpx 30rpx;
.invite-title {
font-size: 28rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
}
.rule {
margin: 0;
font-size: 24rpx;
width: 130rpx;
height: 48rpx;
color: #101010;
border-radius: 8rpx;
background: #dedede;
}
.gong {
font-size: 28rpx;
line-height: 48rpx;
color: #000000;
}
.invite-info {
padding: 30rpx 0;
.item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
width: 210rpx;
//height: 150rpx;
line-height: 48rpx;
color: #A92924;
border-radius: 12rpx;
box-shadow: 0px 2px 6px 0px rgba(169, 41, 36, 1);
margin: 0 10rpx;
padding: 10rpx;
text-align: center;
.b {
font-size: 28rpx;
font-weight: 500;
}
.s {
font-size: 24rpx;
margin-top: 20rpx;
}
}
.active {
color: #ffffff;
background: #A92924;
}
}
.lv {
font-size: 26rpx;
line-height: 40rpx;
}
.invite-btn {
margin-top: 80rpx;
padding: 20rpx 20rpx;
.btn-style {
margin: 0 30rpx;
}
}
.invited {
font-size: 24rpx;
color: #101010;
}
}
</style>
+525
View File
@@ -0,0 +1,525 @@
<template> <!-- 消息 -->
<view>
<view class="layout-notice">
<template v-if="!isNotice">
<view class="notice-head flex justify-between align-center">
<view class="text">
有
<text class="red">{{ unreadNum }}</text>
条系统通知消息未读
</view>
<view class="read flex justify-center align-center" @click="allRead">
<u-icon name="eye" color="#666666" size="20"></u-icon>
<text>全部标为已读</text>
</view>
<view class="push flex justify-center align-center" @click="isNotice = true">
<u-icon name="setting" color="#666666" size="20"></u-icon>
<text>消息推送设置</text>
</view>
</view>
<view class="notice-body">
<!-- 未读消息使用unread -->
<view class="item" :class="{'unread': !item.hasRead}" v-for="(item, index) in noticeList"
:key="index">
<view class="info flex justify-between align-center">
<view class="title text-single" @click="toDetail(item, index)">{{ item.title }}</view>
<view class="date flex-1 m-left-20" @click="toDetail(item, index)">{{
item._add_time_str
}}
</view>
<view class="flex justify-center align-center" v-if="!item.hasRead" @click="setRead(index)">
<u-icon name="eye" color="#A92924" size="18"></u-icon>
<text class="read">标为已读</text>
</view>
<view class="flex justify-center align-center" @click="del(index)">
<u-icon name="trash" color="#A92924" size="18"></u-icon>
<text class="delete">删除</text>
</view>
</view>
<view class="detail m-top-10" @click="toDetail(item, index)">
{{ item.content }}
</view>
</view>
</view>
</template>
<template v-else>
<view class="account-title m-top-20">消息推送设置</view>
<u--text color="#626262" margin="20rpx 0 40rpx"
text="注!我们将针对您的选择,为您精准推送询价信息"></u--text>
<u-line color="#bbb"></u-line>
<!-- 开关遍历容器 -->
<view class="switch-list m-top-20">
<view class="switch-box flex justify-between align-center" v-for="(item,index) in settingList"
:key="index">
<view class="text">
<text class="red">*</text>
{{ item.title }}
</view>
<u-switch v-model="item.status" activeColor="#be2a28" size="20"
@change="handSwitchChange($event,index)"></u-switch>
</view>
</view>
<view class="m-top-30">
<u-line color="#bbb"></u-line>
</view>
<view class="account-title m-top-20">选择产品</view>
<!-- 产品遍历容器 -->
<view class="goods-list">
<view class="goods-box flex" v-for="(item, index) in productList" :key="index">
<view class="lb">{{ item.name }}</view>
<view class="flex-1">
<view class="flex justify-start flex-wrap">
<view class="m-right-20 m-top-20" v-for="(productItem, productIndex) in item.children"
:key="productIndex">
<u-tag size="mini"
:text="productItem.name"
:plain="!productList[index].idList.includes(productItem.name)"
type="error"
:name="productItem.name"
@click="handCheckboxClick"
></u-tag>
</view>
</view>
</view>
</view>
</view>
<!-- 已选 -->
<div class="form">
<view class="account-title m-top-20">请选择服务地区</view>
<view class="flex flex-col justify-start items-start">
<view class="w-100p">
<el-select size="small" v-model="addressIndex[0]" placeholder="请选择省" class="w-100p">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</view>
<view class="my-10 w-100p">
<el-select size="small" v-model="addressIndex[1]" placeholder="请选择市" class="w-100p"
:disabled="!addressIndex[0]">
<template v-if="addressIndex[0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</view>
<view class="my-10 w-100p">
<el-select size="small" v-model="addressIndex[2]" placeholder="请选择区" class="w-100p"
:disabled="!addressIndex[1]">
<template v-if="addressIndex[0] !== null && addressIndex[1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[0]][addressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</view>
</view>
<u-button type="primary" size="mini" @click="addAddress">添加</u-button>
</div>
<div class="flex justify-start items-start flex-wrap mt-20 text-25">
<div class="flex justify-start items-center pointer" @click="deleteAddress(item)"
v-for="(item, index) in addressList"
:key="index" style="margin: 10px 10px 0 0">
<image src="/static/img/check.png" style="width: 12px; height: 12px; margin-right: 5px"/>
<span style="line-height: 18px">{{ item.province.name }}-{{
item.city ? item.city.name : '不限'
}}-{{ item.area ? item.area.name : '不限' }}</span>
</div>
</div>
<el-divider></el-divider>
<div class="form">
<view class="account-title m-top-20">请选择单笔交易额</view>
<div class="flex justify-start items-center">
<el-input size="small" v-model="tradeAmount[0]" placeholder="请输入金额" style="width: 200px">
<template #suffix>元</template>
</el-input>
<span class="mx-20">~</span>
<el-input size="small" v-model="tradeAmount[1]" placeholder="请输入金额" style="width: 200px">
<template #suffix>元</template>
</el-input>
</div>
</div>
<el-divider></el-divider>
<div class="form text-25">
<view class="account-title m-top-20">请选择交易方式</view>
<div class="flex justify-start items-center pointer" @click="changeItemCheck('tradeSelf')"
style="margin: 10px 10px 0 0">
<image :src="tradeSelf ? '/static/img/check.png' : '/static/img/uncheck.png'"
style="width: 12px; height: 12px; margin-right: 5px"/>
<span style="line-height: 18px">自主交易</span>
</div>
<div class="flex justify-start items-center pointer"
@click="changeItemCheck('tradePlatform')"
style="margin: 10px 10px 0 0">
<image :src="tradePlatform ? '/static/img/check.png' : '/static/img/uncheck.png'"
style="width: 12px; height: 12px; margin-right: 5px"/>
<span style="line-height: 18px">金久信公证</span>
</div>
</div>
<el-divider></el-divider>
<div class="form">
<view class="account-title m-top-20">请设置免打扰时间段</view>
<div class="flex justify-start items-center">
<el-time-picker v-model="doNotDisturbRange" range-separator="~" is-range style="width: 200px"/>
</div>
</div>
<view class="flex justify-between items-center">
<view class="mx-15 flex-1">
<u-button class="public-btn" text="保存设置" @click="handSubmit"></u-button>
</view>
<view class="mx-15 flex-1">
<u-button class="public-btn-plain" text="取消" @click="isNotice = false"></u-button>
</view>
</view>
</template>
</view>
</view>
</template>
<script>
import provinces from "@/util/address/provinces.json";
import citys from "@/util/address/citys.json";
import areas from "@/util/address/areas.json";
export default {
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
isNotice: false,
settingList: {
article: {
title: '现货推送服务',
status: false
},
process: {
title: '找加工信息推送服务',
status: false
},
old: {
title: '旧货交易信息推送服务',
status: false
},
enquiry: {
title: '询价单和选项推送服务',
status: false
},
},
value: false,
unreadNum: 0,
noticeList: [],
productList: [],
addressRegion: {},
tradeSelf: false,
tradePlatform: false,
doNotDisturbRange: [new Date(2024, 1, 1, 0, 0), new Date(2024, 1, 1, 0, 0)],
tradeAmount: [],
addressIndex: [null, null, null],
addressList: []
};
},
methods: {
handCheckboxClick(name) {
this.checkboxs[name].checked = !this.checkboxs[name].checked
},
handSwitchChange(val, index) {
this.settingList[index].status = val
},
async getList(pageIndex = 1) {
const {rows, total} = await vk.callFunction({
url: 'client/message/kh/getList',
data: {
pageIndex,
pageSize: 500,
}
})
this.total = total
this.noticeList = rows
},
async getUnreadNum() {
const {data} = await vk.callFunction({
url: 'client/message/kh/getUnreadCount',
});
this.unreadNum = data
},
async setRead(index) {
this.noticeList[index].hasRead = true
await vk.callFunction({
url: 'client/message/kh/setRead',
data: {
id: this.noticeList[index]._id
}
})
},
del(index) {
uni.showModal({
title: '提示',
content: '确定清空内容吗?',
success: async res => {
if (res.confirm) {
await vk.callFunction({
url: 'client/message/kh/delete',
data: {
id: this.noticeList[index]._id
}
})
this.$message.success('删除成功')
await this.getList()
}
}
})
},
toDetail(item, index) {
if (!item.hasRead) this.setRead(index)
let url = null
if (item.type === 'old') url = `/pages/junk/detail?id=${item.pk}`
else if (item.type === 'enquiry') url = `/pages/price/detail?id=${item.pk}`
else if (item.type === 'process') url = `/pages/work/detail?id=${item.pk}`
else if (item.type === 'contract') url = `/pages/public/contract?tab=1`
else if (item.type === 'self-support') url = `/pages/self/makeQuote?id=${item.pk}`
else if (item.type === 'self-product') url = `/pages/user/seller`
else if (item.type === 'spot') url = `/pages/goods/detail?id=${item.pk}`
else if (item.type === 'self-support-quote') {
this.getQuoteDetail(item.pk)
}
if (url) vk.navigateTo({url})
},
async allRead() {
await vk.callFunction({
url: 'client/message/kh/setAllRead'
})
await this.getList(1)
await this.getUnreadNum()
},
async getQuoteDetail(_id) {
await vk.callFunction({
url: 'client/selfSupport/kh/getQuoteDetail',
data: {
_id
},
success: ({rows}) => {
this.sheet = rows
this.dialogVisible = true
}
});
},
toContract() {
this.dialogVisible = false
vk.navigateTo({url: '/pages/public/contract?tab=1'})
},
async getConfig() {
const res = await vk.callFunction({
url: 'client/message/config/kh/getConfig'
})
for (let key in this.settingList) this.settingList[key].status = res[key]
this.productList.forEach((item, index) => {
item.children.forEach(productItem => {
if (res.productList.includes(productItem.name)) {
this.productList[index].idList.push(productItem.name)
}
})
})
this.tradeSelf = res.tradeSelf ?? false
this.tradePlatform = res.tradePlatform ?? false
if (res.addressList) this.addressList = res.addressList
else {
this.addressList = []
}
this.doNotDisturbRange = res.doNotDisturbRange ?? []
this.tradeAmount = res.tradeAmount ?? []
},
async getCate() {
const {rows} = await vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
});
this.productList = rows.map(item => {
item.idList = []
return item
})
},
async handSubmit() {
let productList = []
this.productList.forEach(item => {
productList = [...productList, ...item.idList]
})
await vk.callFunction({
url: 'client/message/config/kh/update',
data: {
article: this.settingList.article.status,
process: this.settingList.process.status,
old: this.settingList.old.status,
enquiry: this.settingList.enquiry.status,
productList,
addressList: this.addressList,
tradeSelf: this.tradeSelf,
tradePlatform: this.tradePlatform,
doNotDisturbRange: this.doNotDisturbRange,
tradeAmount: this.tradeAmount,
}
})
this.$message.success('保存成功')
this.isNotice = false
},
addAddress() {
if (!this.addressIndex[0]) return
this.addressList.push({
province: this.provinceData[this.addressIndex[0]],
city: this.addressIndex[1] ? this.cityData[this.addressIndex[0]][this.addressIndex[1]] : null,
area: this.addressIndex[2] ? this.areaData[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]] : null
})
this.addressIndex = [null, null, null]
},
deleteAddress(index) {
this.addressList.splice(index, 1)
},
changeItemCheck(field) {
this[field] = !this[field]
}
},
async mounted() {
await this.getList()
await this.getUnreadNum()
await this.getCate()
await this.getConfig()
}
}
</script>
<style lang="scss">
.layout-notice {
padding: 10rpx 30rpx;
}
.notice-head {
height: 80rpx;
font-size: 24rpx;
line-height: 32rpx;
color: #333333;
border-bottom: 1px solid #f2f2f2;
}
.notice-body {
.item {
position: relative;
padding: 20rpx 0 40rpx 20rpx;
border-bottom: 1px solid #f2f2f2;
.detail {
font-size: 24rpx;
line-height: 32rpx;
color: #999999;
}
}
.unread::before {
position: absolute;
left: 0;
top: 30rpx;
z-index: 9;
content: '';
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background: #A92924;
}
.title {
max-width: 280rpx;
font-size: 26rpx;
line-height: 32rpx;
color: #333333;
}
.date {
font-size: 22rpx;
line-height: 32rpx;
color: #999999;
}
.read, .delete {
font-size: 24rpx;
line-height: 32rpx;
color: #A92924;
}
}
.account-title {
position: relative;
padding-left: 20rpx;
font-size: 28rpx;
font-weight: 600;
line-height: 48rpx;
color: #A92924;
&:before {
position: absolute;
left: 0;
top: 50%;
z-index: 9;
margin-top: -14rpx;
content: '';
width: 6rpx;
height: 28rpx;
background: #A92924;
}
}
.public-btn {
width: 100%;
margin-top: 60rpx;
color: #ffffff;
background: #A92924;
}
.public-btn-plain {
width: 100%;
margin-top: 60rpx;
color: #A92924;
border: 1px solid #A92924;
}
.lb {
width: 160rpx;
height: auto;
padding-top: 20rpx;
font-size: 24rpx;
line-height: 48rpx;
color: #333333;
}
.goods-box {
padding-bottom: 20rpx;
border-bottom: 1px dashed #f2f2f2;
}
.switch-box {
padding: 16rpx 0;
font-size: 26rpx;
color: #333333;
}
/deep/ .i-icon {
display: flex;
align-items: center;
justify-content: center;
}
/deep/ .el-input__suffix {
display: flex;
align-items: center;
justify-content: center;
}
</style>
+163
View File
@@ -0,0 +1,163 @@
<template>
<view class="p-30">
<view class="flex justify-end items-center">
<u-button size="small" color="#A92924" text="新增收款账户"
@click="showAdd" v-if="!isAdd"></u-button>
</view>
<view class="mt-20" v-if="isAdd">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="类型" required v-if="userData.accountType === 2">
<el-select v-model="form.type" placeholder="请选择账号类型">
<el-option label="对公账号" value="company"/>
<el-option label="个人账号" value="person"/>
</el-select>
</el-form-item>
<el-form-item label="开户行" required>
<el-input v-model="form.bankName" placeholder="请输入开户行"
:readonly="userData.accountType === 2 && form.type === 'company' "/>
</el-form-item>
<el-form-item label="账号名称" required>
<el-input v-model="form.accountName" placeholder="请输入账号名称"
:readonly="userData.accountType === 2 && form.type === 'company'"/>
</el-form-item>
<el-form-item label="账号" required>
<el-input v-model="form.account" placeholder="请输入邮箱"/>
</el-form-item>
<el-form-item label="默认账号">
<el-switch v-model="form.isDefault" active-color="#a92924"/>
</el-form-item>
</el-form>
<view class="mt-30 flex justify-center items-center">
<view class="flex-1 px-20">
<u-button plain @click="isAdd = !isAdd">取消</u-button>
</view>
<view class="flex-1 px-20">
<u-button type="primary" @click="addContact">确定</u-button>
</view>
</view>
<view class="mt-30 text-main text-25">温馨提示:请详细、慎重核查账户信息的正确性,以免给您造成不必要损失。账户信息错误平台不承担付款错误责任。</view>
</view>
<view v-else>
<view class="p-20 shadow flex justify-between items-center my-20 rounded" v-for="(item, index) in list"
:key="index">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center">
<u-tag type="primary" size="mini" class="mr-25" text="默认" v-if="item.isDefault"></u-tag>
<u-tag type="success" size="mini" class="mr-25"
:text="item.type === 'company' ? '对公' : '个人'"></u-tag>
<text class="font-bold text-25">{{ item.account }}</text>
</view>
<view class="my-20">{{ item.accountName }}</view>
<view class="my-20">{{ item.bankName }}</view>
</view>
<view class="flex flex-col justify-end">
<u-button type="primary" size="small" @click="edit(item)">编辑</u-button>
<view class="mt-20">
<u-button type="primary" size="small" @click="del(item._id)" plain>删除</u-button>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: "payeeAccount",
props: {
userData: {
type: Object
}
},
data() {
return {
isAdd: false,
form: {
_id: null,
bankName: '',
accountName: '',
account: '',
type: '',
isDefault: false,
},
list: []
}
},
methods: {
async addContact() {
if (!this.form.bankName) {
this.$message.error('请输入开户行')
return
}
if (!this.form.accountName) {
this.$message.error('请输入账号名称')
return
}
if (!this.form.account) {
this.$message.error('请输入账号')
return
}
if (!this.form.type && parseInt(this.userData.accountType) === 2) {
this.$message.error('请选择类型')
return
}
await vk.callFunction({
url: 'client/account/kh/action',
data: this.form
})
this.$message.success(this.form._id ? '修改成功' : '新增成功')
await this.getList()
this.isAdd = false
this.form = {
_id: null,
bankName: '',
accountName: '',
account: '',
type: '',
isDefault: false,
}
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/account/kh/getList',
})
this.list = rows
},
del(_id) {
uni.showModal({
title: '提示',
content: '确认删除该账号吗?',
success: async res => {
if (res.confirm) {
await vk.callFunction({
url: 'client/account/kh/delete',
data: {_id}
})
await this.getList()
}
}
})
},
edit(item) {
for (let key in this.form) this.form[key] = item[key]
this.isAdd = true
},
showAdd() {
if (this.userData.accountType === 2) {
this.form.account = this.userData.company.companyAccount
this.form.bankName = this.userData.company.companyBankName
this.form.accountName = this.userData.company.companyName
}
this.isAdd = true
}
},
mounted() {
if (parseInt(this.userData.authStatus) !== 1) {
this.$message.error('请先完成实名认证')
uni.navigateBack()
return
}
this.getList()
}
}
</script>