1107
This commit is contained in:
@@ -0,0 +1,612 @@
|
||||
<template>
|
||||
<view>
|
||||
<div class="outter-wrapper">
|
||||
<div class="login-page">
|
||||
<div class="header w-1180 flex-h-ac">
|
||||
<a href="" class="zg-logo fl nuxt-link-active">
|
||||
<img src="@/static/images/logo-small.png" alt="买卖钢材,上金久信">
|
||||
</a>
|
||||
</div>
|
||||
<div class="main-container">
|
||||
<div class="w-1180 flex-h-e">
|
||||
<div class="login-container">
|
||||
<h2 style="margin-bottom: 15px;">会员登录</h2>
|
||||
<div id="from" action="">
|
||||
<div class="input-grouptabs clear">
|
||||
<span @click="memberType = 'personal'"
|
||||
:class="{'tab-active': memberType == 'personal'}" class="normal" data-id="0"
|
||||
id="normal"><i></i>个人用户</span>
|
||||
<span @click="memberType = 'business'"
|
||||
:class="{'tab-active': memberType == 'business'}" class="nopassword" data-id="1"
|
||||
id="nopw"><i></i>企业用户</span>
|
||||
</div>
|
||||
<!-- 账号密码登录 -->
|
||||
<view class="login-method">
|
||||
<view @click="loginMethod = 'username'" class="login-method-item">账号密码登录</view>
|
||||
<view @click="loginMethod = 'mobile'" class="login-method-item">验证码登录</view>
|
||||
</view>
|
||||
<div class="tabContent">
|
||||
<!--企业用户登录-->
|
||||
<div class="login-con active" id="rc">
|
||||
<div v-if="loginMethod == 'username'" class="input-group clear">
|
||||
<div class="input-group-addon">
|
||||
<i class="icon_user"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" v-model="form1.username"
|
||||
placeholder="请输入手机号/邮箱/用户名" autocomplete="off">
|
||||
</div>
|
||||
|
||||
<div v-if="loginMethod == 'username'" class="input-group clear">
|
||||
<div class="input-group-addon">
|
||||
<i class="icon_password"></i>
|
||||
</div>
|
||||
<input type="password" class="form-control" v-model="form1.password"
|
||||
placeholder="请输入登录密码" autocomplete="off">
|
||||
</div>
|
||||
|
||||
<div v-if="loginMethod == 'mobile'" class="input-group clear">
|
||||
<div class="input-group-addon">
|
||||
<i class="icon_user"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" v-model="form1.mobile"
|
||||
placeholder="请输入手机号" autocomplete="off">
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="loginMethod == 'mobile'" class="input-group clear">
|
||||
<div class="input-group-addon">
|
||||
<i class="icon_phone"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" v-model="form1.smsCode"
|
||||
placeholder="请输入短信验证码" autocomplete="off" />
|
||||
<view @click="sendSmsCode" id="btnSendCode1" type="button"
|
||||
class="btn-default" value="">{{smsTips}}</view>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-groupp clear">
|
||||
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
|
||||
style="width: 100%;">立即登录</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-groupwp clear">
|
||||
<navigator url="/pages/auth/register/register" style="float: left;text-align: left;">免费注册新账号</navigator>
|
||||
<a href="/user/find_pwd.html" style="float: right;text-align: right;">找回密码</a>
|
||||
|
||||
</div>
|
||||
<div class=" threeBorder"><span>第三方登录</span></div>
|
||||
|
||||
<div class="input-groupwpg clear">
|
||||
<!-- <a href="" class="dsf-wetChat" title="微信"><i></i></a>-->
|
||||
<a href="/user/qq_login.html" class="dsf-qq" title="QQ"><i></i></a>
|
||||
<!-- <a href="" class="dsf-dx" title="短信"><i></i></a>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var vk = uni.vk
|
||||
let timer = null
|
||||
let timeS = 60
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
memberType: 'personal', // business 企业 、、personal个人
|
||||
loginMethod: 'username', // username 用户名 + 密码 、、mobile 手机号 + 验证码
|
||||
smsTips: '获取验证码',
|
||||
form1: {
|
||||
mobile: '',
|
||||
password: '',
|
||||
smsCode: '',
|
||||
username: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleSubmit() {
|
||||
|
||||
let data = {}
|
||||
|
||||
const {
|
||||
username,
|
||||
password,
|
||||
mobile,
|
||||
smsCode
|
||||
} = this.form1
|
||||
|
||||
if (this.loginMethod == 'username') {
|
||||
data = {
|
||||
username,
|
||||
password
|
||||
}
|
||||
vk.userCenter.login({
|
||||
loading: false,
|
||||
data,
|
||||
success: (data) => {
|
||||
this.loginSuccess()
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
vk.userCenter.loginBySms({
|
||||
loading: false,
|
||||
data: {
|
||||
mobile: mobile,
|
||||
code: smsCode,
|
||||
},
|
||||
success: (data) => {
|
||||
this.loginSuccess()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
sendSmsCode() {
|
||||
if (timer != null) {
|
||||
return
|
||||
}
|
||||
vk.userCenter.sendSmsCode({
|
||||
loading: false,
|
||||
data: {
|
||||
mobile: this.form1.mobile,
|
||||
type: 'login',
|
||||
},
|
||||
success: (data) => {
|
||||
|
||||
this.$message({
|
||||
message: "验证码已发送",
|
||||
type: 'success'
|
||||
})
|
||||
timeS = 60
|
||||
timer = setInterval(() => {
|
||||
timeS--
|
||||
if (timeS == 0) {
|
||||
this.stopTimer()
|
||||
this.smsTips = "重新发送"
|
||||
} else {
|
||||
this.smsTips = timeS + "秒"
|
||||
}
|
||||
|
||||
}, 1000)
|
||||
}
|
||||
});
|
||||
},
|
||||
stopTimer() {
|
||||
if (timer != null) {
|
||||
clearInterval(timer)
|
||||
timer = null
|
||||
}
|
||||
|
||||
},
|
||||
loginSuccess() {
|
||||
uni.reLaunch({
|
||||
url: '/'
|
||||
})
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
this.stopTimer()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@charset "utf-8";
|
||||
|
||||
.login-method {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
margin-bottom: 2px;
|
||||
|
||||
&-item {
|
||||
color: #d0111a;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.outter-wrapper {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.zg-logo img {
|
||||
width: 230px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.layout-common-footer {
|
||||
text-align: center;
|
||||
margin: 15px 0px 10px;
|
||||
}
|
||||
|
||||
.layout-common-footer .copyright .link>a {
|
||||
color: #666;
|
||||
padding: 0 10px;
|
||||
display: inline-block;
|
||||
line-height: 2
|
||||
}
|
||||
|
||||
.w-1180 {
|
||||
width: 1200px;
|
||||
margin: 0px auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.flex-h-ac {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header {
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.main-container {
|
||||
min-width: 1200px;
|
||||
padding: 60px 0;
|
||||
background: #e8f5fd url(/static/images/login-bg.jpg)50% no-repeat;
|
||||
}
|
||||
|
||||
.flex-h-e,
|
||||
.flex-h-e-ac {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.main-container .login-container {
|
||||
width: 350px;
|
||||
box-sizing: border-box;
|
||||
padding: 30px 35px 30px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.login-container h2 {
|
||||
text-align: center;
|
||||
line-height: 2;
|
||||
color: #000;
|
||||
font-size: 25px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.btnMarymt {
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
background: #a92924;
|
||||
color: #fff !important;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
background: linear-gradient(90deg, #f0242e, #d0111a);
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btnMarymt:hover {
|
||||
background: #f12d36
|
||||
}
|
||||
|
||||
.input-group {
|
||||
width: 100%;
|
||||
height: 46px;
|
||||
}
|
||||
|
||||
.input-group-addon {}
|
||||
|
||||
.input-group .form-control {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
border: none;
|
||||
background: none;
|
||||
margin-left: 12px;
|
||||
outline: none;
|
||||
font-size: 13px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px solid #d4d4d4;
|
||||
margin-bottom: 15px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.input-group-addon i {
|
||||
background: url(/static/images/iconsmall.png)no-repeat center center;
|
||||
width: 38px;
|
||||
border-right: 1px solid #d4d4d4;
|
||||
height: 26px;
|
||||
overflow: hidden;
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.input-group-addon .icon_user {
|
||||
background-position: -212px -35px;
|
||||
}
|
||||
|
||||
.input-group-addon .icon_phone {
|
||||
background-position: -212px -67px;
|
||||
}
|
||||
|
||||
.input-group-addon .icon_password {
|
||||
background-position: -212px -100px;
|
||||
}
|
||||
|
||||
.input-group-addon .icon_yaoqingma {
|
||||
background-position: -209px -318px;
|
||||
}
|
||||
|
||||
.input-groupp {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#btnSendCode1 {
|
||||
position: absolute;
|
||||
right: 1px;
|
||||
top: 8px;
|
||||
line-height: 31px;
|
||||
color: #d0111a;
|
||||
width: 79px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
border-left: 1px solid;
|
||||
background: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.input-group.focus {
|
||||
background-color: #fff;
|
||||
box-shadow: 0 2px 11px 0 rgba(0, 0, 0, .04)
|
||||
}
|
||||
|
||||
.input-groupwp {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
font-size: 14px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.input-groupwpg a {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.input-groupwpg .dsf-wetChat i {
|
||||
background: url(/static/images/iconsmall.png)no-repeat;
|
||||
width: 50px;
|
||||
height: 40px;
|
||||
display: block;
|
||||
background-position: -218px -132px;
|
||||
}
|
||||
|
||||
.input-groupwpg .dsf-qq i {
|
||||
background: url(/static/images/iconsmall.png)no-repeat;
|
||||
width: 50px;
|
||||
height: 40px;
|
||||
display: block;
|
||||
background-position: -216px -178px;
|
||||
margin: 0px 24px;
|
||||
}
|
||||
|
||||
.input-groupwpg .dsf-dx i {
|
||||
background: url(/static/images/iconsmall.png)no-repeat;
|
||||
width: 50px;
|
||||
height: 40px;
|
||||
display: block;
|
||||
background-position: -215px -224px;
|
||||
}
|
||||
|
||||
.threeBorder {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
.threeBorder:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
width: 95%;
|
||||
height: 1px;
|
||||
border-bottom: 1px solid #CCCCCC;
|
||||
-webkit-transform: scaleY(0.5);
|
||||
transform: scaleY(0.5);
|
||||
-webkit-transform-origin: 0 100%;
|
||||
transform-origin: 0 100%;
|
||||
}
|
||||
|
||||
.threeBorder span {
|
||||
color: #888888;
|
||||
background: #fff;
|
||||
width: 90px;
|
||||
margin: 0 auto;
|
||||
z-index: 1002;
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.input-groupwpg {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 48px;
|
||||
font-size: 14px;
|
||||
margin-top: 22px;
|
||||
|
||||
}
|
||||
|
||||
.login-con {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.input-grouptabs span {
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
line-height: 23px;
|
||||
font-weight: normal;
|
||||
display: inline-block;
|
||||
padding: 0px 18px;
|
||||
text-align: center;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
.input-grouptabs {
|
||||
text-align: center;
|
||||
margin: 0px auto 30px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.input-grouptabs i {
|
||||
background: url(/static/images/iconsmall.png)no-repeat;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.input-grouptabs .tab-active#normal i {
|
||||
background-position: -218px -269px;
|
||||
}
|
||||
|
||||
.input-grouptabs .tab-active#nopw i {
|
||||
background-position: -218px -269px;
|
||||
}
|
||||
|
||||
.input-grouptabs #normal i {
|
||||
background-position: -218px -293px;
|
||||
}
|
||||
|
||||
.input-grouptabs #nopw i {
|
||||
background-position: -218px -293px;
|
||||
}
|
||||
|
||||
.input-grouptabs span.tab-active {
|
||||
color: #a92924
|
||||
}
|
||||
|
||||
.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.input-groupread {
|
||||
height: 40px;
|
||||
line-height: 30px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.agreement_dialogs {
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 99999;
|
||||
text-align: center;
|
||||
display: none;
|
||||
background-color: rgba(35, 35, 35, 0.4);
|
||||
-webkit-transition: all 0.5s linear;
|
||||
transition: all 0.5s linear;
|
||||
}
|
||||
|
||||
.agreement_dialogs .dialog_lay_1syd {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
display: inline-block;
|
||||
width: 750px;
|
||||
color: #656565;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
background-color: #fff;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
-webkit-transition: all 0.2s linear;
|
||||
transition: all 0.2s linear;
|
||||
}
|
||||
|
||||
.agreement_dialogs .dialog_foot_1hHfr {
|
||||
height: 80px;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
border-top: 1px solid #d5d5d5;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.agreement_dialogs .dialog_minorBtn_1u8nf {
|
||||
display: inline-block;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
border: 1px #316ccb solid;
|
||||
padding: 0 30px;
|
||||
height: 40px;
|
||||
background: #a92924;
|
||||
background: linear-gradient(90deg, #f0242e, #d0111a);
|
||||
line-height: 40px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
vertical-align: top;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
color: #fff;
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
.agreement_titley {
|
||||
height: 55px;
|
||||
line-height: 55px;
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #d5d5d5;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.agreement_content {
|
||||
margin: 23px 32px;
|
||||
}
|
||||
|
||||
.con-subhead {
|
||||
font-size: 14px;
|
||||
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.con-content {
|
||||
height: 240px;
|
||||
overflow-y: scroll;
|
||||
line-height: 2;
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,629 @@
|
||||
<template>
|
||||
<view>
|
||||
<top-bar></top-bar>
|
||||
<common-header></common-header>
|
||||
<category-bar></category-bar>
|
||||
<div class="outter-wrapper">
|
||||
<div class="login-page">
|
||||
<div class="main-container">
|
||||
<div class="w-1180 flex-h-e">
|
||||
<div class="login-container">
|
||||
<h2 style="margin-bottom: 15px;">免费注册会员</h2>
|
||||
<view id="from" action="">
|
||||
<div class="input-grouptabs clear">
|
||||
<span @click="form1.accountType = 1"
|
||||
:class="{'tab-active': form1.accountType == 1}" class="normal" data-id="0"
|
||||
id="normal"><i></i>个人用户</span>
|
||||
<span @click="form1.accountType = 2"
|
||||
:class="{'tab-active': form1.accountType == 2}" class="nopassword" data-id="1"
|
||||
id="nopw"><i></i>企业用户</span>
|
||||
</div>
|
||||
<div class="tabContent">
|
||||
<div class="login-con active" id="rc">
|
||||
<div class="input-group clear">
|
||||
<div class="input-group-addon">
|
||||
<i class="icon_user"></i>
|
||||
</div>
|
||||
<input v-model="form1.mobile" type="text" class="form-control" name="mobile"
|
||||
placeholder="请输入手机号" autocomplete="off">
|
||||
</div>
|
||||
|
||||
<div class="input-group clear">
|
||||
<div class="input-group-addon">
|
||||
<i class="icon_phone"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" v-model="form1.smsCode" name="smsCode"
|
||||
placeholder="请输入短信验证码" autocomplete="off" />
|
||||
<view @click="sendSmsCode" id="btnSendCode1" type="button"
|
||||
class="btn-default" value="">{{smsTips}}</view>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="input-group clear">
|
||||
<div class="input-group-addon">
|
||||
<i class="icon_password"></i>
|
||||
</div>
|
||||
<input type="password" class="form-control" v-model="form1.password" name="password"
|
||||
placeholder="设置登录密码" autocomplete="off">
|
||||
</div>
|
||||
|
||||
<div class="input-group clear">
|
||||
<div class="input-group-addon">
|
||||
<i class="icon_password"></i>
|
||||
</div>
|
||||
<input type="password" class="form-control" v-model="form1.repassword"
|
||||
placeholder="确认登录密码" autocomplete="off">
|
||||
</div>
|
||||
|
||||
<div class="input-group clear">
|
||||
<div class="input-group-addon">
|
||||
<i class="icon_yaoqingma"></i>
|
||||
</div>
|
||||
<input type="text" class="form-control" v-model="form1.inviteCode"
|
||||
placeholder="请输入邀请码,选填" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-groupread clear">
|
||||
<input id="check" type="checkbox" class="check" name="is_read">
|
||||
<label>阅读并同意<a href="javascript:;" style="display: inline-block;"
|
||||
id="register-xieyi">
|
||||
<span style="color: #3288b2">《金久信注册协议》</span></a></label>
|
||||
</div>
|
||||
<div class="input-groupp clear">
|
||||
<button @click="handleSubmit" type="button" class="btnMarymt"
|
||||
style="width: 100%;">立即免费注册</button>
|
||||
</div>
|
||||
</view>
|
||||
<div class="input-groupwp clear">
|
||||
<navigator url="/pages/auth/login/login">已有账号?<span style="color: #a92924">去登录</span></navigator>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let timer = null
|
||||
let timeS = 60
|
||||
var vk = uni.vk;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
smsTips: '点击获取',
|
||||
form1: {
|
||||
accountType: 1, // business 企业 、、personal个人
|
||||
mobile: '',
|
||||
smsCode: '',
|
||||
password: '',
|
||||
repassword: '',
|
||||
inviteCode: '',
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
sendSmsCode() {
|
||||
if (timer != null) {
|
||||
return
|
||||
}
|
||||
vk.userCenter.sendSmsCode({
|
||||
loading: false,
|
||||
data: {
|
||||
mobile: this.form1.mobile,
|
||||
type: 'register',
|
||||
},
|
||||
success: (data) => {
|
||||
this.$message({
|
||||
message: "验证码已发送",
|
||||
type: 'success'
|
||||
})
|
||||
timeS = 60
|
||||
timer = setInterval(() => {
|
||||
timeS--
|
||||
if (timeS == 0) {
|
||||
this.stopTimer()
|
||||
this.smsTips = "重新发送"
|
||||
} else {
|
||||
this.smsTips = timeS + "秒"
|
||||
}
|
||||
|
||||
}, 1000)
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
|
||||
|
||||
if (this.testForm()) {
|
||||
const {
|
||||
mobile, // 手机号
|
||||
smsCode, // 短信验证码4-8位
|
||||
password, // 密码 6-20位
|
||||
repassword, // 重复输入密码
|
||||
inviteCode, // 邀请码
|
||||
accountType
|
||||
} = this.form1
|
||||
|
||||
vk.userCenter.loginBySms({
|
||||
data: {
|
||||
type: 'register',
|
||||
mobile: mobile,
|
||||
code: smsCode,
|
||||
password,
|
||||
inviteCode,
|
||||
accountType
|
||||
},
|
||||
success: (data) => {
|
||||
uni.reLaunch({
|
||||
url: '/'
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
testForm() {
|
||||
const {
|
||||
mobile, // 手机号
|
||||
smsCode, // 短信验证码4-8位
|
||||
password, // 密码 6-20位
|
||||
repassword, // 重复输入密码
|
||||
inviteCode, // 邀请码
|
||||
} = this.form1;
|
||||
|
||||
// 手机号验证
|
||||
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
|
||||
this.$message({
|
||||
message: '手机号为空或格式不正确',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// 短信验证码验证
|
||||
if (!smsCode || !/^\d{4,8}$/.test(smsCode)) {
|
||||
// 短信验证码为空或格式不正确
|
||||
// 处理错误逻辑
|
||||
this.$message({
|
||||
message: '短信验证码为空或格式不正确',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
// 密码验证
|
||||
if (!password || password.length < 6 || password.length > 20) {
|
||||
// 密码为空或长度不符合要求
|
||||
this.$message({
|
||||
message: '密码长度不符合要求',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
// 处理错误逻辑
|
||||
}
|
||||
|
||||
// 重复输入密码验证
|
||||
if (password !== repassword) {
|
||||
// 两次输入的密码不一致
|
||||
this.$message({
|
||||
message: '两次输入的密码不一致',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
// 处理错误逻辑
|
||||
}
|
||||
|
||||
return true
|
||||
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
if (timer != null) {
|
||||
clearInterval(timer)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@charset "utf-8";
|
||||
|
||||
.zg-logo img {
|
||||
width: 230px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.layout-common-footer {
|
||||
text-align: center;
|
||||
margin: 15px 0px 10px;
|
||||
}
|
||||
|
||||
.layout-common-footer .copyright .link>a {
|
||||
color: #666;
|
||||
padding: 0 10px;
|
||||
display: inline-block;
|
||||
line-height: 2
|
||||
}
|
||||
|
||||
.w-1180 {
|
||||
width: 1200px;
|
||||
margin: 0px auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.flex-h-ac {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header {
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.main-container {
|
||||
min-width: 1200px;
|
||||
padding: 60px 0;
|
||||
background: #e8f5fd url(/static/images/login-bg.jpg)50% no-repeat;
|
||||
}
|
||||
|
||||
.flex-h-e,
|
||||
.flex-h-e-ac {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.main-container .login-container {
|
||||
width: 350px;
|
||||
box-sizing: border-box;
|
||||
padding: 30px 35px 30px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.login-container h2 {
|
||||
text-align: center;
|
||||
line-height: 2;
|
||||
color: #000;
|
||||
font-size: 25px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.btnMarymt {
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
background: #a92924;
|
||||
color: #fff !important;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
background: linear-gradient(90deg, #f0242e, #d0111a);
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btnMarymt:hover {
|
||||
background: #f12d36
|
||||
}
|
||||
|
||||
.input-group {
|
||||
width: 100%;
|
||||
height: 46px;
|
||||
}
|
||||
|
||||
.input-group-addon {}
|
||||
|
||||
.input-group .form-control {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
border: none;
|
||||
background: none;
|
||||
margin-left: 12px;
|
||||
outline: none;
|
||||
font-size: 13px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.input-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px solid #d4d4d4;
|
||||
margin-bottom: 15px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.input-group-addon i {
|
||||
background: url(/static/images/iconsmall.png)no-repeat center center;
|
||||
width: 38px;
|
||||
border-right: 1px solid #d4d4d4;
|
||||
height: 26px;
|
||||
overflow: hidden;
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.input-group-addon .icon_user {
|
||||
background-position: -212px -35px;
|
||||
}
|
||||
|
||||
.input-group-addon .icon_phone {
|
||||
background-position: -212px -67px;
|
||||
}
|
||||
|
||||
.input-group-addon .icon_password {
|
||||
background-position: -212px -100px;
|
||||
}
|
||||
|
||||
.input-group-addon .icon_yaoqingma {
|
||||
background-position: -209px -318px;
|
||||
}
|
||||
|
||||
.input-groupp {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#btnSendCode1 {
|
||||
position: absolute;
|
||||
right: 1px;
|
||||
top: 8px;
|
||||
line-height: 31px;
|
||||
color: #d0111a;
|
||||
width: 79px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
border-left: 1px solid;
|
||||
background: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.input-group.focus {
|
||||
background-color: #fff;
|
||||
box-shadow: 0 2px 11px 0 rgba(0, 0, 0, .04)
|
||||
}
|
||||
|
||||
.input-groupwp {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
font-size: 14px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.input-groupwpg a {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.input-groupwpg .dsf-wetChat i {
|
||||
background: url(/static/images/iconsmall.png)no-repeat;
|
||||
width: 50px;
|
||||
height: 40px;
|
||||
display: block;
|
||||
background-position: -218px -132px;
|
||||
}
|
||||
|
||||
.input-groupwpg .dsf-qq i {
|
||||
background: url(/static/images/iconsmall.png)no-repeat;
|
||||
width: 50px;
|
||||
height: 40px;
|
||||
display: block;
|
||||
background-position: -216px -178px;
|
||||
margin: 0px 24px;
|
||||
}
|
||||
|
||||
.input-groupwpg .dsf-dx i {
|
||||
background: url(/static/images/iconsmall.png)no-repeat;
|
||||
width: 50px;
|
||||
height: 40px;
|
||||
display: block;
|
||||
background-position: -215px -224px;
|
||||
}
|
||||
|
||||
.threeBorder {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
.threeBorder:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
width: 95%;
|
||||
height: 1px;
|
||||
border-bottom: 1px solid #CCCCCC;
|
||||
-webkit-transform: scaleY(0.5);
|
||||
transform: scaleY(0.5);
|
||||
-webkit-transform-origin: 0 100%;
|
||||
transform-origin: 0 100%;
|
||||
}
|
||||
|
||||
.threeBorder span {
|
||||
color: #888888;
|
||||
background: #fff;
|
||||
width: 90px;
|
||||
margin: 0 auto;
|
||||
z-index: 1002;
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.input-groupwpg {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 48px;
|
||||
font-size: 14px;
|
||||
margin-top: 22px;
|
||||
|
||||
}
|
||||
|
||||
.login-con {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.input-grouptabs span {
|
||||
color: #666;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
line-height: 23px;
|
||||
font-weight: normal;
|
||||
display: inline-block;
|
||||
padding: 0px 18px;
|
||||
text-align: center;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
.input-grouptabs {
|
||||
text-align: center;
|
||||
margin: 0px auto 30px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.input-grouptabs i {
|
||||
background: url(/static/images/iconsmall.png)no-repeat;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.input-grouptabs .tab-active#normal i {
|
||||
background-position: -218px -269px;
|
||||
}
|
||||
|
||||
.input-grouptabs .tab-active#nopw i {
|
||||
background-position: -218px -269px;
|
||||
}
|
||||
|
||||
.input-grouptabs #normal i {
|
||||
background-position: -218px -293px;
|
||||
}
|
||||
|
||||
.input-grouptabs #nopw i {
|
||||
background-position: -218px -293px;
|
||||
}
|
||||
|
||||
.input-grouptabs span.tab-active {
|
||||
color: #a92924
|
||||
}
|
||||
|
||||
.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.input-groupread {
|
||||
height: 40px;
|
||||
line-height: 30px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.agreement_dialogs {
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 99999;
|
||||
text-align: center;
|
||||
display: none;
|
||||
background-color: rgba(35, 35, 35, 0.4);
|
||||
-webkit-transition: all 0.5s linear;
|
||||
transition: all 0.5s linear;
|
||||
}
|
||||
|
||||
.agreement_dialogs .dialog_lay_1syd {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
display: inline-block;
|
||||
width: 750px;
|
||||
color: #656565;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
background-color: #fff;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
-webkit-transition: all 0.2s linear;
|
||||
transition: all 0.2s linear;
|
||||
}
|
||||
|
||||
.agreement_dialogs .dialog_foot_1hHfr {
|
||||
height: 80px;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
border-top: 1px solid #d5d5d5;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.agreement_dialogs .dialog_minorBtn_1u8nf {
|
||||
display: inline-block;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
border: 1px #316ccb solid;
|
||||
padding: 0 30px;
|
||||
height: 40px;
|
||||
background: #a92924;
|
||||
background: linear-gradient(90deg, #f0242e, #d0111a);
|
||||
line-height: 40px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
vertical-align: top;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
color: #fff;
|
||||
border-color: #fff;
|
||||
}
|
||||
|
||||
.agreement_titley {
|
||||
height: 55px;
|
||||
line-height: 55px;
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #d5d5d5;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.agreement_content {
|
||||
margin: 23px 32px;
|
||||
}
|
||||
|
||||
.con-subhead {
|
||||
font-size: 14px;
|
||||
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.con-content {
|
||||
height: 240px;
|
||||
overflow-y: scroll;
|
||||
line-height: 2;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#btnSendCode1 {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<view>
|
||||
<top-bar></top-bar>
|
||||
<common-header></common-header>
|
||||
<category-bar></category-bar>
|
||||
|
||||
<view class="page-nav">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>
|
||||
<navigator style="display: inline-block;" url="/pages/spot/goods/goods">现货市场</navigator>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{{product.name}}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,184 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- <view class="product-title">{{title}}</view> -->
|
||||
<vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"
|
||||
:rules="form1.props.rules" :form-type="form1.props.formType" :loading.sync="form1.props.loading"
|
||||
:before-action="form1.props.beforeAction" :auto-close="true" label-width="140px" :footer-show="false"
|
||||
@success="onFormSuccess">
|
||||
</vk-data-form>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
baseAttributes: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
productIndex: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '商品',
|
||||
// 表单相关开始-----------------------------------------------------------
|
||||
form1: {
|
||||
// 表单请求数据,此处可以设置默认值
|
||||
data: {
|
||||
extraAttributes: {},
|
||||
attributes: {},
|
||||
},
|
||||
// 表单属性
|
||||
props: {
|
||||
// 表单请求地址
|
||||
action: "client/enquiry/kh/add",
|
||||
// 表单字段显示规则
|
||||
columns: [
|
||||
{key: "", title: "商品1", type: "bar-title", component: 'custom-form-section'},
|
||||
{
|
||||
key: "name",
|
||||
title: "模板",
|
||||
type: "remote-select",
|
||||
action: "client/enquiry/template/pub/getList",
|
||||
showAll: true,
|
||||
actionData: {
|
||||
pageSize: 1000
|
||||
},
|
||||
props: {
|
||||
list: "rows",
|
||||
value: "_id",
|
||||
label: "name"
|
||||
},
|
||||
watch: (res) => {
|
||||
const {
|
||||
option
|
||||
} = res
|
||||
this.form1.props.columns[2].columns = option.extraAttributes.map((item, index) => {
|
||||
return {
|
||||
key: index,
|
||||
title: item.lable,
|
||||
type: "select",
|
||||
data: item.values.map(citem => {
|
||||
return {
|
||||
value: JSON.stringify({keyName: item.lable,keyValue: citem}),
|
||||
label: citem
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
key: "extraAttributes",
|
||||
title: "额外属性",
|
||||
type: "object",
|
||||
justify: "start",
|
||||
showLabel: false,
|
||||
columns: [
|
||||
|
||||
],
|
||||
},
|
||||
{
|
||||
key: "attributes",
|
||||
title: "固定属性",
|
||||
type: "object",
|
||||
// justify: "start",
|
||||
showLabel: false,
|
||||
columns: [
|
||||
|
||||
],
|
||||
},
|
||||
{
|
||||
key: "",title: "",type: 'group',showLabel: false, justify: "start",columns:
|
||||
[
|
||||
{key: "procureNumber", title: "采购数量", type: "number",},
|
||||
{
|
||||
key: "procureUnit",
|
||||
title: "单位",
|
||||
type: "remote-select",
|
||||
showAll: true,
|
||||
action: "client/enquiry/attributes/pub/getOne",
|
||||
actionData: {
|
||||
label: '单位',
|
||||
},
|
||||
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
{key: "deliveryTime", title: "交货时限", type: "date",},
|
||||
{
|
||||
key: "address",
|
||||
title: "交货地点",
|
||||
type: "object",
|
||||
// justify: "start",
|
||||
showLabel: false,
|
||||
columns: [
|
||||
{key: "region", title: "交货地点", type: "address",},
|
||||
{key: "detail", title: "详细交货地址", type: "textarea",},
|
||||
],
|
||||
},
|
||||
],
|
||||
// 表单验证规则
|
||||
rules: {
|
||||
name:[
|
||||
{ required:true, message:'商品不能为空', trigger: ["change","blur"] }
|
||||
],
|
||||
|
||||
},
|
||||
// add 代表添加 update 代表修改
|
||||
formType: "add",
|
||||
// 表单是否在请求中
|
||||
loading: false,
|
||||
// 是否显示表单1 的弹窗
|
||||
show: false,
|
||||
beforeAction: (formData)=> {
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
// 表单相关结束-----------------------------------------------------------
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.form1.props.columns[0].title = '商品' + (this.productIndex + 1)
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
watch: {
|
||||
"form1.data"(val){
|
||||
this.$emit('input', val)
|
||||
console.log("this.$emit('input', val.data)");
|
||||
},
|
||||
value(val) {
|
||||
this.form1.data = val
|
||||
console.log("this.form1.data = val", val);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.product-title {
|
||||
margin: 10px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,254 @@
|
||||
<template>
|
||||
<view>
|
||||
<top-bar></top-bar>
|
||||
<common-header></common-header>
|
||||
<category-bar></category-bar>
|
||||
|
||||
<!-- <view class="page-nav">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</view> -->
|
||||
|
||||
<view class="carousel">
|
||||
<el-carousel height="170px">
|
||||
<el-carousel-item v-for="item in 4" :key="item">
|
||||
<image class="carousel-img"
|
||||
src="http://jyx.gxwebsoft.com/uploads/20210506/600fc93e6b85324b3ea1373ee264290d.jpg"
|
||||
mode="aspectFill"></image>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
<view class="goods-options">
|
||||
<el-row class="">
|
||||
<el-button @click="toRelease" type="primary" round>发布询价单</el-button>
|
||||
<el-button type="primary" round plain>我发布的询价单</el-button>
|
||||
</el-row>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 筛选表单 -->
|
||||
<view class="filter-outer">
|
||||
<el-form @submit.native.prevent label-width="80px">
|
||||
<el-form-item label="关键词">
|
||||
<el-input @keyup.enter.native="search" clearable placeholder="输入关键字搜索" v-model="keyword">
|
||||
<el-button @click="search(1)" type="primary" slot="append" icon="el-icon-search"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类">
|
||||
<el-tabs>
|
||||
<el-tab-pane v-for="(item, index) in categoryTreeData" :label="item.name" :key="item._id">
|
||||
<el-checkbox-group v-model="checkCategoryList[index]">
|
||||
<el-checkbox v-for="(citem, cindex) in item.children" :label="citem"
|
||||
:key="cindex">{{citem.name}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-tab-pane>
|
||||
|
||||
</el-tabs>
|
||||
</el-form-item>
|
||||
<el-form-item label="城市">
|
||||
<el-checkbox-group v-model="checkProvinceList">
|
||||
<!-- <el-checkbox :label="{code:0,name: '全国'}">全国</el-checkbox> -->
|
||||
<el-checkbox :checked="cindex == 0" v-for="(citem, cindex) in provinceData" :label="citem"
|
||||
:key="cindex">{{citem.name}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="已选">
|
||||
<view class="tags">
|
||||
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{item.name}}</el-tag>
|
||||
</view>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</view>
|
||||
|
||||
<!-- 商品列表 -->
|
||||
<view class="goods-list">
|
||||
|
||||
</view>
|
||||
|
||||
<view class="paginatio">
|
||||
<el-pagination
|
||||
@current-change="search"
|
||||
background
|
||||
layout="prev, pager, next"
|
||||
:total="goodsData.total">
|
||||
</el-pagination>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
|
||||
provinces.unshift({
|
||||
code: 9999,
|
||||
name: '全国'
|
||||
})
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
categoryTreeData: [],
|
||||
provinceData: provinces,
|
||||
checkCategoryList: [],
|
||||
checkProvinceList: [],
|
||||
keyword: '',
|
||||
goodsData: {
|
||||
total: 0,
|
||||
rows: []
|
||||
}
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.search(1)
|
||||
vk.callFunction({
|
||||
url: 'client/spot/category/pub/getTree',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
|
||||
},
|
||||
success: (data) => {
|
||||
this.categoryTreeData = data.rows
|
||||
for (var i = 0; i < data.rows.length; i++) {
|
||||
this.checkCategoryList.push([])
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
toRelease() {
|
||||
|
||||
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
|
||||
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.getCertUrl()
|
||||
})
|
||||
}else if(vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
|
||||
this.$confirm('请完善名片信息', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
vk.navigateTo('/pages/user/user?menu=business-card');
|
||||
})
|
||||
}else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/enquiry/release'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
search(pageIndex) {
|
||||
const categoryIds = []
|
||||
this.checkCategoryList.forEach(item => {
|
||||
item.forEach(sitem => {
|
||||
categoryIds.push(sitem._id)
|
||||
})
|
||||
})
|
||||
|
||||
let provinceCodes = this.checkProvinceList.map(item => item.code)
|
||||
|
||||
if (provinceCodes.includes(9999)) {
|
||||
provinceCodes = []
|
||||
}
|
||||
|
||||
vk.callFunction({
|
||||
url: 'client/spot/goods/pub/getList',
|
||||
data: {
|
||||
pageIndex: pageIndex,
|
||||
pageSize: 20,
|
||||
keyword: this.keyword,
|
||||
categoryIds: categoryIds,
|
||||
provinceCodes: provinceCodes
|
||||
|
||||
},
|
||||
success: (data) => {
|
||||
console.log('data: ',data);
|
||||
data.rows.forEach(item => {
|
||||
try {
|
||||
item.addressStr = item.address.province.name + "-" + item.address.city.name + "-" + item.address.area.name
|
||||
} catch(err){
|
||||
item.addressStr = ""
|
||||
}
|
||||
})
|
||||
this.goodsData = data
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
checkCategoryArr() {
|
||||
let arr = []
|
||||
this.checkCategoryList.forEach(item => {
|
||||
arr.push(...item)
|
||||
})
|
||||
|
||||
this.checkProvinceList.forEach(item => {
|
||||
arr.push({
|
||||
...item
|
||||
})
|
||||
})
|
||||
return arr
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.carousel {
|
||||
width: 1200px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.carousel-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.goods-options {
|
||||
background-color: #FFFFFF;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.filter-outer {
|
||||
width: 1200px;
|
||||
margin: 20px auto;
|
||||
background-color: #FFFFFF;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.tags {
|
||||
display: flex;
|
||||
|
||||
.el-tag {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.goods-list {
|
||||
width: 1200px;
|
||||
margin: 20px auto;
|
||||
display: flex;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.paginatio{
|
||||
float: none;
|
||||
width: 1200px;
|
||||
margin: 20px auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<view>
|
||||
<top-bar></top-bar>
|
||||
<common-header></common-header>
|
||||
<category-bar></category-bar>
|
||||
|
||||
<view class="page-nav">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>
|
||||
<navigator style="display: inline-block;" url="/pages/enquiry/list">询价单</navigator>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>发布询价单</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</view>
|
||||
|
||||
<view class="form-view">
|
||||
|
||||
<view class="m-20">
|
||||
<view class="title-main">请填写询价单</view>
|
||||
<view class="title-sub">询价信息越完整,供应商报价越精准</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in productList" :key="index">
|
||||
<enquiry-template :ref="'product' + index" v-model="productList[index]" :base-attributes="baseAttributes" :productIndex="index"></enquiry-template>
|
||||
</view>
|
||||
<view class="btn-add-outer">
|
||||
<el-button @click="addProduct" type="primary" size="small">添加商品</el-button>
|
||||
<el-button @click="removeProduct" type="warning" size="small">删除商品</el-button>
|
||||
</view>
|
||||
<vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"
|
||||
:rules="form1.props.rules" :form-type="form1.props.formType" :loading.sync="form1.props.loading"
|
||||
:before-action="form1.props.beforeAction" label-width="140px" cancel-text="保存草稿" submit-text="提交询价单"
|
||||
@success="onFormSuccess">
|
||||
|
||||
</vk-data-form>
|
||||
<!-- <el-divider content-position="left">其他设置</el-divider> -->
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import EnquiryTemplate from './components/template.vue'
|
||||
export default {
|
||||
components: {EnquiryTemplate},
|
||||
data() {
|
||||
return {
|
||||
// 表单相关开始-----------------------------------------------------------
|
||||
productList: [{}],
|
||||
baseAttributes: [],
|
||||
form1: {
|
||||
// 表单请求数据,此处可以设置默认值
|
||||
data: {
|
||||
// extraAttributes: {},
|
||||
// attributes: {},
|
||||
invoice: false
|
||||
},
|
||||
// 表单属性
|
||||
props: {
|
||||
// 表单请求地址
|
||||
action: "client/enquiry/sheet/kh/add",
|
||||
// 表单字段显示规则
|
||||
columns: [
|
||||
{key: "", title: "采购商其他要求", type: "bar-title"},
|
||||
{key: "remark", title: "其他要求", type: "textarea",},
|
||||
{key: "", title: "发票要求", type: "bar-title"},
|
||||
{key: "invoice", title: "发票要求", type: "radio",
|
||||
data: [
|
||||
{ value: true, label: "含税" },
|
||||
{ value: false, label: "不含税" }
|
||||
],
|
||||
},
|
||||
{key: "writeInvoiceTime",
|
||||
title: "开票时间",
|
||||
type: "radio",
|
||||
data: [
|
||||
{ value: '付款当月(限20号之前付款,20号之后付款次月开票)', label: "付款当月(限20号之前付款,20号之后付款次月开票)" },
|
||||
{ value: '付款后次月', label: "付款后次月" },
|
||||
{ value: '付款前', label: "付款前" },
|
||||
],
|
||||
showRule: 'invoice == true'
|
||||
},
|
||||
{key: "nvoiceType",
|
||||
title: "发票种类",
|
||||
type: "radio",
|
||||
data: [
|
||||
{ value: '增值税专用发票13%', label: "增值税专用发票13%" },
|
||||
{ value: '增值税普通发票', label: "增值税普通发票" },
|
||||
{ value: '普通发票', label: "普通发票" },
|
||||
],
|
||||
showRule: 'invoice == true'
|
||||
},
|
||||
{key: "", title: "运输要求", type: "bar-title"},
|
||||
{key: "transportDocuments",
|
||||
title: "随货资料",
|
||||
type: "checkbox",
|
||||
data: [
|
||||
{ value: '合格证', label: "合格证" },
|
||||
{ value: '检测报告', label: "检测报告" },
|
||||
{ value: '销售清单', label: "销售清单" },
|
||||
{ value: '磅重', label: "磅重" },
|
||||
],
|
||||
},
|
||||
{key: "otherTransportDocuments", title: "其他资料", type: "text"},
|
||||
{key: "transportLimit",
|
||||
title: "运输限制",
|
||||
type: "text",
|
||||
},
|
||||
{key: "", title: "交易模式", type: "bar-title", component: 'custom-form-section'},
|
||||
{key: "tradeMethod",
|
||||
title: "交易模式",
|
||||
type: "radio",
|
||||
data: [
|
||||
{ value: '自主交易', label: "自主交易" },
|
||||
{ value: '金久信公证', label: "金久信公证" },
|
||||
],
|
||||
},
|
||||
{key: "", title: "交易说明", type: "bar-title"},
|
||||
{
|
||||
key: "payMethod",
|
||||
title: "付款方式",
|
||||
type: "radio",
|
||||
data: [
|
||||
{ value: 1, label: "预付x%货到付全款" },
|
||||
{ value: 2, label: "货到验收后付款" },
|
||||
{ value: 3, label: "提货付全款" },
|
||||
{ value: 4, label: "信誉采购" },
|
||||
{ value: 5, label: "其他付款方式" },
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
key: "",title: "",type: 'group',showLabel: false, justify: "start",columns:[
|
||||
{key: "advancePayRate", title: "预付百分比", type: "percentage",showRule: "payMethod==1"},
|
||||
{key: "otherPayMethod", title: "其他付款方式", type: "text",showRule: "payMethod==5"},
|
||||
{key: "reputationPayDay", title: "货到签单后账期天数", type: "number",showRule: "payMethod==4",rightText: '天'},
|
||||
|
||||
]
|
||||
},
|
||||
{key: "answerTime", title: "报价时限", type: "date",dateType: "datetime"},
|
||||
{key: "earnestMoney", title: "保证金要求", type: "text"},
|
||||
// {key: "", title: "采购商信息", type: "bar-title"},
|
||||
{
|
||||
key: "files",
|
||||
title: "附件文档",
|
||||
type: "file",
|
||||
buttonText: "点击上传",
|
||||
limit: 9,
|
||||
accept: ".jpg,.png,.xlsx,.doc,.docx",
|
||||
tips: '上传自有采购单图片或文档,支持jpg/png/word/excel'
|
||||
},
|
||||
|
||||
|
||||
],
|
||||
// 表单验证规则
|
||||
rules: {
|
||||
// name:[
|
||||
// { required:true, message:'商品不能为空', trigger: ["change","blur"] }
|
||||
// ],
|
||||
|
||||
},
|
||||
// add 代表添加 update 代表修改
|
||||
formType: "add",
|
||||
// 表单是否在请求中
|
||||
loading: false,
|
||||
// 是否显示表单1 的弹窗
|
||||
show: false,
|
||||
beforeAction: (formData)=> {
|
||||
|
||||
// console.log('formData: ',JSON.parse(JSON.stringify(formData)));
|
||||
// console.log('product: ',JSON.parse(JSON.stringify(this.productList)));
|
||||
formData.productList = JSON.parse(JSON.stringify(this.productList))
|
||||
return formData
|
||||
}
|
||||
}
|
||||
},
|
||||
// 表单相关结束-----------------------------------------------------------
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getAttributes()
|
||||
},
|
||||
methods: {
|
||||
getAttributes() {
|
||||
// vk.callFunction({
|
||||
// url: 'client/enquiry/attributes/pub/getList',
|
||||
// title: '请求中...',
|
||||
// data: {
|
||||
// pageSize: 1000
|
||||
// },
|
||||
// success: (res) => {
|
||||
// this.baseAttributes = res.rows
|
||||
// }
|
||||
// });
|
||||
},
|
||||
addProduct() {
|
||||
this.productList.push({})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.form-view {
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
background-color: #FFFFFF;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.m-20 {
|
||||
margin: 20px;
|
||||
}
|
||||
.title-main{
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.title-sub{
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-add-outer{
|
||||
padding-left: 140px;
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<view class="app">
|
||||
<!-- 页面内容开始 -->
|
||||
|
||||
这里是404页面
|
||||
|
||||
<!-- 页面内容结束 -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var vk = uni.vk;
|
||||
export default {
|
||||
data() {
|
||||
// 页面数据变量
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
// 监听 - 页面每次【加载时】执行(如:前进)
|
||||
onLoad(options = {}) {
|
||||
vk = uni.vk;
|
||||
this.options = options;
|
||||
this.init(options);
|
||||
},
|
||||
// 函数
|
||||
methods: {
|
||||
// 页面数据初始化函数
|
||||
init(options){
|
||||
console.log("init: ",options);
|
||||
},
|
||||
pageTo(path){
|
||||
vk.navigateTo(path);
|
||||
}
|
||||
},
|
||||
// 监听器
|
||||
watch:{
|
||||
|
||||
},
|
||||
// 计算属性
|
||||
computed:{
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<view>
|
||||
<top-bar></top-bar>
|
||||
<common-header></common-header>
|
||||
<category-bar></category-bar>
|
||||
这是首页
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
var vk = uni.vk;
|
||||
export default {
|
||||
data() {
|
||||
// 页面数据变量
|
||||
return {
|
||||
// init请求返回的数据
|
||||
data:{
|
||||
|
||||
},
|
||||
// 表单请求数据
|
||||
form1:{
|
||||
|
||||
},
|
||||
scrollTop:0,
|
||||
}
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
},
|
||||
// 监听 - 页面每次【加载时】执行(如:前进)
|
||||
onLoad(options = {}) {
|
||||
vk = uni.vk;
|
||||
this.options = options;
|
||||
this.init(options);
|
||||
},
|
||||
// 监听 - 页面【首次渲染完成时】执行。注意如果渲染速度快,会在页面进入动画完成前触发
|
||||
onReady(){
|
||||
|
||||
},
|
||||
// 监听 - 页面每次【显示时】执行(如:前进和返回) (页面每次出现在屏幕上都触发,包括从下级页面点返回露出当前页面)
|
||||
onShow() {
|
||||
|
||||
},
|
||||
// 监听 - 页面每次【隐藏时】执行(如:返回)
|
||||
onHide() {
|
||||
|
||||
},
|
||||
// 监听 - 点击右上角转发时
|
||||
onShareAppMessage(options) {
|
||||
|
||||
},
|
||||
// 函数
|
||||
methods: {
|
||||
// 页面数据初始化函数
|
||||
init(options){
|
||||
|
||||
},
|
||||
pageTo(path){
|
||||
vk.navigateTo(path);
|
||||
}
|
||||
},
|
||||
// 监听器
|
||||
watch:{
|
||||
|
||||
},
|
||||
// 计算属性
|
||||
computed:{
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,497 @@
|
||||
<template>
|
||||
<view>
|
||||
<top-bar></top-bar>
|
||||
<common-header></common-header>
|
||||
<category-bar></category-bar>
|
||||
|
||||
<view class="page-nav">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>
|
||||
<navigator style="display: inline-block;" url="/pages/spot/goods/goods">现货市场</navigator>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>{{product.name}}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</view>
|
||||
|
||||
<view class="card">
|
||||
<div class="card-header">
|
||||
<view class="card-header-left">
|
||||
<image class="logo" :src="product.user.businessCard.logo" mode="aspectFit"></image>
|
||||
<view class="info">
|
||||
<view v-if="product.user.accountType == 1" class="info-name">{{product.user.person.personName}}
|
||||
</view>
|
||||
<view v-if="product.user.accountType == 2" class="info-name">
|
||||
{{product.user.company.companyName}}
|
||||
</view>
|
||||
|
||||
<view class="info-update">
|
||||
<view class="info-update-time">
|
||||
{{product._add_time_str}}
|
||||
</view>
|
||||
<view class="info-update-business">
|
||||
主营业务:{{product.user.businessCard.mainBusiness}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-header-right">
|
||||
|
||||
<el-button v-if="vk.getVuex('$user.userInfo._id') != product.userId" @click="toCooperate"
|
||||
type="primary" round>申请合作</el-button>
|
||||
</view>
|
||||
</div>
|
||||
|
||||
<view class="card-body">
|
||||
<div class="part-head">
|
||||
<h3>现货详情</h3>
|
||||
</div>
|
||||
<view v-if="product.user.accountType == 1" class="card-body-name">{{product.user.person.personName}}
|
||||
</view>
|
||||
<view v-if="product.user.accountType == 2" class="card-body-name">{{product.user.company.companyName}}
|
||||
</view>
|
||||
<view class="card-body-stock">库存:{{product.stock}}吨</view>
|
||||
<view class="card-body-address">
|
||||
供货地:{{product.address.province.name + "-" + product.address.city.name + "-" + product.address.area.name}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="card-body">
|
||||
<div class="part-head">
|
||||
<h3>附件</h3>
|
||||
</div>
|
||||
<ul class="el-upload-list el-upload-list--text">
|
||||
<li @click="downloadFile(item)" v-for="(item,index) in product.files" :key="index" tabindex="0"
|
||||
class="el-upload-list__item is-success">
|
||||
<a class="el-upload-list__item-name">
|
||||
<i class="el-icon-document"></i>
|
||||
{{item | getFileName}}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</view>
|
||||
|
||||
<view class="card-body">
|
||||
<div class="part-head">
|
||||
<h3>已收到的合作申请</h3>
|
||||
</div>
|
||||
<vk-data-table :data="product.cooperateList" :columns="table1.columns"
|
||||
:customRightBtns="table1.customRightBtns"></vk-data-table>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 申请合作 -->
|
||||
<el-dialog :visible.sync="form1.props.show" title="申请合作" width="600px" mode="form">
|
||||
<vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"
|
||||
:rules="form1.props.rules" :form-type="form1.props.formType" :loading.sync="form1.props.loading"
|
||||
:beforeAction="form1.props.beforeAction" :auto-close="true" label-width="140px"
|
||||
@success="onFormSuccess"></vk-data-form>
|
||||
</el-dialog>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
product: {
|
||||
name: '现货详情',
|
||||
address: {
|
||||
province: {},
|
||||
city: {},
|
||||
area: {},
|
||||
},
|
||||
user: {
|
||||
businessCard: {},
|
||||
},
|
||||
cooperateList: []
|
||||
},
|
||||
// 表单相关开始-----------------------------------------------------------
|
||||
form1: {
|
||||
// 表单请求数据,此处可以设置默认值
|
||||
data: {
|
||||
|
||||
},
|
||||
// 表单属性
|
||||
props: {
|
||||
// 表单请求地址
|
||||
action: "client/spot/goods/kh/addCooperate",
|
||||
// 表单字段显示规则
|
||||
columns: [{
|
||||
key: "person",
|
||||
title: "个人",
|
||||
type: "object",
|
||||
showLabel: false,
|
||||
showRule: (formData) => {
|
||||
return formData.person.personName != null
|
||||
},
|
||||
columns: [{
|
||||
key: "personName",
|
||||
title: "姓名",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
// {
|
||||
// key: "idCard",
|
||||
// title: "身份证号",
|
||||
// type: "text",
|
||||
// readonly: true,
|
||||
// disabled: true
|
||||
// },
|
||||
{
|
||||
key: "mobile",
|
||||
title: "电话",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
key: "company",
|
||||
title: "企业信息",
|
||||
type: "object",
|
||||
showLabel: false,
|
||||
showRule: (formData) => {
|
||||
return formData.company.companyName != null
|
||||
},
|
||||
columns: [{
|
||||
key: "companyName",
|
||||
title: "企业名称",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
key: "organization",
|
||||
title: "统一社会信用代码",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
key: "legalName",
|
||||
title: "法人",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
key: "legalMobile",
|
||||
title: "法人电话",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
key: "manager",
|
||||
title: "代理人",
|
||||
type: "object",
|
||||
showLabel: false,
|
||||
showRule: (formData) => {
|
||||
return formData.manager.personName != null
|
||||
},
|
||||
columns: [{
|
||||
key: "personName",
|
||||
title: "代理人",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
// {
|
||||
// key: "idCard",
|
||||
// title: "代理人身份证号",
|
||||
// type: "text",
|
||||
// readonly: true,
|
||||
// disabled: true
|
||||
// },
|
||||
{
|
||||
key: "mobile",
|
||||
title: "代理人电话",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
key: "remark",
|
||||
title: "备注",
|
||||
type: "textarea",
|
||||
maxlength: 200,
|
||||
showWordLimit: true,
|
||||
},
|
||||
],
|
||||
// 表单验证规则
|
||||
rules: {
|
||||
text: [{
|
||||
required: true,
|
||||
message: "text不能为空",
|
||||
trigger: "change"
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
message: "text不能为空",
|
||||
trigger: "change"
|
||||
},
|
||||
]
|
||||
},
|
||||
// add 代表添加 update 代表修改
|
||||
formType: "",
|
||||
// 表单是否在请求中
|
||||
loading: false,
|
||||
// 是否显示表单1 的弹窗
|
||||
show: false,
|
||||
beforeAction: (formData) => {
|
||||
formData.goodsId = this.product._id
|
||||
formData.goodsUserId = this.product.userId
|
||||
return formData
|
||||
},
|
||||
}
|
||||
},
|
||||
// 表单相关结束-----------------------------------------------------------
|
||||
table1: {
|
||||
// 表格数据
|
||||
data: [],
|
||||
// 表格字段显示规则
|
||||
columns: [{
|
||||
key: "subjectName",
|
||||
title: "主体",
|
||||
type: "text",
|
||||
width: 400,
|
||||
formatter: (val, row, column, index) => {
|
||||
if (vk.getVuex('$user.userInfo._id') == this.product.userId) {
|
||||
return val
|
||||
}
|
||||
if (row.accountType == 1) {
|
||||
return vk.pubfn.hidden(val, 1, 1);
|
||||
} else {
|
||||
return vk.pubfn.hidden(val, 2, 4);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
key: "subjectMobile",
|
||||
title: "联系方式",
|
||||
type: "text",
|
||||
width: 120,
|
||||
formatter: (val, row, column, index) => {
|
||||
let str = val
|
||||
if (row.managerMobile) {
|
||||
str = row.managerMobile
|
||||
}
|
||||
if (vk.getVuex('$user.userInfo._id') == this.product.userId) {
|
||||
return str
|
||||
}
|
||||
return vk.pubfn.hidden(str, 3, 4);
|
||||
}
|
||||
},
|
||||
{
|
||||
key: "remark",
|
||||
title: "备注",
|
||||
type: "textarea",
|
||||
width: 280,
|
||||
formatter: (val, row, column, index) => {
|
||||
let str = val
|
||||
if (row.managerMobile) {
|
||||
str = row.managerMobile
|
||||
}
|
||||
if (vk.getVuex('$user.userInfo._id') == this.product.userId) {
|
||||
return val
|
||||
}
|
||||
return "******";
|
||||
}
|
||||
},
|
||||
{
|
||||
key: "_add_time_str",
|
||||
title: "申请时间",
|
||||
type: "text",
|
||||
width: 200
|
||||
},
|
||||
|
||||
],
|
||||
customRightBtns: [{
|
||||
title: '查看',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-search',
|
||||
disabled: (item) => {
|
||||
return vk.getVuex('$user.userInfo._id') != this.product.userId
|
||||
},
|
||||
onClick: (item) => {
|
||||
vk.toast(`${item._id}-按钮1`);
|
||||
}
|
||||
}, ]
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
onLoad({
|
||||
id
|
||||
}) {
|
||||
// 获取现货数据
|
||||
vk.callFunction({
|
||||
url: 'client/spot/goods/pub/getDetail',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
_id: id,
|
||||
|
||||
},
|
||||
success: (data) => {
|
||||
console.log(data);
|
||||
this.product = data.data
|
||||
}
|
||||
});
|
||||
|
||||
// 获取用户数据
|
||||
vk.userCenter.getCurrentUserInfo({
|
||||
success: (data) => {
|
||||
this.form1.data = _.pick(data.userInfo, [
|
||||
'fadadaConfirm', 'person', 'company', 'manager', 'businessCard', 'accountType'
|
||||
])
|
||||
// 成功后的逻辑
|
||||
console.log('form1: ', {
|
||||
...this.form1.data
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
downloadFile(url) {
|
||||
location.href = url
|
||||
},
|
||||
showCooperate() {
|
||||
this.table2.show = true
|
||||
},
|
||||
toCooperate() {
|
||||
if (!this.form1.data.fadadaConfirm) {
|
||||
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.getCertUrl()
|
||||
})
|
||||
} else {
|
||||
this.form1.props.show = true
|
||||
}
|
||||
// vk.navigateTo('/pages/spot/goods/cooperate?id=' + this.product._id);
|
||||
},
|
||||
getCertUrl() {
|
||||
vk.callFunction({
|
||||
url: 'client/fadada.getVerifyUrl',
|
||||
success: (res) => {
|
||||
location.href = res.data.url
|
||||
}
|
||||
});
|
||||
},
|
||||
onFormSuccess() {
|
||||
this.form1.props.show = false
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
getFileName(url) {
|
||||
const arr = url.split("/")
|
||||
return arr[arr.length - 1]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.card {
|
||||
width: 1200px;
|
||||
margin: 20px auto;
|
||||
background-color: #FFFFFF;
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
padding-top: 30px;
|
||||
|
||||
.card-body-name {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.card-body-stock {
|
||||
font-size: 14px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.card-body-address {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 0 60rpx 0;
|
||||
border-bottom: 1px solid rgba(187, 187, 187, 0.37);
|
||||
|
||||
&-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.info {
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
.info-name {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.info-update {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
color: #A7A7A7;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.info-update-time {
|
||||
margin-right: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.part-head {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.part-head h3 {
|
||||
line-height: 28px;
|
||||
color: #a92924;
|
||||
font-size: 20px;
|
||||
text-indent: 15px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.part-head h3:before {
|
||||
content: " ";
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background: #a92924;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,320 @@
|
||||
<template>
|
||||
<view>
|
||||
<top-bar></top-bar>
|
||||
<common-header></common-header>
|
||||
<category-bar></category-bar>
|
||||
|
||||
<!-- <view class="page-nav">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</view> -->
|
||||
|
||||
<view class="carousel">
|
||||
<el-carousel height="170px">
|
||||
<el-carousel-item v-for="item in 4" :key="item">
|
||||
<image class="carousel-img"
|
||||
src="http://jyx.gxwebsoft.com/uploads/20210506/600fc93e6b85324b3ea1373ee264290d.jpg"
|
||||
mode="aspectFill"></image>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
<view class="goods-options">
|
||||
<el-row class="">
|
||||
<el-button @click="toRelease" type="primary" round>发布/编辑我的现货</el-button>
|
||||
<!-- <el-button type="primary" round plain>我发布的现货</el-button> -->
|
||||
</el-row>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 筛选表单 -->
|
||||
<view class="filter-outer">
|
||||
<el-form @submit.native.prevent label-width="80px">
|
||||
<el-form-item label="关键词">
|
||||
<el-input @keyup.enter.native="search" clearable placeholder="输入关键字搜索" v-model="keyword">
|
||||
<el-button @click="search(1)" type="primary" slot="append" icon="el-icon-search"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类">
|
||||
<el-tabs>
|
||||
<el-tab-pane v-for="(item, index) in categoryTreeData" :label="item.name" :key="item._id">
|
||||
<el-checkbox-group v-model="checkCategoryList[index]">
|
||||
<el-checkbox v-for="(citem, cindex) in item.children" :label="citem"
|
||||
:key="cindex">{{citem.name}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-tab-pane>
|
||||
|
||||
</el-tabs>
|
||||
</el-form-item>
|
||||
<el-form-item label="城市">
|
||||
<el-checkbox-group v-model="checkProvinceList">
|
||||
<!-- <el-checkbox :label="{code:0,name: '全国'}">全国</el-checkbox> -->
|
||||
<el-checkbox :checked="cindex == 0" v-for="(citem, cindex) in provinceData" :label="citem"
|
||||
:key="cindex">{{citem.name}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="已选">
|
||||
<view class="tags">
|
||||
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{item.name}}</el-tag>
|
||||
</view>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</view>
|
||||
|
||||
<!-- 商品列表 -->
|
||||
<view class="goods-list">
|
||||
<view v-for="(item, index) in goodsData.rows" :key="index" class="goods">
|
||||
<view class="goods-title">{{item.name}}</view>
|
||||
<view class="goods-stock">库存:{{item.stock}}吨</view>
|
||||
<view class="goods-address">供货地:{{item.addressStr}}</view>
|
||||
<view class="goods-image">
|
||||
<image :src="item.user.businessCard.logo" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view v-if="item.user.accountType == 1" class="goods-company">{{item.user.person.personName}}</view>
|
||||
<view v-if="item.user.accountType == 2" class="goods-company">{{item.user.company.companyName}}</view>
|
||||
<el-button @click="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id);" type="primary" plain round size="small">立即查看</el-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="paginatio">
|
||||
<el-pagination
|
||||
@current-change="search"
|
||||
background
|
||||
layout="prev, pager, next"
|
||||
:total="goodsData.total">
|
||||
</el-pagination>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
|
||||
provinces.unshift({
|
||||
code: 9999,
|
||||
name: '全国'
|
||||
})
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
categoryTreeData: [],
|
||||
provinceData: provinces,
|
||||
checkCategoryList: [],
|
||||
checkProvinceList: [],
|
||||
keyword: '',
|
||||
goodsData: {
|
||||
total: 0,
|
||||
rows: []
|
||||
}
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.search(1)
|
||||
vk.callFunction({
|
||||
url: 'client/spot/category/pub/getTree',
|
||||
title: '请求中...',
|
||||
data: {
|
||||
|
||||
},
|
||||
success: (data) => {
|
||||
this.categoryTreeData = data.rows
|
||||
for (var i = 0; i < data.rows.length; i++) {
|
||||
this.checkCategoryList.push([])
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
toRelease() {
|
||||
|
||||
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
|
||||
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.getCertUrl()
|
||||
})
|
||||
}else if(vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
|
||||
this.$confirm('请完善名片信息', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
vk.navigateTo('/pages/user/user?menu=business-card');
|
||||
})
|
||||
}else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/spot/release/release'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
search(pageIndex) {
|
||||
const categoryIds = []
|
||||
this.checkCategoryList.forEach(item => {
|
||||
item.forEach(sitem => {
|
||||
categoryIds.push(sitem._id)
|
||||
})
|
||||
})
|
||||
|
||||
let provinceCodes = this.checkProvinceList.map(item => item.code)
|
||||
|
||||
if (provinceCodes.includes(9999)) {
|
||||
provinceCodes = []
|
||||
}
|
||||
|
||||
vk.callFunction({
|
||||
url: 'client/spot/goods/pub/getList',
|
||||
data: {
|
||||
pageIndex: pageIndex,
|
||||
pageSize: 20,
|
||||
keyword: this.keyword,
|
||||
categoryIds: categoryIds,
|
||||
provinceCodes: provinceCodes
|
||||
|
||||
},
|
||||
success: (data) => {
|
||||
console.log('data: ',data);
|
||||
data.rows.forEach(item => {
|
||||
try {
|
||||
item.addressStr = item.address.province.name + "-" + item.address.city.name + "-" + item.address.area.name
|
||||
} catch(err){
|
||||
item.addressStr = ""
|
||||
}
|
||||
})
|
||||
this.goodsData = data
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
checkCategoryArr() {
|
||||
let arr = []
|
||||
this.checkCategoryList.forEach(item => {
|
||||
arr.push(...item)
|
||||
})
|
||||
|
||||
this.checkProvinceList.forEach(item => {
|
||||
arr.push({
|
||||
...item
|
||||
})
|
||||
})
|
||||
return arr
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.carousel {
|
||||
width: 1200px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.carousel-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.goods-options {
|
||||
background-color: #FFFFFF;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.filter-outer {
|
||||
width: 1200px;
|
||||
margin: 20px auto;
|
||||
background-color: #FFFFFF;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.tags {
|
||||
display: flex;
|
||||
|
||||
.el-tag {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.goods-list {
|
||||
width: 1200px;
|
||||
margin: 20px auto;
|
||||
display: flex;
|
||||
|
||||
}
|
||||
|
||||
.goods {
|
||||
width: 217px;
|
||||
height: 280px;
|
||||
background-color: #FFFFFF;
|
||||
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.05);
|
||||
text-align: center;
|
||||
margin-right: 20px;
|
||||
margin-bottom: 25px;
|
||||
|
||||
&-title {
|
||||
font-size: 15px;
|
||||
color: #101010;
|
||||
height: 62px;
|
||||
padding-top: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
&-stock {
|
||||
font-size: 12px;
|
||||
color: #BD3124;
|
||||
}
|
||||
|
||||
&-address {
|
||||
font-size: 12px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
&-image {
|
||||
width: 200px;
|
||||
height: 70px;
|
||||
margin: 0 auto;
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
&-company {
|
||||
color: #4F4F4F;
|
||||
font-size: 14px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
&-buy {
|
||||
width: 108px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
color: rgba(169, 41, 36, 1);
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
font-family: Roboto;
|
||||
border: 1px solid rgba(169, 41, 36, 1);
|
||||
margin: 0 auto;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.paginatio{
|
||||
float: none;
|
||||
width: 1200px;
|
||||
margin: 20px auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<view>
|
||||
<top-bar></top-bar>
|
||||
<common-header></common-header>
|
||||
<category-bar></category-bar>
|
||||
|
||||
<view class="page-nav">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item><navigator style="display: inline-block;" url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
|
||||
<el-breadcrumb-item>发布现货</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</view>
|
||||
|
||||
<view class="form-view">
|
||||
<vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"
|
||||
:rules="form1.props.rules" :form-type="form1.props.formType" :loading.sync="form1.props.loading"
|
||||
:before-action="form1.props.beforeAction" :auto-close="true" label-width="140px"
|
||||
@success="onFormSuccess">
|
||||
<template v-slot:name="{ form, keyName }">
|
||||
<el-input v-model="productName" readonly placeholder="请添加现货分类"></el-input>
|
||||
</template>
|
||||
</vk-data-form>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 表单相关开始-----------------------------------------------------------
|
||||
form1: {
|
||||
// 表单请求数据,此处可以设置默认值
|
||||
data: {
|
||||
|
||||
},
|
||||
// 表单属性
|
||||
props: {
|
||||
// 表单请求地址
|
||||
action: "client/spot/goods/kh/addUpdate",
|
||||
// 表单字段显示规则
|
||||
columns: [{
|
||||
key: "name",
|
||||
title: "现货名称",
|
||||
type: "text",
|
||||
},
|
||||
{
|
||||
key: "categoryIds",
|
||||
title: "现货分类",
|
||||
type: "checkbox",
|
||||
action: "client/spot/category/pub/getList",
|
||||
actionData: {
|
||||
whereJson: {
|
||||
level: 2
|
||||
}
|
||||
},
|
||||
props: {
|
||||
list: "data",
|
||||
value: "_id",
|
||||
label: "name"
|
||||
},
|
||||
watch: ({
|
||||
option
|
||||
}) => {
|
||||
console.log('res: ', option)
|
||||
|
||||
this.form1.data.name = option.map(item => item.name).join('、')
|
||||
this.productName = option.map(item => item.name).join('、')
|
||||
console.log(this.form1);
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
key: "stock",
|
||||
title: "库存(吨)",
|
||||
type: "number"
|
||||
},
|
||||
{
|
||||
key: "address",
|
||||
title: "供货地",
|
||||
type: "address"
|
||||
},
|
||||
{
|
||||
key: "files",
|
||||
title: "附件文档",
|
||||
type: "file",
|
||||
buttonText: "点击上传",
|
||||
limit: 9,
|
||||
accept: ".jpg,.png,.xlsx,.doc,.docx",
|
||||
tips: '上传自有采购单图片或文档,支持jpg/png/word/excel'
|
||||
},
|
||||
|
||||
|
||||
],
|
||||
// 表单验证规则
|
||||
rules: {
|
||||
categoryIds: [
|
||||
{
|
||||
required: true,
|
||||
message: "现货名称不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (value.length > 5) {
|
||||
callback(new Error('最多选择五个分类'));
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
],
|
||||
stock: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写库存",
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
{
|
||||
min: 0,
|
||||
type: 'number',
|
||||
message: "库存不能小于0",
|
||||
trigger: ['blur', 'change']
|
||||
},
|
||||
],
|
||||
address: [
|
||||
{
|
||||
required: true,
|
||||
message: "请填写地址",
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
// add 代表添加 update 代表修改
|
||||
formType: "add",
|
||||
// 表单是否在请求中
|
||||
loading: false,
|
||||
// 是否显示表单1 的弹窗
|
||||
show: false
|
||||
}
|
||||
},
|
||||
productName: ''
|
||||
// 表单相关结束-----------------------------------------------------------
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
vk.callFunction({
|
||||
url: 'client/spot/goods/kh/getSelfOne',
|
||||
success: (res) => {
|
||||
if(res.data) {
|
||||
this.$refs.form1.setResetFormData(res.data);
|
||||
this.$refs.form1.resetForm();
|
||||
this.productName = res.data.name
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
onFormSuccess() {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.form-view {
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
background-color: #FFFFFF;
|
||||
padding: 20rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<span>我的名片</span>
|
||||
</div>
|
||||
|
||||
<!-- 表单开始 -->
|
||||
<vk-data-form
|
||||
ref="form1"
|
||||
v-model="form1.data"
|
||||
:rules="form1.props.rules"
|
||||
:action="form1.props.action"
|
||||
:form-type="form1.props.formType"
|
||||
:columns='form1.props.columns'
|
||||
:loading.sync="form1.props.loading"
|
||||
label-width="140px"
|
||||
input-width="400px"
|
||||
:before-action="form1.props.beforeAction"
|
||||
@success="onFormSuccess"
|
||||
>
|
||||
<!-- v-slot:editor 中的 editor 对应 columns中的 key, form对应 form1.data keyName 对应 columns中的 key -->
|
||||
<!-- <template v-slot:editor="{ form, keyName }">
|
||||
<vk-data-input-editor v-model="form[keyName]" placeholder="开始输入" width="750px"></vk-data-input-editor>
|
||||
</template> -->
|
||||
|
||||
</vk-data-form>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 表单相关开始-----------------------------------------------------------
|
||||
form1: {
|
||||
// 表单请求数据,此处可以设置默认值
|
||||
data: {
|
||||
companyIntroduction: ''
|
||||
},
|
||||
// 表单属性
|
||||
props: {
|
||||
// 表单请求地址
|
||||
action: "no",
|
||||
// 表单字段显示规则
|
||||
columns: [
|
||||
{
|
||||
key: "logo",
|
||||
title: "Logo",
|
||||
type: "image",
|
||||
limit: 1
|
||||
},
|
||||
{
|
||||
key: "personName",
|
||||
title: "姓名",
|
||||
type: "text"
|
||||
},
|
||||
{
|
||||
key: "position",
|
||||
title: "职位",
|
||||
type: "text"
|
||||
},
|
||||
{
|
||||
key: "address",
|
||||
title: "地区",
|
||||
type: "address"
|
||||
},
|
||||
{
|
||||
key: "addressDetail",
|
||||
title: "详细地址",
|
||||
type: "text"
|
||||
},
|
||||
{
|
||||
key: "email",
|
||||
title: "邮箱",
|
||||
type: "text"
|
||||
},
|
||||
{
|
||||
key: "website",
|
||||
title: "网址",
|
||||
type: "text"
|
||||
},
|
||||
{
|
||||
key: "mainBusiness",
|
||||
title: "主营业务",
|
||||
type: "textarea"
|
||||
},
|
||||
{
|
||||
key: "mainSpotCategoryIds",
|
||||
title: "主营商品",
|
||||
type: "checkbox",
|
||||
action: "client/spot/category/pub/getList",
|
||||
actionData: {
|
||||
whereJson: {
|
||||
level: 2
|
||||
}
|
||||
},
|
||||
props: {
|
||||
list: "data",
|
||||
value: "_id",
|
||||
label: "name"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
key: "companyIntroduction",
|
||||
title: "企业简介",
|
||||
type: "editor"
|
||||
},
|
||||
],
|
||||
// 表单验证规则
|
||||
rules: {
|
||||
logo: [{
|
||||
required: true,
|
||||
message: "Logo不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
personName: [{
|
||||
required: true,
|
||||
message: "姓名不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
position: [{
|
||||
required: true,
|
||||
message: "职位不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
address: [{
|
||||
required: true,
|
||||
message: "地区不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
addressDetail: [{
|
||||
required: true,
|
||||
message: "详细地址不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
email: [{
|
||||
required: true,
|
||||
message: "邮箱不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
// website: [{
|
||||
// required: true,
|
||||
// message: "logo不能为空",
|
||||
// trigger: ['blur', 'change']
|
||||
// }],
|
||||
mainBusiness: [{
|
||||
required: true,
|
||||
message: "主营业务不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
mainSpotCategoryIds: [{
|
||||
required: true,
|
||||
message: "主营商品不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
companyIntroduction: [{
|
||||
required: true,
|
||||
message: "企业简介不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
|
||||
},
|
||||
// add 代表添加 update 代表修改
|
||||
formType: "update",
|
||||
// 表单是否在请求中
|
||||
loading: false,
|
||||
// 是否显示表单1 的弹窗
|
||||
show: false,
|
||||
beforeAction: (formData) => {
|
||||
vk.userCenter.updateUser({
|
||||
data: {
|
||||
businessCard: formData
|
||||
},
|
||||
success: (data) => {
|
||||
// 成功后的逻辑
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '保存成功'
|
||||
})
|
||||
}
|
||||
});
|
||||
return false;
|
||||
},
|
||||
}
|
||||
},
|
||||
// 表单相关结束-----------------------------------------------------------
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getUserInfo()
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
vk.userCenter.getCurrentUserInfo({
|
||||
success: (data) => {
|
||||
if(data.userInfo.businessCard) {
|
||||
this.form1.data = data.userInfo.businessCard
|
||||
}
|
||||
// 成功后的逻辑
|
||||
console.log('用户信息: ', data);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -0,0 +1,309 @@
|
||||
<template>
|
||||
<view>
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<span v-if="vk.getVuex('$user.userInfo.accountType') === 1">个人认证</span>
|
||||
<span v-if="vk.getVuex('$user.userInfo.accountType') === 2">企业认证</span>
|
||||
</div>
|
||||
<vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns" :footer-show="false"
|
||||
:before-action="form1.props.beforeAction" :rules="form1.props.rules" :form-type="form1.props.formType"
|
||||
:loading.sync="form1.props.loading" :auto-close="true" label-width="140px" @success="onFormSuccess1">
|
||||
<template v-slot:fadadaConfirm="{ form, keyName }">
|
||||
<view style="display: flex;">
|
||||
<el-tag type="primary" v-if="form[keyName]">已认证</el-tag>
|
||||
<el-tag type="info" v-if="!form[keyName]">未认证</el-tag>
|
||||
<view style="margin-left: 10px;" class="">
|
||||
<el-button v-if="!form[keyName]" @click="getCertUrl" type="text"
|
||||
size="small">去认证</el-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
</vk-data-form>
|
||||
</el-card>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var _ = require('lodash');
|
||||
export default {
|
||||
data() {
|
||||
// 页面数据变量
|
||||
return {
|
||||
// 表单相关开始-----------------------------------------------------------
|
||||
form1: {
|
||||
// 表单请求数据,此处可以设置默认值
|
||||
data: {
|
||||
person: {},
|
||||
company: {},
|
||||
manager: {},
|
||||
fadadaConfirm: false
|
||||
},
|
||||
// 表单属性
|
||||
props: {
|
||||
// 表单请求地址
|
||||
action: "user/kh/setCertification",
|
||||
// 表单字段显示规则
|
||||
columns: [
|
||||
{
|
||||
key: "fadadaConfirm",
|
||||
title: "认证状态",
|
||||
type: "text",
|
||||
},
|
||||
|
||||
{
|
||||
key: "person",
|
||||
title: "个人",
|
||||
type: "object",
|
||||
showLabel: false,
|
||||
showRule: (formData) => {
|
||||
return formData.person.personName != null
|
||||
},
|
||||
columns: [{
|
||||
key: "personName",
|
||||
title: "姓名",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
key: "idCard",
|
||||
title: "身份证号",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
key: "mobile",
|
||||
title: "电话",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
key: "company",
|
||||
title: "企业信息",
|
||||
type: "object",
|
||||
showLabel: false,
|
||||
showRule: (formData) => {
|
||||
return formData.company.companyName != null
|
||||
},
|
||||
columns: [{
|
||||
key: "companyName",
|
||||
title: "企业名称",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
key: "organization",
|
||||
title: "统一社会信用代码",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
key: "legalName",
|
||||
title: "法人",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
key: "legalMobile",
|
||||
title: "法人电话",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
key: "manager",
|
||||
title: "代理人",
|
||||
type: "object",
|
||||
showLabel: false,
|
||||
showRule: (formData) => {
|
||||
return formData.manager.personName != null
|
||||
},
|
||||
columns: [{
|
||||
key: "personName",
|
||||
title: "代理人",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
key: "idCard",
|
||||
title: "代理人身份证号",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
key: "mobile",
|
||||
title: "代理人电话",
|
||||
type: "text",
|
||||
readonly: true,
|
||||
disabled: true
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
// {
|
||||
// key: "bankCardNo",
|
||||
// title: "银行卡号",
|
||||
// type: "text",
|
||||
// disabled: true,
|
||||
// // tips: `请用个人账户向以下账户转账0.10元。请备注:账号认证,平台将7个工作日内退回原账户。\r\n,
|
||||
// // 户名:金久信开户行:中国广发银行南宁支行账号:622252 20151145678XX'`
|
||||
// },
|
||||
// {
|
||||
// key: "mailAddress",
|
||||
// title: "有效通讯地址",
|
||||
// type: "text"
|
||||
// },
|
||||
// {
|
||||
// key: "contactQq",
|
||||
// title: "QQ号码",
|
||||
// type: "text",
|
||||
// },
|
||||
// {
|
||||
// key: "contactEmail",
|
||||
// title: "邮箱",
|
||||
// type: "text",
|
||||
// },
|
||||
// {
|
||||
// key: "",
|
||||
// title: "",
|
||||
// type: "group",
|
||||
// justify: "start",
|
||||
// columns: [{
|
||||
// key: "contactWechatImage",
|
||||
// title: "微信二维码",
|
||||
// type: "image",
|
||||
// limit: 1
|
||||
// },
|
||||
// {
|
||||
// key: "contactWechat",
|
||||
// title: "微信号",
|
||||
// type: "text",
|
||||
// },
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// key: "bank_name",
|
||||
// title: "开户行",
|
||||
// type: "text",
|
||||
// },
|
||||
// {
|
||||
// key: "bank_account_name",
|
||||
// title: "户名",
|
||||
// type: "text",
|
||||
// },
|
||||
|
||||
|
||||
|
||||
],
|
||||
// 表单验证规则
|
||||
rules: {
|
||||
mailAddress: [{
|
||||
required: true,
|
||||
message: "通讯地址不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
contactQq: [{
|
||||
required: true,
|
||||
message: "QQ号码不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
contactWechat: [{
|
||||
required: true,
|
||||
message: "微信不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
contactWechatImage: [{
|
||||
required: true,
|
||||
message: "微信二维码不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
contactEmail: [{
|
||||
required: true,
|
||||
message: "邮箱不能为空",
|
||||
trigger: ['blur', 'change']
|
||||
}, {
|
||||
validator: vk.pubfn.validator("email"),
|
||||
message: '邮箱格式错误',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
|
||||
},
|
||||
// add 代表添加 update 代表修改
|
||||
formType: "",
|
||||
// 表单是否在请求中
|
||||
loading: false,
|
||||
// 是否显示表单1 的弹窗
|
||||
show: false,
|
||||
beforeAction: (formData) => {
|
||||
const newFormData = _.pick(formData, ['contactWechat', 'contactEmail',
|
||||
'contactWechatImage', 'contactQq', 'mailAddress'
|
||||
])
|
||||
vk.userCenter.updateUser({
|
||||
data: newFormData,
|
||||
success: (data) => {
|
||||
// 成功后的逻辑
|
||||
|
||||
}
|
||||
});
|
||||
return false;
|
||||
},
|
||||
}
|
||||
},
|
||||
// 表单相关结束-----------------------------------------------------------
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
||||
this.getUserInfo()
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
vk.userCenter.getCurrentUserInfo({
|
||||
success: (data) => {
|
||||
this.form1.data = _.pick(data.userInfo, [
|
||||
'fadadaConfirm', 'person', 'company', 'manager', 'contactWechat',
|
||||
'contactEmail', 'contactWechatImage', 'contactQq', 'mailAddress'
|
||||
])
|
||||
// 成功后的逻辑
|
||||
console.log('data: ', data);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
onFormSuccess1() {
|
||||
console.log(123);
|
||||
},
|
||||
getCertUrl() {
|
||||
vk.callFunction({
|
||||
url: 'client/fadada.getVerifyUrl',
|
||||
success: (res) => {
|
||||
location.href = res.data.url
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<view>
|
||||
<top-bar></top-bar>
|
||||
<common-header></common-header>
|
||||
<category-bar></category-bar>
|
||||
|
||||
<view class="w-1200">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-menu @select="menuSelect" default-active="fadada" class="el-menu-vertical-demo">
|
||||
<el-menu-item index="fadada">
|
||||
<i class="el-icon-menu"></i>
|
||||
<span slot="title">实名认证</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="business-card">
|
||||
<i class="el-icon-setting"></i>
|
||||
<span slot="title">我的名片</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<personal v-if="currMenu == 'fadada'"></personal>
|
||||
<business-card v-else-if="currMenu == 'business-card'"></business-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Personal from './components/personal'
|
||||
import BusinessCard from './components/business-card'
|
||||
export default {
|
||||
components: {Personal, BusinessCard},
|
||||
data() {
|
||||
return {
|
||||
currMenu: 'business-card',
|
||||
// currMenu: 'fadada',
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options);
|
||||
if(options && options.menu) {
|
||||
this.currMenu = options.menu
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
menuSelect(e) {
|
||||
this.currMenu = e
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.w-1200 {
|
||||
width: 1200px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user