This commit is contained in:
2026-10-08 18:20:51 +08:00
parent dec4ebc773
commit 6f1b2dc03a
621 changed files with 47117 additions and 43176 deletions
+222
View File
@@ -0,0 +1,222 @@
<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/article/list">金久信学堂</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>金久信学堂详情</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="w-1200 m-a bg-white p-40">
<view class=" flex justify-between items-center">
<text class="text-50 font-bold">{{ info.name }}</text>
<view class="flex flex-col justify-center items-center">
<star @click.native="changeCollect" theme="outline" size="30" fill="#4a4a4a" strokeLinecap="square"
v-if="!hasCollect" class="pointer"/>
<star @click.native="changeCollect" theme="filled" size="30" fill="#d00243" strokeLinecap="square"
v-else class="pointer"/>
<text>{{ hasCollect ? '已收藏' : '收藏' }}</text>
</view>
</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{ info._add_time_str }}</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom" v-if="userInfo">
<span>剩余</span>
<span class="mx-15 text-main font-bold">{{ userInfo.remainArticleDownloadNum }}</span>
<span>次下载次数</span>
</view>
<view class="py-20 border-bottom flex justify-start flex-col items-start " v-if="info.files">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
附件
</view>
</view>
</view>
<view class="flex justify-start items-start flex-wrap my-25">
<view class="mt-15 mr-15" v-for="(item, index) in info.files" :key="index">
<template v-if="['doc', 'docx'].includes(item.split('.').pop())">
<file-word theme="outline" class="pointer" size="100" fill="#4a90e2" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">
<file-excel theme="outline" class="pointer" size="100" fill="#417505" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['pdf'].includes(item.split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="100" fill="#f5a623"
strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else>
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item]"/>
</template>
</view>
</view>
</view>
<view v-html="info.content" class="mt-20"></view>
</view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template>
<script>
import {FileExcel, FilePdfOne, FileWord, Star} from "@icon-park/vue";
export default {
name: "detail",
components: {FileWord, FilePdfOne, FileExcel, Star},
data() {
return {
info: {
name: '',
content: ''
},
hasCollect: false,
userInfo: null,
}
},
onLoad(option) {
if (option.id) {
this.getInfo(option.id);
this.addView(option.id)
this.getUserInfo()
}
},
onShow() {
this.getUserInfo()
},
methods: {
async getInfo(id) {
this.info = await vk.callFunction({
url: `client/article/list/pub/getDetail`,
data: {id}
});
await this.checkCollect()
},
async getUserInfo() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.userInfo = userInfo
},
addView(id) {
vk.callFunction({
url: `client/article/list/pub/addView`,
data: {id}
});
},
async openDownload(url) {
await this.getUserInfo()
if (this.userInfo.userLevel < 0) return this.$message.error('非会员,无法下载');
// else if (this.userInfo.userLevel === 0) {
const {data} = await vk.callFunction({
url: 'client/article/list/kh/check',
data: {
id: this.info._id,
}
})
if (!data) {
if (this.userInfo.remainArticleDownloadNum === 0) {
return this.$confirm(`下载次数不足,是否购买次数?`, '提示', {
cancelButtonText: '关闭',
}).then(async () => {
const {data} = await vk.callFunction({
url: 'client/order/kh/addDownloadOrder',
title: '请求中...',
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
})
} else {
this.$confirm(`将消耗1次下载次数,是否继续?`, '提示', {
cancelButtonText: '关闭',
}).then(async () => {
this.userInfo.remainArticleDownloadNum -= 1
// await this.getUserInfo()
vk.callFunction({
url: 'client/article/list/pub/addDownload',
data: {
id: this.info._id,
}
})
vk.callFunction({
url: 'client/user/kh/reduceDownloadNum',
})
vk.callFunction({
url: 'client/article/list/kh/addDownload',
data: {
id: this.info._id,
}
})
window.open(url)
})
}
} else {
window.open(url)
}
// } else {
// vk.callFunction({
// url: 'client/article/list/pub/addDownload',
// data: {
// id: this.info._id
// }
// })
// window.open(url)
// }
},
async checkCollect() {
const {data} = await vk.callFunction({
url: 'client/article/collect/kh/check',
data: {
articleId: this.info._id
},
});
this.hasCollect = data
},
changeCollect() {
this.hasCollect = !this.hasCollect
vk.callFunction({
url: 'client/article/collect/kh/changeCollect',
data: {
articleId: this.info._id
},
});
}
}
}
</script>
<style scoped lang="scss">
@import "@/common/css/app.scss";
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: $--color-primary;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
}
}
</style>
+212 -205
View File
@@ -1,241 +1,248 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
</view>
<view class="filter-outer">
<view class="cate">
<view class="item" :class="[activeCateIndex === 0 ? 'active' : '']"
@click="selectCate(0)">
<text class="title">{{ cateList[0].name }}</text>
<text class="remark mt-10">{{ cateList[0].remark }}</text>
</view>
<view class="item" :class="[activeCateIndex === 1 ? 'active' : '']"
@click="selectCate(1)">
<text class="title">{{ cateList[1].name }}</text>
<text class="remark mt-10">{{ cateList[1].remark }}</text>
</view>
<view class="item" :class="[activeCateIndex === -1 ? 'active' : '']"
@click="selectCate(-1)">
<text class="title">乐邦团</text>
<text class="remark mt-10">可提问一些与钢材有关的专业知识问答</text>
</view>
<view class="item" :class="[activeCateIndex === 2 ? 'active' : '']"
@click="selectCate(2)">
<text class="title">{{ cateList[2].name }}</text>
<text class="remark mt-10">{{ cateList[2].remark }}</text>
</view>
<view class="item" :class="[activeCateIndex === -2 ? 'active' : '']"
@click="selectCate(-2)">
<text class="title">金久信风向标</text>
<text class="remark mt-10">平台客户可将宝贵意见和平台需要改进的意见在此发表</text>
</view>
<view class="item mt-20" @click="toMySchool">
<text class="title text-main">我的学堂</text>
<text class="remark mt-10">我上传和下载的文档</text>
</view>
</view>
<view class="content-wrap">
<el-input @keyup.enter.native="getContentList" clearable placeholder="关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="getContentList" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
<view class="flex flex-col justify-start items-start pointer w-100p">
<view v-for="(item, index) in list" :key="index" class="content-item-wrap"
@click="openDownload(item._id, item.files[0])">
<file-word theme="outline" size="80" fill="#4a90e2" strokeLinecap="square"/>
<view class="content">
<text class="title">{{ item.name }}</text>
<view class="desc">
<text class="item">{{ item._add_time_str }}</text>
<text class="item">{{ item.viewNum }}人浏览</text>
<text class="item">{{ item.downloadNum }}次下载</text>
<text class="item">{{ item.amount === 0 ? '免费下载' : `${item.amount}元下载` }}</text>
<!-- <text class="item">{{ item._add_time_str }}</text>-->
</view>
</view>
</view>
</view>
</view>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="carousel">
<common-swiper page="article"/>
</view>
<view class="filter-outer">
<view class="cate">
<view class="item" :class="[activeCateIndex === 0 ? 'active' : '']"
@click="selectCate(0)">
<text class="title">{{ cateList[0].name }}</text>
<text class="remark mt-10">{{ cateList[0].remark }}</text>
</view>
<!-- <view class="item" :class="[activeCateIndex === 1 ? 'active' : '']"-->
<!-- @click="selectCate(1)">-->
<!-- <text class="title">{{ cateList[1].name }}</text>-->
<!-- <text class="remark mt-10">{{ cateList[1].remark }}</text>-->
<!-- </view>-->
<!-- <view class="item" :class="[activeCateIndex === -1 ? 'active' : '']"-->
<!-- @click="selectCate(-1)">-->
<!-- <text class="title">乐邦团</text>-->
<!-- <text class="remark mt-10">可提问一些与钢材有关的专业知识问答</text>-->
<!-- </view>-->
<view class="item" :class="[activeCateIndex === 1 ? 'active' : '']"
@click="selectCate(1)">
<text class="title">{{ cateList[1].name }}</text>
<text class="remark mt-10">{{ cateList[1].remark }}</text>
</view>
<!-- <view class="item" :class="[activeCateIndex === -2 ? 'active' : '']"-->
<!-- @click="selectCate(-2)">-->
<!-- <text class="title">金久信风向标</text>-->
<!-- <text class="remark mt-10">平台客户可将宝贵意见和平台需要改进的意见在此发表</text>-->
<!-- </view>-->
<view class="item mt-20" @click="navTo('/pages/user/school')">
<text class="title text-main">我的学堂</text>
<text class="remark mt-10">我上传和下载的文档</text>
</view>
</view>
<view class="content-wrap">
<el-input @keyup.enter.native="getContentList()" clearable placeholder="关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="getContentList()" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
<view class="flex flex-col justify-start items-start pointer w-100p">
<view v-for="(item, index) in list" :key="index" class="content-item-wrap"
@click="navTo(`/pages/article/detail?id=${item._id}`)">
<template v-if="item.files && item.files.length > 0">
<template v-if="['doc', 'docx'].includes(item.files[0].split('.').pop())">
<file-word theme="outline" class="pointer" size="80" fill="#4a90e2" strokeLinecap="square"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.files[0].split('.').pop())">
<file-excel theme="outline" class="pointer" size="80" fill="#417505" strokeLinecap="square"/>
</template>
<template v-else-if="['pdf'].includes(item.files[0].split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="80" fill="#f5a623" strokeLinecap="square"/>
</template>
<template v-else>
<el-image :src="item.files[0]" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item.files]"/>
</template>
</template>
<view class="content">
<text class="title">{{ item.name }}</text>
<view class="desc">
<text class="item">{{ item._add_time_str }}</text>
<text class="item">{{ item.viewNum }}人浏览</text>
<text class="item">{{ item.downloadNum }}次下载</text>
<!-- <text class="item">{{ item.amount === 0 ? '免费下载' : `${item.amount}元下载` }}</text>-->
<!-- <text class="item">{{ item._add_time_str }}</text>-->
</view>
</view>
</view>
<el-pagination @current-change="getContentList" background layout="prev, pager, next"
:total="total"></el-pagination>
</view>
</view>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template>
<script>
import {FileWord} from '@icon-park/vue'
import {FilePdfOne, FileExcel, FileWord} from '@icon-park/vue'
export default {
name: "list",
components: {FileWord},
data() {
return {
cateList: [],
activeCateIndex: 0,
list: [],
keyword: null
}
},
methods: {
async getCateList() {
const {rows} = await vk.callFunction({
url: 'client/article/category/pub/getList'
})
this.cateList = rows
await this.getContentList()
},
selectCate(index) {
this.activeCateIndex = index
this.getContentList()
},
async getContentList() {
const {rows} = await vk.callFunction({
url: 'client/article/list/pub/getList',
data: {
parentId: this.cateList[this.activeCateIndex]._id,
keyword: this.keyword
}
})
this.list = rows
},
toMySchool() {
vk.navigateTo({
url: '/pages/user/school'
})
},
async openDownload(id, url) {
await vk.callFunction({
url: 'client/article/list/pub/addDownload',
data: {
id
}
})
window.open(url)
}
},
onLoad() {
this.getCateList()
name: "list",
components: {FilePdfOne, FileExcel, FileWord},
data() {
return {
cateList: [],
activeCateIndex: 0,
list: [],
total: 0,
pageSize: 10,
keyword: null
}
},
methods: {
async getCateList() {
const {rows} = await vk.callFunction({
url: 'client/article/category/pub/getList'
})
this.cateList = rows
await this.getContentList()
},
selectCate(index) {
this.activeCateIndex = index
this.getContentList()
},
async getContentList(pageIndex = 1) {
const {rows, total} = await vk.callFunction({
url: 'client/article/list/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
parentId: this.cateList[this.activeCateIndex]._id,
keyword: this.keyword
}
})
this.list = rows
this.total = total
window.scrollTo({top: 0})
},
navTo(url) {
vk.navigateTo({
url
})
},
},
onLoad() {
this.getCateList()
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
width: 1200px;
margin: 20px auto;
//padding: 20px;
//padding: 20px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
.cate {
width: 250px;
margin-right: 30px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.cate {
width: 250px;
margin-right: 30px;
.item {
width: 100%;
padding: 25px 10px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
cursor: pointer;
background-color: #FFFFFF;
.title {
font-size: 18px;
}
.remark {
color: #bbb;
}
}
.active {
background-color: #CB5050;
color: white;
.remark {
color: #F2CFCE;
}
}
}
.content-wrap {
padding: 20px;
background-color: #FFFFFF;
flex: 1;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.content-item-wrap {
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin: 30px 0;
.content {
margin-left: 25px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.item {
width: 100%;
padding: 25px 10px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
cursor: pointer;
background-color: #FFFFFF;
.title {
font-size: 18px;
}
.remark {
color: #bbb;
}
.title {
font-size: 20px;
}
.active {
background-color: #CB5050;
color: white;
.desc {
font-size: 14px;
color: #bbb;
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin-top: 10px;
.remark {
color: #F2CFCE;
}
}
}
.content-wrap {
padding: 20px;
background-color: #FFFFFF;
flex: 1;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.content-item-wrap {
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin: 30px 0;
.content {
margin-left: 25px;
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-direction: column;
.title {
font-size: 20px;
}
.desc {
font-size: 14px;
color: #bbb;
display: flex;
align-items: flex-start;
justify-content: flex-start;
margin-top: 10px;
.item {
padding: 0 10px;
border-right: 2px solid #bbb;
}
:first-child {
padding-left: 0;
}
:last-child {
border-right: none
}
}
}
.item {
padding: 0 10px;
border-right: 2px solid #bbb;
}
:first-child {
padding-left: 0;
}
:last-child {
border-right: none
}
}
}
}
}
}
</style>
+633
View File
@@ -0,0 +1,633 @@
<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="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 type="text" class="form-control" v-model="form1.mobile"
placeholder="请输入手机号" autocomplete="off">
</div>
<div class="input-group clear">
<input type="text" class="form-control" v-model="form1.code"
placeholder="请输入短信验证码" autocomplete="off"/>
<div @click="sendSmsCode" id="btnSendCode1" type="button"
class="btn-default" value="">{{ smsTips }}
</div>
</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"
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>
</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="javascript:;" style="float: right;text-align: right;">
<navigator url="/pages/auth/login/login" style="float: left;text-align: left;">
登录
</navigator>
</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: 'business', // business 企业 、、personal个人
loginMethod: 'username', // username 用户名 + 密码 、、mobile 手机号 + 验证码
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
code: '',
username: ''
},
};
},
methods: {
handleSubmit() {
if (this.testForm()) {
const {
password,
mobile,
code
} = this.form1
vk.userCenter.resetPasswordByMobile({
data: {
password,
mobile,
code
},
success: (data) => {
// 成功后的逻辑
this.$message({
message: "密码重置成功",
type:'success'
})
vk.redirectTo({
url: '/pages/auth/login/login'
})
}
});
}
},
sendSmsCode() {
if (timer != null) {
return
}
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'reset-pwd',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({
url: '/'
})
},
testForm() {
const {
mobile, // 手机号
code, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
} = this.form1;
// 手机号验证
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
this.$message({
message: '手机号为空或格式不正确',
type: 'error'
})
return false
}
// 短信验证码验证
if (!code || !/^\d{4,8}$/.test(code)) {
// 短信验证码为空或格式不正确
// 处理错误逻辑
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)
timer = null
}
}
}
</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>
+576 -538
View File
File diff suppressed because it is too large Load Diff
+642
View File
@@ -0,0 +1,642 @@
<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;">QQ登录</h2>
<template v-if="showBind">
<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-groupp clear">
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
style="width: 100%;">绑定并登录
</button>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
</view>
</template>
<script>
import {Loading} from "element-ui";
var vk = uni.vk
let timer = null
let timeS = 60
export default {
data() {
return {
showBind: false,
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
smsCode: '',
username: ''
},
accountType: null
};
},
methods: {
handleSubmit() {
if (this.testForm()) {
vk.userCenter.bindMobile({
data: {
mobile: this.form1.mobile,
code: this.form1.smsCode,
},
success: () => {
vk.userCenter.resetPwd({
data: {
password: this.form1.password,
},
success: () => {
vk.redirectTo({url: '/pages/auth/login/login'})
}
})
}
})
}
},
sendSmsCode() {
if (timer != null) {
return
}
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'bind',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({
url: '/'
})
},
async loginByQQ(code, accountType) {
let loadingInstance1 = Loading.service({fullscreen: true, text: '登录中...'});
const res = await vk.callFunction({
url: 'user/pub/loginByQQ',
data: {code, accountType}
})
loadingInstance1.close()
if (res.code === 0) {
this.loading = false
if (!res.mobileConfirmed) {
this.showBind = !res.mobileConfirmed
this.accountType = parseInt(accountType)
} else this.loginSuccess()
}
},
testForm() {
const {
mobile, // 手机号
smsCode, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
} = 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
},
},
onLoad(options) {
if (options.state && options.state.includes('jjx')) {
this.loginByQQ(options.code, options.state.split('_')[1])
} else vk.redirectTo({url: '/pages/index/index'})
},
onUnload() {
if (timer != null) {
clearInterval(timer)
timer = null
}
}
}
</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 {
height: 530px;
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>
+728
View File
@@ -0,0 +1,728 @@
<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>
<template v-if="showBind">
<div class="input-grouptabs clear">
<span @click="form1.accountType = 2"
:class="{'tab-active': form1.accountType === 2}" class="nopassword"
data-id="1"
id="nopw"><i></i>企业用户</span>
<span @click="form1.accountType = 1"
:class="{'tab-active': form1.accountType === 1}" class="normal" data-id="0"
id="normal"><i></i>个人用户</span>
</div>
<div v-show="form1.accountType === 1" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.nickname"
placeholder="请输入姓名" autocomplete="off">
</div>
<div v-show="form1.accountType === 2" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.nickname"
placeholder="请输入公司名称" autocomplete="off">
</div>
<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 class="input-groupread clear">
<el-checkbox v-model="agree"></el-checkbox>
<label class="ml-20">阅读并同意<a href="javascript:;" style="display: inline-block;"
@click="getInfo">
<span style="color: #3288b2">《金久信注册协议》</span></a></label>
</div>
<div class="input-groupp clear">
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
style="width: 100%;">绑定
</button>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
<el-dialog title="" :visible.sync="dialogVisible" width="40%">
<div v-html="info"></div>
</el-dialog>
</view>
</template>
<script>
import {Loading} from "element-ui";
var vk = uni.vk
let timer = null
let timeS = 60
export default {
data() {
return {
dialogVisible: false,
agree: false,
info: null,
showBind: false,
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
smsCode: '',
username: '',
inviteCode: '',
accountType: 2,
nickname: '',
},
accountType: null,
code: null,
loginType: null,
uid: null
};
},
methods: {
async handleSubmit() {
if (!this.agree) {
this.$message({
message: '请先阅读并同意《金久信注册协议》',
type: 'warning'
})
return
}
if (this.testForm()) {
await vk.callFunction({
url: '/client/user/kh/updateLoginInfo',
data: {
uid: this.uid,
accountType: this.form1.accountType,
nickname: this.form1.nickname,
inviteCode: this.form1.inviteCode,
}
})
vk.userCenter.bindMobile({
data: {
mobile: this.form1.mobile,
code: this.form1.smsCode,
},
success: () => {
vk.userCenter.resetPwd({
data: {
password: this.form1.password,
},
success: async () => {
vk.redirectTo({url: '/pages/auth/login/login'})
}
})
}
})
}
},
sendSmsCode() {
if (timer != null) {
return
}
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'bind',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({url: '/'})
},
testForm() {
const {
mobile, // 手机号
smsCode, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
nickname
} = 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
// 处理错误逻辑
}
const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+$/
if (!reg.test(password)) {
this.$message({
message: '密码必须由数字和字母组成',
type: 'error'
})
return false
}
// 重复输入密码验证
if (password !== repassword) {
// 两次输入的密码不一致
this.$message({
message: '两次输入的密码不一致',
type: 'error'
})
return false
// 处理错误逻辑
}
if (!nickname) {
return this.$message({
message: '请输入' + (this.form1.accountType === 2 ? '公司名称' : '您的姓名'),
type: 'error'
})
}
return true
},
async getInfo() {
const {content} = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id: 'adea4666684a336402937a2c5dcc448e'}
});
this.info = content
this.dialogVisible = true
}
},
async onLoad(options) {
if (options.state && options.state.includes('jjx')) {
this.form1.accountType = parseInt(options.state.split('_')[1])
if (options.code) {
this.code = options.code
const {uid, type, mobileConfirmed} = await vk.callFunction({
url: 'user/pub/loginByWeixin',
data: {
code: this.code,
accountType: this.form1.accountType,
},
})
this.uid = uid
this.showBind = type === "register"
if (mobileConfirmed) this.loginSuccess()
else this.showBind = true
} else {
this.showBind = !vk.getVuex('$user.userInfo.mobile')
}
} else this.loginSuccess()
},
onUnload() {
if (timer != null) {
clearInterval(timer)
timer = null
}
}
}
</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 {
height: 640px;
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>
+717
View File
@@ -0,0 +1,717 @@
<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>
<template v-if="showBind">
<div class="input-grouptabs clear">
<span @click="form1.accountType = 2"
:class="{'tab-active': form1.accountType === 2}" class="nopassword"
data-id="1"
id="nopw"><i></i>企业用户</span>
<span @click="form1.accountType = 1"
:class="{'tab-active': form1.accountType === 1}" class="normal" data-id="0"
id="normal"><i></i>个人用户</span>
</div>
<div v-show="form1.accountType === 1" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.nickname"
placeholder="请输入姓名" autocomplete="off">
</div>
<div v-show="form1.accountType === 2" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.nickname"
placeholder="请输入公司名称" autocomplete="off">
</div>
<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 class="input-groupread clear">
<el-checkbox v-model="agree"></el-checkbox>
<label class="ml-20">阅读并同意<a href="javascript:;" style="display: inline-block;"
@click="getInfo">
<span style="color: #3288b2">《金久信注册协议》</span></a></label>
</div>
<div class="input-groupp clear">
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
style="width: 100%;">绑定
</button>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
<el-dialog title="" :visible.sync="dialogVisible" width="40%">
<div v-html="info"></div>
</el-dialog>
</view>
</template>
<script>
import {Loading} from "element-ui";
var vk = uni.vk
let timer = null
let timeS = 60
export default {
data() {
return {
dialogVisible: false,
agree: false,
info: null,
showBind: false,
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
smsCode: '',
username: '',
inviteCode: '',
accountType: 2,
nickname: '',
},
accountType: null,
code: null,
loginType: null,
uid: null
};
},
methods: {
async handleSubmit() {
if (!this.agree) {
this.$message({
message: '请先阅读并同意《金久信注册协议》',
type: 'warning'
})
return
}
if (this.testForm()) {
await vk.callFunction({
url: '/client/user/kh/updateLoginInfo',
data: {
uid: this.uid,
accountType: this.form1.accountType,
nickname: this.form1.nickname,
}
})
vk.userCenter.bindMobile({
data: {
mobile: this.form1.mobile,
code: this.form1.smsCode,
},
success: () => {
vk.userCenter.resetPwd({
data: {
password: this.form1.password,
},
success: async () => {
vk.redirectTo({url: '/pages/auth/login/login'})
}
})
}
})
}
},
sendSmsCode() {
if (timer != null) {
return
}
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'bind',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({url: '/'})
},
testForm() {
const {
mobile, // 手机号
smsCode, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
nickname
} = 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
// 处理错误逻辑
}
if (!nickname) {
return this.$message({
message: '请输入' + (this.form1.accountType === 2 ? '公司名称' : '您的姓名'),
type: 'error'
})
}
return true
},
async getInfo() {
const {content} = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id: '65792dc8652341901b34a0bc'}
});
this.info = content
this.dialogVisible = true
}
},
async onLoad(options) {
// if (options.state && options.state.includes('jjx')) {
// this.form1.accountType = parseInt(options.state.split('_')[1])
// if (options.code) {
// this.code = options.code
// const {uid, type, mobileConfirmed} = await vk.callFunction({
// url: 'user/pub/loginByWeixin',
// data: {
// code: this.code,
// accountType: this.form1.accountType,
// },
// })
// this.uid = uid
// this.showBind = type === "register"
// if (mobileConfirmed) this.loginSuccess()
//
// } else {
// this.showBind = !vk.getVuex('$user.userInfo.mobile')
// }
// } else this.loginSuccess()
},
onUnload() {
if (timer != null) {
clearInterval(timer)
timer = null
}
}
}
</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 {
height: 640px;
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>
File diff suppressed because it is too large Load Diff
+439
View File
@@ -0,0 +1,439 @@
<template>
<view class="">
<top-bar></top-bar>
<common-nav></common-nav>
<view class="w-1200">
<view class="certificate-container bg-white p-20">
<!-- 申请表格 -->
<div v-html="content"></div>
<!-- 出证样板选择 -->
<view class="form-item mb-20">
<view class="form-label">出证样板查看</view>
</view>
<!-- 出证方式 -->
<view class="form-item mb-20">
<view class="form-label">出证方式</view>
<view class="form-content">
<el-radio v-model="form.certificateType" label="normal">(正常)出证时效({{ amount }}元/份)</el-radio>
<el-radio v-model="form.certificateType" label="urgent">(加急)出证时效({{
urgentAmount
}}元/份)
</el-radio>
</view>
</view>
<!-- 发票类型 -->
<view class="form-item mb-20">
<view class="form-label">发票类型</view>
<view class="form-content">
<el-radio v-model="form.invoiceTypes" label="none">无需开具发票</el-radio>
<el-radio v-model="form.invoiceTypes" label="electronic">增值税专用发票(电子发票)</el-radio>
<el-radio v-model="form.invoiceTypes" label="normal">普票(电子发票)</el-radio>
</view>
</view>
<!-- 发票抬头 -->
<template v-if="form.invoiceTypes !== 'none'">
<view class="form-item mb-20">
<view class="form-label">发票抬头</view>
<view class="form-content">
<el-form :model="form.invoice" label-width="100px">
<el-form-item label="名称:" required>
<el-input v-model="form.invoice.companyName" placeholder="请输入企业名称或个人姓名"></el-input>
</el-form-item>
<el-form-item label="税号/证号:" required>
<el-input v-model="form.invoice.taxNumber" placeholder="请输入税号或身份证号"></el-input>
</el-form-item>
<el-form-item label="开户行:">
<el-input v-model="form.invoice.bankName"></el-input>
</el-form-item>
<el-form-item label="开户账号:">
<el-input v-model="form.invoice.bankAccount"></el-input>
</el-form-item>
<el-form-item label="联系电话:" required>
<el-input v-model="form.invoice.phone"></el-input>
</el-form-item>
</el-form>
</view>
</view>
<!-- 电子发票接收信息 -->
<!-- <view class="form-item mb-20">-->
<!-- <view class="form-label">电子发票接收信息</view>-->
<!-- <view class="form-content">-->
<!-- <el-form :model="form.electronicInvoice" label-width="100px">-->
<!-- <el-form-item label="收票人:" required>-->
<!-- <el-input v-model="form.electronicInvoice.receiver"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="手机号码:" required>-->
<!-- <el-input v-model="form.electronicInvoice.phone"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="邮箱:" required>-->
<!-- <el-input v-model="form.electronicInvoice.email"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- </view>-->
<!-- </view>-->
</template>
<!-- 出证交付方式 -->
<view class="form-item mb-20">
<view class="form-label">出证交付方式</view>
<view class="form-content">
<el-checkbox v-model="form.deliveryMethods.electronic" @change="selectEle">电子</el-checkbox>
<!-- <el-form v-if="form.deliveryMethods.electronic" :model="form.electronicDelivery" label-width="100px">-->
<!-- <el-form-item label="收件人姓名:" class="required">-->
<!-- <el-input v-model="form.electronicDelivery.receiver"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="手机号码:" class="required">-->
<!-- <el-input v-model="form.electronicDelivery.phone"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="收件邮箱:" class="required">-->
<!-- <el-input v-model="form.electronicDelivery.email"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<el-checkbox v-model="form.deliveryMethods.paper" @change="selectPaper">纸质邮寄</el-checkbox>
<el-form v-if="form.deliveryMethods.paper" :model="form.paperDelivery" label-width="100px">
<el-form-item label="收件人姓名:" class="required">
<el-input v-model="form.paperDelivery.receiver"></el-input>
</el-form-item>
<el-form-item label="手机号码:" class="required">
<el-input v-model="form.paperDelivery.phone"></el-input>
</el-form-item>
<el-form-item label="收件地址:" class="required">
<el-input v-model="form.paperDelivery.address" placeholder="请输入详细地址"></el-input>
</el-form-item>
</el-form>
</view>
</view>
<!-- 支付方式 -->
<view class="form-item mb-20">
<view class="form-label">支付方式</view>
<view class="form-content">
<el-radio v-model="form.paymentMethod" label="online">在线支付</el-radio>
<el-radio v-model="form.paymentMethod" label="advance">公对公支付</el-radio>
</view>
</view>
<view v-if="form.paymentMethod === 'advance'" v-html="bankAccount"></view>
<!-- 提交按钮 -->
<view class="text-center mb-20">
<el-button type="primary" @click="submitForm" v-if="form.paymentMethod === 'online'">提交支付</el-button>
<vk-data-upload v-else v-model="form.payVoucher" :cloudPathRemoveChinese="false" list-type="text"
:limit="1" button-text="上传付款记录"
accept=".jpg,.jpeg,.png" :on-success="uploadSuccess" ref="uploader"
:show-file-list="false">
</vk-data-upload>
</view>
<!-- 客服电话 -->
<view class="text-center">
<view class="service-phone">客服电话:400 686 5559</view>
</view>
</view>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
form: {
sampleSelected: false,
paidConfirm: false,
hasReport: false,
certificateType: 'normal',
lawPrice: '100',
agreementPrice: '150',
invoiceTypes: 'none',
invoice: {
companyName: '',
taxNumber: '',
bankName: '',
bankAccount: '',
phone: ''
},
electronicInvoice: {
receiver: '',
phone: '',
email: ''
},
deliveryMethods: {
electronic: true,
paper: false
},
electronicDelivery: {
receiver: '',
phone: '',
email: ''
},
paperDelivery: {
receiver: '',
phone: '',
address: ''
},
paymentMethod: 'online',
payVoucher: ''
},
contractId: null,
transactionId: null,
amount: null,
urgentAmount: null,
content: null,
bankAccount: null,
}
},
onLoad({contractId, transactionId,}) {
this.contractId = contractId;
this.transactionId = transactionId;
this.getContent()
this.getAmount()
this.getUrgentAmount()
this.getUserInfo()
this.getBankAccount()
},
methods: {
async getUserInfo() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.form.invoice.companyName = userInfo.accountType === 2 ? userInfo.company.companyName : userInfo.person.personName
this.form.invoice.taxNumber = userInfo.accountType === 2 ? userInfo.company.organization : userInfo.person.idCard
this.form.invoice.phone = userInfo.accountType === 2 ? userInfo.company.mobile : userInfo.person.mobile
},
async getContent() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'e647148e684a458a0295b0a239c3d539'
},
})
this.content = res.content
},
async getAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'd77d384f684a47b6029a135220ecf4c9'
},
})
this.amount = res.content
},
async getUrgentAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '8524406c684a47c402985cb55941b3cb'
},
})
this.urgentAmount = res.content
},
uploadSuccess(response, file, fileList) {
this.form.payVoucher = response.url;
this.submitForm()
},
submitForm() {
// 表单验证
if (!this.validateForm()) {
return;
}
if (this.form.certificateType === 'normal') {
this.form.amount = this.amount;
} else {
this.form.amount = this.urgentAmount;
}
this.$confirm(`司法调证服务需向数据中心付费(${this.form.amount}元/次),是否继续?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
// 提交表单
this.form.contractId = this.contractId;
this.form.contractNo = this.transactionId;
vk.callFunction({
url: 'client/contract/kh/certificateAdd',
title: '提交中...',
data: this.form,
success: async (res) => {
this.$message({
message: '申请提交成功',
type: 'success'
});
if (this.form.paymentMethod === 'online') {
const {data} = await vk.callFunction({
url: 'client/contract/kh/buy',
title: '请求中...',
data: {
contractId: this.contractId,
contractNo: this.transactionId,
amount: this.form.amount
},
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
} else {
this.$message({
message: '请等待后台审核',
type: 'success'
});
setTimeout(() => {
vk.navigateTo({
url: `/pages/contract/index?tab=2`
})
}, 1500)
}
}
});
})
},
validateForm() {
// 验证必填项
// if (this.form.deliveryMethods.electronic) {
// if (!this.form.electronicDelivery.receiver) {
// this.$message.error('请填写电子发送邮箱的收件人姓名');
// return false;
// }
// if (!this.form.electronicDelivery.phone) {
// this.$message.error('请填写电子发送邮箱的手机号码');
// return false;
// }
// if (!this.form.electronicDelivery.email) {
// this.$message.error('请填写电子发送邮箱的收件邮箱');
// return false;
// }
// }
if (this.form.deliveryMethods.paper) {
if (!this.form.paperDelivery.receiver) {
this.$message.error('请填写纸质邮寄的收件人姓名');
return false;
}
if (!this.form.paperDelivery.phone) {
this.$message.error('请填写纸质邮寄的手机号码');
return false;
}
if (!this.form.paperDelivery.address) {
this.$message.error('请填写纸质邮寄的收件地址');
return false;
}
}
return true;
},
selectEle(e) {
if (e) {
this.form.deliveryMethods.electronic = true;
this.form.deliveryMethods.paper = false;
} else {
this.form.deliveryMethods.electronic = false;
this.form.deliveryMethods.paper = true;
}
},
selectPaper(e) {
if (!e) {
this.form.deliveryMethods.electronic = true;
this.form.deliveryMethods.paper = false;
} else {
this.form.deliveryMethods.electronic = false;
this.form.deliveryMethods.paper = true;
}
},
async getBankAccount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'b5ad93e068f343230344c7b63cb1aac5'
},
})
this.bankAccount = res.content
},
}
}
</script>
<style scoped lang="scss">
.w-1200 {
width: 1200px;
margin: 20px auto;
}
.certificate-container {
border-radius: 4px;
}
.title {
font-size: 24px;
font-weight: bold;
}
.certificate-table {
width: 100%;
table {
border-collapse: collapse;
width: 100%;
th, td {
border: 1px solid #dcdfe6;
padding: 8px;
text-align: center;
}
th {
background-color: #f5f7fa;
}
}
}
.notice {
border: 1px solid #dcdfe6;
padding: 10px;
border-radius: 4px;
.notice-title {
font-weight: bold;
margin-bottom: 5px;
}
.notice-item {
font-size: 14px;
line-height: 1.5;
color: #606266;
}
}
.form-item {
margin-bottom: 20px;
.form-label {
font-weight: bold;
margin-bottom: 10px;
}
.form-content {
padding: 0 20px;
}
}
.w-100 {
width: 100px;
}
.required /deep/ .el-form-item__label:before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
.service-phone {
font-size: 16px;
font-weight: bold;
color: #333;
}
</style>
+1833 -507
View File
File diff suppressed because it is too large Load Diff
+96 -109
View File
@@ -1,6 +1,6 @@
<template>
<view class="border-bottom pt-20">
<el-form ref="form" :model="form1" label-width="80px" :rules="form1.props.rules">
<el-form ref="form" :model="form1" label-width="140px" :rules="form1.props.rules">
<view class="flex flex-wrap justify-start items-start">
<view class="w-25p">
<el-form-item label="商品名称">
@@ -15,49 +15,51 @@
</el-form-item>
</view>
<view class="w-25p" v-for="(item, index) in goodsAttributes" :key="index">
<el-form-item :label="item.label">
<el-select v-model="form1.data.model[item.label]" placeholder="请选择">
<el-option
v-for="(item, index) in item.values"
:key="index"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
<template v-if="goodsAttributes && goodsAttributes.length > 0">
<el-form-item :label="item.label" v-if="item.label">
<el-select v-model="form1.data.model[index].value" placeholder="请选择">
<el-option
v-for="(value, valueIndex) in item.values" :key="valueIndex" :label="value"
:value="value">
</el-option>
</el-select>
</el-form-item>
</template>
</view>
</view>
<el-row :gutter="10">
<el-col :span="10">
<el-form-item label="单件长度">
<el-input placeholder="请输入内容" v-model="form1.data.singleLength" class="input-with-select">
<el-select v-model="form1.data.singleLengthUnit" slot="append" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '单件长度')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '单件长度').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="材质">
<el-select v-model="form1.data.materialQuality" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '材质')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '材质').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="10">-->
<!-- <el-form-item label="单件长度">-->
<!-- <el-input placeholder="请输入内容" v-model="form1.data.singleLength" class="input-with-select"-->
<!-- type="number">-->
<!-- <template slot="append">米</template>-->
<!--&lt;!&ndash; <el-select v-model="form1.data.singleLengthUnit" slot="append" placeholder="请选择">&ndash;&gt;-->
<!--&lt;!&ndash; <template v-if=" attributes.find(attr => attr.label === '单件长度')">&ndash;&gt;-->
<!--&lt;!&ndash; <el-option&ndash;&gt;-->
<!--&lt;!&ndash; v-for="(item, index) in attributes.find(attr => attr.label === '单件长度').options"&ndash;&gt;-->
<!--&lt;!&ndash; :key="index"&ndash;&gt;-->
<!--&lt;!&ndash; :label="item.label"&ndash;&gt;-->
<!--&lt;!&ndash; :value="item.value">&ndash;&gt;-->
<!--&lt;!&ndash; </el-option>&ndash;&gt;-->
<!--&lt;!&ndash; </template>&ndash;&gt;-->
<!--&lt;!&ndash; </el-select>&ndash;&gt;-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-form-item label="尺寸">-->
<!-- <el-select v-model="form1.data.materialQuality" placeholder="请选择">-->
<!-- <template v-if=" attributes.find(attr => attr.label === '尺寸')">-->
<!-- <el-option-->
<!-- v-for="(item, index) in attributes.find(attr => attr.label === '尺寸').options"-->
<!-- :key="index"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </template>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="6">
<el-form-item label="交货服务">
<el-select v-model="form1.data.deliverService" placeholder="请选择">
@@ -72,24 +74,6 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="采购数量">
<el-input v-model="form1.data.procureNumber" class="input-with-select">
<el-select v-model="form1.data.procureUnit" slot="append" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '单位')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '单位').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="计价形式">
<el-select v-model="form1.data.pricingForm" placeholder="请选择">
@@ -106,53 +90,38 @@
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="6">
<el-form-item label="交货时限">
<el-date-picker
v-model="form1.data.deliveryTime"
type="date"
placeholder="选择日期">
</el-date-picker>
<el-col :span="12">
<el-form-item label="采购数量">
<el-input v-model="form1.data.procureNumber" class="input-with-select" type="number">
<el-select v-model="form1.data.procureUnit" slot="append" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '单位')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '单位').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-input>
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item label="交货地点" class="ml-10">
<el-row :gutter="10">
<el-col :span="5">
<el-select v-model="provinceIndex" placeholder="省" @change="selectProvince">
<el-option v-for="(item, index) in provinceData" :key="index" :value="index"
:label="item.name"/>
<!-- <span slot="prefix">省</span>-->
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="cityIndex" placeholder="市" @change="selectCity">
<template v-if="provinceIndex !== null">
<el-option v-for="(item, index) in cityData[provinceIndex]" :key="index"
:value="index"
:label="item.name"/>
</template>
<!-- <span slot="prefix">市</span>-->
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="areaIndex" placeholder="区/县" @change="selectArea">
<template v-if="provinceIndex !== null && cityIndex !== null">
<el-option v-for="(item, index) in areaData[provinceIndex][cityIndex]"
:key="index" :value="index"
:label="item.name"/>
</template>
<!-- <span slot="prefix">区/县</span>-->
</el-select>
</el-col>
<el-col :span="8">
<el-input v-model="form1.data.addressDetail"
placeholder="详细地址或几公里范围内"></el-input>
</el-col>
</el-row>
<el-col :span="12">
<el-form-item label="装货、卸货费用承担">
<el-select v-model="form1.data.loadPaidBy" placeholder="请选择" style="width: 100%">
<template v-if="attributes.find(attr => attr.label === '装货、卸货费用承担')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '装货、卸货费用承担').options"
:key="index"
:label="item.label"
:value="item.label">
</el-option>
</template>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</view>
</template>
@@ -183,6 +152,11 @@ export default {
},
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
provinceData: provinces,
cityData: citys,
areaData: areas,
@@ -211,6 +185,7 @@ export default {
deliverService: null,
standard: null,
pricingForm: null,
loadPaidBy: '供货方承担装车费用,采购方承担卸货费用',
deliveryTime: null,
len: null,
extraAttributes: {},
@@ -277,8 +252,6 @@ export default {
} else {
this.form1.props.columns[2].columns = []
}
}
},
{
@@ -499,6 +472,7 @@ export default {
getGoodsList() {
vk.callFunction({
url: 'client/enquiry/template/pub/getList',
pageSize: 500,
title: '请求中',
success: ({rows}) => {
this.goodsList = rows
@@ -506,10 +480,17 @@ export default {
})
},
selectGoods(val) {
this.form1.data.model = []
this.goodsList.forEach(({_id, name, extraAttributes}) => {
if (_id === val) {
this.form1.data.goodsName = name
this.goodsAttributes = extraAttributes
this.goodsAttributes.forEach(attr => {
if (attr.label) this.form1.data.model.push({
label: attr.label,
value: null
})
})
}
})
},
@@ -525,13 +506,19 @@ export default {
},
watch: {
"form1.data"(val) {
this.$emit('input', val)
console.log("this.$emit('input', val.data)");
"form1.data": {
immediate: true,
handler(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);
value: {
immediate: true,
handler(val) {
this.form1.data = val
console.log("this.form1.data = val", val);
}
}
}
+334 -130
View File
@@ -16,12 +16,13 @@
<view class="page-main" v-if="sheet">
<view class="flex justify-between items-center">
<text class="text-gray">加工询价单编号:{{ sheet.orderNo }}</text>
<text class="text-gray">询价单编号:{{ sheet.enquiryNo }}</text>
<text class="text-gray">发布时间:{{ sheet._add_time_str }}</text>
</view>
<view class="my-25 flex justify-between items-center">
<view class="flex justify-start items-center">
<text class="text-40 font-bold">{{ sheet.title }}</text>
<el-tag type="success" v-if="sheet.tradeMethod === 0" size="small" class="ml-20">自主交易</el-tag>
<view class="ml-20 flex justify-start items-center">
<building-one theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<view class="text-main ">
@@ -34,15 +35,15 @@
</view>
</view>
<view class="flex justify-end items-end"
v-if="sheet.answerEndTime && dayjs().diff(dayjs(sheet.answerEndTime), 'second') > 0">
v-if="sheet.answerEndTime && dayjs(sheet.answerEndTime).diff(dayjs(), 'second') > 0">
<text>距离报价结束还有:</text>
<view class="border-main countdown text-main">{{
dayjs().diff(dayjs(sheet.answerEndTime), 'day')
dayjs(sheet.answerEndTime).diff(dayjs(), 'day')
}}
</view>
<text>天</text>
<view class="border-main countdown text-main">
{{ (dayjs().diff(dayjs(sheet.answerEndTime), 'hour')) % 24 }}
{{ (dayjs(sheet.answerEndTime).diff(dayjs(), 'hour')) % 24 }}
</view>
<text>时</text>
</view>
@@ -50,19 +51,71 @@
<view class="my-25 flex justify-between items-center pb-20 border-bottom">
<view class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<text class="ml-15 text-gray">
<text class="ml-15 text-gray" v-if="sheet.user">
{{
sheet.user.accountType === 1 ? sheet.user.person.personName : sheet.user.company.companyName
sheet.user.accountType === 1 ? sheet.user.person.personName.replace(/^(.).*$/,"$1**") : sheet.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/,"$1$2***$3$4$5$6")
}}
</text>
</view>
<el-button type="primary" @click.native="toQuote"
v-if="vk.getVuex('$user.userInfo._id') !== sheet.userId && sheet.status === 0">我要报价
<el-button type="primary" @click.native="toQuote" :disabled="sheet.disabled"
v-if="vk.getVuex('$user.userInfo._id') !== sheet.userId && sheet.status === 0">{{
sheet.disabled ? '已超时无法报价' : '我要报价'
}}
</el-button>
<el-button type="primary" @click.native="showDialog = true"
v-else-if="vk.getVuex('$user.userInfo._id') === sheet.userId">查看收到的申请报价
</el-button>
</view>
<!-- <view class="item-wrap">-->
<!-- <view class="form-title-wrap">-->
<!-- <view class="goods-sheet-title">-->
<!-- <view class="form-title">-->
<!-- 主要商品-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="mt-20" v-if="sheet.fillType === 1">{{-->
<!-- sheet.productList.map(item => item.goodsName + `${item.materialQuality ? `(${item.materialQuality})` : ''}`).join(',')-->
<!-- }}-->
<!-- </view>-->
<!-- <view v-else class="mt-20">-->
<!-- <el-descriptions :title="item.goodsName" v-for="(item, index) in sheet.productList" :key="index"-->
<!-- class="pb-20 border-bottom">-->
<!-- <el-descriptions-item :label="model.label" v-for="(model, modelIndex) in item.model"-->
<!-- :key="modelIndex">{{ model.value }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="单价长度">{{-->
<!-- item.singleLength ? item.singleLength : ''-->
<!-- }}{{ item.singleLengthUnit ? item.singleLengthUnit : '' }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="交货服务">{{-->
<!-- item.deliverService ? item.deliverService : '无'-->
<!-- }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="采购数量">{{-->
<!-- item.procureNumber ? item.procureNumber : ''-->
<!-- }}{{ item.procureUnit ? item.procureUnit : '' }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="计价形式">{{-->
<!-- item.pricingForm ? item.pricingForm : '无'-->
<!-- }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="交货时限">{{-->
<!-- sheet.deliveryTime ? sheet.deliveryTime : '无'-->
<!-- }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="交货地点">{{-->
<!-- sheet.fullAddress-->
<!-- }}-->
<!-- </el-descriptions-item>-->
<!-- <el-descriptions-item label="装货、卸货费用承担">{{-->
<!-- item.loadPaidBy ? item.loadPaidBy : '无'-->
<!-- }}-->
<!-- </el-descriptions-item>-->
<!-- </el-descriptions>-->
<!-- </view>-->
<!-- </view>-->
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
@@ -71,13 +124,35 @@
</view>
</view>
</view>
<view class="mt-15 mr-15" v-for="(item, index) in sheet.files" :key="index">
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="sheet.files"/>
</view>
<template v-if="sheet.files">
<view class="mt-15 mr-15" v-for="(item, index) in sheet.files" :key="index">
<file-type :item="item" @click.native="openDownload(item)"/>
</view>
</template>
<template v-if="sheet.multiFiles">
<view class="mt-15 mr-15" v-for="(item, index) in sheet.multiFiles" :key="index">
<template v-if="['doc', 'docx'].includes(item.split('.').pop())">
<file-word theme="outline" class="pointer" size="40" fill="#4a90e2" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">
<file-excel theme="outline" class="pointer" size="40" fill="#417505" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['pdf'].includes(item.split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="40" fill="#f5a623"
strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else>
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item]"/>
</template>
</view>
</template>
</view>
<view class="item-wrap">
<view class="item-wrap" v-if="sheet.remark">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
@@ -98,8 +173,13 @@
</view>
<view class="mt-15">是否含税:{{ sheet.invoice ? '含税' : '不含税' }}</view>
<view class="mt-15">开票时间:{{ WRITE_INVOICE_TIME[sheet.writeInvoiceTime] }}</view>
<view class="mt-15">发票种类:{{ INVOICE_TYPE[sheet.invoiceType] }}</view>
<view class="mt-15">其他要求:{{ sheet.invoiceOther }}</view>
<view class="mt-15" v-if="sheet.invoiceOther">税票要求:{{ sheet.invoiceOther }}</view>
<template v-else>
<view class="mt-15">纳税人身份:{{ sheet.taxType ? sheet.taxType : '无' }}</view>
<view class="mt-15">发票种类:{{ sheet.invoiceType ? sheet.invoiceType : '无' }}</view>
<view class="mt-15">税率:{{ sheet.taxRate ? sheet.taxRate : '无' }}</view>
</template>
</view>
<view class="item-wrap">
@@ -110,9 +190,28 @@
</view>
</view>
</view>
<view class="mt-15">随货资料:{{ sheet.transportDocuments.join() }}</view>
<view class="mt-15">其他要求:{{ sheet.otherTransportDocuments }}</view>
<view class="mt-15" v-if="sheet.transportDocuments && sheet.transportDocuments.length > 0">
随货资料:{{ sheet.transportDocuments.join() }}
</view>
<view class="mt-15" v-if="sheet.otherTransportDocuments">其他要求:{{
sheet.otherTransportDocuments
}}
</view>
<view class="mt-15">运输限制要求:{{ sheet.transportLimit ? '有' : '无' }}</view>
<view class="mt-15" v-if="sheet.transportLimit && sheet.otherTransportRequest">
运输限制说明:{{ sheet.otherTransportRequest }}
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易模式
</view>
</view>
</view>
<view class="mt-15">{{ sheet.tradeMethod === 0 ? '自主交易' : '金久信公证' }}</view>
</view>
<view class="item-wrap">
@@ -123,7 +222,13 @@
</view>
</view>
</view>
<view class="mt-15">付款方式:{{ PROCESS_PAY_METHOD[sheet.payMethod] }}</view>
<view class="mt-15">付款方式:{{ PROCESS_PAY_METHOD[sheet.payMethod] }}{{
sheet.payMethod === 0 ? `${sheet.advancePayRate}%货到付全款` : ''
}}{{
sheet.payMethod === 3 ? `${sheet.reputationPayDay}天` :
(sheet.payMethod === 4 ? `:${sheet.otherPayMethod}` : '')
}}
</view>
<view class="mt-15">报价形式:{{ sheet.offerType === 0 ? '整单报价' : '可分项报价' }}</view>
<view class="mt-15">报价期限:
<text v-if="sheet.answerStartTime && sheet.answerEndTime">{{
@@ -134,6 +239,79 @@
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
采购商信息
</view>
</view>
</view>
<view class="mt-15">项目名称:{{ sheet.projectName ? sheet.projectName : '' }}</view>
<view class="mt-15">项目地址:{{ sheet.fullAddress }}</view>
<template v-if="sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0">
<view class="mt-15" v-if="sheet.companyName">公司信息:{{
sheet.companyName ? sheet.companyName : ''
}}
</view>
<view class="mt-15" v-if="sheet.companyMobile">公司联系方式:{{
sheet.companyMobile ? sheet.companyMobile : ''
}}
</view>
<view class="mt-15">授权业务咨询人:{{
sheet.businessName ? sheet.businessName : ''
}}
</view>
<view class="mt-15">业务咨询联系方式:{{
sheet.businessMobile ? sheet.businessMobile : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.companyName">公司信息:{{
sheet.companyName ? sheet.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
}}
</view>
<view class="mt-15" v-if="sheet.companyMobile">公司联系方式:{{
sheet.companyMobile ? sheet.companyMobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
<view class="mt-15">授权业务咨询人:{{
sheet.businessName ? sheet.businessName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15">业务咨询联系方式:{{
sheet.businessMobile ? sheet.businessMobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易保证金要求
</view>
</view>
</view>
<view class="mt-15">{{ sheet.earnestMoney ? sheet.earnestMoney.toFixed(2) : '无' }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
签约模式
</view>
</view>
</view>
<view class="mt-15">{{
sheet.signMethod === 0 ? '线上签约-标准合同' : (sheet.signMethod !== 1 ? '线上签约-双方协商合同' : '线下签约')
}}
</view>
</view>
<view class="item-wrap" v-if="sheet.signMethod === 0">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
@@ -157,21 +335,36 @@
<view class="mt-15">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view>
<view class="mt-15">采购方补充条款: 供货方逾期供货承担采购方一切损失</view>
<view class="mt-15"> 供应方补充条款:</view>
<view class="mt-15">采购方补充条款: {{ sheet.supplementary }}</view>
<!-- <view class="mt-15">供应方补充条款:</view>-->
</view>
<template v-else-if="sheet.signMethod === 2">
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
合同附件
</view>
</view>
</view>
</view>
<view v-for="(item, index) in sheet.contractAttachment" :key="index" class="mr-25 my-25">
<file-type :item="item" @click.native="openDownload(item)"/>
</view>
</template>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
已收到的加工申请
{{ sheet.quoteList.length }}家已报价
</view>
</view>
</view>
<!-- 报价列表 -->
<vk-data-table :data="sheet.quoteList" :columns="table1.columns" title="adasda "
:customRightBtns="table1.customRightBtns"></vk-data-table>
<!-- <vk-data-table :data="sheet.quoteList" :columns="table1.columns"-->
<!-- :customRightBtns="table1.customRightBtns"></vk-data-table>-->
</view>
</view>
@@ -185,16 +378,26 @@
<view class="mt-15">
<view class="request-header">
<text class="flex-1">供应商</text>
<text class="flex-1">报价时间</text>
<text class="flex-1">{{ sheet.type === 2 && sheet.rentType === 1 ? '询价' : '报价' }}时间</text>
<text class="flex-1">联系方式</text>
<text class="flex-1">报价</text>
<text class="flex-1">{{ sheet.type === 2 && sheet.rentType === 1 ? '询价内容' : '报价' }}</text>
<text class="flex-1">附件</text>
<text class="flex-1">详情</text>
<text class="flex-1">供应商合同补充条款</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in sheet.quoteList" :key="index">
<text class="flex-1">{{ item.subjectName }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">{{ item.subjectMobile }}</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item.totalPrice }}{{ sheet.type === 2 && sheet.rentType === 1 ? '' : '元' }}</text>
<view class="flex-1">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in item.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</view>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item.supplierExt ? item.supplierExt : '无' }}</text>
<text class="flex-1">
<el-button type="primary" v-if="sheet.status === 0" @click.native="confirm(item)">选择
</el-button>
@@ -206,19 +409,31 @@
</template>
<script>
import {BuildingOne, IdCard} from "@icon-park/vue";
import {BuildingOne, IdCard, FileWord, FileExcel, FilePdfOne} from "@icon-park/vue";
import dayjs from "dayjs";
import {WRITE_INVOICE_TIME, INVOICE_TYPE, PROCESS_PAY_METHOD} from '@/util'
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../components/file-type/file-type.vue";
export default {
components: {BuildingOne, IdCard},
components: {FileType, BuildingOne, IdCard, FileWord, FileExcel, FilePdfOne},
data() {
return {
userInfo: {
userLevel: 0
},
accountNum: 0,
provinceData: provinces,
cityData: citys,
areaData: areas,
WRITE_INVOICE_TIME,
INVOICE_TYPE,
PROCESS_PAY_METHOD,
enquiryId: undefined,
showDialog: false,
hasQuote: false,
productList: [],
sheetTitle: '',
sheet: {
@@ -234,18 +449,7 @@ export default {
key: "subjectName",
title: "供应商",
type: "text",
width: 300,
formatter: (val, row, column, index) => {
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
return val
}
if (row.accountType == 1) {
return vk.pubfn.hidden(val, 1, 1);
} else {
return vk.pubfn.hidden(val, 2, 4);
}
}
width: 300
},
{
key: "_add_time_str",
@@ -263,7 +467,7 @@ export default {
if (row.managerMobile) {
str = row.managerMobile
}
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId || row.userId == vk.getVuex('$user.userInfo._id')) {
return str
}
return vk.pubfn.hidden(str, 3, 4);
@@ -279,103 +483,100 @@ export default {
if (row.managerMobile) {
str = row.managerMobile
}
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
return val
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId || row.userId == vk.getVuex('$user.userInfo._id')) {
return `${val}元`
}
return "******";
}
},
{
key: "remark",
title: "详情",
type: "text",
formatter: (val, row, column, index) => {
let str = val
if (row.managerMobile) {
str = row.managerMobile
}
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId || row.userId == vk.getVuex('$user.userInfo._id')) {
return val
}
return "******";
}
}
],
customRightBtns: [
{
title: '合同',
type: 'primary',
icon: 'el-icon-search',
show: (row) => {
return vk.getVuex('$user.userInfo._id') == this.sheet.userId && row.status == 1
},
onClick: (item) => {
vk.navigateTo('/pages/contract/index');
},
},
{
title: '选择',
type: 'primary',
icon: 'el-icon-search',
show: (row) => {
return vk.getVuex('$user.userInfo._id') == this.sheet.userId && row.status == 0
},
onClick: (item) => {
vk.callFunction({
url: 'client/enquiry/quote/kh/confirmQuote',
title: '请求中...',
data: {
quoteId: item._id,
},
success: (data) => {
vk.navigateTo('/pages/contract/index');
}
});
},
},
{
title: '查看报价详情',
type: 'primary',
icon: 'el-icon-search',
disabled: (item) => {
return vk.getVuex('$user.userInfo._id') != this.sheet.userId
},
onClick: (item) => {
this.showDialog = true
}
},
]
},
};
},
onLoad(options = {}) {
const {
id
} = options
const {id} = options
if (!id) {
vk.navigateTo('/pages/enquiry/list');
return
}
this.enquiryId = id
this.getEnquiryDetail()
this.getUserInfo()
},
methods: {
dayjs,
async getUserInfo(){
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.userInfo = userInfo
this.accountNum = accountNum
},
/**
* 打开报价窗口
*/
toQuote() {
// 获取用户信息
vk.userCenter.getCurrentUserInfo({
success: (data) => {
const {
userInfo
} = data
if (userInfo.quoteTimes > 3) {
}
this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
async toQuote() {
if (!this.userInfo.fadadaConfirm || [-1, 2].includes(this.userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(this.userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (this.accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (this.userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
center: true
}).then(res => {
vk.navigateTo('/pages/enquiry/quote?enquiryId=' + this.enquiryId);
type: 'warning'
})
return
}
});
if (this.sheet.earnestMoney && this.sheet.earnestMoney > 0 && this.userInfo.paidEnsure < this.sheet.earnestMoney) {
this.$confirm('保证金不足,是否去充值保证金?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=grade'});
})
return
}
vk.navigateTo('/pages/enquiry/quote?enquiryId=' + this.enquiryId);
}
},
/**
* 获取询价单详情
@@ -388,23 +589,12 @@ export default {
_id: this.enquiryId
},
success: (res) => {
const {
productList
} = res.data
let title = []
productList.forEach(item => {
const keys = Object.keys(item.extraAttributes)
keys.forEach(citem => {
item.extraAttributes[citem] = JSON.parse(item.extraAttributes[
citem])
})
title.push(item.goodsName)
})
this.productList = productList
delete res.data.productList
this.sheet = {...res.data, ...{title: title.join()}}
this.sheet = res.data
this.sheet.disabled = (!this.sheet.answerEndTime || dayjs(this.sheet.answerEndTime).isBefore(dayjs()))
this.sheet.fullAddress = ''
if (this.sheet.deliveryTime) this.sheet.deliveryTime = dayjs(this.sheet.deliveryTime).format('YYYY-MM-DD HH:mm:ss')
this.sheet.fullAddress = (this.sheet.addressRegion && this.sheet.addressRegion.province) ? `${this.sheet.addressRegion.province.name}${this.sheet.addressRegion.city.name}${this.sheet.addressRegion.area.name}` : ''
if (this.sheet.addressRegion.addressDetail) this.list.rows[index].fullAddress += this.sheet.addressRegion.addressDetail
}
});
},
@@ -416,13 +606,27 @@ export default {
quoteId: item._id,
},
success: (data) => {
vk.navigateTo('/pages/contract/index');
this.showDialog = false
if (this.sheet.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.sheet.signMethod === 1) vk.navigateTo('/pages/store/buyer')
else vk.navigateTo('/pages/contract/index?tab=0')
}
this.$message({
type: 'success',
message: '报价确认成功'
})
}
});
},
openDownload(url) {
if (this.sheet.isMine || this.sheet.hasQuote || this.userInfo.userLevel > 0)
window.open(url)
else{
this.$message({
message: '请先完成报价/升级会员'
})
}
}
}
}
+513 -493
View File
File diff suppressed because it is too large Load Diff
+219 -236
View File
@@ -1,42 +1,43 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<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="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="/static/images/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="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true" :query-form-param="queryForm1"></vk-data-table>
</view>
<common-footer></common-footer>
<view class="carousel">
<!-- <el-carousel height="170px">-->
<!-- <el-carousel-item v-for="item in 4" :key="item">-->
<!-- <image class="carousel-img"-->
<!-- src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
<!-- mode="aspectFill"></image>-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<common-swiper page="enquiry-mine" :height="200"/>
<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="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true" :query-form-param="queryForm1"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
@@ -45,237 +46,219 @@ import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
export default {
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
keyword: '',
// 表格相关开始 -----------------------------------------------------------
queryForm1: {
formData: {
userId: vk.getVuex('$user.userInfo._id')
},
columns: [
{key: "userId", title: "发布人ID", type: "text", width: 160, mode: "="},
]
},
table1: {
// 表格数据请求地址
action: "client/enquiry/sheet/pub/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item._id);
}
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('').then(() => {
}).then(() => {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
title: '请求中...',
data: {
_id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
}
},
],
// 表格字段显示规则
columns: [
{
key: "productList",
title: "品名/材质",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
return val.map(item => `${item.goodsName}(${item.materialQuality})`).join("/")
}
},
{
key: "productList",
title: "采购量",
type: "text",
width: 100,
formatter: (val, row, column, index) => {
return val.map(item => item.procureNumber + item.procureUnit).join("/")
}
},
{
key: "productList",
title: "收货地",
type: "text",
minWidth: 200,
formatter: (val, row, column, index) => {
let fullAddress = ""
try {
let provinceIndex = 0, cityIndex = 0, areaIndex = 0
this.provinceData.forEach((item, index) => {
if (row.productList[0].addressRegion !== undefined && parseInt(row.productList[0].addressRegion[0]) === parseInt(item.code)) {
provinceIndex = index
fullAddress = item.name
}
})
this.cityData[provinceIndex].forEach((item, index) => {
if (row.productList[0].addressRegion !== undefined && parseInt(row.productList[0].addressRegion[1]) === parseInt(item.code)) {
cityIndex = index
fullAddress += item.name
}
})
this.areaData[provinceIndex][cityIndex].forEach((item, index) => {
if (row.productList[0].addressRegion !== undefined && parseInt(row.productList[0].addressRegion[2]) === parseInt(item.code)) {
areaIndex = index
fullAddress += item.name
}
})
fullAddress += row.productList[0].addressDetail
} catch (err) {
fullAddress = ""
}
return fullAddress
}
},
{
key: "user",
title: "采购单位",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
if (val.accountType == 1) {
return val.person.personName
} else {
return val.company.companyName
}
}
},
// {
// key: "_add_time_srt",
// title: "添加时间",
// type: "time",
// width: 160
// },
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
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'
})
}
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
keyword: '',
// 表格相关开始 -----------------------------------------------------------
queryForm1: {
formData: {
userId: vk.getVuex('$user.userInfo._id')
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
columns: [
{key: "userId", title: "发布人ID", type: "text", width: 160, mode: "="},
]
},
table1: {
// 表格数据请求地址
action: "client/enquiry/sheet/kh/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item._id);
}
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('如果你要删除此条信息,之前其他客户填写的留言将无法查看', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
title: '请求中...',
data: {
_id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
return arr
}
})
}
},
],
// 表格字段显示规则
columns: [
{
key: "enquiryNo",
title: "单号",
type: "text",
},
{
key: "title",
title: "品名/材质",
type: "text"
},
{
key: "productList",
title: "采购量",
type: "text",
formatter: (val, row, column, index) => {
if (row.fillType === 0) return val.map(item => (item.procureNumber ? item.procureNumber : '') + (item.procureUnit ? item.procureUnit : '')).join("/")
else return row.procureUnit ? `${row.procureNumber}${row.procureUnit}` : ''
}
},
{
key: "addressRegion",
title: "收货地",
type: "text",
formatter: (val, row, column, index) => {
let fullAddress = (val && val.province) ? `${val.province.name}${val.city.name}${val.area.name}` : ''
if (row.addressDetail) fullAddress += ` ${row.addressDetail}`
return fullAddress
}
},
{
key: "user",
title: "采购单位",
type: "text",
formatter: (val, row, column, index) => {
if (!val) return ''
if (val.accountType == 1) {
return val.person.personName
} else {
return val.company.companyName
}
}
},
{
key: "quoteNum",
title: "报价数",
type: "text",
formatter: (val, row, column, index) => {
return `${val}家已报价`
}
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
url: '/pages/enquiry/release'
})
}
},
},
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;
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
display: flex;
.el-tag {
margin-right: 10px;
}
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+217 -167
View File
@@ -1,196 +1,246 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<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="page-main">
<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"
:auto-close="true"
label-width="140px"
@success="onFormSuccess"
></vk-data-form>
</view>
<common-footer></common-footer>
<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="page-main">
<quote-remain-num v-if="reloaded" :amount="sheet.quoteAmount" type="enquiry" :id="enquiryId"/>
<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"
:auto-close="false"
:need-alert="false"
:show-cancel="false"
label-width="160px"
@success="onFormSuccess"
@fail="onFormFail"
>
<template v-slot:totalPrice>
<el-input v-model="form1.data.totalPrice" placeholder="请输入货款总价"
@change="formatNumber"></el-input>
</template>
</vk-data-form>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null
},
// 表单属性
props: {
// 表单请求地址
action: "client/enquiry/quote/kh/addQuote",
// 表单字段显示规则
columns: [
{key: "totalPrice", title: "货款总价", type: "number"},
{key: "totalPriceStr", title: "人民币大写", type: "text"},
{key: "remark", title: "报价单详情", type: "editor"},
],
// 表单验证规则
rules: {
text: [
{required: true, message: "text不能为空", trigger: "change"},
]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
data() {
return {
sheet: null,
enquiryId: null,
reloaded: false,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null,
totalPrice: null,
},
// 表单属性
props: {
// 表单请求地址
action: "client/enquiry/quote/kh/addQuote",
// 表单字段显示规则
columns: [
{
key: "totalPrice",
title: "货款总价(人民币:元)",
type: "html"
},
// 表单相关结束-----------------------------------------------------------
};
},
onLoad(options = {}) {
console.log(options)
const {
enquiryId
} = options
if (!enquiryId) {
vk.navigateTo('/pages/process/sheet/list');
return
}
this.enquiryId = enquiryId
this.form1.data.sheetId = enquiryId
this.getEnquiryDetail()
},
computed: {
totalPriceStr() {
if (this.totalPrice == 0) {
return "零元"
}
return vk.myfn.convertCurrency(this.totalPrice / 100)
}
},
methods: {
onFormSuccess() {
vk.navigateBack()
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.quoteTimes > 3) {
}
this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
center: true
}).then(res => {
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
// data: {
// sheet: this.sheet,
// totalPrice: this.totalPrice
// },
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
}
});
})
},
/**
* 获取询价单详情
*/
getEnquiryDetail() {
vk.callFunction({
url: 'client/enquiry/sheet/pub/getDetail',
title: '请求中...',
data: {
_id: this.enquiryId
},
success: (res) => {
res.data.productList.forEach(item => {
item.unitPrice = 0
const keys = Object.keys(item.extraAttributes)
keys.forEach(citem => {
item.extraAttributes[citem] = JSON.parse(item.extraAttributes[
citem])
})
})
this.sheet = res.data
}
});
// {key: "totalPrice", title: "货款总价(人民币:元)", type: "number", precision: 2},
{
key: "files",
title: "附件",
type: "file",
accept: '.pdf',
tips: '仅支持PDF文档,报价附件将生成标准合同附件,请认真审阅。'
},
{key: "remark", title: "报价单详情", type: "textarea"},
{key: "supplierExt", title: "供应商合同补充条款", type: "textarea", autosize: {minRows: 4, maxRows: 10},},
],
// 表单验证规则
rules: {
totalPrice: [
{required: true, message: "货款总价不能为空", trigger: "change,blur"},
]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
},
// 表单相关结束-----------------------------------------------------------
};
},
onLoad(options = {}) {
console.log(options)
const {
enquiryId
} = options
if (!enquiryId) {
vk.navigateTo('/pages/process/sheet/list');
return
}
this.enquiryId = enquiryId
this.form1.data.sheetId = enquiryId
this.getEnquiryDetail()
},
computed: {
totalPriceStr() {
if (this.totalPrice == 0) {
return "零元"
}
return vk.myfn.convertCurrency(this.totalPrice / 100)
}
},
methods: {
onFormSuccess() {
vk.redirectTo({url: `/pages/enquiry/detail?id=${this.enquiryId}`})
},
onFormFail(data) {
if (data.data.code === 12) {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.redirectTo({url: `/pages/user/user?menu=grade`})
})
} else {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateBack()
})
}
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.remainQuoteNum === 0 || !userInfo.remainQuoteNum) {
}
// this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// center: true
// }).then(res => {
//
// })
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
// data: {
// sheet: this.sheet,
// totalPrice: this.totalPrice
// },
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
},
fail: err => {
console.log(err)
}
})
},
/**
* 获取询价单详情
*/
getEnquiryDetail() {
vk.callFunction({
url: 'client/enquiry/sheet/pub/getDetail',
title: '请求中...',
data: {
_id: this.enquiryId
},
success: (res) => {
this.sheet = res.data
}
});
},
formatNumber(e) {
this.form1.data.totalPrice = parseFloat(this.form1.data.totalPrice).toFixed(2)
}
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
<style lang="scss" scoped>
.page-main {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.description {
margin-bottom: 40px;
width: 800px;
margin-bottom: 40px;
width: 800px;
}
.quote {
display: flex;
align-items: center;
justify-content: space-between;
display: flex;
align-items: center;
justify-content: space-between;
}
.quote-form {
width: 260px;
width: 260px;
}
.form-footer {
height: 40px;
line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
display: block;
height: 40px;
line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
display: block;
}
</style>
+184
View File
@@ -0,0 +1,184 @@
<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="/static/images/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="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: "client/enquiry/quote/kh/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item.sheetId);
}
},
],
// 表格字段显示规则
columns: [
{
key: "sheet.title",
title: "供应标题",
type: "text",
},
{
key: "totalPrice",
title: "金额",
type: "text",
formatter: (val, row, column, index) => {
return `${val}元`
}
},
{
key: "status",
title: "状态",
type: "select",
data: [
{value: 0, label: '待选商'},
{value: 1, label: '已被选商'},
]
},
{
key: "remark",
title: "备注",
type: "text",
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
url: '/pages/enquiry/release'
})
}
},
}
}
</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;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+1089 -886
View File
File diff suppressed because it is too large Load Diff
+1385 -1044
View File
File diff suppressed because it is too large Load Diff
+587 -384
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+260 -206
View File
@@ -1,236 +1,290 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<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="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="/static/images/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="carousel">
<!-- <el-carousel height="170px">-->
<!-- <el-carousel-item v-for="item in 4" :key="item">-->
<!-- <image class="carousel-img"-->
<!-- src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
<!-- mode="aspectFill"></image>-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<common-swiper page="old-mine" :height="200"/>
<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="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns" :customRightBtns="table1.customRightBtns"
:pagination="true" :query-form-param="queryForm1"></vk-data-table>
</view>
<!-- 商品列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true" :query-form-param="queryForm1"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
keyword: '',
// 表格相关开始 -----------------------------------------------------------
queryForm1: {
formData: {
userId: vk.getVuex('$user.userInfo._id')
},
columns: [
{ key:"userId", title:"发布人ID", type:"text", width:160, mode:"=" },
]
},
table1: {
// 表格数据请求地址
action: "client/old/kh/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/index/old/detail?id=' + item._id);
}
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('').then(()=> {
}).then(() => {
vk.callFunction({
url: 'client/old/kh/delete',
title: '请求中...',
data: {
id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
}
},
],
// 表格字段显示规则
columns: [
{
key: "标题",
title: "title",
type: "text",
width: 280
},
{
key: "productList",
title: "所在地",
type: "text",
minWidth: 200,
formatter: (val, row, column, index) => {
let str = ""
try {
str = val.map(item=>{
return item.addressRegion[0].name + "-" + item.addressRegion[1].name
}).join("/")
} catch(err){
str = ""
}
return str
}
},
{
key: "supplier.companyName",
title: "供应商",
type: "text",
},
{
key: "_add_time_srt",
title: "添加时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
export default {
data() {
return {
keyword: '',
// 表格相关开始 -----------------------------------------------------------
queryForm1: {
formData: {
userId: vk.getVuex('$user.userInfo._id')
},
columns: [
{key: "userId", title: "发布人ID", type: "text", width: 160, mode: "="},
]
},
table1: {
// 表格数据请求地址
action: "client/old/kh/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/index/old/detail?id=' + item._id);
}
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('如果你要删除此条信息,之前其他客户填写的留言将无法查看', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.callFunction({
url: 'client/old/kh/delete',
title: '请求中...',
data: {
id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
},
show: (item) => {
console.log(item.status)
return item.status === 0
}
},
],
// 表格字段显示规则
columns: [
{
key: "title",
title: "标题",
type: "text",
width: 280
},
{
key: "addressRegion",
title: "所在地",
type: "text",
minWidth: 200,
formatter: (val, row, column, index) => {
let str = ""
try {
if (row.type === 1) str = (row.deliverAddressRegion && row.deliverAddressRegion.city) ? (row.deliverAddressRegion.province.name + "-" + row.deliverAddressRegion.city.name) : ''
else str = (row.addressRegion && row.addressRegion.city) ? (row.addressRegion.province.name + "-" + row.addressRegion.city.name) : ''
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
// if (row.type === 2) {
// str = row.offerAddressRegion.province.name + row.offerAddressRegion.city.name + row.offerAddressRegion.area.name
// } else if (row.type === 1) {
// str = row.deliverAddressRegion.province.name + row.deliverAddressRegion.city.name + row.deliverAddressRegion.area.name
// } else {
// str = val.province.name + val.city.name + val.area.name
// }
} catch (err) {
str = ""
}
},
methods: {
toRelease() {
return str
}
},
{
key: "quoteNum",
title: "报价数",
type: "text",
formatter: (val, row, column, index) => {
return `${val}家已报价`
}
},
{
key: "type",
title: "类型",
type: "select",
data: [
{value: 0, label: '拍卖'},
{value: 1, label: '采购'},
{value: 2, label: '租赁'},
{value: 3, label: '物资回收'},
]
},
// {
// key: "supplier",
// title: "供应商",
// type: "text",
// formatter: (val, row, column, index) => {
// console.log(val.companyName, val.companyName === '')
// if (val.companyName && val.companyName !== '') return val.companyName
// else return val.personName
// // console.log((val.companyName && val.companyName !== ''), val.companyName)
// // return ((val.companyName && val.companyName !== '') ? val.companyName : val.personName)
// }
// },
{
key: "_add_time_str",
title: "添加时间",
type: "time",
width: 160
},
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/index/old/release'
})
}
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/index/old/release'
})
}
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
}
},
},
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 {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+581 -490
View File
File diff suppressed because it is too large Load Diff
+235
View File
@@ -0,0 +1,235 @@
<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/index/old/old">旧货交易</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>填写报价信息</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="page-main">
<quote-remain-num v-if="reloaded" :amount="sheet.quoteAmount" type="old" :id="id"/>
<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"
:auto-close="false"
label-width="140px"
:show-cancel="false"
@success="onFormSuccess"
>
<template v-slot:totalPrice>
<el-input v-if="sheet.type === 2 && sheet.rentType === 1" v-model="form1.data.totalPrice"
placeholder="请输入询价内容"/>
<el-input v-else v-model="form1.data.totalPrice" placeholder="请输入总价"
@change="formatNumber"></el-input>
</template>
</vk-data-form>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
import dayjs from "dayjs";
export default {
data() {
return {
id: null,
sheet: null,
reloaded: false,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null
},
// 表单属性
props: {
// 表单请求地址
action: "client/old/kh/addQuote",
// 表单字段显示规则
columns: [
{
key: "totalPrice", title: "总价(人民币:元)", type: "number", showRule: () => {
return this.sheet.type !== 2 || (this.sheet.type === 2 && this.sheet.rentType === 0)
}
},
{
key: "totalPrice", title: '简述询价内容', type: "number", showRule: () => {
return this.sheet.type === 2 && this.sheet.rentType === 1
}
},
{key: "files", title: "附件", type: "file", accept: '.pdf'},
{
key: "remark", title: "报价单详情", type: "textarea", showRule: () => {
return this.sheet.type !== 2 || (this.sheet.type === 2 && this.sheet.rentType === 0)
}
},
{
key: "remark", title: "询价详情", type: "textarea", showRule: () => {
return this.sheet.type === 2 && this.sheet.rentType === 1
}
},
{
key: "supplierExt", title: "报价补充条款", type: "textarea", showRule: () => {
return this.sheet.type !== 2 || (this.sheet.type === 2 && this.sheet.rentType === 0)
}
},
],
// 表单验证规则
rules: {
totalPrice: [
{required: true, message: "总价不能为空", trigger: "change,blur"},
]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
},
// 表单相关结束-----------------------------------------------------------
};
},
onLoad(options = {}) {
console.log(options)
const {
id
} = options
if (!id) {
vk.navigateTo('/pages/index/old/old');
return
}
this.id = id
this.form1.data.sheetId = id
this.getDetail()
},
computed: {
totalPriceStr() {
if (this.totalPrice === 0) {
return "零元"
}
return vk.myfn.convertCurrency(this.totalPrice / 100)
}
},
methods: {
getDetail() {
this.reloaded = false
vk.callFunction({
url: 'client/old/pub/getDetail',
title: '请求中...',
data: {
id: this.id
},
success: (res) => {
this.sheet = res
this.reloaded = true
}
}).catch(err => {
if (err.code === -1) {
setTimeout(() => {
vk.navigateBack()
}, 1500)
}
})
},
formatNumber(e) {
this.form1.data.totalPrice = parseFloat(this.form1.data.totalPrice).toFixed(2)
},
onFormSuccess() {
vk.redirectTo({url: `/pages/index/old/detail?id=${this.id}`})
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.quoteTimes > 3) {
}
// this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// center: true
// }).then(res => {
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
// data: {
// sheet: this.sheet,
// totalPrice: this.totalPrice
// },
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
}
});
// })
},
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
<style lang="scss" scoped>
.page-main {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.description {
margin-bottom: 40px;
width: 800px;
}
.quote {
display: flex;
align-items: center;
justify-content: space-between;
}
.quote-form {
width: 260px;
}
.form-footer {
height: 40px;
line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
display: block;
}
</style>
+195
View File
@@ -0,0 +1,195 @@
<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="/static/images/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="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: "client/old/kh/getMyQuoteList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/index/old/detail?id=' + item.sheetId);
}
},
],
// 表格字段显示规则
columns: [
{
key: "sheet.title",
title: "旧货标题",
type: "text",
},
{
key: "sheet.type",
title: "旧货类型",
type: "select",
data: [
{value: 0, label: '拍卖'},
{value: 1, label: '采购'},
{value: 2, label: '租赁'},
{value: 3, label: '物资回收'},
]
},
{
key: "totalPrice",
title: "金额",
type: "text",
formatter: (val, row, column, index) => {
return `${val}元`
}
},
{
key: "status",
title: "状态",
type: "select",
data: [
{value: 0, label: '待选商'},
{value: 1, label: '已被选商'},
]
},
{
key: "remark",
title: "备注",
type: "text",
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
url: '/pages/index/old/release'
})
}
},
}
}
</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;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+136 -33
View File
@@ -1,30 +1,37 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a bg-white">
<image src="/static/images/old/liucheng2.png" class="w-full" mode="widthFix"/>
<view class="p-20">
<el-tabs v-model="activeName" stretch>
<el-tab-pane label="拍卖信息发布" name="0">
<type_0/>
</el-tab-pane>
<el-tab-pane label="采购信息发布" name="1">
<type_1/>
</el-tab-pane>
<el-tab-pane label="承租信息发布" name="2">
<type_2/>
</el-tab-pane>
<el-tab-pane label="物资回收信息发布" name="3">
<type_3/>
</el-tab-pane>
</el-tabs>
</view>
</view>
<gap height="50"/>
<common-footer></common-footer>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a bg-white">
<image src="/static/images/old/liucheng2.png" class="w-full" mode="widthFix"/>
<view class="p-20">
<el-tabs v-model="activeName" stretch>
<el-tab-pane label="拍卖信息发布" name="0">
<type_0 v-if="parseInt(activeName) === 0" :urgentAmount="urgentAmount" :remainOldNum="remainOldNum" :unitList="unitList"
:buyOldNumAmount="buyOldNumAmount" :agreement="agreement"
:commonContractUrl="commonContractUrl" :contactList="contactList"/>
</el-tab-pane>
<el-tab-pane label="采购信息发布" name="1">
<type_1 v-if="parseInt(activeName) === 1" :urgentAmount="urgentAmount" :remainOldNum="remainOldNum"
:buyOldNumAmount="buyOldNumAmount" :agreement="agreement"
:commonContractUrl="commonContractUrl" :contactList="contactList"/>
</el-tab-pane>
<el-tab-pane label="承租、租赁信息发布" name="2">
<type_2 v-if="parseInt(activeName) === 2" :urgentAmount="urgentAmount" :remainOldNum="remainOldNum"
:buyOldNumAmount="buyOldNumAmount" :agreement="agreement"
:commonContractUrl="commonContractUrl" :contactList="contactList"/>
</el-tab-pane>
<el-tab-pane label="物资回收信息发布" name="3">
<type_3 v-if="parseInt(activeName) === 3" :urgentAmount="urgentAmount" :remainOldNum="remainOldNum"
:buyOldNumAmount="buyOldNumAmount" :agreement="agreement" :contactList="contactList"/>
</el-tab-pane>
</el-tabs>
</view>
</view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template>
<script>
@@ -34,13 +41,109 @@ import Type_2 from "./release/type_2.vue";
import Type_3 from "./release/type_3.vue";
export default {
name: "list",
components: {Type_3, Type_2, Type_1, Type_0},
data() {
return {
activeName: '0'
}
name: "list",
components: {Type_3, Type_2, Type_1, Type_0},
data() {
return {
activeName: '0',
urgentAmount: 1,
remainOldNum: vk.getVuex('$user.userInfo.remainOldNum') ? parseInt(vk.getVuex('$user.userInfo.remainOldNum')) : 0,
buyOldNumAmount: 5,
agreement: '',
commonContractUrl: '',
contactList: [],
unitList: [],
}
},
methods: {
async getUrgentAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6587dd2fe0ec19027452c5b5'
},
})
this.urgentAmount = res.content
},
methods: {}
async getBuyOldAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6587dd54189f86d49b3d5ff5'
},
})
this.buyOldNumAmount = res.content
},
async getUnitList() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'a45325976635f10600341a7f2f472cd1'
},
})
this.unitList = res.content.split(',')
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d5b862066f18a4e4a36'
},
})
this.agreement = res.content
},
async getCommonContractUrl() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '657d36befe975f63af1f24e7'
},
})
this.commonContractUrl = res.content
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
},
onLoad() {
this.getUnitList()
this.getUrgentAmount()
this.getBuyOldAmount()
this.getAgreement()
this.getCommonContractUrl()
this.getContactList()
},
onShow() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
this.remainOldNum = data.userInfo.remainOldNum ? parseInt(data.userInfo.remainOldNum) : 0
if (this.remainOldNum === 0) {
this.$confirm('您的旧货发布次数已用完,是否立即购买?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const {data} = await vk.callFunction({
url: 'client/old/kh/buyNum',
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}).catch(() => {
vk.navigateBack()
})
}
}
});
}
}
</script>
</script>
<style>
/deep/ .el-tabs__item.is-active{
font-size: 1.2rem!important;
}
</style>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+371 -197
View File
@@ -1,135 +1,158 @@
<template>
<view class="flex flex-col justify-start items-start">
<text class="text-50">发布我的回收信息</text>
<text class="text-gray">回收信息越完整,成功交易越容易</text>
<el-form ref="form" :model="form" label-width="140px" class="mt-20">
<el-form-item label="信息失效时间:">
<el-date-picker
v-model="form.expiredTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="物资分类:">
<el-radio-group v-model="form.category" size="small">
<el-radio label="机械设备">
<text>机械设备</text>
</el-radio>
<el-radio label="成品钢材">
<text>成品钢材</text>
</el-radio>
<el-radio label="废旧钢材">
<text>废旧钢材</text>
</el-radio>
<el-radio label="旧架子管">
<text>旧架子管</text>
</el-radio>
<el-radio label="旧扣件">
<text>旧扣件</text>
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="信息标题:">
<el-input v-model="form.title" placeholder="一句话简介物资,如拍卖直缝钢管200吨等"/>
</el-form-item>
<el-form-item label="回收方简述:">
<el-input v-model="form.desc" placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
type="textarea" show-word-limit maxlength="300"/>
</el-form-item>
<el-form-item label="回收物实景照片:">
<vk-data-upload v-model="form.files"
accept="image/*">
</vk-data-upload>
</el-form-item>
<el-form-item label="回收单位地址" class="ml-10">
<el-row :gutter="10">
<el-col :span="5">
<el-select v-model="provinceIndex" placeholder="省" @change="selectProvince">
<el-option v-for="(item, index) in provinceData" :key="index" :value="index"
:label="item.name"/>
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="cityIndex" placeholder="市" @change="selectCity">
<template v-if="provinceIndex !== null">
<el-option v-for="(item, index) in cityData[provinceIndex]" :key="index"
:value="index"
:label="item.name"/>
</template>
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="areaIndex" placeholder="区/县" @change="selectArea">
<template v-if="provinceIndex !== null && cityIndex !== null">
<el-option v-for="(item, index) in areaData[provinceIndex][cityIndex]"
:key="index" :value="index"
:label="item.name"/>
</template>
</el-select>
</el-col>
<el-col :span="8">
<el-input v-model="form.addressDetail"
placeholder="详细地址或几公里范围内"></el-input>
</el-col>
</el-row>
</el-form-item>
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
回收单位信息
</view>
</view>
</view>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="公司信息">
<el-input v-model="form.supplier.companyName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司联系方式">
<el-input v-model="form.supplier.contract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="个人信息">
<el-input v-model="form.supplier.personalName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="个人联系方式">
<el-input v-model="form.supplier.personalContract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="授权人姓名">
<el-input v-model="form.supplier.managerName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="授权联系方式">
<el-input v-model="form.supplier.managerContract"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<view class="mt-20 flex justify-start items-center">
<text class="mr-25">您是否对以上信息进行了详细核实:</text>
<el-radio label="是" v-model="checked">
<text>是</text>
</el-radio>
<el-radio label="否" v-model="checked">
<text>否</text>
</el-radio>
</view>
<view class="flex justify-center items-center mt-30 m-a">
<el-button type="primary" :disabled="checked === '否'" @click="publish">立即发布</el-button>
<view class="flex flex-col justify-start items-start">
<text class="text-50">发布我的回收信息</text>
<text class="text-gray">回收信息越完整,成功交易越容易</text>
<el-form ref="form" :model="form" label-width="140px" class="mt-20">
<el-form-item label="信息失效时间:" required>
<el-date-picker
:picker-options="pickerOptions"
v-model="form.expiredTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="物资分类:" required>
<div class="flex justify-start items-center">
<el-cascader :options="cateData" v-model="form.category" :disabled="form.otherCate"
:props="{'label': 'name', 'value': 'name'}"/>
<el-checkbox v-model="form.otherCate" class="mx-20">其他分类</el-checkbox>
<el-input v-model="form.otherCateName" :disabled="!form.otherCate" placeholder="如物资分类选项中不能描述您的信息物资主要内容,请在此用专业或通用术语填写"
class="ml-20"/>
</div>
</el-form-item>
<el-form-item label="信息标题:" required>
<el-input v-model="form.title" placeholder="一句话简介回收内容,如 常年回收 二手、废旧螺纹钢、型材等"/>
</el-form-item>
<el-form-item label="回收方简述:">
<el-input v-model="form.desc" placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
type="textarea" show-word-limit maxlength="300"/>
</el-form-item>
<el-form-item label="回收物实景照片:">
<vk-data-upload v-model="form.files" list-type="text"
accept="image/*">
</vk-data-upload>
</el-form-item>
<el-form-item label="回收单位地址" class="ml-10" required>
<el-row :gutter="10">
<el-col :span="5">
<el-select v-model="provinceIndex" placeholder="省" @change="selectProvince">
<el-option v-for="(item, index) in provinceData" :key="index" :value="index"
:label="item.name"/>
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="cityIndex" placeholder="市" @change="selectCity">
<template v-if="provinceIndex !== null">
<el-option v-for="(item, index) in cityData[provinceIndex]" :key="index"
:value="index"
:label="item.name"/>
</template>
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="areaIndex" placeholder="区/县" @change="selectArea">
<template v-if="provinceIndex !== null && cityIndex !== null">
<el-option v-for="(item, index) in areaData[provinceIndex][cityIndex]"
:key="index" :value="index"
:label="item.name"/>
</template>
</el-select>
</el-col>
<el-col :span="8">
<el-input v-model="form.addressDetail"
placeholder="详细地址或几公里范围内"></el-input>
</el-col>
</el-row>
</el-form-item>
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
回收单位信息
</view>
</view>
</view>
<el-row :gutter="10" v-if="vk.getVuex('$user.userInfo.accountType') === 2">
<el-col :span="12">
<el-form-item label="公司信息">
<el-input v-model="form.supplier.companyName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司联系方式">
<el-input v-model="form.supplier.contract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" v-if="vk.getVuex('$user.userInfo.accountType') === 1">
<el-col :span="12">
<el-form-item label="个人信息">
<el-input v-model="form.supplier.personalName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="个人联系方式">
<el-input v-model="form.supplier.personalContract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12" class="flex justify-start items-center">
<el-form-item label="授权业务咨询人">
<el-select v-model="form.supplier.managerName" placeholder="点击选择业务联系人"
class="w-100p" @change="selectContact">
<el-option
v-for="(item, index) in contactList"
:key="index"
:label="item.name"
:value="item.name">
</el-option>
<view slot="empty" class="text-gray pointer p-20">
<text>无业务联系人,请到</text>
<text class="text-main mx-15" @click="navTo">个人中心</text>
<text>添加</text>
</view>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式">
<el-input v-model="form.supplier.managerContract" type="number" disabled/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<view class="mt-20 flex justify-start items-center">
<text class="mr-25">您是否对以上信息进行了详细核实:</text>
<el-radio label="是" v-model="checked">
<text>是</text>
</el-radio>
<el-radio label="否" v-model="checked">
<text>否</text>
</el-radio>
</view>
<view class="mt-20 flex justify-start items-center">
<text class="mr-25">是否加急({{ urgentAmount }}元/次,将在旧货交易页面加急展示区展示):</text>
<el-radio :label="true" v-model="form.isUrgent">
<text>是</text>
</el-radio>
<el-radio :label="false" v-model="form.isUrgent">
<text>否</text>
</el-radio>
</view>
<view class="my-25 text-main font-bold">本月剩余旧货发布次数:{{ remainOldNum }}</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信旧货交易协议》</span>
</view>
<view class="flex justify-center items-center mt-30 m-a">
<el-button type="primary" :disabled="checked === '否' || !agree" @click="publish">立即发布</el-button>
</view>
<el-dialog title="金久信旧货交易协议" :visible.sync="dialogVisible" width="70%" close-on-press-escape
close-on-click-modal show-close
>
<div v-html="agreement"></div>
</el-dialog>
</view>
</template>
<script>
@@ -138,59 +161,206 @@ import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
export default {
name: "type_3",
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
form: {
type: 3,
category: 0,
files: [],
title: '',
desc: '',
addressRegion: [],
addressDetail: '',
expiredTime: '',
supplier: {
companyName: '',
contract: '',
personalName: '',
personalContract: '',
managerName: '',
managerContract: '',
},
},
provinceIndex: null,
cityIndex: null,
areaIndex: null,
checked: '否'
}
name: "type_3",
props: {
urgentAmount: {
type: Number,
default: 10
},
methods: {
selectProvince(index) {
this.form.addressRegion[0] = this.provinceData[index]
remainOldNum: {
type: Number,
default: 0
},
agreement: {
type: String,
default: ''
},
contactList: {
type: Array,
default: ''
},
},
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
selectCity(index) {
this.form.addressRegion[1] = this.cityData[this.provinceIndex][index]
},
agree: false,
provinceData: provinces,
cityData: citys,
areaData: areas,
allChildCate: [],
cateData: [],
form: {
otherCate: false,
otherCateName: '',
type: 3,
category: 0,
files: [],
title: '',
desc: '',
addressRegion: {},
addressDetail: '',
expiredTime: '',
supplier: {
companyName: '',
contract: '',
personalName: '',
personalContract: '',
managerName: '',
managerContract: '',
},
selectArea(index) {
this.form.addressRegion[2] = this.areaData[this.provinceIndex][this.cityIndex][index]
},
async publish() {
await vk.callFunction({
url: 'client/old/kh/add',
data: this.form
})
this.$message({
message: "提交成功",
type: 'success'
})
vk.navigateBack()
}
isUrgent: false
},
provinceIndex: null,
cityIndex: null,
areaIndex: null,
checked: '否',
dialogVisible: false
}
},
methods: {
selectProvince(index) {
this.form.addressRegion.province = this.provinceData[index]
},
selectCity(index) {
this.form.addressRegion.city = this.cityData[this.provinceIndex][index]
},
selectArea(index) {
this.form.addressRegion.area = this.areaData[this.provinceIndex][this.cityIndex][index]
},
async publish() {
if (this.remainOldNum === 0) {
this.$confirm('您的旧货发布次数已用完,是否立即购买?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async ({confirm}) => {
if (confirm) {
const {data} = await vk.callFunction({
url: 'client/old/kh/buyNum',
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}
})
return
}
if (this.provinceIndex === null || this.cityIndex === null || this.areaIndex === null) return this.$message({
message: "请选择完整的地址",
type: 'warning'
})
if (!this.form.addressDetail) return this.$message({
message: "请填写详细地址",
type: 'warning'
})
if (!this.form.title) return this.$message({
message: "请填写标题",
type: 'warning'
})
if (!this.form.otherCate) {
if (!this.form.category) return this.$message({
message: "请选择分类",
type: 'warning'
})
} else {
if (!this.form.otherCateName) return this.$message({
message: "请输入其他分类",
type: 'warning'
})
this.form.category = ['', this.form.otherCateName]
}
if (!this.form.expiredTime) return this.$message({
message: "请选择失效时间",
type: 'warning'
})
const res = await vk.callFunction({
url: 'client/old/kh/add',
data: this.form
})
localStorage.removeItem("old_3")
this.$message({
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
type: 'success'
})
if (this.form.isUrgent) {
vk.navigateTo({
url: `/pages/index/shop/pay?id=${res.data}`
})
} else {
vk.redirectTo({url: '/pages/index/old/old'});
}
},
showAgreement() {
// this.$confirm(this.agreement, '金久信旧货交易协议', {
// cancelButtonText: '关闭',
// showConfirmButton: false,
// dangerouslyUseHTMLString: true,
// customClass: 'confirm-box'
// })
this.dialogVisible = true
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.form.supplier.managerContract = contact.phone
},
save() {
localStorage.setItem("old_3", JSON.stringify({
form: this.form,
provinceIndex: this.provinceIndex,
cityIndex: this.cityIndex,
areaIndex: this.areaIndex,
}))
this.$message({
message: "已保存",
type: 'success'
})
}
},
mounted() {
vk.callFunction({
url: 'client/old/pub/getTree',
title: '请求中...',
data: {type: 3},
success: (data) => {
this.cateData = data.rows.map(item => {
item.children.forEach(child => {
delete child.children
})
return item
})
}
});
if (vk.getVuex('$user.userInfo.accountType') === 2) {
this.form.supplier.companyName = vk.getVuex('$user.userInfo.company.companyName')
this.form.supplier.contract = vk.getVuex('$user.userInfo.company.mobile')
} else {
this.form.supplier.personalName = vk.getVuex('$user.userInfo.person.personName')
this.form.supplier.personalContract = vk.getVuex('$user.userInfo.person.mobile')
}
if (!!localStorage.getItem("old_3")) {
this.$confirm('您有一份暂存数据,是否恢复?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
const savedData = JSON.parse(localStorage.getItem("old_3"))
this.form = savedData.form
this.provinceIndex = savedData.provinceIndex
this.cityIndex = savedData.cityIndex
this.areaIndex = savedData.areaIndex
})
}
}
}
</script>
@@ -198,38 +368,42 @@ export default {
@import "@/common/css/app.scss";
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: space-between;
justify-content: flex-start;
}
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: $--color-primary;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
}
.form-title {
padding-left: 10px;
color: $--color-primary;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
}
}
.sign-method-header {
width: 120px;
width: 120px;
}
</style>
<style>
/deep/ .input-with-select{
width: 200px;
/deep/ .input-with-select {
width: 200px;
}
/deep/ .input-with-select .el-input-group__append {
background-color: #fff !important;
width: 80px !important;
background-color: #fff !important;
width: 80px !important;
}
.confirm-box .el-dialog {
width: 70%;
}
</style>
+560 -342
View File
@@ -1,191 +1,247 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper>
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="my-20 flex flex-col justify-start items-start">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<view class="flex flex-col justify-start items-start">
<view v-for="(content, contentIndex) in item.contents" :key="contentIndex"
class="mb-40 flex justify-start items-center">
<view class="ml-35">
<text>业务编号:</text>
<text>{{ content.code }}</text>
</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-checkbox v-model="configList[index].contents[contentIndex].checked"
:disabled="!content.amountList || content.amountList.length === 0">
{{ content.title }}
</el-checkbox>
</view>
<view class="flex justify-start items-center ml-35">
<el-select v-model="configList[index].contents[contentIndex].amountIndex"
clearable @change="selectAmount(index, contentIndex, $event)"
:disabled="!content.amountList || content.amountList.length === 0">
<el-option v-for="(amount, amountIndex) in content.amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<text class="ml-35" v-if="content.amountIndex !== null">
{{ content.amountList[content.amountIndex].amount }}元/次
</text>
</view>
</view>
</view>
</view>
<view>备注: {{ item.remark }}</view>
</view>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<common-swiper page="self-support-company-swiper"/>
<view class="flex justify-end items-center text-main pointer my-20 " @click="demoDownload">示例下载</view>
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="server-item my-20 flex flex-col justify-start items-start">
<el-checkbox @change="changeCheck(index, item.name)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<view class="name">{{ item.name }}</view>
<view class="ml-15">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, companyIndex) in companyList" :key="companyIndex">
<el-form-item label="考察对象(个人/企业全称):" required>
<el-input v-model="companyList[companyIndex].name"/>
</el-form-item>
<el-form-item label="考察对象(个人身份证/企业信用代码):">
<el-input v-model="companyList[companyIndex].code"/>
</el-form-item>
<el-form-item label="考察对象(个人/单位)所在地:">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][1]" placeholder="请选择市"
:disabled="addressIndex[companyIndex].length === 0">
<template v-if="addressIndex[companyIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[companyIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][2]" placeholder="请选择区"
:disabled="addressIndex[companyIndex].length === 1">
<template
v-if="addressIndex[companyIndex][0] !== null && addressIndex[companyIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[companyIndex][0]][addressIndex[companyIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="companyList[companyIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="companyList[companyIndex].email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="companyList[companyIndex].wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[companyIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[companyIndex][1]" placeholder="请选择市"
:disabled="receiveAddressIndex[companyIndex].length === 0">
<template v-if="receiveAddressIndex[companyIndex][0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[companyIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[companyIndex][2]" placeholder="请选择区"
:disabled="receiveAddressIndex[companyIndex].length === 1">
<template
v-if="receiveAddressIndex[companyIndex][0] !== null && receiveAddressIndex[companyIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[companyIndex][0]][receiveAddressIndex[companyIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="companyList[companyIndex].receiveAddress" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="申请人:">
<el-input v-model="companyList[companyIndex].requestName"/>
</el-form-item>
<el-form-item label="联系人:">
<el-input v-model="companyList[companyIndex].contactName"/>
</el-form-item>
<el-form-item label="联系方式:">
<el-input v-model="companyList[companyIndex].contact"/>
</el-form-item>
<el-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-start items-center">
<el-input v-model="amount" disabled/>
<view class="ml-20">
<el-button type="primary" @click.native="addCompany">增加考察对象
</el-button>
</view>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeCompany(companyIndex)"
class="ml-20"
:disabled="companyList.length === 1">删除该对象
</el-button>
</view>
</view>
</view>
</el-form-item>
</view>
</el-form>
<view class="mt-40 flex justify-center items-center">
<view class="flex justify-center items-center">
<text>总价:</text>
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
</view>
<view class="ml-35">客服联系方式: 0771-3923001</view>
<view class="server-item-content">
<text class="ml-15">服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable
:disabled="!contentList.includes(index)">
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
<template v-if="item.contentIndex !== null">
<el-select v-model="configList[index].amountIndex"
clearable class="ml-15">
<el-option
v-for="(amount, amountIndex) in item.contents[item.contentIndex].amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
</template>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click="newOrder"
:disabled="companyList.length === 0 || !companyList[0].name">
立即支付
</el-button>
<text>金额:</text>
<view class="ml-15" v-if="item.contentIndex !== null && item.amountIndex!== null">
{{ item.contents[item.contentIndex].amountList[item.amountIndex].amount }}元/次
</view>
<view class="ml-15" v-else>
元/次
</view>
</view>
<view class="remark">备注: {{ item.remark }}</view>
</view>
</el-checkbox>
</view>
<gap/>
<common-footer></common-footer>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, companyIndex) in companyList" :key="companyIndex">
<el-divider>{{ item.name }}</el-divider>
<el-form-item label="考察对象类型:" required>
<el-select v-model="companyList[companyIndex].type" placeholder="请选择考察对象类型">
<el-option label="企业" value="企业"></el-option>
<el-option label="个人" value="个人"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="`考察对象(${item.type}全称):`" required>
<el-input v-model="companyList[companyIndex].name"/>
</el-form-item>
<template v-if="item.type === '个人'">
<el-form-item label="考察对象(个人身份证): " required>
<el-input v-model="companyList[companyIndex].code"/>
</el-form-item>
<el-form-item label="考察对象所在地:" required>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][1]" placeholder="请选择市"
:disabled="addressIndex[companyIndex].length === 0">
<template v-if="addressIndex[companyIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[companyIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][2]" placeholder="请选择区"
:disabled="addressIndex[companyIndex].length === 1">
<template
v-if="addressIndex[companyIndex][0] !== null && addressIndex[companyIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[companyIndex][0]][addressIndex[companyIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="companyList[companyIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
</template>
<el-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-start items-center">
<el-input v-model="amount" disabled/>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeCompany(companyIndex)"
class="ml-20"
:disabled="companyList.length === 1">删除该对象
</el-button>
</view>
</view>
</view>
</el-form-item>
</view>
<el-divider/>
<el-button type="primary" @click.native="addCompany">增加考察对象
</el-button>
<el-form-item label="接收文件电子邮箱:" required>
<el-input v-model="email"/>
</el-form-item>
<el-form-item label="接收文件微信:" required>
<el-input v-model="wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址" required>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[1]" placeholder="请选择市"
:disabled="receiveAddressIndex.length === 0">
<template v-if="receiveAddressIndex[0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[2]" placeholder="请选择区"
:disabled="receiveAddressIndex.length === 1">
<template
v-if="receiveAddressIndex[0] !== null && receiveAddressIndex[1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[0]][receiveAddressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="receiveAddress"
placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<p class="text-main text-25 text-center" style="margin-bottom: 80rpx">接收文件电子邮箱/ 接收文件微信/
接收文件寄件地址,以上三项选填一项即可</p>
<el-row :gutter="10">
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="申请人:" required>
<el-input v-model="requestName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务联系人:" required>
<el-input v-model="contactName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式:" required>
<el-input v-model="contact"/>
</el-form-item>
</el-col>
<!-- <el-col :span="8" class="flex justify-start items-center">-->
<!-- <el-form-item label="业务联系人:" required>-->
<!-- <el-select v-model="contactName" placeholder="点击选择业务联系人"-->
<!-- class="w-100p" @change="selectContact">-->
<!-- <el-option-->
<!-- v-for="(item, index) in contactList"-->
<!-- :key="index"-->
<!-- :label="item.name"-->
<!-- :value="item.name">-->
<!-- </el-option>-->
<!-- <view slot="empty" class="text-gray pointer p-20">-->
<!-- <text>无业务联系人,请到</text>-->
<!-- <text class="text-main mx-15" @click="navTo">个人中心</text>-->
<!-- <text>添加</text>-->
<!-- </view>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" class="flex justify-start items-center">-->
<!-- <el-form-item label="业务咨询联系方式:" required>-->
<!-- <el-input v-model="contact" type="number" disabled/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<!-- <el-form-item label="联系方式:" required>-->
<!-- <el-input v-model="contact" disabled/>-->
<!-- </el-form-item>-->
</el-form>
<view class="mt-40 flex justify-center items-center">
<view class="flex justify-center items-center">
<text>总价:</text>
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
</view>
<view class="ml-35">客服联系方式: 0771-3923001</view>
</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信自营交易协议》</span>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click="newOrder"
:disabled="companyList.length === 0 || !companyList[0].name || !agree">
立即支付
</el-button>
</view>
</view>
</view>
<gap/>
<common-footer></common-footer>
</view>
</template>
<script>
@@ -195,167 +251,329 @@ import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import Gap from "../../../components/gap/gap.vue";
export default {
name: "companyQuote",
components: {Gap},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
list: [
{
image: '/static/images/selfSupport/swiper.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
],
form: {},
configList: [],
checkList: [],
contentList: [],
contentNameList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [[null, null, null]],
receiveAddressDetail: '',
companyList: [
{
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
}
],
}
},
methods: {
async getConfigList() {
const {rows} = await vk.callFunction({
url: 'client/coop/config/pub/getList',
data: {type: 0}
})
if (rows) {
this.configList = rows.map(item => {
item.contents.map(content => {
content.checked = false
content.amountIndex = null
return content
})
return item
})
}
},
addCompany() {
this.companyList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
},
removeCompany(index) {
this.companyList.splice(index, 1)
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
amountList.push(amount._index)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
this.companyList.forEach((item, index) => {
this.companyList[index].addressRegion = {
province: this.provinceData[this.addressIndex[index][0]],
city: this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]],
area: this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]],
}
this.companyList[index].receiveAddressRegion = {
province: this.provinceData[this.receiveAddressIndex[index][0]],
city: this.cityData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]],
area: this.areaData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]][this.receiveAddressIndex[index][2]],
}
})
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
data: {
type: 0,
amountList,
contentList: this.companyList
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
selectAmount(index, contentIndex, e) {
console.log(index, contentIndex, e)
}
},
onLoad() {
this.getConfigList()
},
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
}
})
})
return tmpAmount
},
totalAmount() {
return this.amount * this.companyList.length
name: "companyQuote",
components: {Gap},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
form: {},
configList: [],
checkList: [],
contentList: [],
contentNameList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [null, null, null],
receiveAddressDetail: '',
companyList: [
{
name: '',
code: '',
type: '企业',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
}
],
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
agreement: '',
agree: false,
contactList: []
}
},
methods: {
async getConfigList() {
const {rows} = await vk.callFunction({
url: 'client/coop/config/pub/getList',
data: {type: 0}
})
if (rows) {
this.configList = rows.map(item => {
item.contentIndex = null
item.amountIndex = null
return item
})
}
},
changeCheck(itemIndex, name) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(itemIndex)
this.contentNameList.push(name)
} else {
this.contentList.splice(index, 1)
this.contentNameList.splice(index, 1)
this.configList[itemIndex].contentIndex = null
this.configList[itemIndex].amountIndex = null
}
},
addCompany() {
this.companyList.push({
name: '',
code: '',
type: '企业',
addressRegion: {
province: null,
city: null,
area: null,
},
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
},
removeCompany(index) {
this.companyList.splice(index, 1)
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach((content, contentIndex) => {
if (contentIndex === item.contentIndex && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === item.amountIndex) {
amountList.push(`${content._index},${amount._index}`)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
// if (this.addressIndex[0][2] === null) return this.$message({
// message: '请选择地址',
// type: 'error'
// })
if (!this.email && !this.wechat && this.receiveAddressIndex[0][2] === null) return this.$message({
message: '请选择接收文件地址/微信/邮箱',
type: 'error'
})
this.companyList.forEach((item, index) => {
if (this.addressIndex[index][2]) {
const companyProvince = this.provinceData[this.addressIndex[index][0]]
const companyCity = this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]]
const companyArea = this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]]
this.companyList[index].addressRegion = {
province: {code: companyProvince.code, name: companyProvince.name},
city: {code: companyCity.code, name: companyCity.name},
area: {code: companyArea.code, name: companyArea.name},
}
}
})
for (let i = 0; i < this.companyList.length; i++) {
if (!this.companyList[i].name) return this.$message({
message: '请填写考察对象名称',
type: 'error'
})
if (this.companyList[i].type === '个人') {
if (!this.companyList[i].code) return this.$message({
type: 'error',
message: '请填写考察个人身份证号',
})
if (!this.companyList[i].address) return this.$message({
type: 'error',
message: '请填写个人地址',
})
if (this.addressIndex[i][2] === null) return this.$message({
type: 'error',
message: '请填写个人地址',
})
}
}
if (!this.requestName) return this.$message({
type: 'error',
message: '请填写申请人',
})
if (!this.contactName) return this.$message({
type: 'error',
message: '请填写业务联系人姓名',
})
if (!this.contact) return this.$message({
type: 'error',
message: '请填写联系人电话',
})
if (this.receiveAddressIndex.length > 0 && this.receiveAddressIndex[2] !== null) {
const province = this.provinceData[this.receiveAddressIndex[0]]
const city = this.cityData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]]
const area = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]][this.receiveAddressIndex[2]]
this.receiveAddressRegion = {
province: {code: province.code, name: province.name},
city: {code: city.code, name: city.name},
area: {code: area.code, name: area.name},
}
}
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
title: '提交中...',
data: {
type: 0,
amountList,
contentList: this.companyList,
receiveAddressRegion: this.receiveAddressRegion,
email: this.email,
wechat: this.wechat,
receiveAddress: this.receiveAddress,
requestName: this.requestName,
contactName: this.contactName,
contact: this.contact,
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
showAgreement() {
this.$confirm(this.agreement, '金久信自营交易协议', {
cancelButtonText: '关闭',
showConfirmButton: false,
dangerouslyUseHTMLString: true,
})
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d4c09664c1c8d8e8476'
},
})
this.agreement = res.content
},
demoDownload() {
vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6588642a99c624e89199fbb4'
},
success: res => {
window.open(res.content)
}
})
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.contact = contact.phone
}
},
onLoad() {
const userInfo = vk.getVuex('$user.userInfo')
if (parseInt(userInfo.accountType) === 2) {
this.email = userInfo.company.contactEmail
this.requestName = userInfo.manager.personName
this.contactName = userInfo.manager.personName
this.contact = userInfo.company.mobile
if (userInfo.company && userInfo.company.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.company.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.company.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.company.addressRegion.area.name)
}
if (userInfo.company.addressDetail) this.receiveAddress = userInfo.company.addressDetail
} else {
if (userInfo.businessCard && userInfo.businessCard.email) this.email = userInfo.businessCard.email
this.requestName = userInfo.person.personName
this.contactName = userInfo.person.personName
this.contact = userInfo.person.mobile
if (userInfo.person && userInfo.person.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.person.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.person.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.person.addressRegion.area.name)
}
if (userInfo.person.addressDetail) this.receiveAddress = userInfo.person.addressDetail
}
this.getAgreement()
this.getConfigList()
// this.getContactList()
},
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach((content, contentIndex) => {
if (contentIndex === item.contentIndex && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === item.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
}
})
})
return tmpAmount
},
totalAmount() {
return this.amount * this.companyList.length
}
}
}
</script>
</script>
<style lang="scss" scoped>
.server-item {
background-color: #fbf8f8;
border: 2px solid #fbebf1;
padding: 10px;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
.items-center {
width: 1100px;
display: flex;
justify-content: space-between;
align-items: center;
flex: 1;
view {
width: 300px;
}
.ml-35 {
font-weight: normal;
font-size: 13px;
}
}
.server-item-content {
display: flex;
align-items: center;
width: 600px !important;
}
.remark {
color: #999999;
font-weight: normal;
}
}
.divider-title {
font-size: 17px;
font-weight: bold;
}
</style>
+525
View File
@@ -0,0 +1,525 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<common-swiper page="self-support-quote-swiper"/>
<view class="flex justify-end items-center text-main pointer my-20 " @click="demoDownload">示例下载</view>
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="server-item my-20 flex flex-col justify-start items-start">
<el-checkbox @change="changeCheck(index, item.name)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<view class="name" style="width: 120px;">{{ item.name }}</view>
<view class="ml-15" style="width: 120px;">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
</view>
<view class="server-item-content">
<text class="ml-15">服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable style="width: 200px"
:disabled="!contentList.includes(index)">
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
<template v-if="item.contentIndex !== null">
<el-select v-model="configList[index].amountIndex" @change="changeAmountIndex(index)"
clearable class="ml-15" style="width: 300px">
<el-option
v-for="(amount, amountIndex) in item.contents[item.contentIndex].amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<template v-if="configList[index].amountIndex !== null">
<text class="ml-15">清单单品项数:</text>
<el-input v-model="configList[index].num" style="width: 200px"/>
</template>
</template>
</view>
</view>
<view class="remark">备注: {{ item.remark }}</view>
</view>
</el-checkbox>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, companyIndex) in companyList" :key="companyIndex">
<el-divider>{{ item.name }}</el-divider>
<el-form-item label="产品明细:" required>
<vk-data-upload v-model="companyList[companyIndex].files" list-type="text"
:on-preview="previewUpload"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf">
</vk-data-upload>
</el-form-item>
<el-form-item label="产品应用地址:" required>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][1]" placeholder="请选择市"
:disabled="addressIndex[companyIndex].length === 0">
<template v-if="addressIndex[companyIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[companyIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][2]" placeholder="请选择区"
:disabled="addressIndex[companyIndex].length === 1">
<template
v-if="addressIndex[companyIndex][0] !== null && addressIndex[companyIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[companyIndex][0]][addressIndex[companyIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="companyList[companyIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
</view>
<el-divider/>
<el-form-item label="接收文件电子邮箱:" required>
<el-input v-model="email"/>
</el-form-item>
<el-form-item label="接收文件微信:" required>
<el-input v-model="wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址" required>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[1]" placeholder="请选择市"
:disabled="receiveAddressIndex.length === 0">
<template v-if="receiveAddressIndex[0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[2]" placeholder="请选择区"
:disabled="receiveAddressIndex.length === 1">
<template
v-if="receiveAddressIndex[0] !== null && receiveAddressIndex[1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[0]][receiveAddressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="receiveAddress" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<p class="text-main text-25 text-center" style="margin-bottom: 80rpx">接收文件电子邮箱/ 接收文件微信/
接收文件寄件地址,以上三项选填一项即可</p>
<el-row :gutter="10">
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="申请人:" required>
<el-input v-model="requestName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务联系人:" required>
<el-input v-model="contactName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式:" required>
<el-input v-model="contact"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<view class="mt-40 flex justify-center items-center">
<view class="ml-35">客服联系方式: 0771-3923001</view>
</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信自营交易协议》</span>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click="newOrder"
:disabled="companyList.length === 0 || !agree">
立即提交
</el-button>
</view>
</view>
</view>
<gap/>
<common-footer></common-footer>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import Gap from "../../../components/gap/gap.vue";
export default {
name: "companyQuote",
components: {Gap},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
form: {},
configList: [],
checkList: [],
contentList: [],
contentNameList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [null, null, null],
receiveAddressDetail: '',
companyList: [
{
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
}
],
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
agreement: '',
agree: false,
contactList: []
}
},
methods: {
async getConfigList() {
const {rows} = await vk.callFunction({
url: 'client/coop/config/pub/getList',
data: {type: 2}
})
if (rows) {
this.configList = rows.map(item => {
item.contentIndex = null
item.amountIndex = null
item.num = null
return item
})
}
},
changeCheck(itemIndex, name) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(itemIndex)
this.contentNameList.push(name)
} else {
this.contentList.splice(index, 1)
this.contentNameList.splice(index, 1)
this.configList[itemIndex].contentIndex = null
this.configList[itemIndex].amountIndex = null
}
},
addCompany() {
this.companyList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
},
removeCompany(index) {
this.companyList.splice(index, 1)
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach((content, contentIndex) => {
if (contentIndex === item.contentIndex && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === item.amountIndex) {
amountList.push(`${content._index},${amount._index},${item.num}`)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
if (this.addressIndex[0][2] === null) return this.$message({
message: '请选择地址',
type: 'error'
})
if (!this.email && !this.wechat && this.receiveAddressIndex[0][2] === null) return this.$message({
message: '请选择接收文件地址/微信/邮箱',
type: 'error'
})
this.companyList.forEach((item, index) => {
const companyProvince = this.provinceData[this.addressIndex[index][0]]
const companyCity = this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]]
const companyArea = this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]]
this.companyList[index].addressRegion = {
province: {code: companyProvince.code, name: companyProvince.name},
city: {code: companyCity.code, name: companyCity.name},
area: {code: companyArea.code, name: companyArea.name},
}
})
for (let i = 0; i < this.companyList.length; i++) {
if (!this.companyList[i].files || this.companyList[i].files.length === 0) return this.$message({
message: '请上传产品明细',
type: 'error'
})
if (!this.companyList[i].address) return this.$message({
type: 'error',
message: '请填写产品应用地址',
})
if (this.addressIndex[i][2] === null) return this.$message({
type: 'error',
message: '请填写产品应用地址',
})
}
if (!this.requestName) return this.$message({
type: 'error',
message: '请填写申请人',
})
if (!this.contactName) return this.$message({
type: 'error',
message: '请填写业务联系人姓名',
})
if (!this.contact) return this.$message({
type: 'error',
message: '请填写联系人电话',
})
if (this.receiveAddressIndex.length > 0 && this.receiveAddressIndex[2] !== null) {
const province = this.provinceData[this.receiveAddressIndex[0]]
const city = this.cityData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]]
const area = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]][this.receiveAddressIndex[2]]
this.receiveAddressRegion = {
province: {code: province.code, name: province.name},
city: {code: city.code, name: city.name},
area: {code: area.code, name: area.name},
}
}
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
title: '提交中...',
data: {
type: 2,
amountList,
contentList: this.companyList,
receiveAddressRegion: this.receiveAddressRegion,
email: this.email,
wechat: this.wechat,
receiveAddress: this.receiveAddress,
requestName: this.requestName,
contactName: this.contactName,
contact: this.contact,
}
})
this.$message({
type: 'success',
message: '已提交',
})
vk.navigateBack()
},
showAgreement() {
this.$confirm(this.agreement, '金久信自营交易协议', {
cancelButtonText: '关闭',
showConfirmButton: false,
dangerouslyUseHTMLString: true,
})
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d4c09664c1c8d8e8476'
},
})
this.agreement = res.content
},
demoDownload() {
vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6588642a99c624e89199fbb4'
},
success: res => {
window.open(res.content)
}
})
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.contact = contact.phone
},
changeAmountIndex(configIndex) {
const config = this.configList[configIndex]
if (config.contentIndex !== null && config.amountIndex !== null) {
this.configList[configIndex].num = config.contents[config.contentIndex].amountList[config.amountIndex].defaultNum
}
},
previewUpload({url}) {
window.open(url)
}
},
onLoad() {
const userInfo = vk.getVuex('$user.userInfo')
// console.log('userInfo', userInfo)
if (parseInt(userInfo.accountType) === 2) {
this.email = userInfo.company.contactEmail
this.requestName = userInfo.manager.personName
this.contactName = userInfo.manager.personName
this.contact = userInfo.company.mobile
if (userInfo.company && userInfo.company.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.company.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.company.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.company.addressRegion.area.name)
}
if (userInfo.company.addressDetail) this.receiveAddress = userInfo.company.addressDetail
} else {
if (userInfo.businessCard && userInfo.businessCard.email) this.email = userInfo.businessCard.email
this.requestName = userInfo.person.personName
this.contactName = userInfo.person.personName
this.contact = userInfo.person.mobile
if (userInfo.person && userInfo.person.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.person.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.person.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.person.addressRegion.area.name)
}
if (userInfo.person.addressDetail) this.receiveAddress = userInfo.person.addressDetail
}
this.getAgreement()
this.getConfigList()
// this.getContactList()
},
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach((content, contentIndex) => {
if (contentIndex === item.contentIndex && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === item.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
}
})
})
return tmpAmount
},
totalAmount() {
return this.amount * this.companyList.length
}
}
}
</script>
<style lang="scss" scoped>
.server-item {
background-color: #fbf8f8;
border: 2px solid #fbebf1;
padding: 10px;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
.items-center {
width: 1100px;
display: flex;
justify-content: space-between;
align-items: center;
flex: 1;
view {
width: 300px;
}
.ml-35 {
font-weight: normal;
font-size: 13px;
}
}
.server-item-content {
display: flex;
align-items: center;
flex: 1;
//width: 600px !important;
}
.remark {
color: #999999;
font-weight: normal;
}
}
.divider-title {
font-size: 17px;
font-weight: bold;
}
</style>
+593 -344
View File
@@ -1,193 +1,270 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper>
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="my-20 flex flex-col justify-start items-start">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<view class="flex flex-col justify-start items-start">
<view v-for="(content, contentIndex) in item.contents" :key="contentIndex"
class="mb-40 flex justify-start items-center">
<view class="ml-35">
<text>业务编号:</text>
<text>{{ content.code }}</text>
</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-checkbox v-model="configList[index].contents[contentIndex].checked"
@change="selectContent(content)"
:disabled="!content.amountList || content.amountList.length === 0">
{{ content.title }}
</el-checkbox>
</view>
<view class="flex justify-start items-center ml-35">
<el-select v-model="configList[index].contents[contentIndex].amountIndex"
clearable
:disabled="!content.amountList || content.amountList.length === 0">
<el-option v-for="(amount, amountIndex) in content.amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<text class="ml-35" v-if="content.amountIndex !== null">
{{ content.amountList[content.amountIndex].amount }}元/次
</text>
</view>
</view>
</view>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<common-swiper page="self-support-product-swiper"/>
<view class="flex justify-end items-center text-main pointer my-20 " @click="demoDownload">示例下载</view>
</view>
<view>备注: {{ item.remark }}</view>
</view>
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="server-item my-20 flex flex-col justify-start items-start">
<el-checkbox @change="changeCheck(index, item.name)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<view class="name">{{ item.name }}</view>
<view class="ml-15">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, productIndex) in productList" :key="productIndex">
<el-form-item label="检测产品:" required>
<el-input v-model="productList[productIndex].name"/>
</el-form-item>
<el-form-item label="检测内容">
{{ contentNameList.join() }}
</el-form-item>
<el-form-item label="取样所在地">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][1]" placeholder="请选择市"
:disabled="addressIndex[productIndex].length === 0">
<template v-if="addressIndex[productIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[productIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][2]" placeholder="请选择区"
:disabled="addressIndex[productIndex].length === 1">
<template
v-if="addressIndex[productIndex][0] !== null && addressIndex[productIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[productIndex][0]][addressIndex[productIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="productList[productIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="productList[productIndex].email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="productList[productIndex].wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[productIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[productIndex][1]" placeholder="请选择市"
:disabled="receiveAddressIndex[productIndex].length === 0">
<template v-if="receiveAddressIndex[productIndex][0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[productIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[productIndex][2]" placeholder="请选择区"
:disabled="receiveAddressIndex[productIndex].length === 1">
<template
v-if="receiveAddressIndex[productIndex][0] !== null && receiveAddressIndex[productIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[productIndex][0]][receiveAddressIndex[productIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="productList[productIndex].receiveAddress" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="申请人:">
<el-input v-model="productList[productIndex].requestName"/>
</el-form-item>
<el-form-item label="联系人:">
<el-input v-model="productList[productIndex].contactName"/>
</el-form-item>
<el-form-item label="联系方式:">
<el-input v-model="productList[productIndex].contact"/>
</el-form-item>
<el-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-start items-center">
<el-input v-model="amount" disabled/>
<view class="ml-20">
<el-button type="primary" @click.native="addProduct">增加考察对象
</el-button>
</view>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeProduct(productIndex)"
class="ml-20"
:disabled="productList.length === 1">删除该对象
</el-button>
</view>
</view>
</view>
</el-form-item>
</view>
</el-form>
<view class="mt-40 flex justify-center items-center">
<view class="flex justify-center items-center">
<text>总价:</text>
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
</view>
<view class="ml-35">客服联系方式: 0771-3923001</view>
<view class="server-item-content">
<text class="ml-15">服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable
:disabled="!contentList.includes(index)">
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
<template v-if="item.contentIndex !== null">
<el-select v-model="configList[index].amountIndex"
clearable class="ml-15">
<el-option
v-for="(amount, amountIndex) in item.contents[item.contentIndex].amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
</template>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click.native="newOrder"
:disabled="productList.length === 0 || !productList[0].name">
立即支付
</el-button>
<text>金额:</text>
<view class="ml-15" v-if="item.contentIndex !== null && item.amountIndex !== null">
{{ item.contents[item.contentIndex].amountList[item.amountIndex].amount }}元/次
</view>
<view class="ml-15" v-else>
元/次
</view>
<el-button type="primary" size="small"
@click="addToAmountList(index, configList[index].contentIndex, item.amountIndex)"
:disabled="item.amountIndex === null">
添加
</el-button>
</view>
<view class="remark">备注: {{ item.remark }}</view>
</view>
</el-checkbox>
</view>
<gap/>
<common-footer></common-footer>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, productIndex) in productList" :key="productIndex">
<el-form-item label="检测产品:" required>
<el-input v-model="productList[productIndex].name"/>
</el-form-item>
<el-form-item label="文档上传:">
<vk-data-upload v-model="productList[productIndex].files" list-type="text"
:on-preview="previewUpload"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf">
</vk-data-upload>
</el-form-item>
<el-form-item label="检测内容">
{{ contentNameList.join() }}
</el-form-item>
<el-form-item label="取样所在地">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][1]" placeholder="请选择市"
:disabled="addressIndex[productIndex].length === 0">
<template v-if="addressIndex[productIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[productIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][2]" placeholder="请选择区"
:disabled="addressIndex[productIndex].length === 1">
<template
v-if="addressIndex[productIndex][0] !== null && addressIndex[productIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[productIndex][0]][addressIndex[productIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="productList[productIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-start items-center">
<el-input v-model="amount" disabled/>
</view>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeProduct(productIndex)"
class="ml-20"
:disabled="productList.length === 1">删除该对象
</el-button>
</view>
</view>
</el-form-item>
<el-divider/>
</view>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[1]" placeholder="请选择市"
:disabled="receiveAddressIndex.length === 0">
<template v-if="receiveAddressIndex[0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[2]" placeholder="请选择区"
:disabled="receiveAddressIndex.length === 1">
<template
v-if="receiveAddressIndex[0] !== null && receiveAddressIndex[1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[0]][receiveAddressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="receiveAddress"
placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<p class="text-main text-25 text-center" style="margin-bottom: 80rpx">接收文件电子邮箱/ 接收文件微信/
接收文件寄件地址,以上三项选填一项即可</p>
<!-- <el-form-item label="申请人:">-->
<!-- <el-input v-model="requestName"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="联系人:">-->
<!-- <el-input v-model="contactName"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="联系方式:">-->
<!-- <el-input v-model="contact"/>-->
<!-- </el-form-item>-->
<el-row :gutter="10">
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="申请人:" required>
<el-input v-model="requestName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务联系人:" required>
<el-input v-model="contactName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式:" required>
<el-input v-model="contact"/>
</el-form-item>
</el-col>
<!-- <el-col :span="8" class="flex justify-start items-center">-->
<!-- <el-form-item label="联系人:" required>-->
<!-- <el-select v-model="contactName" placeholder="点击选择业务联系人"-->
<!-- class="w-100p" @change="selectContact">-->
<!-- <el-option-->
<!-- v-for="(item, index) in contactList"-->
<!-- :key="index"-->
<!-- :label="item.name"-->
<!-- :value="item.name">-->
<!-- </el-option>-->
<!-- <view slot="empty" class="text-gray pointer p-20">-->
<!-- <text>无业务联系人,请到</text>-->
<!-- <text class="text-main mx-15" @click="navTo">个人中心</text>-->
<!-- <text>添加</text>-->
<!-- </view>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" class="flex justify-start items-center">-->
<!-- <el-form-item label="业务咨询联系方式:" required>-->
<!-- <el-input v-model="contact" type="number" disabled/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-form-item label="备注:">
<el-input v-model="remark"/>
</el-form-item>
<el-button type="primary" @click.native="addProduct">增加考察对象
</el-button>
</el-form>
<view class="mt-20">
<view>已选项目:</view>
<view v-for="(item, index) in amountList" :key="index" class="mt-20 flex justify-start items-center">
<el-button type="primary" size="small" @click="removeFromAmountList(index)">删除</el-button>
<p class="ml-20">{{ configList[item.index].name }} -- {{ configList[item.index].contents[item.contentIndex].title }} --
{{
configList[item.index].contents[item.contentIndex].amountList[item.amountIndex].title
}},{{ configList[item.index].contents[item.contentIndex].amountList[item.amountIndex].amount }}元</p>
</view>
</view>
<view class="mt-40 flex justify-center items-center">
<view class="flex justify-center items-center">
<text>总价:</text>
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
</view>
<view class="ml-35">客服联系方式: 0771-3923001</view>
</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信自营交易协议》</span>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click.native="newOrder"
:disabled="productList.length === 0 || !productList[0].name || !agree">
立即支付
</el-button>
</view>
</view>
</view>
<gap/>
<common-footer></common-footer>
</view>
</template>
<script>
@@ -196,168 +273,340 @@ import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
export default {
name: "productQuote",
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
list: [
{
image: '/static/images/selfSupport/swiper.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
],
form: {},
configList: [],
checkList: [],
contentList: [],
contentNameList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [[null, null, null]],
receiveAddressDetail: '',
productList: [
{
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
}
],
}
},
methods: {
async getConfigList() {
const {rows} = await vk.callFunction({
url: 'client/coop/config/pub/getList',
data: {type: 1}
})
if (rows) {
this.configList = rows.map(item => {
item.contents.map(content => {
content.checked = false
content.amountIndex = null
return content
})
return item
})
}
},
addProduct() {
this.productList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
},
removeProduct(index) {
this.productList.splice(index, 1)
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
selectContent(content) {
const index = this.contentNameList.indexOf(content.title)
if (index === -1) this.contentNameList.push(content.title)
else this.contentNameList.splice(index, 1)
},
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
amountList.push(amount._index)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
this.productList.forEach((item, index) => {
this.productList[index].addressRegion = {
province: this.provinceData[this.addressIndex[index][0]],
city: this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]],
area: this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]],
}
this.productList[index].receiveAddressRegion = {
province: this.provinceData[this.receiveAddressIndex[index][0]],
city: this.cityData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]],
area: this.areaData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]][this.receiveAddressIndex[index][2]],
}
})
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
data: {
type: 1,
amountList,
contentList: this.productList
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
},
onLoad() {
this.getConfigList()
},
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
}
})
})
return tmpAmount
},
totalAmount() {
return this.amount * this.productList.length
name: "productQuote",
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
form: {},
configList: [],
checkList: [],
contentList: [],
contentNameList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [null, null, null],
receiveAddressDetail: '',
productList: [
{
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
}
],
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
remark: '',
agreement: '',
agree: false,
contactList: [],
files: [],
amountList: []
}
},
methods: {
async getConfigList() {
const {rows} = await vk.callFunction({
url: 'client/coop/config/pub/getList',
data: {type: 1}
})
if (rows) {
this.configList = rows.map(item => {
item.contentIndex = null
item.amountIndex = null
return item
})
}
},
addProduct() {
this.productList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
})
this.addressIndex.push([null, null, null])
},
removeProduct(index) {
this.productList.splice(index, 1)
this.addressIndex.splice(index, 1)
},
addToAmountList(index, contentIndex, amountIndex) {
this.amountList.push({
index,
contentIndex,
amountIndex,
contentIndexVal: this.configList[index].contents[contentIndex]._index,
amountIndexVal: this.configList[index].contents[contentIndex].amountList[amountIndex]._index,
amount: this.configList[index].contents[contentIndex].amountList[amountIndex].amount
})
this.configList[index].contentIndex = null
this.configList[index].amountIndex = null
},
removeFromAmountList(index) {
this.amountList.splice(index, 1)
},
async newOrder() {
// const amountList = []
// this.configList.forEach(item => {
// item.contents.forEach((content, contentIndex) => {
// if (contentIndex === item.contentIndex && content.amountList.length > 0) {
// content.amountList.forEach((amount, amountIndex) => {
// if (amountIndex === item.amountIndex) {
// amountList.push(`${content._index},${amount._index}`)
// }
// })
// }
// })
// })
if (this.amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
if (!this.email && !this.wechat && this.receiveAddressIndex[0][2] === null) return this.$message({
message: '请选择接收文件地址/微信/邮箱',
type: 'error'
})
if (!this.requestName) return this.$message({
type: 'error',
message: '请填写申请人',
})
if (!this.contactName) return this.$message({
type: 'error',
message: '请填写联系人姓名',
})
if (!this.contact) return this.$message({
type: 'error',
message: '请填写联系人电话',
})
for (let i = 0; i < this.productList.length; i++) {
if (!this.productList[i].name) return this.$message({
message: '请填写考察产品名称',
type: 'error'
})
if (!this.productList[i].address) return this.$message({
type: 'error',
message: '请填写考察产品地址',
})
if (this.addressIndex[i][2] === null) return this.$message({
type: 'error',
message: '请填写考察产品地址',
})
}
if (this.receiveAddressIndex.length > 0 && this.receiveAddressIndex[2] !== null) {
const province = this.provinceData[this.receiveAddressIndex[0]]
const city = this.cityData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]]
const area = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]][this.receiveAddressIndex[2]]
this.receiveAddressRegion = {
province: {code: province.code, name: province.name},
city: {code: city.code, name: city.name},
area: {code: area.code, name: area.name},
}
}
this.productList.forEach((item, index) => {
const companyProvince = this.provinceData[this.addressIndex[index][0]]
const companyCity = this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]]
const companyArea = this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]]
this.productList[index].addressRegion = {
province: {code: companyProvince.code, name: companyProvince.name},
city: {code: companyCity.code, name: companyCity.name},
area: {code: companyArea.code, name: companyArea.name},
}
})
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
title: '请求中...',
data: {
type: 1,
amountList: this.amountList.map(item => `${item.contentIndexVal},${item.amountIndexVal}`),
contentList: this.productList,
receiveAddressRegion: this.receiveAddressRegion,
email: this.email,
wechat: this.wechat,
receiveAddress: this.receiveAddress,
requestName: this.requestName,
contactName: this.contactName,
contact: this.contact,
remark: this.remark,
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
changeCheck(itemIndex, name) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(itemIndex)
this.contentNameList.push(name)
} else {
this.contentList.splice(index, 1)
this.contentNameList.splice(index, 1)
this.configList[itemIndex].contentIndex = null
this.configList[itemIndex].amountIndex = null
}
},
showAgreement() {
this.$confirm(this.agreement, '金久信自营交易协议', {
cancelButtonText: '关闭',
showConfirmButton: false,
dangerouslyUseHTMLString: true,
})
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d4c09664c1c8d8e8476'
},
})
this.agreement = res.content
},
demoDownload() {
vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6588648da7c432e4a360bb34'
},
success: res => {
window.open(res.content)
}
})
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.contact = contact.phone
},
previewUpload({url}) {
window.open(url)
}
},
onLoad() {
const userInfo = vk.getVuex('$user.userInfo')
// console.log('userInfo', userInfo)
if (parseInt(userInfo.accountType) === 2) {
this.email = userInfo.company.contactEmail
this.requestName = userInfo.manager.personName
this.contactName = userInfo.manager.personName
this.contact = userInfo.company.mobile
if (userInfo.company && userInfo.company.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.company.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.company.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.company.addressRegion.area.name)
}
if (userInfo.company.addressDetail) this.receiveAddress = userInfo.company.addressDetail
} else {
if (userInfo.businessCard && userInfo.businessCard.email) this.email = userInfo.businessCard.email
this.requestName = userInfo.person.personName
this.contactName = userInfo.person.personName
this.contact = userInfo.person.mobile
if (userInfo.person && userInfo.person.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.person.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.person.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.person.addressRegion.area.name)
}
if (userInfo.person.addressDetail) this.receiveAddress = userInfo.person.addressDetail
}
this.getConfigList()
this.getAgreement()
// this.getContactList()
},
computed: {
amount() {
let tmpAmount = 0
// this.configList.forEach(item => {
// item.contents.forEach((content, contentIndex) => {
// if (contentIndex === item.contentIndex && content.amountList.length > 0) {
// content.amountList.forEach((amount, amountIndex) => {
// if (amountIndex === item.amountIndex) {
// tmpAmount += parseFloat(amount.amount)
// }
// })
// }
// })
// })
this.amountList.forEach(item => {
tmpAmount += item.amount
})
return tmpAmount
},
totalAmount() {
return this.amount * this.productList.length
}
}
}
</script>
</script>
<style lang="scss" scoped>
.server-item {
background-color: #fbf8f8;
border: 2px solid #fbebf1;
padding: 10px;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
.items-center {
width: 1100px;
display: flex;
justify-content: space-between;
align-items: center;
flex: 1;
view {
width: 300px;
}
.ml-35 {
font-weight: normal;
font-size: 13px;
}
}
.server-item-content {
display: flex;
align-items: center;
width: 600px !important;
}
.remark {
color: #999999;
font-weight: normal;
}
}
.divider-title {
font-size: 17px;
font-weight: bold;
}
</style>
+214
View File
@@ -0,0 +1,214 @@
<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/self-support/self-support">金久信自营</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>填写报价信息</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="page-main">
<quote-remain-num v-if="reloaded"/>
<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"
:auto-close="false"
:show-cancel="false"
label-width="160px"
@success="onFormSuccess"
>
<template v-slot:desc>
<span>{{ sheet.desc }}</span>
</template>
<template v-slot:amount>
<el-input v-model="form1.data.amount" placeholder="请输入货款总价" @change="formatNumber"></el-input>
</template>
<template v-slot:sheetFile="{ row, column, index }">
<p v-for="(item, index) in sheet.files" :key="index" class="text-main">
<a :href="item" target="_blank">预览:文件{{index + 1}}</a>
</p>
</template>
</vk-data-form>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
reloaded: false,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null,
amount: null,
},
// 表单属性
props: {
// 表单请求地址
action: "client/selfSupport/kh/addQuote",
// 表单字段显示规则
columns: [
{key: "sheetFile", title: "询价文件", type: "html"},
{key: "desc", title: "产品描述", type: "html"},
{key: "amount", title: "货款总价(人民币:元)", type: "html"},
{key: "files", title: "附件", type: "file", accept: '.pdf'},
{key: "remark", title: "报价单详情", type: "textarea"},
],
// 表单验证规则
rules: {
amount: [
{required: true, message: "货款总价不能为空", trigger: "change,blur"},
]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
},
// 表单相关结束-----------------------------------------------------------
sheet: null
};
},
onLoad(options = {}) {
console.log(options)
const {
id
} = options
if (!id) {
vk.navigateTo('/pages/self-support/self-support');
return
}
this.enquiryId = id
this.form1.data.sheetId = id
this.getEnquiryDetail()
},
computed: {
totalPriceStr() {
if (this.totalPrice == 0) {
return "零元"
}
return vk.myfn.convertCurrency(this.totalPrice / 100)
}
},
methods: {
onFormSuccess() {
vk.redirectTo({url: `/pages/index/index`})
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.remainQuoteNum === 0 || !userInfo.remainQuoteNum) {
}
// this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// center: true
// }).then(res => {
//
// })
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
// data: {
// sheet: this.sheet,
// totalPrice: this.totalPrice
// },
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
}
});
},
/**
* 获取询价单详情
*/
getEnquiryDetail() {
vk.callFunction({
url: 'client/selfSupport/kh/getDetail',
title: '请求中...',
data: {
_id: this.enquiryId
},
success: (res) => {
this.sheet = res
}
});
},
formatNumber(e){
this.form1.data.amount = parseFloat(this.form1.data.amount).toFixed(2)
}
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
<style lang="scss" scoped>
.page-main {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.description {
margin-bottom: 40px;
width: 800px;
}
.quote {
display: flex;
align-items: center;
justify-content: space-between;
}
.quote-form {
width: 260px;
}
.form-footer {
height: 40px;
line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
display: block;
}
</style>
+79 -28
View File
@@ -1,38 +1,89 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper>
<view class="flex flex-col">
<image src="/static/images/selfSupport/company.jpg" class="w-100p pointer" mode="widthFix"
@click="navTo('/pages/index/self-support/companyQuote')"/>
<image src="/static/images/selfSupport/product.jpg" class="w-100p pointer mt-20" mode="widthFix"
@click="navTo('/pages/index/self-support/productQuote')"/>
</view>
</view>
<common-footer></common-footer>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<!-- <el-carousel :height="`500px`" :style="{width: '1200px'}" class="m-a">-->
<!-- <el-carousel-item v-for="(item, index) in list" :key="index" :style="{width: '1200px'}">-->
<!-- <image :src="item.image" mode="scaleToFill" :style="{width: '1200px', height: '500px'}"/>-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<common-swiper page="self-support-main"/>
<view class="flex flex-col">
<image :src="companyImg" class="w-100p pointer"
style="height: 150px"
@click="navTo('/pages/index/self-support/companyQuote')"/>
<image :src="productImg" class="w-100p pointer mt-20"
style="height: 150px"
@click="navTo('/pages/index/self-support/productQuote')"/>
<image :src="costImg" class="w-100p pointer mt-20"
style="height: 150px"
@click="navTo('/pages/index/self-support/costQuote')"/>
</view>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "selectType",
data() {
return {
list: [
{
image: '/static/images/selfSupport/swiper.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
]
}
},
methods: {
navTo(url) {
vk.navigateTo(url);
name: "selectType",
data() {
return {
list: [
{
image: '/static/images/selfSupport/swiper.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
],
companyImg: '',
productImg: '',
costImg: '',
}
},
methods: {
navTo(url) {
vk.navigateTo(url);
},
async getCompanyImg(){
vk.callFunction({
url: 'client/album/pub/list',
data: {
page: 'self-support-company'
},
success: ({swiper}) => {
this.companyImg = swiper[0]
}
})
},
async getProductImg(){
vk.callFunction({
url: 'client/album/pub/list',
data: {
page: 'self-support-product'
},
success: ({swiper}) => {
this.productImg = swiper[0]
}
})
},
async getCostImg(){
vk.callFunction({
url: 'client/album/pub/list',
data: {
page: 'self-support-quote'
},
success: ({swiper}) => {
this.costImg = swiper[0]
}
})
},
},
onLoad(){
this.getCompanyImg()
this.getProductImg()
this.getCostImg()
}
}
</script>
+344 -186
View File
@@ -1,215 +1,373 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper>
<view class="test">
<text class="pointer" @click="navTo('/pages/index/self-support/self-support')">自营钢城</text>
<text class="pointer" @click="navTo('/pages/index/self-support/selectType')">平台服务</text>
<text class="pointer" @click="navTo('/pages/index/shop/shop')">特产商城</text>
</view>
<view class="tool-bar">
<view class="search">
<text>交易区域:</text>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address"
@change="getCompanyList" clearable/>
</view>
<view class="buy-btn">
<el-button type="primary" plain class="empty-bg-plain-btn" :disabled="address.length === 0"
@click.native="dialogVisible = true">
下单询价>
</el-button>
</view>
</view>
<!-- 合作单位/联营单位-->
<view class="cooperate">
<view class="title">合作单位/联营单位</view>
<u-gap height="5" bg-color="#f3f3f3"/>
<view class="flex justify-start items-start flex-wrap">
<view class="w-25p pointer" v-for="(item, index) in companyList" :key="index">
<view class="border bg-white flex flex-col justify-center items-center p-20">
<image :src="item.businessCard.logo" class="logo"/>
<span class="mt-20 line-1 w-100p text-center">
主营: {{ item.businessCard.mainBusiness }}
</span>
</view>
</view>
</view>
<u-gap height="5" bg-color="#f3f3f3"/>
</view>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200">
<view class="test">
<text class="pointer active" @click="navTo('/pages/index/self-support/self-support')">自营钢城</text>
<text class="pointer" @click="navTo('/pages/index/self-support/selectType')">平台服务</text>
<text class="pointer" @click="navTo('/pages/index/shop/shop')">特产商城</text>
</view>
<common-swiper page="self-support-index"/>
<view class="tool-bar">
<view class="search">
<text>交易区域:</text>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address"
clearable @change="getCompanyList"/>
</view>
<!-- 现货市场 end -->
<gap height="50"/>
<right-bar></right-bar>
<common-footer></common-footer>
<el-dialog
title="下询价单"
:visible.sync="dialogVisible"
width="60%">
<vk-data-upload v-model="files" accept="*">
</vk-data-upload>
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addFiles">确 定</el-button>
</el-dialog>
<view class="flex justify-end items-start">
<view class="flex flex-col justify-center items-center mr-10">
<el-button type="primary" plain class="empty-bg-plain-btn" :disabled="address.length === 0"
@mouseenter.native="showTips = true"
@mouseleave.native="showTips = false"
@click.native="dialogVisible = true">
下单询价>
</el-button>
<text class="text-main mt-10 text-20" v-if="showTips && address.length === 0">请先选择交易区域</text>
</view>
<el-button type="primary" @click.native="getList">
我的询价
</el-button>
</view>
</view>
<!-- 合作单位/联营单位-->
<view class="cooperate">
<view class="title">合作单位/联营单位</view>
<u-gap height="5" bg-color="#f3f3f3"/>
<view class="flex justify-start items-start flex-wrap">
<view class="w-25p pointer" v-for="(item, index) in companyList" :key="index"
@click="navTo(`/pages/yellowPage/info?id=${item.uid}`)">
<view class="border bg-white flex justify-start items-center p-20">
<image v-if="item.businessCard" :src="item.businessCard.logo" class="logo"/>
<image v-else src="/static/images/no-logo.jpg" class="logo" mode="aspectFill"/>
<div class="flex flex-col justify-start items-start ml-20 w-67p">
<span class="text-30 font-bold mb-25">{{ item.company.companyName }}</span>
<span class="mt-20 line-2 w-100p">
主营: {{
(item.mainSpotCategory && item.mainSpotCategory.length > 0) ? item.mainSpotCategory.join() : ''
}}
</span>
</div>
</view>
</view>
</view>
<u-gap height="5" bg-color="#f3f3f3"/>
</view>
</view>
<!-- 现货市场 end -->
<gap height="50"/>
<right-bar></right-bar>
<common-footer></common-footer>
<el-dialog
title="下询价单"
:visible.sync="dialogVisible"
width="60%">
<el-form ref="form" label-width="140px">
<el-form-item label="联系人" required>
<el-select v-model="name" placeholder="点击选择业务联系人"
class="w-100p" @change="selectContact">
<el-option
v-for="(item, index) in contactList"
:key="index"
:label="item.name"
:value="item.name">
</el-option>
<view slot="empty" class="text-gray pointer p-20">
<text>无业务联系人,请到</text>
<text class="text-main mx-15" @click="navToContact">个人中心</text>
<text>添加</text>
</view>
</el-select>
</el-form-item>
<el-form-item label="联系方式" required>
<el-input v-model="phone" placeholder="请输入联系方式" disabled/>
</el-form-item>
<el-form-item label="用户名称" required>
<el-input v-model="company" placeholder="请输入您的名称"/>
</el-form-item>
<el-form-item label="询价单附件" required>
<vk-data-upload v-model="files" list-type="text" accept="*" :on-preview="previewUpload">
</vk-data-upload>
<!-- <p class="text-main text-25">平台目前仅支持PDF文档上传,请你谅解!</p>-->
</el-form-item>
</el-form>
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addFiles">确 定</el-button>
</el-dialog>
<el-dialog title="我的询价单" :visible.sync="showList" width="60%">
<el-table :data="list" style="width: 100%">
<el-table-column prop="name" label="联系人"/>
<el-table-column label="询价区域">
<template #default="{row}">
{{ row.province.name }}{{ row.city.name }}
</template>
</el-table-column>
<el-table-column prop="phone" label="联系方式"/>
<el-table-column prop="company" label="企业名称"/>
<el-table-column label="附件">
<template #default="{row}">
<file-type v-for="(item, index) in row.files" :key="index" :item="item"/>
</template>
</el-table-column>
<el-table-column prop="_add_time_str" label="询价日期"/>
</el-table>
<div class="mt-20 text-center">
<el-button @click="showList = false">关 闭</el-button>
</div>
</el-dialog>
</view>
</template>
<script>
import UGap from "@/uni_modules/vk-uview-ui/components/u-gap/u-gap.vue";
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default {
components: {UGap},
data() {
return {
dialogVisible: false,
address: [],
files: [],
list: [
{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
title: '身无彩凤双飞翼,心有灵犀一点通'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
options: [],
companyList: []
};
},
onLoad(options) {
if (options && options.menu) {
this.currMenu = options.menu
}
this.getCompanyList()
this.options = provinces.map(item => {
item.children = [];
return item
})
this.options.forEach((province, index) => {
citys[index].forEach(city => {
this.options[index].children.push(city)
})
})
},
methods: {
menuSelect(e) {
this.currMenu = e
},
navTo(url) {
vk.navigateTo(url);
},
async getCompanyList() {
const {rows} = await vk.callFunction({
url: 'client/user/pub/getCompany',
data: {
isCoop: 1,
city: this.address.length > 0 ? [this.address[1]] : []
}
})
this.companyList = rows
},
async addFiles() {
await vk.callFunction({
url: 'client/selfSupport/kh/add',
data: {
files: this.files,
city: this.address.length > 0 ? this.address[1] : []
}
})
this.$message({
message: '下单成功',
type: 'success'
})
this.dialogVisible = false
}
components: {FileType, UGap},
data() {
return {
dialogVisible: false,
address: [],
files: [],
options: [],
companyList: [],
name: null,
phone: null,
company: null,
showList: false,
list: [],
allChildCate: [],
contactList: [],
showTips: false
};
},
onLoad(options) {
if (options && options.menu) {
this.currMenu = options.menu
}
this.getCategoryTreeData()
this.options = provinces.map(item => {
item.children = [];
return item
})
this.options.forEach((province, index) => {
citys[index].forEach(city => {
city.children = []
this.options[index].children.push(city)
})
})
this.options.forEach((province, index) => {
citys[index].forEach((city, cityIndex) => {
areas[index][cityIndex].forEach(area => {
this.options[index].children[cityIndex].children.push(area)
})
})
})
this.getContactList()
const user = vk.getVuex('$user.userInfo')
this.company = user.accountType === 2 ? user.company.companyName : user.person.personName
},
methods: {
getCategoryTreeData() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.allChildCate = []
data.rows.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
this.getCompanyList()
}
});
},
menuSelect(e) {
this.currMenu = e
},
navTo(url) {
vk.navigateTo(url);
},
async getCompanyList() {
const {rows} = await vk.callFunction({
url: 'client/user/pub/getCompany',
data: {
isCoop: 1,
province: this.address.length > 0 ? [this.address[0]] : []
}
})
this.companyList = rows.map(item => {
item.name = item.company.companyName
item.mainSpotCategory = []
if (item.company && item.company.mainSpotCategoryIds) {
this.allChildCate.forEach(child => {
if (item.company.mainSpotCategoryIds.includes(child._id)) {
item.mainSpotCategory.push(child.name)
}
})
}
return item
})
},
async addFiles() {
if (!this.name) return this.$message({type: 'error', message: '请输入联系人'})
if (!this.phone) return this.$message({type: 'error', message: '请输入联系方式'})
if (!this.company) return this.$message({type: 'error', message: '请输入您的企业名称'})
if (this.files.length === 0) return this.$message({type: 'error', message: '请上传询价单附件'})
if (!vk.getVuex('$user.userInfo.fadadaConfirm') || [-1, 2].includes(vk.getVuex('$user.userInfo.authStatus'))) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
this.dialogVisible = false
return
}
let city, province
this.options.forEach((provinceItem, index) => {
provinceItem.children.forEach(cityItem => {
if (cityItem.code === this.address[1]) {
city = cityItem
province = {code: provinceItem.code, name: provinceItem.name}
}
})
})
await vk.callFunction({
url: 'client/selfSupport/kh/add',
data: {
files: this.files,
city,
province,
name: this.name,
phone: this.phone,
company: this.company,
}
})
await this.$alert('<p style="text-align: center">您已下单成功,感谢您选择金久信</p><p style="text-align: center">请待平台为您提供竭诚服务!</p><p style="text-align: center; color: red">客服电话:0771-3923001</p>', '', {
dangerouslyUseHTMLString: true,
})
this.dialogVisible = false
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/selfSupport/kh/getList',
})
this.list = rows
this.showList = true
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navToContact() {
this.dialogVisible = false
this.showList = false
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.phone = contact.phone
},
previewUpload({url}) {
window.open(url)
}
}
}
</script>
<style lang="scss">
.w-1200 {
width: 1200px;
margin: 20px auto;
background-color: #fff;
width: 1200px;
margin: 20px auto;
background-color: #fff;
.test {
height: 50px;
color: #ffffff;
font-size: 18px;
background-color: #bf2b28;
display: flex;
align-items: center;
justify-content: center;
.test {
height: 50px;
color: #ffffff;
font-size: 18px;
background-color: #bf2b28;
display: flex;
align-items: center;
justify-content: center;
text {
margin: 0 20px;
}
text:hover {
color: #F2CFCE;
}
text {
padding: 0 20px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.tool-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
font-size: 16px;
.search {
display: flex;
align-items: center;
}
text:hover {
background-color: #690503
}
.cooperate {
.title {
text-align: center;
color: #bf2b28;
font-size: 28px;
line-height: 3em;
}
.wrap {
flex-wrap: wrap;
}
.grid-content {
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
flex-direction: column;
.comments {
line-height: 2em;
}
}
.bg-purple {
border-top: 1px solid #f3f3f3;
border-right: 1px solid #f3f3f3;
.image {
width: 140px;
}
}
.active {
background-color: #941411
}
}
.tool-bar {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 20px;
font-size: 16px;
.search {
display: flex;
align-items: center;
}
}
.cooperate {
.title {
text-align: center;
color: #bf2b28;
font-size: 28px;
line-height: 3em;
}
.wrap {
flex-wrap: wrap;
}
.grid-content {
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
flex-direction: column;
.comments {
line-height: 2em;
}
}
.bg-purple {
border-top: 1px solid #f3f3f3;
border-right: 1px solid #f3f3f3;
.image {
width: 140px;
}
}
}
}
.logo {
width: 80px;
height: 80px;
width: 80px;
height: 80px;
}
</style>
+3 -3
View File
@@ -244,15 +244,15 @@ export default {
data() {
return {
list: [{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
image: '/static/images/swiper_5.png',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
image: '/static/images/swiper_5.png',
title: '身无彩凤双飞翼,心有灵犀一点通'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
image: '/static/images/swiper_5.png',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
+50 -18
View File
@@ -9,11 +9,11 @@
<text class="font-bold text-40">
购物车(全部{{ list.length }})
</text>
<view class="flex justify-end items-center">
<text>已选商品(不含运费)</text>
<text class="text-main text-40 font-bold mx-20">¥{{ amount }}</text>
<el-button type="primary" round>结算</el-button>
</view>
<!-- <view class="flex justify-end items-center">-->
<!-- <text>已选商品(不含运费)</text>-->
<!-- <text class="text-main text-40 font-bold mx-20">¥{{ amount }}</text>-->
<!-- <el-button type="primary" round @click.native="addFromCart">结算</el-button>-->
<!-- </view>-->
</view>
<view class="py-20">
<el-row :gutter="10">
@@ -46,23 +46,24 @@
<view class="flex justify-start items-start">
<el-checkbox v-model="list[index].checked" @change="changeCheck($event, item._id)">
</el-checkbox>
<el-image :src="item.goods.cover" class="cover ml-20" fit="fit"/>
<el-image :src="item.goods.cover" class="cover ml-20" fit="fit"/>
<view class="flex flex-col justify-start items-start ml-20">
{{ item.goods.name }}
<text class="font-bold mb-15">{{ item.goods.name }}</text>
<text class="text-gray">{{ item.sku.label }}</text>
</view>
</view>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">¥{{ item.goods.amount }}</text>
<text class="text-35 font-bold flex-1">¥{{ item.sku.values }}</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">
<el-input-number v-model="list[index].num" @change="changeNum" :min="1" size="small"/>
<el-input-number v-model="list[index].num" @change="changeNum(index)" :min="1" size="small"/>
</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1 text-main">¥{{
parseFloat(item.goods.amount) * item.num
parseFloat(item.sku.values) * item.num
}}
</text>
</el-col>
@@ -72,7 +73,7 @@
</el-row>
</view>
<view class="mt-20 flex justify-between items-center">
<el-button type="text">移出购物车</el-button>
<el-button type="text" @click.native="removeMulti" :disabled="selectedList.length === 0">移出购物车</el-button>
<view class="flex justify-end items-center">
<view>
<text>已选商品</text>
@@ -81,7 +82,7 @@
</view>
<text class="ml-35">合计(不含运费):</text>
<text class="mx-15 font-bold text-40 text-main">¥{{ amount }}</text>
<el-button type="primary" round :disabled="selectedList.length === 0">结算</el-button>
<el-button type="primary" round :disabled="selectedList.length === 0" @click.native="addFromCart">结算</el-button>
</view>
</view>
</view>
@@ -106,18 +107,27 @@ export default {
const {rows} = await vk.callFunction({
url: "client/cart/kh/getList"
})
this.selectedAll = false
this.list = rows.map(item => {
item.checked = false
return item
})
},
doSelectAll() {
this.selectedList = []
this.list.forEach((item, index) => {
this.list[index].checked = this.selectedAll
if (this.selectedAll) this.selectedList.push(item._id)
})
},
changeNum(e) {
console.log(e)
changeNum(index) {
vk.callFunction({
url: "client/cart/kh/changeNum",
data: {
id: this.list[index]._id,
num: this.list[index].num
}
})
},
changeCheck(e, id) {
const index = this.selectedList.indexOf(id)
@@ -126,15 +136,38 @@ export default {
this.selectedAll = this.selectedList.length === this.list.length
},
remove(index) {
this.list.splice(index, 1)
vk.callFunction({
url: "client/cart/kh/delete",
data: {
ids: [this.list[index]._id]
}
})
this.list.splice(index, 1)
},
async removeMulti() {
if (this.selectedList.length === 0) return
await vk.callFunction({
url: "client/cart/kh/delete",
data: {
ids: this.selectedList
}
})
this.selectedList = []
await this.getList()
},
async addFromCart(){
const {data} = await vk.callFunction({
url: "client/order/kh/addFromList",
data: {
type: 0,
ids: this.selectedList
}
})
this.selectedAll = false
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}
},
onShow() {
this.getList()
@@ -143,8 +176,7 @@ export default {
amount() {
let tmpAmount = 0
this.list.forEach(item => {
console.log(item.checked)
if (item.checked) tmpAmount += parseFloat(item.goods.amount) * parseInt(item.num)
if (item.checked) tmpAmount += parseFloat(item.sku.values) * parseInt(item.num)
})
return tmpAmount
}
+210 -112
View File
@@ -1,142 +1,240 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<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/index/shop/shop">特产商城</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item class="text-main">{{ info.name }}</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="bg-white p-40 flex justify-start items-start">
<el-carousel height="400px" class="album">
<el-carousel-item v-for="(item, index) in info.album" :key="index">
<image :src="item" class="album-item" mode="aspectFill"/>
</el-carousel-item>
</el-carousel>
<view class="ml-35 flex flex-col justify-start items-start flex-1">
<view class="font-bold text-40 mb-20">{{ info.name }}</view>
<view class="flex flex-col justify-start items-start flex-1">
<text>产品介绍:</text>
<view class="desc p-20 mt-20">{{ info.desc }}</view>
</view>
<view class="flex justify-between items-center w-100p mt-20">
<view class="flex justify-start items-center">
<text>零售价:</text>
<text class="font-bold text-main">¥{{ info.amount }}</text>
</view>
<view class="flex justify-end is-center">
<el-button type="danger" round class="add-to-cart-btn" @click.native="addToCart">加入购物车</el-button>
<el-button type="primary" round class="ml-35" @click.native="newOrder">立即购买</el-button>
</view>
</view>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<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/index/shop/shop">特产商城</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item class="text-main">{{ info.name }}</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="bg-white p-40 flex justify-start items-start">
<el-carousel height="500px" class="album">
<el-carousel-item v-for="(item, index) in info.album" :key="index">
<image :src="item" class="album-item" mode="aspectFill"/>
</el-carousel-item>
</el-carousel>
<view class="ml-35 flex flex-col justify-start items-start flex-1">
<view class="font-bold text-40 mb-20">{{ info.name }}</view>
<view class="flex flex-col justify-start items-start flex-1">
<text>产品介绍:</text>
<view class="desc p-20 mt-20">{{ info.desc }}</view>
</view>
<view class="flex flex-col items-start justify-start w-100p mt-20">
<view class="flex flex-col justify-start items-start flex-1 mr-25 w-100p">
<view class="flex justify-start items-center">
<text>零售价:</text>
<text class="font-bold text-main">¥{{ info.amount }}</text>
</view>
<view class="flex-1 w-100p" v-if="info.sku">
<view class="w-100p my-25 flex flex-1 justify-center items-center p-15">
<text class="flex-1 text-center">规格/分类/说明</text>
<text class="flex-1 text-center">数量</text>
<text class="flex-1 text-center">价格</text>
</view>
<view class="border my-25 flex justify-center items-center p-15 pointer sku"
v-for="(item, index) in info.sku" :key="index"
:class="[selectedSku === item._index ? 'sku-selected' : '']">
<el-image v-if="item.image" :src="item.image" style="width: 40px; height: 40px"
@click="selectedSku = item._index"/>
<text class="flex-1 text-center" @click="selectedSku = item._index">{{
item.label
}}
</text>
<view class="flex-1 flex justify-center items-center" style="z-index: 999">
<el-input-number v-model="info.sku[index].num" :min="1" size="small"/>
</view>
<text class="flex-1 text-center" @click="selectedSku = item._index">{{
item.values
}}元
</text>
</view>
</view>
</view>
<view class="mt-40">
<view class="intro-title">商品介绍</view>
<view class="intro bg-white" v-html="info.content"></view>
<view class="flex justify-center items-center w-100p mt-20">
<el-button type="danger" round
:class="selectedSku ? 'add-to-cart-btn' : 'add-to-cart-btn-disabled'"
@click.native="addToCart" :disabled="!selectedSku">
加入购物车
</el-button>
<el-button type="primary" round class="ml-35" @click.native="newOrder"
:disabled="!selectedSku">立即购买
</el-button>
</view>
<view class="mt-20 flex justify-start items-center">
<template v-if="info.express">
<transporter theme="outline" size="16" fill="#9b9b9b" strokeLinecap="square"/>
<text class="ml-10">快递:{{ info.express }}</text>
</template>
<text v-if="info.deliverDate" class="ml-35">{{ info.deliverDate }}</text>
<text v-if="info.expressAmount !== undefined && info.expressAmount !== null" class="ml-35">
运费:{{ info.expressAmount === 0 ? '免运费' : info.expressAmount }}
</text>
</view>
<view class="mt-20 flex justify-start items-center" v-if="info.ensureService">
<like theme="outline" size="16" fill="#9b9b9b" strokeLinecap="square"/>
<text class="ml-10">{{ info.ensureService }}</text>
</view>
</view>
</view>
<!-- 现货市场 end -->
<gap height="50"/>
<common-footer></common-footer>
<right-bar></right-bar>
</view>
<view class="mt-40" v-if="info.video">
<view class="intro-title">视频介绍</view>
<video :src="info.video" autoplay controls style="width: 100%; height: 800px"></video>
</view>
<view class="mt-40">
<view class="intro-title">商品介绍</view>
<view class="intro bg-white" v-html="info.content"></view>
</view>
</view>
<!-- 现货市场 end -->
<gap height="50"/>
<common-footer></common-footer>
<right-bar></right-bar>
</view>
</template>
<script>
import UGap from "@/uni_modules/vk-uview-ui/components/u-gap/u-gap.vue";
import {Transporter, Like} from '@icon-park/vue'
export default {
components: {UGap},
data() {
return {
id: null,
info: {
name: ''
}
};
},
onLoad(options) {
if (options && options.id) {
this.id = options.id;
this.getInfo(options.id)
}
},
methods: {
navTo(url) {
vk.navigateTo(url);
},
async getInfo(id) {
this.info = await vk.callFunction({
url: 'client/goods/list/pub/getDetail',
data: {id}
})
},
addToCart(){
vk.callFunction({
url: 'client/cart/kh/add',
data: {
goodsId: this.id,
},
success: (res) => {
this.$message({
type:'success',
message: '添加成功'
})
}
})
},
async newOrder(){
const {data} = await vk.callFunction({
url: 'client/order/kh/add',
data: {
goodsId: this.id,
num: 1,
type: 0
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}
components: {UGap, Transporter, Like},
data() {
return {
id: null,
info: {
name: ''
},
num: 1,
selectedSku: null
};
},
onLoad(options) {
if (options && options.id) {
this.id = options.id;
this.getInfo(options.id)
}
},
methods: {
navTo(url) {
vk.navigateTo(url);
},
async getInfo(id) {
this.info = await vk.callFunction({
url: 'client/goods/list/pub/getDetail',
data: {id}
})
if (this.info.sku && this.info.sku.length > 0) {
this.info.sku.map((sku, index) => {
this.$set(this.info.sku[index], 'num', 1)
return sku
})
this.selectedSku = this.info.sku[0]._index
}
},
addToCart() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm') || ([-1, 2].includes(vk.getVuex('$user.userInfo.authStatus')) && !vk.getVuex('$user.userInfo.userType'))) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
return
}
vk.callFunction({
url: 'client/cart/kh/add',
data: {
goodsId: this.id,
skuId: this.selectedSku,
num: this.info.sku.find(item => item._index === this.selectedSku).num,
},
success: (res) => {
this.$message({
type: 'success',
message: '添加成功'
})
}
})
},
async newOrder() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm') || ([-1, 2].includes(vk.getVuex('$user.userInfo.authStatus')) && !vk.getVuex('$user.userInfo.userType'))) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
return
}
const {data} = await vk.callFunction({
url: 'client/order/kh/add',
title: '请求中...',
data: {
goodsId: this.id,
skuId: this.selectedSku,
num: this.info.sku.find(item => item._index === this.selectedSku).num,
type: 0
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
}
}
</script>
<style lang="scss" scoped>
.album {
width: 500px;
width: 500px;
.album-item {
width: 500px;
height: 400px;
}
.album-item {
width: 500px;
height: 400px;
}
}
.desc {
background-color: #F5E2E3;
background-color: #F5E2E3;
}
.add-to-cart-btn{
background-color: #FF7300;
.add-to-cart-btn {
background-color: #FF7300;
}
.intro-title{
background-color: #EF0021;
padding: 10px 20px;
color: white;
width: 120px;
text-align: center;
.add-to-cart-btn-disabled {
background-color: #f6aa6b;
}
.intro{
border-top: 1px solid #F95F6E;
.intro-title {
background-color: #EF0021;
padding: 10px 20px;
color: white;
width: 120px;
text-align: center;
}
.intro {
border-top: 1px solid #F95F6E;
}
.sku:hover {
background-color: #F5E2E3;
border: 1px solid #EF0021;
}
.sku-selected {
background-color: #F5E2E3;
border: 1px solid #EF0021;
}
</style>
+519 -198
View File
@@ -1,97 +1,202 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a bg-white p-40">
<template v-if="info">
<view class="pb-20 border-bottom flex justify-between items-center">
<text>订单号: {{ info.orderNo }}</text>
<text>下单时间: {{ info._add_time_str }}</text>
</view>
<view class="my-20">
<text class="font-bold text-35">商品详情</text>
<view class="flex justify-start items-start my-20">
<text class="w-15p" v-if="info.type === 0">封面</text>
<text class="w-40p">名称</text>
<text class="w-15p">数量</text>
<text class="w-15p">单价</text>
<text class="w-15p">小计</text>
</view>
<view class="flex justify-start items-start my-20" v-for="(item, index) in info.goods" :key="index">
<text class="w-15p" v-if="info.type === 0">
<image :src="item.goodsCover" mode="aspectFit" class="goods-cover"/>
</text>
<text class="w-40p font-bold text-35">{{ item.goodsName }}</text>
<text class="w-15p">x{{ item.num }}</text>
<text class="w-15p text-main">¥{{ item.goodsPrice }}</text>
<text class="w-15p">{{ item.goodsPrice * item.num }}</text>
</view>
</view>
</template>
<template v-if="info.type === 0">
<el-row :gutter="10" class="mb-20">
<el-col :span="4">
<el-input v-model="name" placeholder="请输入收件人姓名"/>
</el-col>
<el-col :span="4">
<el-input v-model="phone" placeholder="请输入收件人手机号"/>
</el-col>
</el-row>
<el-row :gutter="10" class="border-bottom pb-20">
<el-col :span="4">
<el-select v-model="addressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[1]" placeholder="请选择市"
:disabled="addressIndex.length === 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>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[2]" placeholder="请选择区"
:disabled="addressIndex.length === 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>
</el-col>
<el-col :span="12">
<el-input v-model="addressDetail" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</template>
<view class="mt-20 w-50p flex flex-col justify-center items-center m-a">
<text class="text-main font-bold text-40 mb-20" v-if="info">订单金额:¥{{ info.amount }}</text>
<el-button type="primary" round
:disabled="(info.type === 0 && (!phone || !name || addressIndex.length < 3))" @click="onPay">
立即支付
</el-button>
</view>
<div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">请打开手机微信,扫一扫完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div>
<view>
<top-bar></top-bar>
<!-- <common-header></common-header>-->
<!-- <category-bar></category-bar>-->
<view class="w-1200 m-a bg-white p-40 mt-20">
<template v-if="info">
<view class="pb-20 border-bottom flex justify-between items-center">
<text>订单号: {{ info.orderNo }}</text>
<text>下单时间: {{ info._add_time_str }}</text>
</view>
<gap height="50"/>
<common-footer></common-footer>
<right-bar></right-bar>
<view class="my-20">
<text class="font-bold text-35">商品详情</text>
<view class="flex justify-start items-start my-20">
<text class="w-15p" v-if="info.type === 0">封面</text>
<text class="w-40p">商品详情</text>
<text class="w-15p">数量</text>
<text class="w-15p">单价</text>
<text class="w-15p">小计</text>
</view>
<view class="flex justify-start items-start my-20" v-for="(item, index) in info.goods" :key="index">
<text class="w-15p" v-if="info.type === 0">
<image :src="item.goodsCover" mode="aspectFit" class="goods-cover"/>
</text>
<template v-if="info.type === 0">
<view class="flex flex-col justify-start items-start w-40p">
<text class=" font-bold text-35">{{ item.goodsName }}</text>
<text class="mt-15 text-gray">{{ item.sku.label }}</text>
</view>
<text class="w-15p">x{{ item.num }}</text>
<text class="w-15p text-main">¥{{ item.sku.values }}</text>
<text class="w-15p font-bold">¥{{ item.sku.values * item.num }}</text>
</template>
<template v-else>
<view class="flex flex-col justify-start items-start w-40p">
<text class=" font-bold text-35">{{ item.goodsName }}</text>
</view>
<text class="w-15p">x{{ item.num }}</text>
<text class="w-15p text-main">¥{{ item.goodsPrice }}</text>
<text class="w-15p font-bold">¥{{ item.goodsPrice * item.num }}</text>
</template>
</view>
</view>
</template>
<template v-if="info.type === 0">
<div class="p-20 rounded border m-30 pointer address" v-if="!address" @click="showAddress">
点击选择地址
</div>
<div v-else
class="py-20 flex justify-between items-center">
<div class="flex flex-col justify-start items-start">
<div class="flex justify-start items-center">
<text class="font-bold">{{ address.name }}</text>
</div>
<text>{{ address.phone }}</text>
<text v-if="address.addressRegion && address.addressRegion.province">{{
address.addressRegion.province.name
}}{{
address.addressRegion.city.name
}}{{ address.addressRegion.area.name }}{{ address.addressDetail }}
</text>
<text v-else-if="info.address.province">{{ info.address.province.name }}{{
info.address.city.name
}}{{ info.address.area.name }}{{ info.addressDetail }}
</text>
</div>
<div class="flex justify-center items-center">
<el-button type="primary" @click="showAddress">
变更
</el-button>
</div>
</div>
</template>
<!-- <view class="mt-40 font-bold text-main">您的会员等级:-->
<!-- {{ getUserLevelLabel(vk.getVuex('$user.userInfo.userLevel')) }}-->
<!-- {{ info.offRate !== 100 ? `,享受${info.offRate / 10}折优惠,已为您优惠${info.saveAmount}元` : '' }}-->
<!-- </view>-->
<div v-if="info.type === 0" class="my-20">
<p>备注和要求:</p>
<el-input v-model="remark" type="textarea"/>
</div>
<view class="mt-40 w-50p flex flex-col justify-center items-center m-a">
<text class=" mb-20"
:class="[info.amount !== info.offAmount ? 'text-line-through text-30' : 'text-main font-bold text-40']"
v-if="info">
订单金额:¥{{ info.amount }}
</text>
<text class="text-main font-bold text-40 mb-20" v-if="info && info.amount !== info.offAmount">
优惠后金额:¥{{ parseFloat(info.offAmount).toFixed(2) }}
</text>
<el-button type="primary" round
:disabled="(info.type === 0 && !address)" @click="onPay">
立即支付
</el-button>
</view>
<div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">微信、支付宝、云闪付扫码完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div>
</view>
<gap height="50"/>
<common-footer></common-footer>
<right-bar></right-bar>
<el-dialog :visible.sync="dialogVisible" :title="dialogTitle" width="50%" :close-on-click-modal="false"
@close="dialogVisible = false">
<template v-if="dialogVisible && dialogType === 'address-list'">
<div v-for="(item, index) in addressList" :key="index"
class="py-20 border-bottom flex justify-between items-center">
<div class="flex flex-col justify-start items-start">
<div class="flex justify-start items-center">
<text v-if="item.isDefault" class="default-address">默</text>
<text class="font-bold">{{ item.name }}</text>
</div>
<text>{{ item.phone }}</text>
<text>{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.addressDetail }}
</text>
</div>
<div class="flex justify-center items-center">
<el-button type="primary" @click="address = item; dialogVisible = false" size="small">
选择
</el-button>
<el-button type="warning" @click="addressEdit(item)" plain size="small" class="mt-20">
编辑
</el-button>
</div>
</div>
<div class="text-center">
<el-button plain @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="dialogType = 'address-action'; dialogTitle = '新增地址'">
新增地址
</el-button>
</div>
</template>
<div class="flex flex-col justify-start" v-else-if="dialogVisible && dialogType === 'address-action'">
<el-form ref="form" label-width="100px">
<el-row :gutter="10" class="mb-20">
<el-col :span="12">
<el-form-item label="收件人姓名">
<el-input v-model="name" placeholder="请输入收件人姓名"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收件人手机号">
<el-input v-model="phone" placeholder="请输入收件人手机号"/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="收件人地址">
<el-row :gutter="10">
<el-col :span="6">
<el-select 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>
</el-col>
<el-col :span="6">
<el-select v-model="addressIndex[1]" placeholder="请选择市" class="w-100p"
:disabled="addressIndex.length === 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>
</el-col>
<el-col :span="6">
<el-select v-model="addressIndex[2]" placeholder="请选择区" class="w-100p"
:disabled="addressIndex.length === 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>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="详细地址">
<el-input v-model="addressDetail" placeholder="请输入详细地址"/>
</el-form-item>
<el-form-item label="默认地址">
<el-switch v-model="isDefault"/>
</el-form-item>
</el-form>
<div class="flex justify-center items-center">
<el-button type="primary" @click="onAddressAction">保存</el-button>
<el-button @click="dialogTitle = '地址列表'; dialogType = 'address-list'">取消</el-button>
</div>
</div>
</el-dialog>
</view>
</template>
<script>
@@ -99,131 +204,347 @@ import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import dayjs from "dayjs";
import {Loading} from "element-ui";
import {getUserLevelLabel} from "../../../util";
const OpenSdk = require('../../user/lib/base').default;
const sdk = new OpenSdk({
appId: '10037e6f6823b20801682b6a5e5a0006',
appKey: '1c4e3b16066244ae9b236a09e5b312e8'
// appId: '10037e6f6823b20801682b6a5e5a0006',
// appKey: '1c4e3b16066244ae9b236a09e5b312e8'
// 正式
appId: '8a81c1db8fc5238d01910b9e312d0692',
appKey: 'a15ceac60f5b464eb758c4fe7800ee9f'
// 测试分账
// appId: 'f0ec96ad2c3848b5b810e7aadf369e2f',
// appKey: '775481e2556e4564985f5439a5e6a277'
})
// const mid = '8984501521190CF'
// const tid = '20713432'
const mid = '898450100002303'
const tid = 'G5SBN2XJ'
// const mid = '898310060514001'
// const tid = '00000001'
export default {
name: "order",
data() {
return {
id: null,
info: {
type: null
},
provinceData: provinces,
cityData: citys,
areaData: areas,
addressIndex: [null, null, null],
addressDetail: '',
name: '',
phone: '',
billQRCode: null,
checkPayInterval: null,
}
},
methods: {
async getInfo() {
this.info = await vk.callFunction({
url: 'client/order/kh/getInfo',
data: {
id: this.id
}
})
if (this.info.orderStatus === 1) {
this.$message({
type: 'success',
message: '订单已支付成功'
})
setTimeout(() => {
this.$router.push({
path: '/pages/user/order',
})
}, 1000)
}
},
async onPay() {
if (this.info.type === 0) {
if (this.addressIndex.length > 2 && this.addressIndex[2] === null) {
await vk.callFunction({
url: 'client/order/kh/updateAddress',
data: {
id: this.id,
address: [provinces[this.addressIndex[0]], citys[this.addressIndex[0]][this.addressIndex[1]], areas[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]]],
addressDetail: this.addressDetail,
phone: this.phone,
name: this.name,
}
})
}
}
const requestTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss')
const timestamp = dayjs().format('YYYYMMDDHHmmss')
const goods = []
let goodsName = this.info.goods[0].goodsName
goods.push({goodsName})
if (this.info.goods.length > 1) goodsName += `等${this.info.goods.length - 1}件商品`
let data = {
queryUrl: 'https://test-api-open.chinaums.com/v1/netpay/bills/get-qrcode',
timestamp,
nonce: 'rp84ufhfn20yneo3tp',
content: {
billNo: this.info.orderNo,
requestTimestamp,
mid: '898201612345678',
tid: '88880001',
instMid: 'QRPAYDEFAULT',
totalAmount: 1,
notifyUrl: 'https://fc-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/pay_notify',
goods
}
}
/**
* 调用函数
*/
sdk.exec(data).then(res => {
const h = this.$createElement;
const result = JSON.parse(res);
if (result.errCode === 'SUCCESS') {
this.showQrcode = true
this.billQRCode = result.billQRCode
setTimeout(() => {
this.checkPayInterval = setInterval(() => {
this.getInfo()
}, 1000)
}, 3000)
}
})
},
},
onLoad(options) {
if (options && options.id) {
this.id = options.id
this.getInfo()
}
},
onUnload() {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
name: "order",
data() {
return {
id: null,
info: {
type: null,
offRate: 100
},
provinceData: provinces,
cityData: citys,
areaData: areas,
addressIndex: [null, null, null],
addressDetail: '',
name: '',
phone: '',
billQRCode: null,
checkPayInterval: null,
dialogVisible: false,
dialogTitle: '',
dialogType: '',
address: null,
addressList: [],
selectedAddressId: null,
isDefault: false,
remark: ''
}
},
methods: {
getUserLevelLabel,
async getInfo(resetOrderNo = false) {
this.info = await vk.callFunction({
url: 'client/order/kh/getInfo',
data: {
id: this.id,
resetOrderNo
}
})
if (this.info.name) {
this.address = {
name: this.info.name,
phone: this.info.phone,
addressDetail: this.info.addressDetail,
addressRegion: {
province: this.info.address.province,
city: this.info.address.city,
area: this.info.address.area,
},
}
}
if (this.info.orderStatus === -1) {
this.$message.error('订单已取消')
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
vk.redirectTo({
url: '/pages/order/order?menuIndex=1',
})
}
if ([1, 4].includes(this.info.orderStatus)) {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
this.$message({
type: 'success',
message: '订单已支付成功'
})
setTimeout(() => {
if ([7, 11].includes(this.info.type)) {
vk.navigateBack()
} else if (this.info.type === 13) {
vk.redirectTo({
url: '/pages/contract/index?tab=sign',
})
} else if (this.info.type === 10) {
vk.redirectTo({
url: '/pages/index/old/release',
})
} else {
vk.redirectTo({
url: '/pages/order/order?menuIndex=1',
})
}
}, 1000)
}
},
async onPay() {
if (this.info.type === 0) {
if (!this.address) return this.$message({type: 'error', message: '请选择地址'})
await vk.callFunction({
url: 'client/order/kh/updateAddress',
data: {
id: this.id,
address: {
province: this.address.addressRegion.province,
city: this.address.addressRegion.city,
area: this.address.addressRegion.area,
},
addressDetail: this.address.addressDetail,
phone: this.address.phone,
name: this.address.name,
remark: this.remark,
}
})
}
// await vk.callFunction({
// url: 'client/user/pub/pay',
// data: {
// orderNo: this.info.orderNo,
// billStatus: 'PAID',
// billPayment: JSON.stringify({
// payTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
// receiptAmount: this.info.offAmount * 100,
// paySeqId: 'asdasd'
// })
// }
// })
// this.checkPayInterval = setInterval(() => {
// this.getInfo()
// }, 1000)
// return
const requestTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss')
const timestamp = dayjs().format('YYYYMMDDHHmmss')
// 平台分账金额
let platformAmount = 0
const goodsList = []
// let goodsName = this.info.goods[0].goodsName
// goods.push({goodsName})
// if (this.info.goods.length > 1) goodsName += `等${this.info.goods.length - 1}件商品`
let subOrderAmount = 0
this.info.goods.forEach((goods, index) => {
const goodsData = {
goodsName: goods.goodsName
}
if (goods.company && goods.company.merchantCode && goods.company.settleRate) {
// subOrderAmount += parseInt((goods.company.settleRate * goods.price).toString())
// goodsData['subOrderAmount'] = parseInt((goods.company.settleRate * goods.price).toString())
subOrderAmount += 9
goodsData['subOrderAmount'] = 9
goodsData['subMerchantId'] = goods.company.merchantCode
goodsData['merOrderId'] = this.info.orderNo + index
}
goodsList.push(goodsData)
})
if (subOrderAmount > 0) platformAmount = this.info.offAmount * 100 - subOrderAmount
// let data = {
// queryUrl: 'https://test-api-open.chinaums.com/v1/inip/upsp/shop/csb/get-qrcode',
// sysSource: 'OPT',
// vaMchntNo: mid,
// vaTermNo: tid,
// timestamp,
// nonce: 'rp84ufhfn20yneo3tp',
// billNo: this.info.orderNo,
// totalAmount: 10,
// notifyUrl: 'https://www.jinjiuxinzg.cn/pay_notify',
// vaFld:
// }
let attachedData = this.info.goods[0].goodsName
if (this.info.goods.length > 1) attachedData += `等${this.info.goods.length - 1}件商品`
let data = {
queryUrl: 'https://api-mop.chinaums.com/v1/netpay/bills/get-qrcode',
timestamp,
nonce: 'rp84ufhfn20yneo3tp',
content: {
billNo: this.info.orderNo,
requestTimestamp,
mid,
tid,
instMid: 'QRPAYDEFAULT',
totalAmount: parseInt(this.info.offAmount * 100).toFixed(0),
notifyUrl: 'https://tcb-n44byxi8bmrfrki-d4bn1c4a206d.service.tcloudbase.com/pay_notify',
// notifyUrl: 'https://www.jinjiuxinzg.cn/pay_notify',
goods: goodsList,
attachedData,
billDesc: attachedData,
}
}
if (platformAmount > 0) {
data['divisionFlag'] = true
data['platformAmount'] = platformAmount
}
console.log(data)
/**
* 调用函数
*/
const loadingInstance = Loading.service({fullscreen: true, text: '请求中'});
sdk.exec(data).then(res => {
this.$nextTick(() => {
loadingInstance.close();
});
const h = this.$createElement;
const result = JSON.parse(res);
if (result.errCode === 'SUCCESS') {
this.showQrcode = true
this.billQRCode = result.billQRCode
setTimeout(() => {
this.checkPayInterval = setInterval(() => {
this.getInfo()
}, 1000)
}, 3000)
}
}).catch(err => {
this.$nextTick(() => {
loadingInstance.close();
});
this.$message({
type: 'error',
message: '服务器繁忙,请稍后再试或联系平台客服'
})
setTimeout(() => {
vk.redirectTo({
url: '/pages/order/order?activeName=0&menuIndex=1',
})
}, 1500)
})
},
async onAddressAction() {
if (!this.name) return this.$message({type: 'error', message: '请填写收件人姓名'})
if (!this.phone) return this.$message({type: 'error', message: '请填写收件人手机号'})
if (!this.addressDetail || this.addressIndex[2] === null) return this.$message({
type: 'error',
message: '请填写地址'
})
const province = this.provinceData[this.addressIndex[0]]
const city = this.cityData[this.addressIndex[0]][this.addressIndex[1]]
const area = this.areaData[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]]
this.addressRegion = {
province: {code: province.code, name: province.name},
city: {code: city.code, name: city.name},
area: {code: area.code, name: area.name},
}
await vk.callFunction({
url: 'client/userAddress/kh/addUpdate',
data: {
id: this.selectedAddressId ?? null,
name: this.name,
phone: this.phone,
addressDetail: this.addressDetail,
addressRegion: this.addressRegion,
isDefault: this.isDefault
}
})
this.name = ''
this.phone = ''
this.addressDetail = ''
this.addressIndex = [null, null, null,]
this.dialogType = 'address-list'
this.dialogTitle = '地址列表'
await this.getUserAddress()
},
async getUserAddress() {
const {rows} = await vk.callFunction({
url: 'client/userAddress/kh/getList'
})
this.addressList = rows
},
showAddress() {
this.dialogType = 'address-list'
this.dialogTitle = '选择地址'
this.dialogVisible = true
},
addressEdit(item) {
this.selectedAddressId = item._id
this.name = item.name
this.phone = item.phone
this.addressDetail = item.addressDetail
this.addressIndex[0] = this.provinceData.findIndex(i => i.code === item.addressRegion.province.code)
this.addressIndex[1] = this.cityData[this.addressIndex[0]].findIndex(i => i.code === item.addressRegion.city.code)
this.addressIndex[2] = this.areaData[this.addressIndex[0]][this.addressIndex[1]].findIndex(i => i.code === item.addressRegion.area.code)
this.dialogType = 'address-action';
this.dialogTitle = ' 编辑地址'
}
},
onLoad(options) {
if (options && options.id) {
this.id = options.id
this.getInfo(true)
this.getUserAddress()
}
},
beforeDestroy() {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
},
onUnload() {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
}
}
</script>
<style lang="scss" scoped>
.goods-cover {
width: 100px;
height: 100px;
width: 100px;
height: 100px;
}
.pay-price {
margin-top: 20px;
margin-top: 20px;
}
.pay-desc {
font-size: 16px;
line-height: 2em;
font-size: 16px;
line-height: 2em;
}
.address:hover {
border: 1px solid #a92924;
background-color: #f1c7c7;
}
.default-address {
background-color: #a92924;
color: #fff;
font-size: 14px;
width: 20px;
height: 20px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 5px;
padding: 2px;
}
</style>
+294 -208
View File
@@ -1,63 +1,89 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper>
<view class="tool-bar">
<view class="search">
<text>地区:</text>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address"
@change="getGoodsList()" clearable/>
</view>
<view class="buy-btn">
<image src="https://oss.wsdns.cn/20231204/bcc976f4396e437abf19deb11c1f06b4.png" mode="widthFix"/>
</view>
</view>
<view class="tool-bar">
<view class="item">分类:</view>
<view class="item" @click="selectCate(null)">全部</view>
<view class="item" v-for="(item, index) in categoryList" :key="index"
@click="selectCate(item._id)"
:class="[categoryId === item._id? 'active' : '']">{{ item.name }}
</view>
</view>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200">
<common-swiper page="shop"/>
<view class="tool-bar">
<view class="search">
<el-row :gutter="10" flex justify="center" align="center">
<el-col :span="8">
<el-input v-model="keyword" placeholder="请输入商品名称" clearable @clear="getGoodsList()"
@keyup.enter.native="getGoodsList()" class="w-100"/>
</el-col>
<el-col :span="10">
<view class="flex justify-start items-center">
<text class="text-25">特产地区:</text>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}"
v-model="address"
@change="getGoodsList()" clearable/>
</view>
</el-col>
<el-col :span="6">
<image src="https://oss.wsdns.cn/20231204/bcc976f4396e437abf19deb11c1f06b4.png"
mode="widthFix"/>
</el-col>
</el-row>
</view>
<view class="goods-list">
<view class="flex flex-wrap justify-start is-status">
<view class="w-20p" v-for="(item, index) in goodsList" :key="index">
<view class="p-20">
<view class="grid-content bg-purple pointer"
@click="navTo(`/pages/index/shop/detail?id=${item._id}`)">
<image :src="item.cover" mode="aspectFill"/>
<view class="comments">
<view class="goods-name">
{{ item.name }}
</view>
<view class="goods-price">¥{{ item.amount }}</view>
</view>
</view>
</view>
</view>
</view>
<div class="pagination">
<el-pagination
background
layout="prev, pager, next"
:total="total"
:page-size="pageSize"
@click="getGoodsList"
>
</el-pagination>
</div>
</view>
<view class="tool-bar">
<view class="item">分类:</view>
<view class="item" @click="selectCate(null)">全部</view>
<view class="item" v-for="(item, index) in categoryList" :key="index"
@click="selectCate(item._id)"
:class="[categoryId === item._id? 'active' : '']">{{ item.name }}
</view>
<!-- 现货市场 end -->
<gap height="50"/>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</view>
<div class="m-a w-1200 flex justify-start items-center flex-wrap" v-if="adLoaded">
<div v-for="(ad, adIndex) in adList" :key="adIndex"
:style="{width: '600px'}">
<template v-if="ad.length > 0">
<el-carousel :height="`100px`" class="m-a">
<el-carousel-item v-for="(item, index) in ad" :key="index" :style="{width: '600px'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer" :src="item.swiper" mode="aspectFill"
:style="{width: '100%', height: '100px'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
</div>
<view class="goods-list">
<view class="flex flex-wrap justify-start is-status">
<view class="w-20p " v-for="(item, index) in goodsList" :key="index">
<view class="p-20 ">
<view class="grid-content bg-purple pointer pos-r"
@click="navTo(`/pages/index/shop/detail?id=${item._id}`)">
<text class="recommend" v-if="item.recommend === 1">荐</text>
<image :src="item.cover" mode="aspectFill"/>
<view class="comments">
<view class="goods-name" style="height: 60px">
{{ item.name }}
</view>
<view class="goods-price">¥{{ item.amount }}</view>
</view>
</view>
</view>
</view>
</view>
<div class="pagination">
<el-pagination
background
layout="prev, pager, next"
:total="total"
:page-size="pageSize"
@click="getGoodsList"
>
</el-pagination>
</div>
</view>
<!-- 现货市场 end -->
<gap height="50"/>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template>
<script>
@@ -66,184 +92,244 @@ import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
export default {
components: {UGap},
data() {
return {
categoryList: [],
goodsList: [],
list: [
{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
title: '身无彩凤双飞翼,心有灵犀一点通'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
options: [],
address: [],
pageIndex: 1,
pageSize: 20,
total: 0,
categoryId: null
};
},
onLoad(options) {
if (options && options.menu) {
this.currMenu = options.menu
}
this.options = provinces.map(item => {
item.children = [];
return item
})
this.options.forEach((province, index) => {
citys[index].forEach(city => {
this.options[index].children.push(city)
})
})
this.getCategoryList()
this.getGoodsList()
},
methods: {
menuSelect(e) {
this.currMenu = e
},
navTo(url) {
vk.navigateTo(url);
},
getCategoryList() {
vk.callFunction({
url: 'client/goods/category/pub/getList'
}).then(res => {
this.categoryList = res.rows
})
},
getGoodsList(pageIndex = 1) {
vk.callFunction({
url: 'client/goods/list/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
city: this.address.length > 1 ? this.address[1] : null,
parentId: this.categoryId
}
}).then(res => {
this.goodsList = res.rows
})
},
selectCate(cateId) {
if (this.categoryId === cateId) this.categoryId = null
else this.categoryId = cateId
this.getGoodsList()
}
components: {UGap},
data() {
return {
categoryList: [],
goodsList: [],
options: [],
address: [],
pageIndex: 1,
pageSize: 20,
total: 0,
categoryId: null,
keyword: null,
adList: [],
adNum: 0,
adLoaded: false
};
},
async onLoad(options) {
await this.getCategoryList()
if (options && options.menu) this.currMenu = options.menu
if (options && options.keyword) this.keyword = options.keyword
if (options && options.cateName) {
const cate = this.categoryList.find(item => item.name === options.cateName)
if (cate) this.categoryId = cate._id
}
this.options = provinces.map(item => {
item.children = [];
return item
})
this.options.forEach((province, index) => {
citys[index].forEach(city => {
this.options[index].children.push(city)
})
})
console.error(this.options)
this.getGoodsList()
},
methods: {
menuSelect(e) {
this.currMenu = e
},
navTo(url) {
vk.navigateTo(url);
},
async getCategoryList() {
const res = await vk.callFunction({
url: 'client/goods/category/pub/getList'
})
this.categoryList = res.rows
},
getGoodsList(pageIndex = 1) {
vk.callFunction({
url: 'client/goods/list/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
city: this.address.length > 1 ? this.address[1] : null,
parentId: this.categoryId,
keyword: this.keyword
}
}).then(res => {
this.goodsList = res.rows
this.getAdList()
})
},
selectCate(cateId) {
if (this.categoryId === cateId) this.categoryId = null
else this.categoryId = cateId
this.getGoodsList()
},
async getAdList() {
this.adList = [[], [], [], [], []]
if (this.address.length === 0) {
if (!this.categoryId) {
for (let i = 0; i < 5; i++) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 27 + i
}
})
if (res.data) this.adList[i] = res.data
}
} else {
const cate = this.categoryList.find(item => item._id === this.categoryId)
if (cate.ad && cate.ad.length > 0) {
cate.ad.forEach(item => {
this.adList[item.adKey - 27].push(item)
})
}
}
} else {
for (let i = 0; i < 5; i++) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 27 + i,
region: this.address[0]
}
})
if (res.data) this.adList[i] = res.data
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.adList[i].push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
}
}
this.adNum = 0
for (let i = 0; i < 5; i++) {
if (this.adList[i].length > 0) {
this.adNum += 1
}
}
this.adLoaded = true
this.$forceUpdate()
},
}
}
</script>
<style lang="scss">
.w-1200 {
width: 1200px;
margin: 20px auto;
background-color: #fff;
width: 1200px;
margin: 20px auto;
background-color: #fff;
.test {
height: 50px;
color: #ffffff;
font-size: 18px;
background-color: #bf2b28;
display: flex;
align-items: center;
justify-content: center;
.test {
height: 50px;
color: #ffffff;
font-size: 18px;
background-color: #bf2b28;
display: flex;
align-items: center;
justify-content: center;
text {
margin: 0 20px;
}
text {
margin: 0 20px;
}
}
.tool-bar {
display: flex;
justify-content: flex-start;
align-items: center;
padding: 20px;
font-size: 16px;
.search {
display: flex;
align-items: center;
}
.tool-bar {
display: flex;
justify-content: flex-start;
align-items: center;
padding: 20px;
font-size: 16px;
.search {
display: flex;
align-items: center;
}
.item {
margin-right: 10px;
cursor: pointer;
}
.item:hover, .active {
color: #bf2b28;
}
.item {
margin-right: 10px;
cursor: pointer;
}
.item:hover, .active {
color: #bf2b28;
}
}
}
.wrap {
flex-wrap: wrap;
flex-wrap: wrap;
}
.goods-list {
width: 1200px;
margin: 20px auto;
width: 1200px;
margin: 20px auto;
.grid-content {
.grid-content {
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
width: 100%;
padding: 10px;
margin-bottom: 10px;
flex-direction: column;
.comments {
display: flex;
flex-direction: column;
justify-content: start;
align-items: flex-start;
line-height: 2em;
width: 100%;
.goods-name {
font-size: 16px;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
width: 100%;
padding: 10px;
margin-bottom: 10px;
flex-direction: column;
align-items: flex-start;
}
.comments {
display: flex;
flex-direction: column;
justify-content: start;
align-items: flex-start;
line-height: 2em;
width: 100%;
.goods-name {
font-size: 16px;
display: flex;
align-items: center;
}
.goods-price {
color: #bf2b28;
font-size: 20px;
font-weight: 600;
}
}
.goods-price {
color: #bf2b28;
font-size: 20px;
font-weight: 600;
}
}
}
.bg-purple {
border-top: 1px solid #f3f3f3;
border-right: 1px solid #f3f3f3;
.bg-purple {
border-top: 1px solid #f3f3f3;
border-right: 1px solid #f3f3f3;
image {
width: 180px;
height: 180px;
}
image {
width: 180px;
height: 180px;
}
}
}
.pagination {
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
.recommend {
position: absolute;
right: 0;
top: 0;
padding: 5px;
background-color: #bf2b28;
color: white;
font-size: 30rpx;
z-index: 999;
}
</style>
+39
View File
@@ -0,0 +1,39 @@
<template>
<el-form ref="form" label-width="80px">
<el-form-item label="物流公司">
{{ info.expressName }}
</el-form-item>
<el-form-item label="物流单号">
{{ info.expressNo }}
</el-form-item>
<el-form-item label="发货单">
<el-image v-for="(item, index) in info.expressPhoto" :key="index" :src="item"
class="mr-10 mb-10"
:preview-src-list="info.expressPhoto" style="width: 100px;height: 100px"/>
</el-form-item>
<el-form-item label="备注">
{{ info.remark }}
</el-form-item>
<div class="mt-20 flex justify-center items-center text-center">
<el-button type="primary" size="small" plain @click.native="close">关闭</el-button>
</div>
</el-form>
</template>
<script>
export default {
name: "expressInfo",
props: {
info: Object
},
data() {
return {}
},
methods: {
close() {
this.$emit('close')
},
}
}
</script>
+131
View File
@@ -0,0 +1,131 @@
<template>
<view>
<view class="py-20">
<el-row :gutter="10">
<el-col :span="12">
<text class="text-35 font-bold">商品信息</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1">单价</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1">数量</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1">金额</text>
</el-col>
</el-row>
</view>
<view class="p-20 mb-20" v-for="(item, index) in goods" :key="index">
<el-row :gutter="10">
<el-col :span="12">
<view class="flex justify-start items-start">
<el-image :src="item.goods.cover" class="cover ml-20" fit="fit" v-if="item.goods"/>
<view class="flex flex-col justify-start items-start ml-20">
<text class="font-bold mb-15">{{ item.goodsName }}</text>
<text class="text-gray" v-if="order.type === 0">{{ item.sku.label }}</text>
</view>
</view>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1" v-if="order.type === 0">¥{{ item.sku.values }}</text>
<text class="text-35 font-bold flex-1" v-else>¥{{ item.goodsPrice }}</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1">
x{{ item.num }}
</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1 text-main" v-if="order.type === 0">¥{{
parseFloat(item.sku.values) * item.num
}}
</text>
<text class="text-35 font-bold flex-1 text-main" v-else>¥{{
parseFloat(item.goodsPrice) * item.num
}}
</text>
</el-col>
</el-row>
</view>
<view v-if="order.type === 1">
<p class="text-35 font-bold mb-25">服务详情</p>
<el-descriptions border :column="2">
<el-descriptions-item label="考察对象" v-if="selfProduct.type === 0">
<div style="margin-bottom: .5rem" v-for="(item, index) in selfProduct.contentList" :key="index">
<span>{{ item.name }}</span>
<template v-if="item.type && item.type === '个人'">
({{
item.code
}})--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}
</template>
</div>
</el-descriptions-item>
<el-descriptions-item label="考察产品" v-else>
<p style="margin-bottom: .5rem" v-for="(item, index) in selfProduct.contentList" :key="index">{{
item.name
}}--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}</p>
</el-descriptions-item>
<el-descriptions-item label="接收文件电子邮箱">
<span>{{ selfProduct.email }}</span>
</el-descriptions-item>
<el-descriptions-item label="接收文件微信">
<span>{{ selfProduct.wechat }}</span>
</el-descriptions-item>
<el-descriptions-item label="接收文件寄件地址">
<span v-if="selfProduct.receiveAddressRegion.province">{{
selfProduct.receiveAddressRegion.province.name
}}{{ selfProduct.receiveAddressRegion.city.name }}{{
selfProduct.receiveAddressRegion.area.name
}}{{ selfProduct.receiveAddress }}</span>
</el-descriptions-item>
<el-descriptions-item label="申请人">
<span>{{ selfProduct.requestName }}</span>
</el-descriptions-item>
<el-descriptions-item label="业务联系人">
<span>{{ selfProduct.contactName }}</span>
</el-descriptions-item>
<el-descriptions-item label="业务联系方式">
<span>{{ selfProduct.contact }}</span>
</el-descriptions-item>
<el-descriptions-item label="结果文件" v-if="order && order.resultFiles">
<div v-for="(item, index) in order.resultFiles" :key="index">
<a :href="item"
target="_blank">预览:文件{{ index + 1 }}</a>
</div>
</el-descriptions-item>
<el-descriptions-item label="发送途径" v-if="order && order.sendMethod">{{ order.sendMethod }}
</el-descriptions-item>
</el-descriptions>
</view>
</view>
</template>
<script>
export default {
name: "goods",
props: {
goods: Array,
order: Object,
selfProduct: Object,
},
data() {
return {}
},
methods: {}
}
</script>
<style lang="scss" scoped>
.cover {
width: 80px;
height: 80px;
}
</style>
+191
View File
@@ -0,0 +1,191 @@
<template>
<view>
<div class="font-bold">
<span>订单编号: {{ orderInfo.orderNo }}</span>
<span class="ml-20 text-main" v-if="orderInfo.orderStatus > 1">(已发货)</span>
</div>
<div class="font-bold my-25">订单总额: {{ orderInfo.amount }}元</div>
<el-form ref="form" label-width="80px">
<el-form-item label="支付类型" required >
<el-select v-model="payInfo.type" @change="changeType">
<el-option
v-for="item in payTypeList"
:key="item"
:label="item"
:value="item"
:disabled="(!['预付款', '货到付款', '全款'].includes(item) && orderInfo.payStatus === 0)
|| (['预付款', '货到付款', '全款'].includes(item) && orderInfo.payStatus > 0)"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="payInfo.type" required>
<el-input v-model="payInfo.amount" placeholder="请输入金额"/>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="payInfo.remark"/>
</el-form-item>
<template v-if="[0, 1].includes(orderInfo.orderStatus)">
<el-row :gutter="10">
<el-col :span="6">
<el-form-item label="是否发货">
<el-radio-group v-model="payInfo.isExpress"
:disabled="['货到付款', '全款'].includes(payInfo.type)">
<el-radio :label="true">是</el-radio>
<el-radio :label="false">否</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="物流公司" required>-->
<!-- <el-input v-model="payInfo.expressName" placeholder="请输入物流公司"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物流单号" required>-->
<!-- <el-input v-model="payInfo.expressNo" placeholder="请输入物流单号"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-form-item label="凭证" v-if="!payInfo.isExpress">
<vk-data-upload v-model="payInfo.photos"></vk-data-upload>
</el-form-item>
<el-form-item label="凭证" v-else required>
<vk-data-upload v-model="payInfo.expressPhoto"></vk-data-upload>
</el-form-item>
</template>
<el-form-item label="附件">
<vk-data-upload v-model="payInfo.ext"></vk-data-upload>
</el-form-item>
</el-form>
<el-row>
<el-col :span="24" class="text-center">
<el-button type="primary" size="mini" @click="setPayList">提交</el-button>
<el-button type="warning" size="mini" @click="close">取消
</el-button>
</el-col>
</el-row>
</view>
</template>
<script>
export default {
name: "makePay",
props: {
info: {
type: Object,
default: () => {
return {}
}
},
payTypeList: {
type: Array,
default: () => {
return []
}
},
},
data() {
return {
payInfo: {
orderId: this.info._id,
amount: null,
type: null,
remark: '',
buyerRemark: '',
photos: [],
payerUid: null,
hasPaid: false,
paidVoucher: '',
paidAt: '',
sellerConfirm: false,
confirmAt: '',
buyerUid: this.info.uid,
sellerUid: this.info.sellerUid,
status: 0,
buyerRefuse: false,
refuseReason: null,
buyerPhotos: [],
expressPhoto: [],
isExpress: false,
expressName: null,
expressNo: null,
ext: [],
},
orderInfo: {
payStatus: 0
}
}
},
methods: {
close() {
this.$emit("close")
},
async getOrderInfo() {
this.orderInfo = await vk.callFunction({
url: 'client/order/kh/getInfo',
data: {
id: this.info._id
}
})
},
async setPayList() {
if (!this.payInfo.type) return this.$message({
type: 'error',
message: '请选择支付类型'
})
if (!this.payInfo.amount) return this.$message({
type: 'error',
message: '请输入支付金额'
})
if (this.payInfo.isExpress && this.payInfo.expressPhoto.length === 0) return this.$message({
type: 'error',
message: '请上传凭证'
})
// if (this.payInfo.isExpress && !this.payInfo.expressName) return this.$message({
// type: 'error',
// message: '请输入物流公司'
// })
// if (this.payInfo.isExpress && !this.payInfo.expressNo) return this.$message({
// type: 'error',
// message: '请输入物流单号'
// })
if (this.payInfo.isExpress) {
this.$confirm('发货状态一旦确定无法修改,请谨慎操作', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
await vk.callFunction({
url: 'client/order/kh/makePay',
title: '请求中...',
data: {payInfo: this.payInfo}
})
this.$message({
type: 'success',
message: '支付单创建成功'
})
this.close()
})
} else {
await vk.callFunction({
url: 'client/order/kh/makePay',
title: '请求中...',
data: {payInfo: this.payInfo}
})
this.$message({
type: 'success',
message: '支付单创建成功'
})
this.close()
}
},
changeType() {
this.payInfo.isExpress = ['货到付款', '全款'].includes(this.payInfo.type)
console.log(this.payInfo.isExpress, this.payInfo.type)
}
},
mounted() {
this.getOrderInfo()
}
}
</script>
+195
View File
@@ -0,0 +1,195 @@
<template>
<view>
<view style="margin-bottom: 16px; padding: 12px; background: #fff8e8; color: #8a5a00; line-height: 1.7;">
<view>服务提供方(卖家):请于系统确认支付方已依照协议或约定支付对应订单款项后,再启动对应服务。申请款项付款方在系统端完成划款授权确认操作后,款项到账时间约为工作日T+1,请届时查询确认。</view>
<view style="margin-top: 8px;">服务需求方(买家):请于依照交易规则和协议完成对应服务验收后,再在系统端完成对应申请款项的授权确认操作,系统默认确认时限为72小时(含工作日,届时系统仅提供信息提醒服务),请及时完成该项确认。若您届时未确认且未提出正当异议,系统将默认您已收货或同意支付申请。</view>
</view>
<view v-for="(item, index) in payList" :key="index" class="py-20 border-bottom">
<el-descriptions :title="item.type" :column="2" border :labelStyle="{width: '120px'}">
<template slot="extra">
<div class="flex justify-start items-center">
<template v-if="!item.buyerRefuse">
<el-button plain type="primary" size="mini" @click="showPay(item)"
v-if="item.status === 0 && item.isBuyer && !item.hasPaid">上传支付凭证
</el-button>
<el-button type="primary" size="mini" class="mx-20" @click="confirmPay(item)"
v-if="item.hasPaid && item.isSeller && !item.sellerConfirm">
确认收款
</el-button>
<el-button plain type="primary" size="mini" class="mx-20" @click="paidRefuse(item)"
v-if="item.isBuyer && item.status === 0 && !item.paidVoucher">
驳回
</el-button>
</template>
</div>
</template>
<el-descriptions-item label="支付金额">{{ item.amount }}</el-descriptions-item>
<el-descriptions-item label="支付凭证">
<template v-if="!item.buyerRefuse">
<span v-if="item.isSeller && !item.hasPaid">待买方支付</span>
<view v-else-if="item.paidVoucher">
<el-image :src="item.paidVoucher[0]" style="width: 80px; height: 80px" fit="cover"
:preview-src-list="item.paidVoucher"/>
</view>
<view v-else-if="!item.paidVoucher">
<span>未上传凭证</span>
</view>
</template>
<span v-else class="text-main">买家已拒绝: {{ item.refuseReason }}</span>
</el-descriptions-item>
<el-descriptions-item label="交货凭证">
<el-image v-for="(photo, photoIndex) in item.expressPhoto" :key="photoIndex" :src="photo"
style="width: 80px; height: 80px" fit="cover"
:preview-src-list="item.expressPhoto"/>
</el-descriptions-item>
<el-descriptions-item label="备注">
<text>{{ item.remark ? item.remark : '无' }}</text>
</el-descriptions-item>
<el-descriptions-item label="买家备注">
<text>{{ item.buyerRemark ? item.buyerRemark : '无' }}</text>
</el-descriptions-item>
<el-descriptions-item label="图片">
<template v-if="item.photos && item.photos.length > 0">
<el-image v-for="(photo, photoIndex) in item.photos" :key="photoIndex" :src="photo"
style="width: 80px; height: 80px" fit="cover"
:preview-src-list="item.photos"/>
</template>
<span v-else>无</span>
</el-descriptions-item>
<el-descriptions-item label="我方状态">
<template v-if="item.isSeller">
<span v-if="!item.hasPaid && !item.buyerRefuse">待上传凭证</span>
<span v-if="!item.sellerConfirm && item.hasPaid">待确认收款</span>
<span v-if="item.sellerConfirm && item.hasPaid">已完成</span>
</template>
<template v-if="item.isBuyer">
<span v-if="!item.hasPaid && !item.buyerRefuse">待上传凭证</span>
<span v-if="!item.sellerConfirm && item.hasPaid">完成支付</span>
<span v-if="item.sellerConfirm && item.hasPaid">已完成</span>
</template>
</el-descriptions-item>
<el-descriptions-item label="对方状态">
<!-- 自己是卖家则对方是买家-->
<template v-if="item.isSeller">
<span v-if="!item.hasPaid && !item.buyerRefuse">待上传凭证</span>
<span v-if="!item.sellerConfirm && item.hasPaid">完成支付</span>
<span v-if="item.sellerConfirm && item.hasPaid">已完成</span>
</template>
<template v-if="item.isBuyer">
<span v-if="!item.hasPaid && !item.buyerRefuse">待上传凭证</span>
<span v-if="!item.sellerConfirm && item.hasPaid">待确认收款</span>
<span v-if="item.sellerConfirm && item.hasPaid">已完成</span>
</template>
</el-descriptions-item>
</el-descriptions>
</view>
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="50%" append-to-body="">
<template v-if="dialogVisible && dialogType === 'do-pay'">
<div class="font-bold">支付金额: {{ payInfo.amount }}元</div>
<el-form ref="form" label-width="80px">
<el-form-item label="支付凭证" required>
<vk-data-upload v-model="payInfo.paidVoucher"></vk-data-upload>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="payInfo.buyerRemark"/>
</el-form-item>
<el-form-item label="图片">
<vk-data-upload v-model="payInfo.buyerPhotos"></vk-data-upload>
</el-form-item>
</el-form>
<el-row>
<el-col :span="24" class="text-center">
<el-button type="primary" size="mini" @click="uploadPayVoucher">提交</el-button>
<el-button type="warning" size="mini" @click="dialogVisible = false">取消
</el-button>
</el-col>
</el-row>
</template>
</el-dialog>
</view>
</template>
<script>
import ExpressInfo from "./expressInfo.vue";
import Goods from "./goods.vue";
import SetExpress from "./setExpress.vue";
import MakePay from "./makePay.vue";
export default {
name: "payList",
components: {MakePay, SetExpress, Goods, ExpressInfo},
props: {
payList: {
type: Array,
default: []
}
},
data() {
return {
dialogVisible: false,
dialogType: '',
dialogTitle: '',
payInfo: null
}
},
methods: {
showPay(item) {
this.payInfo = item;
this.dialogTitle = '支付'
this.dialogType = 'do-pay';
this.dialogVisible = true;
},
async confirmPay({_id, type}) {
await vk.callFunction({
url: 'client/order/kh/paidConfirm',
title: '请求中...',
data: {
id: _id
}
})
this.$message({
type: 'success',
message: '确认成功'
})
if (['尾款', '货到付款'].includes(type)) this.$emit('refresh', '4')
else this.$emit('refresh')
},
paidRefuse({_id}) {
this.$prompt('请输入驳回理由', '提示', {
showCancelButton: true,
showInput: true,
}).then(async ({value}) => {
await vk.callFunction({
url: 'client/order/kh/payRefuse',
title: '请求中...',
data: {
id: _id,
refuseReason: value,
}
})
this.$emit('refresh')
this.$message({
type: 'success',
message: '驳回成功'
})
})
},
async uploadPayVoucher() {
if (this.payInfo.paidVoucher.length === 0) return this.$message.error()
await vk.callFunction({
url: 'client/order/kh/uploadPayVoucher',
title: '请求中...',
data: this.payInfo
})
this.$message({
type: 'success',
message: '上传成功'
})
this.$emit('refresh')
this.dialogVisible = false
},
}
}
</script>
+84
View File
@@ -0,0 +1,84 @@
<template>
<el-form ref="form" label-width="80px">
<el-form-item label="客户信息" required>
<p>收件人: {{ info.name }}</p>
<p>收件人联系方式: {{ info.phone }}</p>
<p>收件地址: {{ info.addressRegion.province.name }}{{ info.addressRegion.city.name }}{{ info.addressRegion.area.name }}{{ info.addressDetail }}</p>
</el-form-item>
<el-form-item label="物流公司" required>
<el-input v-model="expressName" placeholder="请输入物流公司"/>
</el-form-item>
<el-form-item label="物流单号" required>
<el-input v-model="expressNo" placeholder="请输入物流单号"/>
</el-form-item>
<el-form-item label="发货单" required>
<vk-data-upload v-model="expressPhoto"></vk-data-upload>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="remark" placeholder="请输入备注"/>
</el-form-item>
<div class="mt-20 flex justify-center items-center text-center">
<el-button type="primary" size="small" plain @click.native="cancel">取消</el-button>
<el-button type="primary" size="small" @click.native="confirm">确定</el-button>
</div>
</el-form>
</template>
<script>
export default {
name: "setExpress",
props: {
id: Number | String,
info: Object
},
data() {
return {
expressName: null,
expressNo: null,
remark: null,
expressPhoto: [],
}
},
methods: {
close() {
this.$emit('close')
},
cancel() {
this.expressName = null
this.expressNo = null
this.remark = null
this.expressPhoto = []
this.$emit('close')
},
async confirm() {
if (!this.expressName) return this.$message({
type: 'error',
message: '请填写物流公司'
})
if (!this.expressNo) return this.$message({
type: 'error',
message: '请填写物流单号'
})
if (this.expressPhoto.length === 0) return this.$message({
type: 'error',
message: '请上传发货单'
})
await vk.callFunction({
url: 'client/order/kh/setExpress',
data: {
id: this.id,
expressName: this.expressName,
expressNo: this.expressNo,
remark: this.remark,
expressPhoto: this.expressPhoto
}
})
this.$emit('close')
this.$message({
type: 'success',
message: '发货成功'
})
}
}
}
</script>
+60
View File
@@ -0,0 +1,60 @@
<template>
<el-form ref="form" label-width="80px">
<el-form-item label="退款原因" required>
<el-input v-model="refundReason" placeholder="请输入退款原因"/>
</el-form-item>
<el-form-item label="图片">
<vk-data-upload v-model="refundPhotos"></vk-data-upload>
</el-form-item>
<div class="mt-20 flex justify-center items-center text-center">
<el-button type="primary" size="small" plain @click.native="cancel">取消</el-button>
<el-button type="primary" size="small" @click.native="confirm">确定</el-button>
</div>
</el-form>
</template>
<script>
export default {
name: "setRefund",
props: {
id: Number | String
},
data() {
return {
refundReason: null,
refundPhotos: [],
}
},
methods: {
close() {
this.$emit('close')
},
cancel() {
this.refundReason = null
this.refundPhotos = []
this.close()
},
async confirm() {
if (!this.refundReason) return this.$message({
type: 'error',
message: '请填写退款原因'
})
const res = await vk.callFunction({
url: 'client/order/kh/refund',
data: {
id: this.id,
refundReason: this.refundReason,
refundPhotos: this.refundPhotos,
}
}).catch(err => false)
if (res) {
this.$emit('close')
this.$message({
type: 'success',
message: '平台将在2个工作日内审核,请您耐心等待'
})
}
}
}
}
</script>
+141
View File
@@ -0,0 +1,141 @@
<template>
<view>
<el-descriptions title="金久信自营订单详情" :column="2" border :labelStyle="{width: '120px'}" v-if="info">
<el-descriptions-item label="服务">
<p v-for="(item, index) in orderInfo.goods" :key="index">{{ item.goodsName }}</p>
</el-descriptions-item>
<el-descriptions-item label="考察对象" v-if="info.type === 0">
<div style="margin-bottom: .5rem" v-for="(item, index) in info.contentList" :key="index">
<span>{{ item.name }}</span>
<template v-if="item.type && item.type === '个人' && item.addressRegion">
({{
item.code
}})--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}
</template>
</div>
</el-descriptions-item>
<el-descriptions-item label="考察产品" v-else>
<p style="margin-bottom: .5rem" v-for="(item, index) in info.contentList" :key="index">{{
item.name
}}--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}</p>
</el-descriptions-item>
<el-descriptions-item label="文档">
<div v-for="(item, index) in info.contentList" :key="index">
<template v-if="item.files">
<a v-for="(file, fileIndex) in item.files" :key="fileIndex" :href="file"
target="_blank">预览:文件{{ fileIndex + 1 }}</a>
</template>
</div>
</el-descriptions-item>
<el-descriptions-item label="接收文件电子邮箱">
<span>{{ info.email }}</span>
</el-descriptions-item>
<el-descriptions-item label="接收文件微信">
<span>{{ info.wechat }}</span>
</el-descriptions-item>
<el-descriptions-item label="接收文件寄件地址">
<span v-if="info.receiveAddressRegion.province">{{
info.receiveAddressRegion.province.name
}}{{ info.receiveAddressRegion.city.name }}{{
info.receiveAddressRegion.area.name
}}{{ info.receiveAddress }}</span>
</el-descriptions-item>
<el-descriptions-item label="申请人">
<span>{{ info.requestName }}</span>
</el-descriptions-item>
<el-descriptions-item label="业务联系人">
<span>{{ info.contactName }}</span>
</el-descriptions-item>
<el-descriptions-item label="业务联系方式">
<span>{{ info.contact }}</span>
</el-descriptions-item>
<el-descriptions-item label="接单公司" v-if="info.companyId">
<span>{{ info.company.company.companyName }}</span>
</el-descriptions-item>
<el-descriptions-item label="文件上传">
<vk-data-upload v-model="resultFiles"
:limit="9"
:on-preview="previewUpload"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf" list-type="text">
</vk-data-upload>
</el-descriptions-item>
<el-descriptions-item label="发送途径">
<el-select v-model="sendMethod" placeholder="请选择发送途径">
<el-option label="接收文件电子邮箱" value="接收文件电子邮箱"/>
<el-option label="接收文件微信" value="接收文件微信"/>
<el-option label="邮寄接收文件地址" value="邮寄接收文件地址"/>
</el-select>
</el-descriptions-item>
<template slot="extra">
<div class="flex justify-start items-center">
<el-button type="primary" size="mini" @click="setSend">确认完成
</el-button>
<el-button plain type="primary" size="mini" class="mx-20" @click="close">
关闭
</el-button>
</div>
</template>
</el-descriptions>
</view>
</template>
<script>
export default {
name: "setSend",
props: {
orderInfo: Object
},
data() {
return {
info: null,
sendMethod: null,
resultFiles: []
}
},
methods: {
async getInfo() {
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/getDetailByOrder',
data: {
orderId: this.orderInfo._id
}
})
this.info = data
},
async setSend() {
if (this.resultFiles.length === 0) {
vk.toast("请上传文件")
return
}
if (!this.sendMethod) {
vk.toast("请选择发送途径")
return
}
await vk.callFunction({
url: 'client/order/kh/changeOrderStatus',
data: {
id: this.orderInfo._id,
orderStatus: 3,
sendMethod: this.sendMethod,
resultFiles: this.resultFiles,
}
})
this.close()
},
close() {
this.$emit("close")
},
previewUpload({url}) {
window.open(url)
}
},
mounted() {
console.log(this.orderInfo)
this.getInfo()
}
}
</script>
+119
View File
@@ -0,0 +1,119 @@
<template>
<view>
<el-table :data="tableData.rows" style="width: 100%" border stripe>
<el-table-column prop="orderNo" label="订单号" width="200"/>
<el-table-column label="订单类型">
<template v-slot="{ row }">
<span>{{ row.type === 0 ? '普通订单' : '金久信自营订单' }}</span>
</template>
</el-table-column>
<el-table-column label="商品列表" width="250">
<template v-slot="{ row }">
<view class="flex flex-col justify-start items-start">
<view v-for="(item, index) in row.goods" :key="index"
class="flex justify-start items-start">
<image :src="item.goodsCover" class="goods-cover" v-if="row.type === 0"/>
<view class="ml-20 flex flex-col justify-start items-start">
<text class="text-main font-bold">{{ item.goodsName }}</text>
<text class="mt-20">¥{{ item.goodsPrice }}</text>
<text class="mt-20">x{{ item.num }}</text>
</view>
</view>
</view>
</template>
</el-table-column>
<el-table-column prop="amount" label="订单金额"/>
<el-table-column prop="payAmount" label="支付金额"/>
<el-table-column label="订单状态">
<template v-slot="{ row }">
<span v-if="row.orderStatus === 0">待支付</span>
<span v-if="row.orderStatus === 1">已支付</span>
<span v-if="row.orderStatus === 2">待收货</span>
<span v-if="row.orderStatus === 3">已完成</span>
</template>
</el-table-column>
<el-table-column prop="_add_time_str" label="下单时间"/>
<el-table-column label="操作">
<template v-slot="{ row }">
<text v-if="row.orderStatus === 0" class="text-main pointer" @click="repay(row)">去支付</text>
</template>
</el-table-column>
</el-table>
<view class="text-center mt-20">
<el-pagination
:page-size="pageSize"
@current-change="getOrderList"
background
layout="prev, pager, next"
:total="tableData.total">
</el-pagination>
</view>
</view>
</template>
<script>
export default {
name: "shopOrder",
props: {
tableData: Object
},
data() {
return {
tableData: [],
activeIndex: 0,
pageSize: 20,
total: 0,
}
},
methods: {
async repay(row) {
await vk.callFunction({
url: 'client/order/kh/resetOrderNo',
data: {
id: row._id,
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${row._id}`
})
},
getOrderList(index){
this.$emit('change-page', index)
}
},
onLoad(options) {
}
}
</script>
<style lang="scss" scoped>
.main-wrap {
width: 1200px;
margin: 20px auto;
position: relative;
.left-wrap {
position: absolute;
width: 220px;
left: -240px;
top: 0;
view {
padding: 20px;
}
.active {
background-color: #a92924;
color: white;
}
}
}
.goods-cover {
width: 80px;
height: 80px;
}
</style>
+959 -778
View File
File diff suppressed because it is too large Load Diff
+43 -31
View File
@@ -1,40 +1,52 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<gap height="50"/>
<view class="w-1200 m-a bg-white p-40">
<view class="text-50 font-bold">{{ info.name }}</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{ info._add_time_str }}</view>
<view v-html="info.content" class="mt-20"></view>
</view>
<gap height="50"/>
<common-footer></common-footer>
<view>
<top-bar></top-bar>
<!-- <common-header></common-header>-->
<!-- <category-bar></category-bar>-->
<gap height="50"/>
<view class="w-1200 m-a bg-white p-40">
<view class="text-50 font-bold">{{ info.name }}</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{
info._update_time ? info._update_time : info._add_time_str
}}</view>
<view v-html="info.content" class="mt-20"></view>
</view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "detail",
data() {
return {
info: {
name: '',
content: ''
}
}
},
onLoad(option) {
if (option.id) this.getInfo(option.id);
},
methods: {
async getInfo(id) {
this.info = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id}
});
}
name: "detail",
data() {
return {
info: {
name: '',
content: ''
}
}
},
onLoad(option) {
if (option.id) {
this.getInfo(option.id);
this.addViewNum(option.id);
}
},
methods: {
async getInfo(id) {
const res = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id}
});
this.info = res
},
addViewNum(_id){
vk.callFunction({
url: `client/otherArticle/list/pub/addViewNum`,
data: {_id}
});
}
}
}
</script>
+56 -3
View File
@@ -1,13 +1,66 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<gap height="50"/>
<view class="w-1200 m-a bg-white p-40">
<view v-for="(item, index) in list" :key="index"
@click="navTo(item._id)"
class="py-30 border-bottom flex justify-between items-center pointer">
<text class="font-bold">{{ item.name }}</text>
<text class="text-gray">{{ item._add_time_str }}</text>
</view>
<view class="text-center">
<el-pagination
:page-size="pageSize"
@current-change="getList"
background
layout="prev, pager, next"
:total="total">
</el-pagination>
</view>
</view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "list",
data() {
return {}
return {
list: [],
parentId: null,
pageSize: 20,
total: 0,
}
},
methods: {}
methods: {
getList(pageIndex) {
vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
pageSize: this.pageSize,
pageIndex,
data: {
parentId: this.parentId
},
success: res => {
this.list = res.rows;
this.total = res.total;
}
})
},
navTo(id) {
vk.navigateTo({
url: `/pages/otherArticle/detail?id=${id}`
})
}
},
onLoad(options) {
if (options) this.parentId = options.id;
this.getList();
}
}
</script>
+514 -288
View File
@@ -1,261 +1,487 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-main" v-if="info">
<view class="flex justify-between items-center">
<text class="text-gray">加工询价单编号:{{ info.orderNo }}</text>
<text class="text-gray">发布时间:{{ info._add_time_str }}</text>
</view>
<view class="my-25 flex justify-between items-center">
<view class="flex justify-start items-center">
<text class="text-40 font-bold">{{ info.title }}</text>
<view class="ml-20 flex justify-start items-center">
<building-one theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<view class="text-main ">
<text class="mx-20">{{ info.quoteList.rows.length }}</text>
<text>家已报价</text>
</view>
</view>
</view>
<view class="flex justify-end items-end"
v-if="info.answerEndTime && dayjs().diff(dayjs(info.answerEndTime), 'second') < 0">
<text>距离加工结束还有:</text>
<view class="border-main countdown text-main">{{
dayjs(info.answerEndTime).diff(dayjs(), 'day')
}}
</view>
<text>天</text>
<view class="border-main countdown text-main">
{{ (dayjs(info.answerEndTime).diff(dayjs(), 'hour')) % 24 }}
</view>
<text>时</text>
</view>
</view>
<view class="my-25 flex justify-between items-center pb-20 border-bottom">
<view class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<text class="ml-15 text-gray">
{{ info.user.accountType === 1 ? info.user.person.personName : info.user.company.companyName }}
</text>
</view>
<el-button type="primary" @click.native="toQuote"
v-if="vk.getVuex('$user.userInfo._id') !== info.userId && info.status === 0">我要申请加工
</el-button>
<el-button type="primary" @click.native="showDialog = true"
v-else-if="vk.getVuex('$user.userInfo._id') === info.userId">查看收到的申请加工
</el-button>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
上传的附件
</view>
</view>
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
加工商其他要求
</view>
</view>
</view>
<view class="mt-15">{{ info.remark }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
纳税和税票
</view>
</view>
</view>
<view class="mt-15">是否含税:{{ info.invoice ? '含税' : '不含税' }}</view>
<view class="mt-15">开票时间:{{ WRITE_INVOICE_TIME[info.writeInvoiceTime] }}</view>
<view class="mt-15">发票种类:{{ INVOICE_TYPE[info.invoiceType] }}</view>
<view class="mt-15">其他要求:{{ info.invoiceOther }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
运输要求
</view>
</view>
</view>
<view class="mt-15">随货资料:{{ info.transportDocuments.join() }}</view>
<view class="mt-15">其他要求:{{ info.otherTransportDocuments }}</view>
<view class="mt-15">运输限制要求:{{ info.transportLimit ? '有' : '无' }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
交易说明
</view>
</view>
</view>
<view class="mt-15">付款方式:{{ PROCESS_PAY_METHOD[info.payMethod] }}</view>
<view class="mt-15">报价形式:{{ info.offerType === 0 ? '整单报价' : '可分项报价' }}</view>
<view class="mt-15">报价期限:
<text v-if="info.answerStartTime && info.answerEndTime">{{
dayjs(info.answerStartTime).format('YYYY-MM-DD')
}}~{{ dayjs(info.answerEndTime).format('YYYY-MM-DD') }}
</text>
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
简易合同备注和其他补充条款
</view>
</view>
</view>
<view class="mt-15">违约责任:</view>
<view class="mt-15">
1.乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。
</view>
<view class="mt-15">解决纠纷的方法:</view>
<view class="mt-15">
1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工費和获取证据产生费用等其他相关费用。2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。
</view>
<view class="mt-15">不可抗力:</view>
<view class="mt-15">
甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。
</view>
<view class="mt-15">其他:</view>
<view class="mt-15">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view>
<view class="mt-15">采购方补充条款: 供货方逾期供货承担采购方一切损失</view>
<view class="mt-15"> 供应方补充条款:</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
已收到的加工申请
</view>
</view>
</view>
<view class="mt-15">
<view class="request-header">
<text class="flex-1">加工商</text>
<text class="flex-1">申请时间</text>
</view>
<view class="quote" v-for="(item, index) in info.quoteList.rows" :key="index">
<text class="flex-1">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item._add_time_str }}</text>
</view>
</view>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-main" v-if="info">
<view class="flex justify-between items-center">
<text class="text-gray">加工询价单编号:{{ info.orderNo }}</text>
<text class="text-gray">发布时间:{{ info._add_time_str }}</text>
</view>
<view class="my-25 flex justify-between items-center">
<view class="flex justify-start items-center">
<text class="text-40 font-bold">{{ info.title }}</text>
<view class="ml-20 flex justify-start items-center">
<building-one theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<view class="text-main ">
<text class="mx-20">{{ info.quoteList.rows.length }}</text>
<text>家已报价</text>
</view>
</view>
</view>
<common-footer></common-footer>
<el-dialog :visible.sync="showDialog" width="70%" :show-close="false">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的加工申请</text>
<el-button type="primary" @click.native="showDialog = false">关闭</el-button>
<view class="flex justify-end items-end"
v-if="info.answerEndTime && dayjs(info.answerEndTime).diff(dayjs(), 'second') > 0">
<text>距离加工结束还有:</text>
<view class="border-main countdown text-main">{{
dayjs(info.answerEndTime).diff(dayjs(), 'day')
}}
</view>
<text>天</text>
<view class="border-main countdown text-main">
{{ (dayjs(info.answerEndTime).diff(dayjs(), 'hour')) % 24 }}
</view>
<text>时</text>
</view>
</view>
<view class="my-25 flex justify-between items-center pb-20 border-bottom">
<view class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<text class="ml-15 text-gray" v-if="info.user">
{{ info.user.accountType === 1 ? info.user.person.personName : info.user.company.companyName }}
</text>
</view>
<el-button type="primary" @click.native="toQuote" :disabled="info.disabled"
v-if="vk.getVuex('$user.userInfo._id') !== info.userId && info.status === 0">{{
info.disabled ? '已超时无法报价' : '我要申请合作'
}}
</el-button>
<el-button type="primary" @click.native="showDialog = true"
v-else-if="vk.getVuex('$user.userInfo._id') === info.userId">查看收到的申请合作
</el-button>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
上传的附件
</view>
<view class="mt-15" v-if="info && info.quoteList">
<view class="request-header">
<text class="flex-1">加工商</text>
<text class="flex-1">报价</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in info.quoteList.rows" :key="index">
<text class="flex-1">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
<el-button type="primary" @click.native="createContract(item)" v-if="info.status === 0">选择</el-button>
</text>
</view>
</view>
</view>
<view class="mt-15 mr-15" v-if="info.files">
<file-type :item="item" v-for="(item, index) in info.files" :key="index" @click.native="openDownload(item)"/>
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
加工产品交货地址
</view>
</el-dialog>
</view>
</view>
<view class="mt-15">{{
info.addressRegion ? `${info.addressRegion.province.name}${info.addressRegion.city.name}${info.addressRegion.area ? info.addressRegion.area.name : ''}` : ``
}}{{
info.addressDetail ? info.addressDetail : ''
}}
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
加工商其他要求
</view>
</view>
</view>
<view class="mt-15">{{ info.remark }}</view>
<template v-if="info.multiFiles">
<file-type :item="item" v-for="(item, index) in info.multiFiles" :key="index"
@click.native="openDownload(item)"/>
<!-- <el-image :src="item" v-for="(item, index) in info.multiFiles" :key="index" style="width: 100px; height: 100px" fit="cover"-->
<!-- :preview-src-list="info.multiFiles"/>-->
</template>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
主要商品
</view>
</view>
</view>
<view class="mt-15">{{ info.title }}</view>
<view class="mt-15">加工产品简述:{{ info.detail }}</view>
<view class="mt-15">加工量:{{ info.num }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
纳税和税票
</view>
</view>
</view>
<view class="mt-15">是否含税:{{ info.invoice ? '含税' : '不含税' }}</view>
<view class="mt-15">开票时间:{{ WRITE_INVOICE_TIME[info.writeInvoiceTime] }}</view>
<view class="mt-15" v-if="info.invoiceOther">税票要求:{{ info.invoiceOther }}</view>
<template v-else>
<view class="mt-15">纳税人身份:{{ info.taxType ? info.taxType : '无' }}</view>
<view class="mt-15">发票种类:{{ info.invoiceType ? info.invoiceType : '无' }}</view>
<view class="mt-15">税率:{{ info.taxRate ? info.taxRate : '无' }}</view>
</template>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
运输要求
</view>
</view>
</view>
<view class="mt-15" v-if="info.transportDocuments && info.transportDocuments.length > 0">
随货资料:{{ info.transportDocuments.join() }}
</view>
<view class="mt-15" v-if="info.otherTransportDocuments">其他要求:{{ info.otherTransportDocuments }}</view>
<view class="mt-15">运输限制要求:{{ info.transportLimit ? '有' : '无' }}</view>
<view class="mt-15" v-if="info.transportLimit && info.otherTransportRequest">
运输限制说明:{{ info.otherTransportRequest }}
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易模式
</view>
</view>
</view>
<view class="mt-15">{{ info.tradeMethod === 0 ? '自主交易' : '金久信公证' }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易说明
</view>
</view>
</view>
<!-- <view class="mt-15" v-if="info.payMethod === 0">付款方式:{{ PROCESS_PAY_METHOD[info.payMethod] }}{{-->
<!-- info.payMethod === 0 ? `${info.advancePayRate}%货到付全款` : ''-->
<!-- }}{{ info.payMethod === 3 ? `${info.reputationPayDay}天` :-->
<!-- ( info.payMethod === 4 ? `:${info.otherPayMethod}` : '') }}-->
<!-- </view>-->
<view class="mt-15" v-if="info.payMethod === 0">付款方式:预付{{ info.advancePayRate }}%货到付全款</view>
<view class="mt-15" v-if="info.payMethod === 1">付款方式:加工验收合格后付全款</view>
<view class="mt-15" v-if="info.payMethod === 3">付款方式:加工验收合格后{{
info.reputationPayDay
}}天内支付全款
</view>
<view class="mt-15">报价形式:{{ info.offerType === 0 ? '整单报价' : '可分项报价' }}</view>
<view class="mt-15">报价期限:
<text v-if="info.answerStartTime && info.answerEndTime">{{
dayjs(info.answerStartTime).format('YYYY-MM-DD')
}}~{{ dayjs(info.answerEndTime).format('YYYY-MM-DD') }}
</text>
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易保证金要求
</view>
</view>
</view>
<view class="mt-15">{{ info.earnestMoney }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
采购商信息
</view>
</view>
</view>
<view class="mt-15" v-if="info.companyName">
公司信息:{{ info.companyName ? info.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : '' }}
</view>
<view class="mt-15" v-if="info.companyMobile">公司联系方式:{{
info.companyMobile ? info.companyMobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
<view class="mt-15" v-if="info.businessName">
授权业务咨询人:{{ info.businessName ? info.businessName.replace(/^(.).*(.)$/, "$1***$2") : '' }}
</view>
<view class="mt-15" v-if="info.businessMobile">业务咨询联系方式:{{
info.businessMobile ? info.businessMobile.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
签约模式
</view>
</view>
</view>
<view class="mt-15">{{
info.signMethod === 0 ? '线上签约-标准合同' : (info.signMethod !== 1 ? '线上签约-双方协商合同' : '线下签约')
}}
</view>
</view>
<view class="item-wrap" v-if="info.signMethod === 0">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
简易合同备注和其他补充条款
</view>
</view>
</view>
<view class="mt-15">违约责任:</view>
<view class="mt-15">
1.乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。
</view>
<view class="mt-15">解决纠纷的方法:</view>
<view class="mt-15">
1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工費和获取证据产生费用等其他相关费用。2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。
</view>
<view class="mt-15">不可抗力:</view>
<view class="mt-15">
甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。
</view>
<view class="mt-15">其他:</view>
<view class="mt-15">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view>
<view class="mt-15">采购方补充条款: {{ info.supplementary }}</view>
</view>
<template v-else-if="info.signMethod === 2">
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
合同附件
</view>
</view>
</view>
</view>
<view v-for="(item, index) in info.contractAttachment" :key="index" class="mr-25 my-25">
<file-type :item="item" @click.native="openDownload(item)"/>
</view>
</template>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
已收到的加工申请
</view>
</view>
</view>
<view class="mt-15">
<view class="request-header">
<text class="flex-1">加工商</text>
<text class="flex-1">申请时间</text>
</view>
<view class="quote" v-for="(item, index) in info.quoteList.rows" :key="index">
<text class="flex-1" v-if="info.user">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item._add_time_str }}</text>
</view>
</view>
</view>
</view>
<common-footer></common-footer>
<el-dialog :visible.sync="showDialog" width="70%" :show-close="false">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的加工合作申请</text>
<el-button type="primary" @click.native="showDialog = false">关闭</el-button>
</view>
<view class="mt-15" v-if="info && info.quoteList">
<view class="request-header">
<text class="flex-1">加工商</text>
<text class="flex-1">报价</text>
<text class="flex-1">附件</text>
<text class="flex-1">补充条款</text>
<text class="flex-1">报价详情</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in info.quoteList.rows" :key="index">
<text class="flex-1" v-if="info.user">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<view class="flex-1">
<view class="flex-1">
<!-- <view class="mt-15 mr-15" v-for="(item, index) in item.files" :key="index">-->
<!-- <template v-if="['doc', 'docx'].includes(item.split('.').pop())">-->
<!-- <file-word theme="outline" class="pointer" size="40" fill="#4a90e2" strokeLinecap="square"-->
<!-- @click.native="openDownload(item)"/>-->
<!-- </template>-->
<!-- <template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">-->
<!-- <file-excel theme="outline" class="pointer" size="40" fill="#417505" strokeLinecap="square"-->
<!-- @click.native="openDownload(item)"/>-->
<!-- </template>-->
<!-- <template v-else-if="['pdf'].includes(item.split('.').pop())">-->
<!-- <file-pdf-one theme="outline" class="pointer" size="40" fill="#f5a623"-->
<!-- strokeLinecap="square"-->
<!-- @click.native="openDownload(item)"/>-->
<!-- </template>-->
<!-- <template v-else>-->
<!-- <el-image :src="item" style="width: 100px; height: 100px" fit="cover"-->
<!-- :preview-src-list="[item]"/>-->
<!-- </template>-->
<!-- </view>-->
<file-type :item="file" v-for="(file, fileIndex) in item.files" :key="fileIndex"
@click.native="openDownload(file)"/>
</view>
</view>
<view class="flex-1 flex flex-col justify-start items-start">
<text>采购方补充条款:{{ info.supplementary ? info.supplementary : '无' }}</text>
<text>加工方补充条款:{{ item.supplierExt ? item.supplierExt : '无' }}</text>
</view>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
<el-button type="primary" @click.native="createContract(item)" v-if="info.status === 0">选择
</el-button>
</text>
</view>
</view>
</el-dialog>
</view>
</template>
<script>
import {BuildingOne, IdCard} from '@icon-park/vue'
import {BuildingOne, FileExcel, FilePdfOne, FileWord, IdCard} from '@icon-park/vue'
import dayjs from "dayjs";
import {WRITE_INVOICE_TIME, INVOICE_TYPE, PROCESS_PAY_METHOD} from '@/util'
import FileType from "../../components/file-type/file-type.vue";
export default {
components: {BuildingOne, IdCard},
data() {
return {
WRITE_INVOICE_TIME,
INVOICE_TYPE,
PROCESS_PAY_METHOD,
id: null,
info: null,
showDialog: false
};
},
methods: {
dayjs,
getInfo() {
vk.callFunction({
url: 'client/process/sheet/pub/getInfo',
data: {
id: this.id
}
}).then((res) => {
this.info = res
})
},
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
createContract({totalPrice, uid, _id}) {
vk.callFunction({
url: 'client/contract/kh/add',
data: {
type: 'process',
productTitle: this.info.title,
transactionId: vk.pubfn.createOrderNo("P", 20),
sheetId: this.id,
quoteId: _id,
buyer: vk.getVuex('$user.userInfo._id'),
seller: uid,
amount: totalPrice,
partyCount: 2,
signCount: 0,
}
}).then((res) => {
this.$message({
message: '选择成功',
type: 'success'
})
setTimeout(() => {
vk.navigateTo('/pages/contract/index')
}, 1500)
})
components: {FileType, FileWord, FilePdfOne, FileExcel, BuildingOne, IdCard,},
data() {
return {
WRITE_INVOICE_TIME,
INVOICE_TYPE,
PROCESS_PAY_METHOD,
id: null,
info: null,
showDialog: false
};
},
methods: {
dayjs,
getInfo() {
vk.callFunction({
url: 'client/process/sheet/pub/getInfo',
data: {
id: this.id
}
}).then((res) => {
this.info = res
this.info.disabled = (!this.info.answerEndTime || dayjs(this.info.answerEndTime).isBefore(dayjs()))
})
},
onLoad(option) {
if (!option.id) vk.navigateBack()
this.id = option.id
this.getInfo()
async toQuote() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (userInfo.factoryStatus !== 1) return this.$message.error('非加工厂,无法报价,请去个人中心申请加工厂')
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
if (this.info.earnestMoney && this.info.earnestMoney > 0 && userInfo.paidEnsure < this.info.earnestMoney) {
this.$confirm('保证金不足,是否去充值保证金?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=grade'});
})
return
}
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
}
},
createContract({totalPrice, uid, _id}) {
vk.callFunction({
url: 'client/contract/kh/add',
title: '请求中...',
data: {
type: 'process',
productTitle: this.info.title,
transactionId: vk.pubfn.createOrderNo("P", 20),
sheetId: this.id,
quoteId: _id,
buyer: vk.getVuex('$user.userInfo._id'),
seller: uid,
amount: totalPrice,
partyCount: 2,
signCount: 0,
}
}).then((res) => {
this.$message({
message: '选择成功',
type: 'success'
})
this.showDialog = false
setTimeout(() => {
if (this.info.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.info.signMethod === 1) vk.navigateTo('/pages/store/buyer?menuIndex=0')
else vk.navigateTo('/pages/contract/index?tab=0')
}
}, 1500)
})
},
openDownload(url) {
window.open(url)
}
},
onLoad(option) {
if (!option.id) vk.navigateBack()
this.id = option.id
this.getInfo()
}
}
</script>
@@ -263,68 +489,68 @@ export default {
@import "@/common/css/app.scss";
.page-main {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
border-radius: 5px;
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
border-radius: 5px;
}
.countdown {
padding: 2px 5px;
margin: 0 5px;
padding: 2px 5px;
margin: 0 5px;
}
.item-wrap {
margin: 24px 0;
margin: 24px 0;
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: $--color-primary;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
}
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: $--color-primary;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
}
}
}
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
text {
text-align: center;
}
text {
text-align: center;
}
}
.quote {
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
text {
text-align: center;
}
text {
text-align: center;
}
}
</style>
+577
View File
@@ -0,0 +1,577 @@
<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/index/process/list">找加工</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item class="text-main">加工厂列表</el-breadcrumb-item>
</el-breadcrumb>
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>
</el-row>
</view>
<view class="w-1200 m-a">
<common-swiper page="factory"/>
</view>
<!-- 筛选表单 -->
<view class="w-1200 m-a" style="margin-top: 30rpx">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="分类:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectCate({name: -1})" class="pointer mr-25"
:class="[(checkCategoryList.includes(-1) || checkCategoryList.length === 0) ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="selectCate(item)" class="pointer mr-25"
:class="[checkCategoryList.includes(item.name) ? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
</view>
</el-form-item>
<el-form-item label="地区" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
</text>
<view v-for="(item, index) in provinceData" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectProvince(item.code)"
:class="[checkProvinceList.includes(item.code)? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
</view>
</el-form-item>
</el-form>
</view>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad12.length">
<el-carousel :height="`100px`" :style="{width: '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad12" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad122.length">
<el-carousel :height="`100px`" :style="{width: '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad122" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<!-- 商品列表 -->
<view class="goods-list">
<view v-for="(item, index) in list.rows" :key="index" class="goods">
<view class="goods-info" @click="navTo(`/pages/yellowPage/factory?userId=${item.uid}`)">
<!-- <el-image src="https://oss.wsdns.cn/20231204/d35332fa6a3b4596b522edf9527ac612.png"-->
<!-- class="goods-img"/>-->
<view class="info">
<view class="field">
<view class="desc" style="width: 1000px">
<view class="text">加工主体</view>
<view class="font-bold" v-if="item.user">{{
item.user.accountType === 2 ? item.user.company.companyName : item.user.person.personName
}}
</view>
</view>
<view class="desc">
<view class="text">所在地区</view>
<view>{{ item.addressRegion.province.name }}{{ item.addressRegion.city.name }}</view>
</view>
<view class="desc">
<view class="text">成立年限</view>
<view>{{ item.year }}年</view>
</view>
<view class="desc">
<view class="text">年产值</view>
<view>{{ item.yearsIncome }}万元</view>
</view>
<view class="desc">
<view class="text">员工人数</view>
<view>{{ item.employeeNum }}人</view>
</view>
<view class="desc">
<view class="text">流水线数量</view>
<view>{{ item.flowNum }}条</view>
</view>
<view class="desc">
<view class="text">厂房归属</view>
<view>{{ item.blongTo }}</view>
</view>
<view class="desc">
<view class="text">厂房面积</view>
<view>{{ item.size }}㎡</view>
</view>
<view class="desc">
<view class="text">服务信息</view>
<view>{{ item.serviceInfo }}</view>
</view>
<view class="desc" v-if="item.mainSpotCategory && item.mainSpotCategory.length > 0">
<view class="text">主营类别</view>
<view>{{ item.mainSpotCategory.join() }}</view>
</view>
<view class="desc">
<view class="text">主营工艺和业务范围</view>
<view>{{ item.mainProcess }}</view>
</view>
</view>
</view>
</view>
<view class="buttons">
<button type="default" class="btn" plain @click="doShowContract(index)">查看电话
</button>
<button type="default" class="btn green mt-20" plain @click="doShowWechat(index)">添加微信
</button>
<button type="default" class="btn mt-20" plain @click="navTo(`/pages/yellowPage/factory?userId=${item.uid}`)">
查看详情
</button>
<view class="wechat"
v-if="item.user && parseInt(item.user.accountType) === 2 && item.user.businessCard && item.user.businessCard.companyWechat && item.showWechat">
<el-image :src="item.user.businessCard.companyWechat" style="width: 100%; height: 100%"/>
</view>
<view class="wechat"
v-if="item.user && parseInt(item.user.accountType) === 1 && item.user.businessCard && item.user.businessCard.personalWechat && item.showWechat">
<el-image :src="item.user.businessCard.personalWechat" style="width: 100%; height: 100%"/>
</view>
<view class="mobile" v-if="item.user && item.showContract && item.user.businessCard">
<i class="el-icon-phone"></i>
<text class="ml-20">{{
(item.user.businessCard && item.user.businessCard.companyMobile) ? item.user.businessCard.companyMobile : '暂无电话'
}}
</text>
</view>
</view>
</view>
<view class="paginatio">
<el-pagination @current-change="search" background layout="prev, pager, next" :total="list.total"
:page-size="pageSize">
</el-pagination>
</view>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import dayjs from "dayjs";
export default {
data() {
return {
checkCategoryList: [],
clickedCateIndex: -1,
provinceData: provinces,
checkProvinceList: [],
keyword: '',
list: {
total: 0,
rows: []
},
showAllProvince: false,
type: 0,
pageSize: 20,
ad12: [],
ad122: [],
categoryTreeData: [],
};
},
onLoad(option) {
if (option.type) this.type = option.type
vk.callFunction({
url: 'client/process/category/pub/getTree',
title: '请求中...',
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
}
});
},
onShow() {
this.search(1)
},
methods: {
navTo(url) {
vk.navigateTo({
url
})
},
selectCate({name}) {
if (name === -1) this.checkCategoryList = []
const index = this.checkCategoryList.indexOf(name)
if (index === -1) {
this.checkCategoryList = [name]
} else {
this.checkCategoryList = []
}
console.log(this.checkCategoryList)
this.search(1)
},
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
else {
this.checkProvinceList = [code]
}
this.search(1)
},
toMyEnquiry() {
vk.navigateTo({
url: '/pages/process/my'
})
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/process/release'
})
}
},
search(pageIndex) {
// const categoryIds = []
// this.allChildCate.map(item => {
// if (this.checkCategoryList.indexOf(item._id) > -1) categoryIds.push(item.name)
// })
vk.callFunction({
url: 'client/factory/pub/getList',
title: '加载中...',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
mainSpotCategory: this.checkCategoryList.length ? this.checkCategoryList[0] : null
},
success: ({data}) => {
data.rows.map(item => {
item.showWechat = false
item.showContract = false
return item
})
this.list = data
this.getAd12()
this.getAd122()
}
});
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
doShowWechat(index) {
if (parseInt(this.list.rows[index].user.accountType) === 2 && !this.list.rows[index].user.businessCard.companyWechat)
return vk.toast('用户暂未上传')
else if (parseInt(this.list.rows[index].user.accountType) === 1 && !this.list.rows[index].user.businessCard.personalWechat)
return vk.toast('用户暂未上传')
this.list.rows[index].showContract = false
this.list.rows[index].showWechat = !this.list.rows[index].showWechat
},
doShowContract(index) {
this.list.rows[index].showWechat = false
this.list.rows[index].showContract = !this.list.rows[index].showContract
},
async getAd12() {
this.ad12 = []
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 12,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad12 = res.data
},
async getAd122() {
this.ad122 = []
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 122,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad122 = res.data
},
},
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.page-nav {
display: flex;
justify-content: space-between;
}
.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;
flex-wrap: wrap;
.el-tag {
margin-right: 10px;
}
}
.goods-list {
width: 1200px;
margin: 20px auto;
display: flex;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
}
.goods {
background-color: #FFFFFF;
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.05);
text-align: center;
width: 1200px;
margin: 10px auto;
padding: 20px;
display: flex;
justify-content: space-between;
.goods-info {
display: flex;
flex: 1;
.goods-img {
width: 200px;
height: 150px;
}
.info {
width: 1000px;
text-align: left;
margin-left: 20px;
.goods-name {
font-size: 20px;
font-weight: 500;
line-height: 2.5em;
}
.field {
display: flex;
flex-wrap: wrap;
.desc {
display: flex;
width: 330px;
line-height: 2.5em;
.text {
width: 140px;
color: #999999;
}
}
}
}
}
.buttons {
padding: 0 20px;
width: 200px;
border-left: 1px solid #f3f3f3;
display: flex;
flex-direction: column;
justify-content: space-around;
position: relative;
.btn {
width: 120px;
}
.green {
background-color: #7ec050 !important;
color: #ffffff;
}
.wechat {
position: absolute;
left: -140px;
top: 0;
width: 150px;
height: 150px;
background-color: white;
border-radius: 10px;
padding: 5px;
box-shadow: 0 1px 10px 0 #eee
}
.mobile {
position: absolute;
left: -110px;
top: 10px;
background-color: white;
border-radius: 10px;
padding: 5px;
box-shadow: 0 1px 10px 0 #eee;
display: flex;
align-items: center;
justify-content: center;
}
}
&-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;
}
.goods-image {
width: 100%;
}
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
.selected-cate {
border-bottom: 2px solid #BD3124;
line-height: 40rpx;
}
.child-cate {
background-color: #DB8382;
color: white;
margin-top: 10rpx;
border-radius: 15rpx;
padding: 0 20rpx;
}
</style>
+492 -338
View File
@@ -1,388 +1,542 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<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="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="/static/images/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 @click="toMyEnquiry" 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="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="分类:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
{{ item.name }}
</text>
</view>
</view>
<view class="child-cate flex justify-start items-center flex-wrap">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
</text>
</template>
<!-- <text @click="showAllTexture = !showAllTexture" class="pointer mr-25" >查看更多-->
<!-- </text>-->
</view>
</el-form-item>
<el-form-item label="供应商:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectCompany(-1)" class="pointer mr-25"
:class="[checkCompanyList.length === 0 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in companyList" :key="index">
<text @click="selectCompany(item._id)" class="pointer mr-25"
:class="[checkCompanyList.includes(item._id) ? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllCompany">
{{ item.name }}
</text>
</view>
<text @click="showAllCompany = !showAllCompany" class="pointer mr-25"
v-if="companyList.length > 10">查看更多
</text>
</view>
</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="sheet-list">
<el-table :data="list.rows" style="width: 100%">
<el-table-column align="center" label="标题">
<template v-slot="{ row }">
<p class="text-main">{{ row.title }}</p>
</template>
</el-table-column>
<el-table-column prop="num" label="加工量"/>
<el-table-column align="center" label="采购企业">
<template v-slot="{ row }">
<p>{{
row.user.accountType === 1 ? row.user.person.personName : row.user.company.companyName
}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="报价情况">
<template v-slot="{ row }">
<p>{{ `${row.quoteNum}家已报价` }}</p>
</template>
</el-table-column>
<el-table-column align="center" prop="_add_time_srt" label="发布时间"/>
<el-table-column align="center" label="操作">
<template v-slot="{ row }">
<el-button size="mini" type="primary" plain @click.native="toDetail(row._id)">
{{ vk.getVuex('$user.userInfo._id') === row.userId ? '查看' : '申请加工' }}
</el-button>
</template>
</el-table-column>
</el-table>
<div class="mt-20 text-center">
<el-pagination @current-change="search" background layout="prev, pager, next"
:total="list.total" :page-size="pageSize"/>
</div>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
<view class="carousel">
<common-swiper page="process"/>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>
<el-button @click="toMyQuote" type="primary" round plain>我的报价</el-button>
<el-button @click="navTo('/pages/process/factoryList')" type="success" round plain>加工厂列表</el-button>
</el-row>
</view>
</view>
<!-- 筛选表单 -->
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="分类:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectCate({_id: -1})" class="pointer mr-25"
:class="[checkCategoryList.length === 0 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="selectCate(item)" class="pointer mr-25"
:class="[checkCategoryList.length && checkCategoryList.includes(item._id) ? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
</view>
<!-- <view class="child-cate flex justify-start items-center flex-wrap">-->
<!-- <template v-if="clickedCateIndex === -1">-->
<!-- <text class="pointer mr-25" @click="selectCate(item)"-->
<!-- :class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"-->
<!-- v-for="(item, index) in allChildCate" :key="index">{{ item.name }}-->
<!-- </text>-->
<!-- </template>-->
<!-- <template v-else>-->
<!-- <text class="pointer mr-25" @click="selectCate(item)"-->
<!-- :class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"-->
<!-- v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">-->
<!-- {{ item.name }}-->
<!-- </text>-->
<!-- </template>-->
<!-- &lt;!&ndash; <text @click="showAllTexture = !showAllTexture" class="pointer mr-25" >查看更多&ndash;&gt;-->
<!-- &lt;!&ndash; </text>&ndash;&gt;-->
<!-- </view>-->
</el-form-item>
<!-- <el-form-item label="供应商:" class="border-bottom pb-30">-->
<!-- <view class="flex justify-start items-center flex-wrap">-->
<!-- <text @click="selectCompany(-1)" class="pointer mr-25"-->
<!-- :class="[checkCompanyList.length === 0 ? 'text-main selected-cate' : '']">全部-->
<!-- </text>-->
<!-- <view v-for="(item, index) in companyList" :key="index">-->
<!-- <text @click="selectCompany(item._id)" class="pointer mr-25"-->
<!-- :class="[checkCompanyList.includes(item._id) ? 'text-main selected-cate' : '']"-->
<!-- v-if="index < 10 || showAllCompany">-->
<!-- {{ item.name }}-->
<!-- </text>-->
<!-- </view>-->
<!-- <text @click="showAllCompany = !showAllCompany" class="pointer mr-25"-->
<!-- v-if="companyList.length > 10">查看更多-->
<!-- </text>-->
<!-- </view>-->
<!-- </el-form-item>-->
<el-form-item label="地区:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
</text>
<view v-for="(item, index) in provinceData" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectProvince(item.code)"
:class="[checkProvinceList.includes(item.code)? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
<!-- <text @click="showAllProvince = !showAllProvince" class="pointer mr-25">查看更多-->
<!-- </text>-->
</view>
</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>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad13.length">
<el-carousel :height="`100px`" :style="{width: ad14.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad13" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad14.length">
<el-carousel :height="`100px`" :style="{width: ad13.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad14" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<!-- 商品列表 -->
<view class="sheet-list">
<view class="flex justify-start items-center my-20">
<el-button @click="changeStatus(0)" type="primary" :plain="status === 1" round>正在询价</el-button>
<el-button @click="changeStatus(1)" type="primary" :plain="status === 0" round>合作成交
</el-button>
</view>
<el-table :data="list.rows" style="width: 100%" :loading="loading">
<el-table-column align="center" label="标题">
<template v-slot="{ row }">
<p class="text-main">{{ row.title }}</p>
</template>
</el-table-column>
<el-table-column prop="num" label="加工量" width="80"/>
<el-table-column align="center" label="采购企业" width="260">
<template v-slot="{ row }">
<p v-if="row.user">{{
row.user.accountType === 1 ? row.user.person.personName : row.user.company.companyName
}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="加工产品交货地址">
<template v-slot="{ row }">
<p v-if="row.addressRegion && row.addressRegion.province">{{
row.addressRegion.province.name
}}{{ row.addressRegion.city.name }}{{
row.addressRegion.area.name
}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="报价情况">
<template v-slot="{ row }">
<p>{{ `${row.quoteNum}家已报价` }}</p>
</template>
</el-table-column>
<el-table-column align="center" prop="_add_time_str" label="发布时间"/>
<el-table-column align="center" label="操作">
<template v-slot="{ row }">
<el-button size="mini" type="primary" plain @click.native="toDetail(row._id)" v-if="status === 0">
{{ vk.getVuex('$user.userInfo._id') === row.userId ? '查看' : '申请合作' }}
</el-button>
<el-button size="mini" type="primary" plain @click.native="toDetail(row._id)" v-if="status === 1">
查看详情
</el-button>
</template>
</el-table-column>
</el-table>
<div class="mt-20 text-center">
<el-pagination @current-change="search" background layout="prev, pager, next"
:total="list.total" :page-size="pageSize"/>
</div>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
export default {
data() {
return {
categoryTreeData: [],
checkProvinceList: [],
allChildCate: [],
companyList: [],
checkCompanyList: [],
clickedCateIndex: -1,
checkCategoryList: [],
checkCategoryNameList: [],
showAllCompany: false,
keyword: '',
queryParam: {},
list: {
rows: [],
total: 0
},
pageSize: 20
};
data() {
return {
categoryTreeData: [],
checkProvinceList: [],
allChildCate: [],
companyList: [],
checkCompanyList: [],
clickedCateIndex: -1,
checkCategoryList: [],
checkCategoryNameList: [],
showAllCompany: false,
keyword: '',
queryParam: {},
list: {
rows: [],
total: 0
},
pageSize: 20,
provinceData: provinces,
showAllProvince: true,
loading: true,
status: 0,
ad13: [],
ad14: [],
};
},
onLoad(options) {
if (options && options.keyword) this.keyword = options.keyword
// this.search(1)
vk.callFunction({
url: 'client/process/category/pub/getTree',
title: '请求中...',
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
console.log(child)
this.allChildCate.push(child)
})
})
}
});
this.search()
this.getCompany()
},
methods: {
selectCate({_id, name}) {
if (_id === -1) {
this.checkCategoryList = []
this.checkCategoryNameList = []
return this.search(1)
}
const index = this.checkCategoryList.indexOf(_id)
if (index === -1) {
this.checkCategoryList = [_id]
this.checkCategoryNameList = [name]
} else {
this.checkCategoryList.splice(index, 1)
this.checkCategoryNameList.splice(index, 1)
}
this.search(1)
},
onLoad() {
// this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
}
});
this.search()
this.getCompany()
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
else {
// const index = this.checkProvinceList.indexOf(code)
// if (index === -1) this.checkProvinceList.push(code)
// else this.checkProvinceList.splice(index, 1)
this.checkProvinceList = [code]
}
this.search(1)
},
methods: {
selectCate({_id, name}) {
const index = this.checkCategoryList.indexOf(_id)
console.log(_id, name, index)
if (index === -1) {
this.checkCategoryList.push(_id)
this.checkCategoryNameList.push(name)
} else {
this.checkCategoryList.splice(index, 1)
this.checkCategoryNameList.splice(index, 1)
}
this.search(1)
},
selectTexture(id) {
if (id === -1) this.checkTextureList = []
else {
const index = this.checkTextureList.indexOf(id)
if (index === -1) this.checkTextureList.push(id)
else this.checkTextureList.splice(index, 1)
}
this.search(1)
},
selectCompany(id) {
if (id === -1) this.checkCompanyList = []
else {
const index = this.checkCompanyList.indexOf(id)
if (index === -1) this.checkCompanyList.push(id)
else this.checkCompanyList.splice(index, 1)
}
this.search(1)
},
getCompany() {
vk.callFunction({
url: 'client/user/pub/getCompany',
title: '请求中...',
data: {},
success: (data) => {
this.companyList = data.rows.map(item => {
item.name = item.company.companyName
return item
})
}
});
},
toMyEnquiry() {
vk.navigateTo({
url: '/pages/process/my'
})
},
async toRelease() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=business-card'});
})
} else {
vk.navigateTo({
url: '/pages/process/release'
})
}
},
async toDetail(id) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
vk.navigateTo({
url: `/pages/process/detail?id=${id}`
})
}
},
search(pageIndex = 1) {
vk.callFunction({
url: 'client/process/sheet/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
companyList: this.checkCompanyList,
categoryIds: this.checkCategoryList
},
success: (data) => {
this.list = data
console.log(this.list)
}
});
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryNameList.forEach(name => {
arr.push({name})
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
getCompany() {
vk.callFunction({
url: 'client/user/pub/getCompany',
title: '请求中...',
data: {},
success: (data) => {
this.companyList = data.rows.map(item => {
item.name = item.company.companyName
return item
})
}
});
},
toMyEnquiry() {
vk.navigateTo({
url: '/pages/process/my'
})
},
toMyQuote() {
vk.navigateTo({
url: '/pages/process/quote/my'
})
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/process/release'
})
}
},
async toDetail(id) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: `/pages/process/detail?id=${id}`
})
}
},
search(pageIndex = 1) {
vk.callFunction({
url: 'client/process/sheet/pub/getList',
title: '请求中...',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
// companyList: this.checkCompanyList,
categoryIds: this.checkCategoryList.length ? this.checkCategoryList : null,
provinceCodes: this.checkProvinceList,
status: this.status,
},
success: (data) => {
this.list = data
this.loading = false
this.getAd13()
this.getAd14()
}
});
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
navTo(url) {
vk.navigateTo({url});
},
changeStatus(status) {
this.status = status
this.search(1)
},
async getAd13() {
this.ad13 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 13,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad13 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 1,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad13.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd14() {
this.ad14 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 14,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad14 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 2,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad14.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryNameList.forEach(name => {
arr.push({name})
})
this.provinceData.forEach(item => {
if (this.checkProvinceList.includes(item.code)) {
arr.push(item)
}
})
return arr
}
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
display: flex;
.el-tag {
margin-right: 10px;
}
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
.selected-cate {
border-bottom: 2px solid #BD3124;
line-height: 40rpx;
border-bottom: 2px solid #BD3124;
line-height: 40rpx;
}
.child-cate {
background-color: #DB8382;
color: white;
margin-top: 10rpx;
border-radius: 15rpx;
padding: 0 20rpx;
background-color: #DB8382;
color: white;
margin-top: 10rpx;
border-radius: 15rpx;
padding: 0 20rpx;
}
</style>
+298 -244
View File
@@ -1,293 +1,347 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<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="/static/images/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 @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>-->
</el-row>
</view>
</view>
<!-- 加工单列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
<!-- <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="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
<!-- mode="aspectFill"></image>-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<common-swiper page="process-mine" :height="200"/>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<!-- <el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>-->
</el-row>
</view>
</view>
<!-- 加工单列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
categoryTreeData: [],
checkCategoryList: [],
checkProvinceList: [],
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: (obj = {}) => {
let {data, success, fail, complete} = obj;
vk.callFunction({
url: `client/process/sheet/pub/getList`,
data: {
...data, ...{
userId: vk.getVuex('$user.userInfo._id')
}
},
success: (res) => {
if (typeof success === "function") {
success({
rows: res.rows, // 列表数据
total: res.total, // 总记录数
});
}
},
fail: (err => {
}),
complete: (res) => {
if (typeof complete === "function") complete(res);
}
})
},
customRightBtns: [{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/process/detail?id=' + item._id);
}
},],
// 表格字段显示规则
columns: [
{
key: "title",
title: "标题",
type: "text",
},
{
key: "num",
title: "加工量",
type: "text"
},
{
key: "productList",
title: "收货地",
type: "text",
minWidth: 200,
formatter: (val, row, column, index) => {
let str = ""
try {
str = val.map(item => {
const addressStr = item.address.region.province.name + "-" + item.address.region.city.name + "-" + item.address.region.area.name
return addressStr
}).join("/")
} catch (err) {
str = ""
}
return str
}
},
// {
// key: "user",
// title: "采购单位",
// type: "text",
// width: 280,
// formatter: (val, row, column, index) => {
// if(val.accountType == 1) {
// return val.person.personName
// }else {
// return val.company.companyName
// }
// }
//
// },
{
key: "_add_time_srt",
title: "添加时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
data() {
return {
categoryTreeData: [],
checkCategoryList: [],
checkProvinceList: [],
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: (obj = {}) => {
let {data, success, fail, complete} = obj;
vk.callFunction({
url: `client/process/sheet/pub/getList`,
data: {
...data, ...{
userId: vk.getVuex('$user.userInfo._id'),
isUser: true
}
},
// 表格相关结束 -----------------------------------------------------------
};
},
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([])
}
success: (res) => {
if (typeof success === "function") {
success({
rows: res.rows, // 列表数据
total: res.total, // 总记录数
});
}
},
fail: (err => {
}),
complete: (res) => {
if (typeof complete === "function") complete(res);
}
});
},
methods: {
toMyEnquiry() {
vk.navigateTo({
url: '/pages/enquiry/my'
})
})
},
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 {
vk.navigateTo({
url: '/pages/process/release'
})
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/process/detail?id=' + item._id);
}
},
search(pageIndex) {
const categoryIds = []
this.checkCategoryList.forEach(item => {
item.forEach(sitem => {
categoryIds.push(sitem._id)
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('如果你要删除此条信息,之前其他客户填写的留言将无法查看', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.callFunction({
url: 'client/process/sheet/kh/delete',
title: '请求中...',
data: {
_id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
let provinceCodes = this.checkProvinceList.map(item => item.code)
if (provinceCodes.includes(9999)) {
provinceCodes = []
})
}
},
],
// 表格字段显示规则
columns: [
{
key: "orderNo",
title: "单号",
type: "text",
},
{
key: "title",
title: "标题",
type: "text",
},
{
key: "num",
title: "加工量",
type: "text"
},
{
key: "quoteNum",
title: "报价数",
type: "text",
formatter: (val, row, column, index) => {
return `${val}家已报价`
}
},
// {
// key: "productList",
// title: "收货地",
// type: "text",
// minWidth: 200,
// formatter: (val, row, column, index) => {
// let str = ""
// try {
// str = val.map(item => {
// const addressStr = item.address.region.province.name + "-" + item.address.region.city.name + "-" + item.address.region.area.name
// return addressStr
// }).join("/")
// } catch (err) {
// str = ""
// }
//
// return str
// }
// },
// {
// key: "user",
// title: "采购单位",
// type: "text",
// width: 280,
// formatter: (val, row, column, index) => {
// if(val.accountType == 1) {
// return val.person.personName
// }else {
// return val.company.companyName
// }
// }
//
// },
{
key: "_add_time_str",
title: "发布时间",
type: "time",
},
vk.callFunction({
url: 'client/process/sheet/pub/getList',
data: {
pageIndex: pageIndex,
pageSize: 20,
keyword: this.keyword,
},
success: (data) => {
console.log('data: ', data);
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
this.goodsData = data
}
});
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
},
// 表格相关结束 -----------------------------------------------------------
};
},
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: {
toMyEnquiry() {
vk.navigateTo({
url: '/pages/enquiry/my'
})
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/process/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/process/sheet/pub/getList',
data: {
pageIndex: pageIndex,
pageSize: 20,
keyword: this.keyword,
},
success: (data) => {
console.log('data: ', data);
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;
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
display: flex;
.el-tag {
margin-right: 10px;
}
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+63 -33
View File
@@ -15,6 +15,7 @@
</view>
<view class="page-main">
<quote-remain-num v-if="reloaded" :amount="sheet.quoteAmount" type="process" :id="sheetId"/>
<vk-data-form
ref="form1"
v-model="form1.data"
@@ -24,9 +25,16 @@
:form-type="form1.props.formType"
:loading.sync="form1.props.loading"
:auto-close="true"
label-width="140px"
label-width="180px"
:show-cancel="false"
@success="onFormSuccess"
></vk-data-form>
:need-alert="false"
@fail="onFormFail"
>
<template v-slot:totalPrice>
<el-input v-model="form1.data.totalPrice" placeholder="请输入货款总价" @change="formatNumber"></el-input>
</template>
</vk-data-form>
</view>
<common-footer></common-footer>
@@ -37,13 +45,17 @@
export default {
data() {
return {
reloaded: false,
sheet: null,
sheetId: null,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null
sheetId: null,
totalPrice: null,
},
// 表单属性
props: {
@@ -51,14 +63,15 @@ export default {
action: "client/process/quote/kh/addQuote",
// 表单字段显示规则
columns: [
{key: "totalPrice", title: "货款总价", type: "number"},
{key: "totalPriceStr", title: "人民币大写", type: "text"},
{key: "remark", title: "报价单详情", type: "editor"},
{key: "totalPrice", title: "加工总价(人民币:元)", type: "html"},
{key: "files", title: "附件", type: "file", accept: '.pdf', tips: '仅限PDF格式附件或合同,非协议合同将读取为合同附件,请仔细核查'},
{key: "remark", title: "报价单详情", type: "textarea"},
{key: "supplierExt", title: "合同补充条款", type: "textarea"},
],
// 表单验证规则
rules: {
text: [
{required: true, message: "text不能为空", trigger: "change"},
totalPrice: [
{required: true, message: "货款总价不能为空", trigger: "change,blur"},
]
},
// add 代表添加 update 代表修改
@@ -84,7 +97,7 @@ export default {
this.sheetId = sheetId
this.form1.data.sheetId = sheetId
// this.getEnquiryDetail()
this.getDetail()
},
computed: {
@@ -97,7 +110,26 @@ export default {
},
methods: {
onFormSuccess() {
vk.navigateBack()
vk.redirectTo({url: `/pages/process/detail?id=${this.sheetId}`})
},
onFormFail(data) {
if (data.data.code === 12) {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.redirectTo({url: `/pages/user/user?menu=grade`})
})
}else {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateBack()
})
}
},
// 提交报价单
async submit() {
@@ -127,29 +159,27 @@ export default {
/**
* 获取询价单详情
*/
// getEnquiryDetail() {
// vk.callFunction({
// url: 'client/progress/sheet/pub/getDetail',
// title: '请求中...',
// data: {
// _id: this.sheetId
// },
// success: (res) => {
//
// res.data.productList.forEach(item => {
// item.unitPrice = 0
// const keys = Object.keys(item.extraAttributes)
// keys.forEach(citem => {
// item.extraAttributes[citem] = JSON.parse(item.extraAttributes[
// citem])
// })
// })
//
//
// this.sheet = res.data
// }
// });
// }
getDetail() {
vk.callFunction({
url: 'client/process/sheet/pub/getInfo',
title: '请求中...',
data: {
id: this.sheetId
},
success: (res) => {
this.sheet = res
}
});
},
formatNumber(e){
this.form1.data.totalPrice = parseFloat(this.form1.data.totalPrice).toFixed(2)
}
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
+290
View File
@@ -0,0 +1,290 @@
<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="/static/images/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 @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>-->
</el-row>
</view>
</view>
<!-- 加工单列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
categoryTreeData: [],
checkCategoryList: [],
checkProvinceList: [],
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: (obj = {}) => {
let {data, success, fail, complete} = obj;
vk.callFunction({
url: `client/process/quote/kh/getList`,
data: {
...data, ...{
userId: vk.getVuex('$user.userInfo._id')
}
},
success: (res) => {
if (typeof success === "function") {
success({
rows: res.rows, // 列表数据
total: res.total, // 总记录数
});
}
},
fail: (err => {
}),
complete: (res) => {
if (typeof complete === "function") complete(res);
}
})
},
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/process/detail?id=' + item.sheetId);
}
},
],
// 表格字段显示规则
columns: [
{
key: "sheet.title",
title: "加工标题",
type: "text",
},
{
key: "sheet.num",
title: "加工量",
type: "text"
},
{
key: "totalPrice",
title: "金额",
type: "text",
formatter: (val, row, column, index) => {
return `${val}元`
}
},
{
key: "remark",
title: "备注",
type: "text"
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
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: {
toMyEnquiry() {
vk.navigateTo({
url: '/pages/enquiry/my'
})
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0 ) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/process/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/process/sheet/pub/getList',
data: {
pageIndex: pageIndex,
pageSize: 20,
keyword: this.keyword,
},
success: (data) => {
console.log('data: ', data);
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;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+791 -705
View File
File diff suppressed because it is too large Load Diff
+264 -208
View File
@@ -10,33 +10,42 @@
<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>
<image class="logo" :src="product.user.businessCard.logo" mode="aspectFit"
v-if="product.user.businessCard"></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>
<template v-if="product.user">
<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 flex justify-start items-center">
<text class="mr-25">{{ product.user.company.companyName }}</text>
<el-button type="primary" v-if="product.user.showInYellow === 1" size="small"
@click="navTo(`/pages/yellowPage/info?id=${product.user._id}`)">查看主页
</el-button>
</view>
</template>
<view class="info-update">
<view class="info-update-time">
{{ product._add_time_str }}
</view>
<view class="info-update-business">
主营业务:{{ product.user.businessCard.mainBusiness }}
主营业务:{{
(product.user.company.mainSpotCategory && product.user.company.mainSpotCategory.length > 0) ? product.user.company.mainSpotCategory.join() : ''
}}
</view>
</view>
</view>
</view>
<view class="card-header-right">
<view class="card-header-right flex flex-col justify-center items-center">
<text class="mb-20 text-main">{{ product.quoteNum }}家已申请合作</text>
<el-button v-if="vk.getVuex('$user.userInfo._id') !== product.userId" @click="toCooperate"
type="primary">申请合作
</el-button>
@@ -50,20 +59,36 @@
<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>
<!-- <template v-if="product.user">-->
<!-- <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>-->
<!-- </template>-->
<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 }}
供货地:{{
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>
<view class="card-body-stock">截止: {{
dayjs(product.answerEndTime).format('YYYY-MM-DD HH:mm:ss')
}}
</view>
</view>
<view class="card-body">
<div class="part-head">
<h3>附件</h3>
<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"
@@ -76,6 +101,14 @@
</ul>
</view>
<view class="card-body">
<div class="part-head">
<h3>产品现场图片</h3>
</div>
<el-image :preview-src-list="product.images" v-for="(item, index) in product.images" :key="index"
:src="item" style="width: 100px; height: 100px" class="mr-10 mb-15" fit="cover"/>
</view>
<view class="card-body">
<div class="part-head">
<h3>已收到的合作申请</h3>
@@ -84,7 +117,8 @@
:customRightBtns="table1.customRightBtns"></vk-data-table>
</view>
</view>
<Gap/>
<common-footer></common-footer>
<el-dialog :visible.sync="showDialog" width="70%" :show-close="false">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
@@ -93,20 +127,22 @@
</view>
<view class="mt-15" v-if="product">
<view class="request-header">
<text class="flex-1">企业</text>
<text class="flex-1">申请人</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">联系方式</text>
<text class="flex-1">合作留言</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in product.cooperateList" :key="index">
<text class="flex-1">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
item.user.userId !== product.userId ? item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : item.user.person.personName.replace(/^(.).*(.)$/, "$1*$2")
}}
</text>
<text class="flex-1">{{ item.name }}</text>
<text class="flex-1">{{ item.mobile }}</text>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
{{ item.user.accountType === 1 ? item.user.person.mobile : item.user.company.mobile }}
</text>
<text class="flex-1">
<el-button type="primary" @click.native="doShowInfo(item)">查看申请详情</el-button>
</text>
@@ -115,17 +151,39 @@
</el-dialog>
<el-dialog :visible.sync="form1.props.show" title="申请合作" width="60%" mode="form">
<vk-data-form ref="table1" 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-form ref="form" :model="formData" label-width="120px">
<el-form-item label="企业名称" v-if="parseInt(vk.getVuex('$user.userInfo.accountType')) === 2">
<el-input v-model="formData.companyName" placeholder="请输入企业名称"/>
</el-form-item>
<el-form-item label="联系人姓名">
<el-input v-model="formData.name" placeholder="请输入联系人姓名"/>
</el-form-item>
<el-form-item label="联系人电话">
<el-input v-model="formData.mobile" placeholder="请输入联系人电话"/>
</el-form-item>
<el-form-item label="合作留言">
<el-input v-model="formData.remark" placeholder="请输入合作留言"/>
</el-form-item>
<el-form-item label="附件">
<vk-data-upload v-model="formData.files" list-type="text"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf"/>
</el-form-item>
</el-form>
<view class="text-center">
<el-button type="primary" @click.native="addCoop">确定</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" :show-cancel="false"-->
<!-- :beforeAction="form1.props.beforeAction" :auto-close="true" label-width="140px"-->
<!-- @success="onFormSuccess">-->
<!-- </vk-data-form>-->
</el-dialog>
<vk-data-dialog
v-model="showInfo"
title="申请详情"
width="600px"
width="60%"
top="14vh"
center
:close-on-click-modal="true"
@@ -145,17 +203,38 @@
</template>
<script>
import Gap from "../../../components/gap/gap.vue";
import dayjs from "dayjs";
export default {
components: {Gap},
data() {
return {
showDialog: false,
showInfo: false,
info: null,
allChildCate: [],
infoColumns: [
{key: "company.companyName", title: "申请人", type: "text"},
{key: "company.mobile", title: "联系方式", type: "text"},
{key: "manager.personName", title: "代理人", type: "text"},
{key: "manager.mobile", title: "代理人联系方式", type: "text"},
{key: "user.company.companyName", title: "企业", type: "text"},
{key: "name", title: "联系人", type: "text"},
{key: "mobile", title: "联系方式", type: "text"},
{key: "remark", title: "合作留言", type: "text"},
{
key: "files", title: "附件", type: "html",
formatter: (val = [], row, column, index) => {
let content = ''
val.forEach((item, itemIndex) => {
content += `<a href="${item}" target="_blank">预览:文件${itemIndex + 1}</a> `
})
return content
}
},
{
key: "_add_time_str",
title: "申请时间",
type: "text",
align: "left",
},
],
product: {
name: '现货详情',
@@ -169,123 +248,52 @@ export default {
},
cooperateList: []
},
formData: {
companyName: '',
name: '',
mobile: '',
remark: '',
accountType: parseInt(vk.getVuex('$user.userInfo.accountType')),
goodsId: null,
goodsUserId: null,
files: [],
},
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {},
data: {
companyName: '',
name: '',
mobile: '',
remark: '',
},
// 表单属性
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: "姓名",
columns: [
{
key: "companyName",
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
return parseInt(vk.getVuex('$user.userInfo.accountType')) === 2
},
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: "name",
title: "联系人姓名",
type: "text",
},
{
key: "mobile",
title: "联系人电话",
type: "text",
},
{
key: "remark",
title: "备注",
title: "合作留言",
type: "textarea",
maxlength: 200,
showWordLimit: true,
@@ -293,11 +301,12 @@ export default {
],
// 表单验证规则
rules: {
text: [{
required: true,
message: "text不能为空",
trigger: "change"
},
text: [
{
required: true,
message: "text不能为空",
trigger: "change"
},
{
required: true,
message: "text不能为空",
@@ -323,55 +332,53 @@ export default {
// 表格数据
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);
}
}
},
columns: [
{
key: "subjectMobile",
title: "联系方式",
key: "user.company.companyName",
title: "企业",
type: "text",
width: 120,
formatter: (val, row, column, index) => {
let str = val
if (row.managerMobile) {
str = row.managerMobile
if (val) {
if (vk.getVuex('$user.userInfo._id') === this.product.userId) {
return val
}
return val.slice(0, 2) + "******";
}
if (vk.getVuex('$user.userInfo._id') == this.product.userId) {
return str
}
return vk.pubfn.hidden(str, 3, 4);
return ''
}
},
// {
// 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: "name",
title: "申请人",
type: "text",
formatter: (val, row, column, index) => {
if (vk.getVuex('$user.userInfo._id') === this.product.userId) {
return val
}
return val.slice(0, 1) + "**";
}
},
{
key: "mobile",
title: "联系方式",
type: "text",
formatter: (val, row, column, index) => {
if (vk.getVuex('$user.userInfo._id') === this.product.userId) {
return val
}
return "******";
}
},
{
key: "remark",
title: "合作留言",
type: "textarea",
},
{
key: "_add_time",
title: "申请时间",
type: "time",
},
],
customRightBtns: [{
@@ -389,23 +396,9 @@ export default {
}
},
onLoad({
id
}) {
onLoad({id}) {
// 获取现货数据
vk.callFunction({
url: 'client/spot/goods/pub/getDetail',
title: '请求中...',
data: {
_id: id,
},
success: (data) => {
console.log(data);
this.product = data.data
}
});
this.getCategoryTreeData(id)
// 获取用户数据
vk.userCenter.getCurrentUserInfo({
success: (data) => {
@@ -416,22 +409,64 @@ export default {
console.log('form1: ', {
...this.form1.data
});
if (data.userInfo.accountType === 1) {
this.formData.name = data.userInfo.person.personName
this.formData.mobile = data.userInfo.person.mobile
} else {
this.formData.companyName = data.userInfo.company.companyName
this.formData.mobile = data.userInfo.company.mobile
if (data.userInfo.manager) this.formData.name = data.userInfo.manager.personName
}
}
});
},
methods: {
dayjs,
getCategoryTreeData(id) {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.allChildCate = []
data.rows.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
this.getInfo(id)
}
});
},
getInfo(id) {
vk.callFunction({
url: 'client/spot/goods/pub/getDetail',
title: '请求中...',
data: {
_id: id,
},
success: (data) => {
this.product = data.data
this.product.user.company.mainSpotCategory = []
if (this.product.user.company && this.product.user.company.mainSpotCategoryIds) {
this.allChildCate.forEach(child => {
if (this.product.user.company.mainSpotCategoryIds.includes(child._id)) {
this.product.user.company.mainSpotCategory.push(child.name)
}
})
}
}
});
},
downloadFile(url) {
location.href = url
},
showCooperate() {
this.table2.show = true
},
async toCooperate() {
const {userInfo} = await vk.callFunction({
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -439,12 +474,20 @@ export default {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=business-card'});
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
this.form1.props.show = true
@@ -459,12 +502,25 @@ export default {
}
});
},
onFormSuccess() {
this.form1.props.show = false
},
doShowInfo(info) {
this.info = info
this.showInfo = true
},
addCoop() {
if (!this.formData.name) return this.$message.error('请填写联系人姓名')
if (!this.formData.mobile) return this.$message.error('请填写联系方式')
this.formData.goodsId = this.product._id
this.formData.goodsUserId = this.product.userId
vk.callFunction({
url: 'client/spot/goods/kh/addCooperate',
data: this.formData
})
this.form1.props.show = false
this.$message.success('提交成功')
this.getInfo(this.product._id)
},
navTo(url) {
vk.navigateTo({url})
}
},
filters: {
+521 -357
View File
@@ -1,411 +1,575 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<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="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="/static/images/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 @click="toMy" type="primary" round plain class="empty-bg-plain-btn">我发布的现货
</el-button>
</el-row>
</view>
</view>
<!-- 筛选表单 -->
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="现货分类" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
{{ item.name }}
</text>
</view>
</view>
<view class="child-cate flex justify-start items-center flex-wrap">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
</text>
</template>
</view>
</el-form-item>
<el-form-item label="城市" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
</text>
<view v-for="(item, index) in provinceData" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectProvince(item.code)"
:class="[checkProvinceList.includes(item.code)? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllProvince">
{{ item.name }}
</text>
</view>
<text @click="showAllProvince = !showAllProvince" class="pointer mr-25">查看更多
</text>
</view>
</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"
:style="{marginRight:( (index + 1) % 5 === 0 && index > 0) ? 0 : '28px'}">
<view class="goods-title">{{ item.name }}</view>
<view class="goods-stock mt-40">现货库存:{{ item.stock }}吨</view>
<view class="goods-address text-gray">供货地:{{ 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
class="empty-bg-plain-btn"
size="small">立即查看
</el-button>
</view>
</view>
<view class="paginatio">
<el-pagination
:page-size="pageSize"
:current-page="goodsData.page"
@current-change="search"
background
layout="prev, pager, next"
:total="goodsData.total">
</el-pagination>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
<view class="carousel">
<common-swiper page="spot"/>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布现货</el-button>
<el-button @click="toMy" type="primary" round plain class="empty-bg-plain-btn">我发布的现货
</el-button>
</el-row>
</view>
</view>
<!-- 筛选表单 -->
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="现货分类" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
{{ item.name }}
</text>
</view>
</view>
<view class="child-cate flex justify-start items-center flex-wrap">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
</text>
</template>
</view>
</el-form-item>
<el-form-item label="城市" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
</text>
<view v-for="(item, index) in provinceData" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectProvince(item.code)"
:class="[checkProvinceList.includes(item.code)? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllProvince">
{{ item.name }}
</text>
</view>
<!-- <text @click="showAllProvince = !showAllProvince" class="pointer mr-25">查看更多-->
<!-- </text>-->
</view>
</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>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad9.length">
<el-carousel :height="`100px`" :style="{width: ad10.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad9" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad10.length">
<el-carousel :height="`100px`" :style="{width: ad9.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad10" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<!-- 商品列表 -->
<template v-if="!loading">
<template v-if="goodsData.rows.length > 0">
<view class="goods-list">
<view v-for="(item, index) in goodsData.rows" :key="index" class="goods"
:style="{marginRight:( (index + 1) % 5 === 0 && index > 0) ? 0 : '28px'}">
<view class="top" v-if="item.isTop">特别推荐</view>
<view class="top" v-if="!item.isTop && index < 10">最新</view>
<view class="goods-title">{{ item.name }}</view>
<view class="goods-stock mt-40">现货库存:{{ item.stock }}吨</view>
<view class="goods-address text-gray">供货地:{{ item.addressStr }}</view>
<!-- <view class="goods-image">-->
<!-- <image :src="item.user.businessCard.logo" mode="aspectFit"></image>-->
<!-- </view>-->
<view class="goods-company">
<template v-if="item.user">
<view v-if="item.user.accountType == 1">{{
item.user.person.personName.replace(/^(.).*$/, "$1**")
}}
</view>
<view v-if="item.user.accountType == 2">{{
item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")
}}
</view>
</template>
</view>
<el-button @click="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id);" type="primary"
plain
class="empty-bg-plain-btn"
size="small">立即查看
</el-button>
</view>
</view>
</template>
<view v-else class="flex justify-center items-center flex-col">
<data-null theme="outline" size="24" fill="#9b9b9b" strokeLinecap="square"/>
<text class="text-gray mt-20">暂无内容</text>
</view>
</template>
<view class="paginatio">
<el-pagination
:page-size="pageSize"
:current-page="pageIndex"
@current-change="search"
background
layout="prev, pager, next"
:total="goodsData.total">
</el-pagination>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import {DataNull} from '@icon-park/vue'
export default {
data() {
return {
pageSize: 20,
categoryTreeData: [],
allChildCate: [],
checkCategoryList: [],
clickedCateIndex: -1,
provinceData: provinces,
checkProvinceList: [],
keyword: '',
goodsData: {
total: 0,
rows: []
},
showAllProvince: false
};
components: {DataNull},
data() {
return {
pageSize: 20,
pageIndex: 1,
categoryTreeData: [],
allChildCate: [],
checkCategoryList: [],
clickedCateIndex: -1,
provinceData: provinces,
checkProvinceList: [],
keyword: '',
goodsData: {
total: 0,
rows: []
},
showAllProvince: true,
loading: false,
ad9: [],
ad10: [],
};
},
onLoad(options) {
if (options && options.keyword) this.keyword = options.keyword
},
onShow() {
this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
}
});
},
methods: {
selectCate(id) {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList.push(id)
else this.checkCategoryList.splice(index, 1)
this.search(1)
},
onShow() {
this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
}
});
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
else {
// const index = this.checkProvinceList.indexOf(code)
// if (index === -1) this.checkProvinceList.push(code)
// else this.checkProvinceList.splice(index, 1)
this.checkProvinceList = [code]
}
this.search(1)
},
methods: {
selectCate(id) {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList.push(id)
else this.checkCategoryList.splice(index, 1)
this.search(1)
},
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
else {
const index = this.checkProvinceList.indexOf(code)
if (index === -1) this.checkProvinceList.push(code)
else this.checkProvinceList.splice(index, 1)
}
this.search(1)
},
async toRelease() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=business-card'});
})
} else {
vk.navigateTo({
url: '/pages/spot/release/release'
})
}
},
async toMy() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
vk.navigateTo({
url: '/pages/spot/goods/my'
})
}
},
search(pageIndex) {
vk.callFunction({
url: 'client/spot/goods/pub/getList',
data: {
pageIndex: pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
categoryIds: this.checkCategoryList,
provinceCodes: this.checkProvinceList
},
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
}
});
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
},
computed: {
checkCategoryArr() {
const arr = []
this.allChildCate.forEach(item => {
if (this.checkCategoryList.includes(item._id)) arr.push(item)
})
this.provinceData.forEach(item => {
if (this.checkProvinceList.includes(item.code)) {
arr.push(item)
}
})
return arr
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
console.log(userInfo.businessCard)
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
if (userInfo.userLevel < 1) {
this.$confirm('非年费会员,无法发布现货', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/spot/release/release'
})
}
},
async toMy() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
if (userInfo.userLevel < 1) {
this.$confirm('非年费会员,无法发布现货', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/spot/goods/my'
})
}
},
search(pageIndex) {
this.loading = true
vk.callFunction({
url: 'client/spot/goods/pub/getList',
title: '请求中...',
data: {
pageIndex: pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
// categoryIds: this.allChildCate.filter(item => this.checkCategoryList.includes(item._id)).map(item => item.name),
categoryIds: this.checkCategoryList,
provinceCodes: this.checkProvinceList
},
success: (data) => {
this.loading = false
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
this.getAd9()
this.getAd10()
}
});
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
async getAd9() {
this.ad9 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 9,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad9 = res.data
// }else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 1,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad9.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd10() {
this.ad10 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 10,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad10 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 2,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad10.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
},
computed: {
checkCategoryArr() {
const arr = []
this.allChildCate.forEach(item => {
if (this.checkCategoryList.includes(item._id)) arr.push(item)
})
this.provinceData.forEach(item => {
if (this.checkProvinceList.includes(item.code)) {
arr.push(item)
}
})
return arr
}
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
flex-wrap: wrap;
display: flex;
flex-wrap: wrap;
.el-tag {
margin-right: 10px;
}
.el-tag {
margin-right: 10px;
}
}
.goods-list {
width: 1200px;
margin: 20px auto;
display: flex;
flex-wrap: wrap;
width: 1200px;
margin: 20px auto;
display: flex;
flex-wrap: wrap;
}
.goods {
width: 217px;
background-color: #FFFFFF;
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.05);
width: 217px;
background-color: #FFFFFF;
box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.05);
text-align: center;
margin-right: 20px;
margin-bottom: 25px;
padding: 10px 20px;
position: relative;
.top {
position: absolute;
right: 0;
top: 0;
background-color: rgba(169, 41, 36, 1);
padding: 2px 5px;
border-radius: 0 0 0 5px;
color: #FFFFFF;
}
&-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;
height: 35px;
}
&-image {
width: 200px;
height: 70px;
margin: 0 auto;
image {
width: 100%;
height: 100%;
}
}
&-company {
color: #4F4F4F;
font-size: 14px;
margin: 10px 0;
height: 45px;
}
&-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;
margin-right: 20px;
margin-bottom: 25px;
padding: 10px 20px;
font-family: Roboto;
border: 1px solid rgba(169, 41, 36, 1);
margin: 0 auto;
cursor: pointer;
}
&-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;
}
.goods-image {
width: 100%;
}
.goods-image {
width: 100%;
}
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
.selected-cate {
border-bottom: 2px solid #BD3124;
line-height: 40rpx;
border-bottom: 2px solid #BD3124;
line-height: 40rpx;
}
.child-cate {
background-color: #DB8382;
color: white;
margin-top: 10rpx;
border-radius: 15rpx;
padding: 0 20rpx;
background-color: #DB8382;
color: white;
margin-top: 10rpx;
border-radius: 15rpx;
padding: 0 20rpx;
}
</style>
+14 -13
View File
@@ -4,13 +4,14 @@
<common-header></common-header>
<category-bar></category-bar>
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<!-- <el-carousel height="170px">-->
<!-- <el-carousel-item v-for="item in 4" :key="item">-->
<!-- <image class="carousel-img"-->
<!-- src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
<!-- mode="aspectFill"></image>-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<common-swiper page="spot-mine" :height="200"/>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布现货</el-button>
@@ -67,7 +68,7 @@
type: 'warning'
}).then(() => {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
url: 'client/spot/goods/kh/delete',
title: '请求中...',
data: {
_id: item._id
@@ -101,7 +102,7 @@
},
{
key: "_add_time_srt",
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
@@ -123,20 +124,20 @@
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
+357 -162
View File
@@ -1,177 +1,372 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<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="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>
<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"-->
<!-- :show-cancel="false"-->
<!-- @success="onFormSuccess">-->
<!-- <template v-slot:name="{ form, keyName }">-->
<!-- <el-input v-model="productName" readonly placeholder="请添加现货分类"></el-input>-->
<!-- </template>-->
<!-- </vk-data-form>-->
<el-form ref="form" :model="form1.data" label-width="140px">
<el-form-item label="现货名称">
<el-input v-model="form1.data.name" placeholder="请输入现货名称" readonly></el-input>
</el-form-item>
<el-form-item label="现货分类" required>
<el-checkbox-group v-model="form1.data.categoryIds" @change="makeTitle">
<el-checkbox v-for="(item, index) in category" :key="index" :label="item._id">{{
item.name
}}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="库存(吨)" required>
<el-input v-model="form1.data.stock" placeholder="请输入库存(吨)" type="number"/>
</el-form-item>
<el-form-item label="现货存放地" required>
<vk-data-input-address :level="3" v-model="form1.data.address" @change="getAmount()"/>
</el-form-item>
<el-form-item label="产品规格单价">
<vk-data-upload v-model="form1.data.files" list-type="text"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf"/>
</el-form-item>
<el-form-item label="报价有效期">
<el-date-picker :picker-options="pickerOptions"
v-model="form1.data.answerEndTime"
type="datetime"/>
</el-form-item>
<el-form-item label="产品现场图片">
<vk-data-upload v-model="form1.data.images" list-type="text" accept=".jpg,.jpeg,.png"/>
</el-form-item>
<el-form-item label="是否购买全国广告位">
<el-radio-group v-model="form1.data.buyAll" @change="getAmount(true)">
<el-radio :label="true">是</el-radio>
<el-radio :label="false">否</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否购买省份广告位">
<el-radio-group v-model="form1.data.buyTop" @change="getAmount()"
:disabled="form1.data.buyAll || JSON.stringify(form1.data.address) === '{}' || totalAmount === 0">
<el-radio :label="true">是</el-radio>
<el-radio :label="false">否</el-radio>
</el-radio-group>
</el-form-item>
<p class="text-main text-25 my-20" v-if="form1.data.buyAll">
您已选择购买全国广告位,无法继续购买省份广告位</p>
<el-form-item label="购买时长(月)">
<el-input-number v-model="form1.data.buyTopNum" :min="1"/>
</el-form-item>
<el-form-item label="广告位价格">
{{ totalAmount }}元
</el-form-item>
</el-form>
<div class="text-center">
<el-button type="primary" @click="add">发布</el-button>
</div>
</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);
}
export default {
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
category: [],
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
name: '',
stock: '',
buyTop: false,
buyAll: false,
buyTopNum: 1,
categoryIds: [],
files: [],
images: [],
address: {},
answerEndTime: null
},
// 表单属性
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
}) => {
if (this.form1.data.categoryIds.length > 5) {
this.$message.error('最多选择五个分类')
this.form1.data.categoryIds.splice(-1, 1)
return
}
},
{
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'
},
this.form1.data.name = option.map(item => item.name).join('、')
this.productName = option.map(item => item.name).join('、')
},
},
{
key: "stock",
title: "库存(吨)",
type: "number"
},
{
key: "address",
title: "供货地",
type: "address"
},
{
key: "files",
title: "附件文档",
type: "file",
buttonText: "点击上传",
limit: 9,
accept: ".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf",
tips: '上传自有采购单图片或文档,支持jpg/png/word/excel'
},
{
key: "buyAll",
title: "是否购买全国广告位",
type: "radio",
data: [
{
value: true,
label: "是"
},
{
value: false,
label: "否"
}
],
watch: ({value, formData}) => {
if (value) {
formData.buyTop = false
}
}
},
{
key: "buyTop",
title: "是否购买广告位",
type: "radio",
data: [
{
value: true,
label: "是"
},
{
value: false,
label: "否"
}
],
disabled: formData => {
return formData.buyAll
}
},
{
key: "buyTopNum",
title: "购买广告位时长(月)",
type: "number",
controls: true,
precision: 0,
min: 1,
step: 1,
rightText: '月'
},
{
key: "amount",
title: "价格",
type: "text",
readonly: true,
placeholder: '请选择供货地'
},
],
// 表单验证规则
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() {
vk.navigateBack()
],
// 表单验证规则
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: '',
amount: '',
// 表单相关结束-----------------------------------------------------------
};
},
onLoad() {
this.getCategory()
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(res) {
if (this.form1.data.buyTop) {
vk.navigateTo({
url: `/pages/index/shop/pay?id=${res.data.data}`
})
} else vk.redirectTo({url: '/pages/spot/goods/goods'});
},
getCategory() {
vk.callFunction({
url: 'client/spot/category/pub/getList',
data: {
whereJson: {
level: 2
},
},
success: (res) => {
if (res.data) {
this.category = res.data;
}
}
});
},
makeTitle(val) {
if (val.length > 5) {
this.form1.data.categoryIds.splice(-1)
return this.$message.error('最多选择五个分类');
}
this.form1.data.name = this.category.filter(item => val.includes(item._id)).map(item => item.name).join('、')
this.$forceUpdate()
},
getAmount(isAll = false) {
if (!isAll && JSON.stringify(this.form1.data.address) === '{}') return
vk.callFunction({
url: 'client/spot/amount/pub/getDetail',
data: {
province: isAll ? -1 : this.form1.data.address.province.code,
},
success: (res) => {
if (res.data) {
this.amount = parseFloat(res.data.amount)
}
}
});
},
async add() {
if (this.form1.data.categoryIds.length === 0) return this.$message.error('请选择分类')
if (!this.form1.data.stock) return this.$message.error('请填写库存')
if (JSON.stringify(this.form1.data.address) === '{}') return this.$message.error('请选择供货地')
const res = await vk.callFunction({
title: '请求中...',
url: 'client/spot/goods/kh/addUpdate',
data: this.form1.data
})
if (this.form1.data.buyTop || this.form1.data.buyAll) {
vk.navigateTo({
url: `/pages/index/shop/pay?id=${res.data}`
})
} else vk.redirectTo({url: '/pages/spot/goods/goods'});
}
},
computed: {
totalAmount() {
let amount = 0
if (this.amount) amount = this.amount * this.form1.data.buyTopNum
return amount
}
}
}
</script>
<style lang="scss">
.form-view {
width: 1200px;
margin: 0 auto;
background-color: #FFFFFF;
padding: 20rpx;
}
.form-view {
width: 1200px;
margin: 0 auto;
background-color: #FFFFFF;
padding: 20rpx;
}
</style>
+24
View File
@@ -0,0 +1,24 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="flex justify-center items-center p-20 bg-white" style="overflow: hidden">
<iframe src="/static/gangcai-cal/index.html" frameborder="0" scrolling="no"
style="width: 500px; height: 600px;overflow: hidden"></iframe>
<image src="/static/images/banner@2x.png" class="ml-20" style="width: 406px;height: 512px"/>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "stealCal",
data() {
return {}
},
methods: {}
}
</script>
+900 -573
View File
File diff suppressed because it is too large Load Diff
+79
View File
@@ -0,0 +1,79 @@
<template>
<el-card>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
询价单管理
</view>
</view>
<text class="text-gray text-25 pointer">查看全部 <i class="el-icon-arrow-right"></i></text>
</view>
</view>
<view class="flex justify-center items-center">
<view class="flex flex-col justify-center items-center">
<text class="text-main text-50">{{ enquiry.noQuote }}</text>
<text>待报价</text>
</view>
<view class="flex flex-col justify-center items-center">
<text class="text-main text-50">{{ enquiry.notPick }}</text>
<text>待选商</text>
</view>
<view class="flex flex-col justify-center items-center">
<text class="text-main text-50">{{ enquiry.picked }}</text>
<text>已选商</text>
</view>
<view class="flex flex-col justify-center items-center">
<text class="text-main text-50">{{ enquiry.closed }}</text>
<text>已关闭</text>
</view>
</view>
</el-card>
</template>
<script>
export default {
name: "enquiryData",
data() {
return {
enquiry: {
noQuote: 0,
notPick: 0,
picked: 0,
closed: 0
},
}
},
methods: {}
}
</script>
<style scoped lang="scss">
@import "@/common/css/app.scss";
.item-wrap {
margin: 24px 0;
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: $--color-primary;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
}
}
}
</style>
+32 -6
View File
@@ -11,18 +11,30 @@
<view class="mt-15">
<view class="request-header">
<text class="flex-1">供应商</text>
<text class="flex-1">报价时间</text>
<text class="flex-1">联系方式</text>
<text class="flex-1">报价</text>
<text class="flex-1">详情</text>
<text class="flex-1">供应商合同补充条款</text>
<text class="flex-1">报价时间</text>
<text class="flex-1">附件</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in quoteList" :key="index">
<text class="flex-1">{{ item.subjectName }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">{{ item.subjectMobile }}</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item.remark ? item.remark : '无' }}</text>
<text class="flex-1">{{ item.supplierExt ? item.supplierExt : '无' }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
<el-button type="primary" v-if="status === 0" @click.native="confirm(item)">选择</el-button>
<template v-if="item.files && item.files.length > 0">
<file-type v-for="(file, fileIndex) in item.files" :key="fileIndex" :item="file"
@click.native="openDownload(file)"/>
</template>
<text v-else>无</text>
</text>
<text class="flex-1">
<el-button type="primary" v-if="item.status === 0" @click.native="confirm(item)">选择</el-button>
</text>
</view>
</view>
@@ -33,8 +45,11 @@
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default {
name: "enquiryModal",
components: {FileType},
data() {
return {
provinceData: provinces,
@@ -43,12 +58,13 @@ export default {
id: null,
dialogVisible: false,
quoteList: [],
status: 0
info: null
}
},
methods: {
open(status, quoteList) {
this.quoteList = quoteList
open(info) {
this.info = info
this.quoteList = info.quoteList
this.dialogVisible = true
},
handleClose() {
@@ -72,8 +88,18 @@ export default {
type: 'success',
message: '报价确认成功'
})
setTimeout(() => {
if (this.info.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.info.signMethod === 1) vk.navigateTo('/pages/store/buyer')
else vk.navigateTo('/pages/contract/index?tab=0')
}
}, 500)
}
});
},
openDownload(url) {
window.open(url)
}
}
}
+178
View File
@@ -0,0 +1,178 @@
<template>
<view>
<el-dialog
title="报价列表"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleClose">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的报价列表</text>
<el-button type="primary" @click.native="dialogVisible = false">关闭</el-button>
</view>
<view class="mt-15" v-if="quoteList">
<view class="request-header">
<text class="flex-1">报价方</text>
<text class="flex-1">报价时间</text>
<text class="flex-1">联系方式</text>
<text class="flex-1">报价</text>
<text class="flex-1">详情</text>
<text class="flex-1">补充协议</text>
<text class="flex-1">附件</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in quoteList" :key="index">
<text class="flex-1">{{ item.subjectName }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">{{ item.user.mobile }}</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item.supplierExt ? item.supplierExt : '无' }}</text>
<view class="flex-1">
<view class="flex-1">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in item.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</view>
</view>
<text class="flex-1">
<el-button type="primary" @click.native="createContract(item._id)" v-if="status === 0">选择</el-button>
</text>
</view>
</view>
</el-dialog>
<vk-data-dialog
v-model="showInfo"
title="申请详情"
width="600px"
top="14vh"
center
:close-on-click-modal="true"
>
<vk-data-detail-table
:data="info"
:columns="infoColumns"
size="medium"
label-width="150px"
></vk-data-detail-table>
<template v-slot:footer>
<el-button @click="showInfo = false">关闭</el-button>
</template>
</vk-data-dialog>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import {FileExcel, FilePdfOne, FileWord} from "@icon-park/vue";
export default {
name: "oldModal",
components: {FilePdfOne, FileExcel, FileWord},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
dialogVisible: false,
quoteList: [],
status: 0,
infoColumns: [
{key: "company.companyName", title: "申请人", type: "text"},
{key: "company.mobile", title: "联系方式", type: "text"},
{key: "manager.personName", title: "代理人", type: "text"},
{key: "manager.mobile", title: "代理人联系方式", type: "text"},
],
info: null,
showInfo: false,
signMethod: 0
}
},
methods: {
open(id, status, quoteList, signMethod) {
this.id = id
this.status = status
this.quoteList = quoteList
this.signMethod = signMethod
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
async createContract(quoteId) {
await vk.callFunction({
url: 'client/old/kh/confirmQuote',
title: '请求中...',
data: {
quoteId,
}
});
this.dialogVisible = false
this.$message({
message: "选择成功",
type: 'success'
})
if (this.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.signMethod === 1) vk.navigateTo('/pages/store/store?menuIndex=2')
else vk.navigateTo('/pages/contract/index?tab=0&tradeMethod=0')
}
},
getOldInfo() {
vk.callFunction({
url: 'client/old/pub/getDetail',
title: '请求中...',
data: {
id: this.id,
}
}).then(res => {
this.info = res.data
})
},
doShowInfo(info) {
this.info = info
this.showInfo = true
},
openDownload(url) {
window.open(url)
}
}
}
</script>
<style lang="scss" scoped>
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
text {
text-align: center;
}
}
.quote {
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
text {
text-align: center;
}
}
</style>
+120 -97
View File
@@ -1,120 +1,143 @@
<template>
<el-dialog
title="报价列表"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleClose">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的加工申请</text>
<el-button type="primary" @click.native="dialogVisible = false">关闭</el-button>
<el-dialog
title="报价列表"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleClose">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的加工申请</text>
<el-button type="primary" @click.native="dialogVisible = false">关闭</el-button>
</view>
<view class="mt-15">
<view class="request-header">
<text class="flex-1">申请人</text>
<text class="flex-1">报价</text>
<text class="flex-1">补充条款</text>
<text class="flex-1">附件</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in quoteList.rows" :key="index">
<text class="flex-1" v-if="item.user">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<view class="flex-1 flex flex-col justify-start items-start">
<text>加工方补充条款:{{ item.supplierExt ? item.supplierExt : '无' }}</text>
</view>
<view class="mt-15" >
<view class="request-header">
<text class="flex-1">加工商</text>
<text class="flex-1">报价</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in quoteList.rows" :key="index">
<text class="flex-1">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
<el-button type="primary" @click.native="createContract(item)" v-if="status === 0">选择</el-button>
</text>
</view>
</view>
</el-dialog>
<!-- <text class="flex-1">{{ item.remark }}</text>-->
<text class="flex-1">
<file-type v-for="(file, fileIndex) in item.files" :key="fileIndex" :item="file"
@click.native="openDownload(file)"/>
</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
<el-button type="primary" @click.native="createContract(item)" v-if="item.status === 0">选择</el-button>
</text>
</view>
</view>
</el-dialog>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default {
name: "processModal",
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
dialogVisible: false,
quoteList: [],
status: 0
}
},
methods: {
open(status, quoteList) {
console.log(status, quoteList)
this.quoteList = quoteList
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
createContract({totalPrice, uid, _id}) {
vk.callFunction({
url: 'client/contract/kh/add',
data: {
type: 'process',
productTitle: this.info.title,
transactionId: vk.pubfn.createOrderNo("P", 20),
sheetId: this.id,
quoteId: _id,
buyer: vk.getVuex('$user.userInfo._id'),
seller: uid,
amount: totalPrice,
partyCount: 2,
signCount: 0,
}
}).then((res) => {
this.$message({
message: '选择成功',
type: 'success'
})
setTimeout(() => {
vk.navigateTo('/pages/contract/index')
}, 1500)
})
}
name: "processModal",
components: {FileType},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
info: null,
dialogVisible: false,
quoteList: [],
status: 0
}
},
methods: {
open(info) {
this.info = info
this.id = info._id
this.quoteList = info.quoteList
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
createContract({totalPrice, uid, _id}) {
vk.callFunction({
url: 'client/contract/kh/add',
data: {
type: 'process',
productTitle: this.info.title,
transactionId: vk.pubfn.createOrderNo("P", 20),
sheetId: this.id,
quoteId: _id,
buyer: vk.getVuex('$user.userInfo._id'),
seller: uid,
amount: totalPrice,
partyCount: 2,
signCount: 0,
}
}).then((res) => {
this.dialogVisible = false
this.$message({
message: '选择成功',
type: 'success'
})
setTimeout(() => {
if (this.info.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.info.signMethod === 1) vk.navigateTo('/pages/store/buyer')
else vk.navigateTo('/pages/contract/index?tab=0')
}
}, 500)
})
},
openDownload(url) {
window.open(url)
}
}
}
</script>
<style lang="scss" scoped>
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
text {
text-align: center;
}
text {
text-align: center;
}
}
.quote {
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
text {
text-align: center;
}
text {
text-align: center;
}
}
</style>
+132
View File
@@ -0,0 +1,132 @@
<template>
<el-dialog
title="自营询价详情"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleClose">
<el-descriptions border size="small" :column="2">
<el-descriptions-item label="询价区域">
<span>{{ info.province.name }}{{ info.city.name }} </span>
</el-descriptions-item>
<el-descriptions-item label="联系人">
<span>{{ info.name }}</span>
</el-descriptions-item>
<el-descriptions-item label="联系方式">
<span>{{ info.phone }}</span>
</el-descriptions-item>
<el-descriptions-item label="用户名称">
<span>{{ info.company }}</span>
</el-descriptions-item>
<el-descriptions-item label="询价单附件">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in info.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</el-descriptions-item>
<template v-if="info.quoteList && info.status === 1">
<el-descriptions-item label="报价列表">
<div class="py-20 border-bottom" v-for="(item, index) in info.quoteList" :key="index">
<p>公司:{{ item.user.company.companyName }}</p>
<template v-if="item.amount">
<p>报价:¥{{ item.amount }}</p>
<span v-if="item.remark">备注:{{ item.remark }}</span>
<view class="mt-15 mr-15" v-for="(file, fileIndex) in item.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</template>
<p v-else>未报价</p>
</div>
</el-descriptions-item>
</template>
<template v-if="info.quoteList && info.status === 2">
<el-descriptions-item label="报价公司">
<div class="py-20 border-bottom" v-for="(item, index) in info.quoteList.filter(q => q.status === 1)"
:key="index">
<p>{{ item.user.company.companyName }}</p>
</div>
</el-descriptions-item>
</template>
<template v-if="info.quote">
<el-descriptions-item label="报价">
<span>¥{{ info.quote.amount }}</span>
</el-descriptions-item>
<el-descriptions-item label="备注">
<span>{{ info.quote.remark }}</span>
</el-descriptions-item>
<el-descriptions-item label="报价单附件">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in info.quote.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</el-descriptions-item>
</template>
</el-descriptions>
</el-dialog>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default {
name: "selfSupportModal",
components: {FileType},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
info: null,
dialogVisible: false,
quoteList: [],
status: 0,
quote: null,
}
},
methods: {
open(info) {
this.info = info
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
openDownload(url) {
window.open(url)
}
}
}
</script>
<style lang="scss" scoped>
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
text {
text-align: center;
}
}
.quote {
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
text {
text-align: center;
}
}
</style>
@@ -0,0 +1,107 @@
<template>
<el-dialog
title="自营询价详情"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleClose">
<el-descriptions border size="small" :column="2">
<el-descriptions-item label="询价区域">
<span>{{ info.sheet.province.name }}{{ info.sheet.city.name }} </span>
</el-descriptions-item>
<el-descriptions-item label="联系人">
<span>{{ info.sheet.name }}</span>
</el-descriptions-item>
<el-descriptions-item label="联系方式">
<span>{{ info.sheet.phone }}</span>
</el-descriptions-item>
<el-descriptions-item label="用户名称">
<span>{{ info.sheet.company }}</span>
</el-descriptions-item>
<el-descriptions-item label="询价单附件">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in info.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</el-descriptions-item>
<el-descriptions-item label="报价">
<span>¥{{ info.amount }}</span>
</el-descriptions-item>
<el-descriptions-item label="备注">
<span>{{ info.remark }}</span>
</el-descriptions-item>
<el-descriptions-item label="报价单附件">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in info.files" :key="fileIndex">
<file-type :item="file" @click.native="openDownload(file)"/>
</view>
</el-descriptions-item>
</el-descriptions>
</el-dialog>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default {
name: "selfSupportQuoteModal",
components: {FileType},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
info: null,
dialogVisible: false,
quoteList: [],
status: 0
}
},
methods: {
open(info) {
this.info = info
console.log(this.info)
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
openDownload(url) {
window.open(url)
}
}
}
</script>
<style lang="scss" scoped>
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
text {
text-align: center;
}
}
.quote {
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
text {
text-align: center;
}
}
</style>
+12 -13
View File
@@ -12,23 +12,22 @@
</view>
<view class="mt-15" v-if="cooperateList">
<view class="request-header">
<text class="flex-1">申请人</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">公司名称</text>
<text class="flex-1">联系人</text>
<text class="flex-1">联系方式</text>
<text class="flex-1">操作</text>
<text class="flex-1">备注</text>
<text class="flex-1">附件</text>
<text class="flex-1">申请时间</text>
</view>
<view class="quote" v-for="(item, index) in cooperateList" :key="index">
<text class="flex-1">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item.user.company.companyName }}</text>
<text class="flex-1">{{ item.name }}</text>
<text class="flex-1"> {{ item.mobile }}</text>
<text class="flex-1">{{ item.remark }}</text>
<view class="flex-1">
<a v-for="(file, fileIndex) in item.files" :key="fileIndex" :href="file" target="_blank">预览:文件{{ fileIndex + 1 }}</a>
</view>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
{{ item.user.accountType === 1 ? item.user.person.mobile : item.user.company.mobile }}
</text>
<text class="flex-1">
<el-button type="primary" @click.native="doShowInfo(item)">查看申请详情</el-button>
</text>
</view>
</view>
</el-dialog>
+1043 -578
View File
File diff suppressed because it is too large Load Diff
+155
View File
@@ -0,0 +1,155 @@
<template>
<el-card>
<view class="flex justify-end items-center">
<el-button type="primary" @click="showAdd" v-if="!isAdd">新增收款账户</el-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="vk.getVuex('$user.userInfo.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="请输入开户行"/>
</el-form-item>
<el-form-item label="账号名称" required>
<el-input v-model="form.accountName" placeholder="请输入账号名称"/>
</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"/>
</el-form-item>
</el-form>
<view class="mt-30 flex justify-center items-center">
<el-button plain @click="isAdd = !isAdd">取消</el-button>
<el-button type="primary" @click="addContact">确定</el-button>
</view>
</view>
<view v-else>
<view class="py-20 border-bottom flex justify-between items-center" v-for="(item, index) in list"
:key="index">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center">
<el-tag type="primary" size="small" class="mr-25" v-if="item.isDefault">默认</el-tag>
<el-tag type="success" size="small" class="mr-25">{{
item.type === 'company' ? '对公' : '个人'
}}
</el-tag>
<text class="font-bold text-40">{{ 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">
<el-button type="primary" size="small" @click="edit(item)">编辑</el-button>
<view class="mt-20">
<el-button type="primary" size="small" @click="del(item._id)" plain>删除</el-button>
</view>
</view>
</view>
</view>
</el-card>
</template>
<script>
export default {
name: "account",
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(vk.getVuex('$user.userInfo.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) {
this.$confirm('确认删除该账号吗?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(async () => {
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() {
const user = vk.getVuex('$user.userInfo')
if (vk.getVuex('$user.userInfo.accountType') === 2) {
this.form.account = user.company.companyAccount
this.form.bankName = user.company.companyBankName
this.form.accountName = user.company.companyName
}else {
this.form.account = user.person.personAccount
this.form.bankName = user.person.personBankName
this.form.accountName = user.person.accountName
console.log(user)
}
this.isAdd = true
}
},
mounted() {
if (parseInt(vk.getVuex('$user.userInfo.authStatus')) !== 1) {
this.$message.error('请先完成实名认证')
this.$emit('done', 'fadada')
}
this.getList()
}
}
</script>
+4 -3
View File
@@ -51,7 +51,7 @@
</div>
<div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">请打开手机微信,扫一扫完成支付</div>
<div class="pay-desc">微信、支付宝、云闪付扫码完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div>
<el-button v-else type="danger" @click="onPay">立即支付</el-button>
@@ -202,7 +202,8 @@ export default {
tid: '88880001',
instMid: 'QRPAYDEFAULT',
totalAmount: 1,
notifyUrl: 'https://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/'
// notifyUrl: 'https://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/'
notifyUrl: 'https://tcb-n44byxi8bmrfrki-d4bn1c4a206d.service.tcloudbase.com/pay_notify'
}
}
/**
@@ -214,7 +215,7 @@ export default {
if (result.errCode === 'SUCCESS') {
this.showQrcode = true
this.billQRCode = result.billQRCode
// this.$alert('', '请打开手机微信,扫一扫完成支付', {
// this.$alert('', '微信、支付宝、云闪付扫码完成支付', {
// confirmButtonText: '确定',
// callback: action => {
// this.$message({
+345 -211
View File
@@ -1,224 +1,358 @@
<template>
<el-card>
<div slot="header" class="clearfix">
<span>我的名片</span>
<el-card>
<div slot="header" class="clearfix">
<span>我的名片</span>
</div>
<p class="text-main" v-if="parseInt(vk.getVuex('$user.userInfo.authStatus')) !== 1">请先完成认证</p>
<template
v-else-if="parseInt(vk.getVuex('$user.userInfo.authStatus')) === 1 && vk.getVuex('$user.userInfo.businessCard')">
<div class="text-main flex justify-start items-center">
<info theme="outline" size="18" fill="#a92924" strokeLinecap="square"
style="height: 18px"/>
<span v-if="parseInt(vk.getVuex('$user.userInfo.businessCard.status')) === 0">名片审核中</span>
<span v-if="parseInt(vk.getVuex('$user.userInfo.businessCard.status')) === 2">名片审核失败: {{
vk.getVuex('$user.userInfo.businessCard.refuseReason')
}}</span>
<span v-if="parseInt(vk.getVuex('$user.userInfo.businessCard.status')) === 1">名片审核通过</span>
</div>
</template>
<!-- 表单开始 -->
<vk-data-form
v-if="parseInt(vk.getVuex('$user.userInfo.authStatus')) === 1"
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"
:show-cancel="false"
submit-text="保存名片"
:submit-disabled="!!vk.getVuex('$user.userInfo.businessCard') && parseInt(vk.getVuex('$user.userInfo.businessCard.status')) === 0"
>
<!-- v-slot:editor 中的 editor 对应 columns中的 key, form对应 form1.data keyName 对应 columns中的 key -->
<template v-slot:video="{ form, keyName }">
<vk-data-upload v-model="form1.data.video" list-type="text" :limit="1"
accept="video/*">
</vk-data-upload>
</template>
<template v-slot:album="{ form, keyName }">
<vk-data-upload v-model="form1.data.album" list-type="picture-card"
:limit="albumLimit"
accept=".jpg,.jpeg,.png">
</vk-data-upload>
</template>
<template v-slot:productImageList="{ form, keyName }">
<vk-data-upload v-model="form1.data.productImageList" list-type="picture-card"
:limit="productImageLimit"
accept=".jpg,.jpeg,.png">
</vk-data-upload>
</template>
<template v-slot:exampleImageList="{ form, keyName }">
<vk-data-upload v-model="form1.data.exampleImageList" list-type="picture-card"
:limit="productImageLimit"
accept=".jpg,.jpeg,.png">
</vk-data-upload>
</template>
<template v-slot:map="{ form, keyName }">
<div class="mapDiv">
<tdt-map :center="center" :zoom="zoom" @click="mapClick">
<tdt-marker :position="[form1.data.longitude, form1.data.latitude]" :draggable="false"/>
</tdt-map>
</div>
</template>
<!-- 表单开始 -->
<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"
:show-cancel="false"
submit-text="保存名片"
@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>
</vk-data-form>
</el-card>
</template>
<script>
import {Info} from "@icon-park/vue";
import MapInit from '@/util/MapInit'
export default {
data() {
return {
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
companyIntroduction: ''
},
// 表单属性
props: {
// 表单请求地址
action: "no",
// 表单字段显示规则
columns: [
{
type: 'group',
columns: [
{
key: "logo",
title: "Logo",
type: "image",
limit: 1
},
{
key: "personalWechat",
title: "个人微信",
type: "image",
limit: 1
},
{
key: "companyWechat",
title: "企业微信",
type: "image",
limit: 1
},
]
},
{
key: "position",
title: "职位",
type: "text"
},
{
key: "companyMobile",
title: "公司电话",
type: "text"
},
{
key: "managerMobile",
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: "companyIntroduction",
title: "企业简介",
type: "editor"
},
],
// 表单验证规则
rules: {
logo: [{
required: true,
message: "请上传Logo",
trigger: ['blur', 'change']
}],
personalWechat: [{
required: true,
message: "请上传个人微信",
trigger: ['blur', 'change']
}],
companyWechat: [{
required: true,
message: "请上传企业微信",
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']
}],
},
// add 代表添加 update 代表修改
formType: "update",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData) => {
vk.callFunction({
url: 'client/user/kh/addAuth',
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);
}
});
components: {Info},
data() {
return {
T: null,
tMap: null,
userInfo: {
accountType: 1,
userLevel: -1,
},
productImageLimit: 2,
albumLimit: 2,
dialogVisible: false,
center: [108.358150, 22.826820],
zoom: 12,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
companyIntroduction: '',
video: '',
longitude: 108.358150,
latitude: 22.826820,
album: [],
productImageList: [],
exampleImageList: [],
},
// 表单属性
props: {
// 表单请求地址
action: "no",
// 表单字段显示规则
columns: [
{
type: 'group',
columns: [
{
key: "logo",
title: "Logo",
type: "image",
limit: 1
},
{
key: "personalWechat",
title: "个人微信",
type: "image",
limit: 1
},
{
key: "companyWechat",
title: "企业微信",
type: "image",
limit: 1,
showRule: (formData) => {
console.log('formData', this.userInfo)
return parseInt(this.userInfo.accountType) === 2
},
},
]
},
{
key: "position",
title: "职位",
type: "text",
showRule: (formData) => {
return parseInt(this.userInfo.accountType) !== 2
},
},
{
key: "companyMobile",
title: "公司电话",
type: "text"
},
{
key: "managerMobile",
title: "负责人电话",
type: "text"
},
{
key: "address",
title: "地区",
type: "address"
},
{
key: "addressDetail",
title: "详细地址",
type: "text"
},
{
key: "email",
title: "有效邮箱",
type: "text"
},
{
key: "website",
title: "网址",
type: "text",
showRule: (formData) => {
return parseInt(this.userInfo.accountType) === 2 && parseInt(this.userInfo.userLevel) > 2
},
},
{
key: "companyIntroduction",
title: "企业简介",
type: "editor"
},
{
key: "video",
title: "视频",
type: "html",
showRule: (formData) => {
return parseInt(this.userInfo.accountType) === 2 && parseInt(this.userInfo.userLevel) > 2
},
},
{
key: "album",
title: `首页大图`,
type: "html",
},
{
key: "productImageList",
title: `产品展示`,
type: "html",
},
{
key: "exampleImageList",
title: `案例展示`,
type: "html",
},
{
key: "map",
title: `地图定位`,
type: "html",
showRule: (formData) => {
return parseInt(this.userInfo.accountType) === 2 && parseInt(this.userInfo.userLevel) > 1
},
},
],
// 表单验证规则
rules: {
logo: [{
required: true,
message: "请上传Logo",
trigger: ['blur', 'change']
}],
personalWechat: [{
required: true,
message: "请上传个人微信",
trigger: ['blur', 'change']
}],
personName: [{
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']
}],
},
// add 代表添加 update 代表修改
formType: "update",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData) => {
vk.callFunction({
url: 'client/user/kh/addAuth',
data: {
businessCard: {...formData, status: 0},
isBusinessCard: true
},
success: (data) => {
// 成功后的逻辑
this.$message({
type: 'success',
message: '提交成功,新信息将在审核通过后显示',
duration: 5000
})
setTimeout(() => {
window.location.reload()
}, 1000)
}
});
return false;
},
}
},
// 表单相关结束-----------------------------------------------------------
}
},
created() {
this.getUserInfo()
},
methods: {
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
if (data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
}
for (let key in this.userInfo) this.userInfo[key] = data.userInfo[key]
if (!data.userInfo.businessCard) {
if (this.userInfo.company.mobile) this.form1.data.companyMobile = this.userInfo.company.mobile
if (this.userInfo.manager.mobile) this.form1.data.managerMobile = this.userInfo.manager.mobile
if (this.userInfo.company.email) this.form1.data.email = this.userInfo.company.email
} else {
if (data.userInfo.businessCard.album && !Array.isArray(data.userInfo.businessCard.album)) this.form1.data.album = [data.userInfo.businessCard.album]
}
if (!this.form1.data.longitude) this.form1.data.longitude = 108.358150
if (!this.form1.data.latitude) this.form1.data.latitude = 22.826820
if (this.userInfo.userLevel === 0) {
this.albumLimit = 1
this.productImageLimit = 2
} else if (this.userInfo.userLevel === 1) {
this.albumLimit = 2
this.productImageLimit = 4
} else if (this.userInfo.userLevel === 2) {
this.albumLimit = 2
this.productImageLimit = 12
} else if (this.userInfo.userLevel > 2) {
this.albumLimit = 4
if (this.userInfo.userLevel > 3) {
this.albumLimit = 6
}
this.productImageLimit = 30
}
}
});
},
mapClick({type, lnglat}) {
if (type === "click") {
this.form1.data.longitude = parseFloat(lnglat.lng);
this.form1.data.latitude = parseFloat(lnglat.lat);
this.$message.success("已选择");
console.log(this.form1.data.longitude, this.form1.data.latitude)
this.$forceUpdate()
}
}
}
}
</script>
<style>
<style scoped>
.mapDiv {
width: 100%;
height: 300px;
}
</style>
+125
View File
@@ -0,0 +1,125 @@
<template>
<el-card>
<view class="flex justify-end items-center">
<el-button type="primary" @click="isAdd = !isAdd" v-if="!isAdd">新增业务联系人</el-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">
<el-button plain @click="isAdd = !isAdd">取消</el-button>
<el-button type="primary" @click="addContact">确定</el-button>
</view>
</view>
<view v-else>
<view class="py-20 border-bottom 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">
<el-button type="primary" size="small" @click="edit(item)">编辑</el-button>
<view class="mt-20">
<el-button type="primary" size="small" @click="del(item._id)" plain>删除</el-button>
</view>
</view>
</view>
</view>
</el-card>
</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) {
this.$confirm('确认删除该业务联系人吗?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(async () => {
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 it is too large Load Diff
+334
View File
@@ -0,0 +1,334 @@
<template>
<el-card shadow="never">
<p class="text-main font-bold mb-20">加工商状态: {{
(isNaN(factoryStatus) || factoryStatus === -1) ? '未提交审核' : (factoryStatus === 0 ? '审核中' : (factoryStatus === 1 ? '审核通过' : `审核不通过:${refuseReason}`))
}}</p>
<p class="text-main font-bold mb-20" v-if="factoryStatus === 0">
温馨提示:审核中不能修改内容,如有数据变更审核通过后再次修改提交。
</p>
<el-form ref="form" :model="form" label-width="140px">
<el-divider>
<span class="text-50 text-main font-bold">工厂信息</span>
</el-divider>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="成立年限" required>
<el-input v-model="form.year" placeholder="请输入成立年限" type="number"
:readonly="factoryStatus === 0">
<template #append>年</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="年产值" required>
<el-input v-model="form.yearsIncome" placeholder="请输入年产值" type="number"
:readonly="factoryStatus === 0">
<template #append>万元</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mt-20">
<el-col :span="12">
<el-form-item label="员工人数" required>
<el-input v-model="form.employeeNum" placeholder="请输入员工人数" type="number"
:readonly="factoryStatus === 0">
<template #append>人</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="流水线数量" required>
<el-input v-model="form.flowNum" placeholder="请输入流水线数量" type="number"
:readonly="factoryStatus === 0">
<template #append>条</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mt-20">
<el-col :span="12">
<el-form-item label="厂房归属" required>
<el-input v-model="form.blongTo" placeholder="请输入厂房归属" :readonly="factoryStatus === 0"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="厂房面积" required>
<el-input v-model="form.size" placeholder="请输入厂房面积" :readonly="factoryStatus === 0">
<template #append>平方米</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="所在地" required>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="addressRegion"
clearable :disabled="factoryStatus === 0"/>
</el-form-item>
<el-form-item label="主营类别" required>
<el-select multiple v-model="form.mainSpotCategory" style="width: 100%">
<el-option v-for="(item, index) in goodsCate" :key="index" :value="item.name">{{ item.name }}</el-option>
</el-select>
</el-form-item>
<el-form-item label="主营工艺和业务范围">
<el-input v-model="form.mainProcess" placeholder="请输入主营工艺和业务范围"
:readonly="factoryStatus === 0"/>
</el-form-item>
<el-form-item label="服务信息">
<el-input v-model="form.serviceInfo" placeholder="请输入服务信息" type="textarea"
:readonly="factoryStatus === 0"/>
</el-form-item>
<el-form-item label="视频">
<vk-data-upload v-model="form.video" list-type="text"
accept="video/*">
</vk-data-upload>
</el-form-item>
<el-divider>
<span class="text-50 text-main font-bold">设备信息</span>
</el-divider>
<el-row :gutter="10" class="p-20 bg-gray-light">
<el-col :span="3">
<p class="text-center">设备名称</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备数量({{ deviceNum }}台)</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备来源</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备类型</p>
</el-col>
<el-col :span="3">
<p class="text-center">品牌</p>
</el-col>
<el-col :span="3">
<p class="text-center">型号</p>
</el-col>
<el-col :span="3">
<p class="text-center">投产年限</p>
</el-col>
<el-col :span="3">
<p class="text-center">特点描述</p>
</el-col>
</el-row>
<el-row :gutter="10" class="p-20 bg-gray-light pos-r" v-for="(item, index) in form.deviceList" :key="index">
<el-col :span="3">
<el-input v-model="form.deviceList[index].name" placeholder="设备名称"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].num" placeholder="设备数量" type="number"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-select v-model="form.deviceList[index].source" placeholder="请选择设备来源"
:disabled="factoryStatus === 0">
<el-option v-for="item in deviceSource" :key="item" :label="item" :value="item"/>
</el-select>
</el-col>
<el-col :span="3">
<el-select v-model="form.deviceList[index].type" placeholder="请选择设备类型"
:disabled="factoryStatus === 0">
<el-option v-for="item in deviceType" :key="item" :label="item" :value="item"/>
</el-select>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].brand" placeholder="品牌"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].model" placeholder="型号"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].year" placeholder="投产年限" type="number"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].desc" placeholder="特点描述"
:readonly="factoryStatus === 0"/>
</el-col>
<i class="el-icon-remove pointer text-main text-40 pos-a" style="right: -10px; top: 20px"
@click="remove(index)" v-if="factoryStatus !== 0"/>
</el-row>
<div class="mt-20 text-center">
<el-button type="text" @click.native="addDevice" v-if="factoryStatus !== 0">添加设备</el-button>
</div>
<el-divider>
<span class="text-50 text-main font-bold">工厂实景</span>
</el-divider>
<vk-data-upload v-model="form.album" :limit="userLevel.factoryPicNum"
:disabled="factoryStatus === 0"></vk-data-upload>
<div class="mt-20 text-center">
<el-button type="primary" @click.native="submit" v-if="factoryStatus !== 0">提交</el-button>
</div>
</el-form>
</el-card>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
export default {
name: "factory",
data() {
return {
form: {
year: null,
yearsIncome: null,
employeeNum: null,
flowNum: null,
blongTo: null,
size: null,
addressRegion: {
province: null,
city: null,
},
mainProcess: null,
serviceInfo: null,
video: '',
deviceList: [],
album: [],
mainSpotCategory: [],
},
options: [],
addressRegion: [],
deviceSource: ['国产', '进口'],
deviceType: ['生产设备', '维护设备'],
userLevel: {
factoryPicNum: 0
},
factoryStatus: parseInt(vk.getVuex('$user.userInfo.factoryStatus')),
refuseReason: '',
goodsCate: []
}
},
methods: {
addDevice() {
this.form.deviceList.push({
name: null,
num: null,
source: null,
type: null,
brand: null,
model: null,
year: null,
desc: null
})
},
getGoodsCate() {
vk.callFunction({
url: 'client/process/category/pub/getList',
success: (res) => {
this.goodsCate = res.data
}
});
},
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({
type: 'error',
message: '请先完成认证'
})
setTimeout(() => {
this.$emit('done', 'fadada')
}, 1000)
return
}
this.userLevel.factoryPicNum = res.factoryPicNum
}
},
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.length === 0) return this.$message.error('请选择所在地')
if (this.form.deviceList.length === 0) return this.$message.error('请添加设备信息')
if (this.form.mainSpotCategory.length === 0) return this.$message.error('请选择主营类别')
// if (this.form.album.length === 0) return this.$message.error('请上传工厂实景图')
const province = provinces.find(item => item.code === this.addressRegion[0])
const city = province.children.find(item => item.code === this.addressRegion[1])
const addressRegion = {
province: {
code: province.code,
name: province.name,
},
city: {
code: city.code,
name: city.name,
}
}
await vk.callFunction({
url: "client/factory/kh/addUpdate",
data: {
year: this.form.year,
yearsIncome: this.form.yearsIncome,
employeeNum: this.form.employeeNum,
flowNum: this.form.flowNum,
blongTo: this.form.blongTo,
size: this.form.size,
addressRegion,
mainProcess: this.form.mainProcess,
serviceInfo: this.form.serviceInfo,
deviceList: this.form.deviceList,
album: this.form.album,
video: this.form.video,
mainSpotCategory: this.form.mainSpotCategory,
}
})
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.code, res.addressRegion.city.code]
if (res.status === 2) this.refuseReason = res.refuseReason
}
}
},
mounted() {
this.options = provinces.map(item => {
item.children = [];
return item
})
this.options.forEach((province, index) => {
citys[index].forEach(city => {
this.options[index].children.push(city)
})
})
this.getGoodsCate()
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>
+124 -63
View File
@@ -5,12 +5,13 @@
</div>
<div class="grade-list">
<div class="item pointer" v-for="(item,index) in gradeList" :key="index"
:class="gradeIndex === index ? 'active' : ''" @click="onChange(index)">
:class="[parseInt(gradeIndex) === index ? 'active' : '', item.disabled ? 'disabled' : '']"
@click="onChange(index)">
<div class="item-box">
<div class="title">{{ item.name }}</div>
<div class="title">
<span>{{ item.amount }}元/年</span>
<span v-if="parseFloat(item.ensureAmount) > 0">+交易保证金</span>
<span v-if="parseFloat(item.ensureAmount) > 0">+交易保证金({{ item.ensureAmount }}元)</span>
</div>
</div>
<div class="select">
@@ -19,11 +20,46 @@
</div>
</div>
</div>
<div class="item pointer"
:class="[gradeIndex === -2 ? 'active' : '']" @click="onChange(-2)">
<div class="item-box">
<div class="title">交易保证金缴纳</div>
<div class="title">
<el-select v-model="ensureAmount" size="small">
<el-option
v-for="item in ensureList"
:key="item.amount"
:label="`${item.amount.toFixed(2)}元`"
:value="item.amount">
</el-option>
</el-select>
</div>
</div>
<div class="select">
<div class="icon">
<i class="el-icon-check"></i>
</div>
</div>
</div>
<div class="flex justify-start items-center mt-20" v-if="gradeIndex === 2">
<div @click="ensureIndex = 0"
:style="{backgroundColor: ensureIndex === 0 ? '#a92924' : '', color: ensureIndex === 0 ? 'white' : ''}"
class="border rounded p-20">50000元保证金
</div>
<div @click="ensureIndex = 1"
:style="{backgroundColor: ensureIndex === 1 ? '#a92924' : '', color: ensureIndex === 1 ? 'white' : ''}"
class="border rounded p-20 mx-20">100000元保证金
</div>
<div @click="ensureIndex = 2"
:style="{backgroundColor: ensureIndex === 2 ? '#a92924' : '', color: ensureIndex === 2 ? 'white' : ''}"
class="border rounded p-20">200000元保证金
</div>
</div>
</div>
<div class="bzj-readme">
<div class="sub-title">保证金说明</div>
<div class="sub-title">保证金协议</div>
<div class="content">
保证金说明内容...
{{ desc }}
</div>
</div>
<div class="payment">
@@ -41,7 +77,7 @@
</div>
<div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">请打开手机微信,扫一扫完成支付</div>
<div class="pay-desc">微信、支付宝、云闪付扫码完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div>
<el-button v-else type="danger" @click="onPay">立即支付</el-button>
@@ -67,80 +103,80 @@ export default {
payment: ["银联支付"],
showQrcode: false,
billQRCode: '',
gradeIndex: 1,
gradeList: []
gradeIndex: null,
desc: '',
gradeList: [],
ensureList: [],
ensureAmount: null,
ensureIndex: 0
}
},
created() {
this.getUserLevelList()
this.getDesc()
this.getEnsureConfig()
},
methods: {
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
if (data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
this.gradeList.map(item => {
item.disabled = false
if (data.userInfo.userLevel && parseInt(data.userInfo.userLevel) > -1) {
item.disabled = parseInt(item.level) < parseInt(data.userInfo.userLevel)
}
return item
})
for (let i in this.gradeList) {
if (!this.gradeList[i].disabled) {
this.gradeIndex = i
break
}
}
// 成功后的逻辑
console.log('用户信息: ', data);
}
});
},
onChange(index) {
this.gradeIndex = index
if (index === -2) this.gradeIndex = index
else {
if (this.gradeList[index].disabled) return
this.gradeIndex = index
}
},
async onPay() {
const res = await vk.callFunction({
url: 'client/order/kh/add',
data: {
goods: {
name: '会员升级',
amount: this.amount,
cover: null
},
type: 3,
goodsId: parseInt(this.gradeList[this.gradeIndex].level),
num: 1,
}
})
const requestTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss')
const timestamp = dayjs().format('YYYYMMDDHHmmss')
let data = {
queryUrl: 'https://test-api-open.chinaums.com/v1/netpay/bills/get-qrcode',
timestamp,
nonce: 'rp84ufhfn20yneo3tp',
content: {
billNo: res.data,
requestTimestamp,
mid: '898201612345678',
tid: '88880001',
instMid: 'QRPAYDEFAULT',
totalAmount: 1,
notifyUrl: 'https://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/'
}
let res
if (this.gradeIndex === -2) {
res = await vk.callFunction({
url: 'client/order/kh/add',
data: {
goods: {
name: `交易保证金-${this.ensureAmount}元`,
amount: this.ensureAmount,
cover: null
},
type: 2,
goodsId: null,
num: 1,
}
})
} else {
res = await vk.callFunction({
url: 'client/order/kh/add',
data: {
goods: {
name: `会员升级-${this.gradeList[this.gradeIndex].name}`,
amount: this.amount,
cover: null
},
type: 3,
goodsId: parseInt(this.gradeList[this.gradeIndex].level),
ensureIndex: this.ensureIndex,
num: 1,
}
})
}
/**
* 调用函数
*/
sdk.exec(data).then(res => {
const h = this.$createElement;
const result = JSON.parse(res);
if (result.errCode === 'SUCCESS') {
this.showQrcode = true
this.billQRCode = result.billQRCode
// this.$alert('', '请打开手机微信,扫一扫完成支付', {
// confirmButtonText: '确定',
// callback: action => {
// this.$message({
// type: 'success',
// message: `已完成支付`
// });
// }
// });
}
})
vk.redirectTo({url: `/pages/index/shop/pay?id=${res.data}`})
},
getUserLevelList() {
vk.callFunction({
@@ -151,13 +187,33 @@ export default {
},
success: (data) => {
this.gradeList = data.rows.filter(item => parseFloat(item.amount) > 0)
this.getUserInfo()
}
});
}
},
async getDesc() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '880c33886636217300376edd5a56e1e6'
},
})
this.desc = res.content
},
async getEnsureConfig() {
const {rows} = await vk.callFunction({
url: 'client/ensureConfig/pub/getList',
})
this.ensureList = rows
this.ensureAmount = this.ensureList[0].amount
},
},
computed: {
amount() {
return parseFloat(this.gradeList[this.gradeIndex].amount) + parseFloat(this.gradeList[this.gradeIndex].ensureAmount)
if (this.gradeIndex === -2) return this.ensureAmount
else if (this.gradeIndex === 2) return parseFloat(this.gradeList[this.gradeIndex].amount) + [50000, 100000, 200000][this.ensureIndex]
else return parseFloat(this.gradeList[this.gradeIndex].amount) + parseFloat(this.gradeList[this.gradeIndex].ensureAmount)
}
},
}
@@ -288,4 +344,9 @@ export default {
font-size: 16px;
line-height: 2em;
}
.disabled {
cursor: not-allowed;
background-color: #F0F0F0;
}
</style>
+2 -2
View File
@@ -77,13 +77,13 @@ export default {
},
{
key: "headPhotoPath",
title: "身份证正面",
title: "身份证头像面",
type: "image",
limit: 1
},
{
key: "backgroundIdCardPath",
title: "身份证反面",
title: "身份证国徽面",
type: "image",
limit: 1
},
+114
View File
@@ -0,0 +1,114 @@
<template>
<el-card>
<view class="flex justify-end items-center">
<el-button type="primary" @click="showAdd" v-if="!isAdd">新增新闻动态</el-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.title" placeholder="请输入标题"/>
</el-form-item>
<el-form-item label="内容">
<vk-data-input-editor v-model="form.content" width="750px"></vk-data-input-editor>
</el-form-item>
</el-form>
<view class="mt-30 flex justify-center items-center">
<el-button plain @click="cancel">取消</el-button>
<el-button type="primary" @click="addArticle">确定</el-button>
</view>
</view>
<view v-else>
<view class="py-20 border-bottom flex justify-between items-center" v-for="(item, index) in list"
:key="index">
<view class="flex flex-col justify-start items-start">
<text>{{ item.title }}</text>
<text class="mt-20 text-gray text-28">{{ item._add_time_str }}</text>
</view>
<view class="flex flex-col justify-end">
<el-button type="primary" size="small" @click="edit(item)">编辑</el-button>
<view class="mt-20">
<el-button type="primary" size="small" @click="del(item._id)" plain>删除</el-button>
</view>
</view>
</view>
</view>
</el-card>
</template>
<script>
export default {
name: "news",
data() {
return {
isAdd: false,
form: {
_id: null,
title: '',
content: '',
},
list: []
}
},
methods: {
async addArticle() {
if (!this.form.title) {
this.$message.error('请输入标题')
return
}
if (!this.form.content) {
this.$message.error('请输入内容')
return
}
await vk.callFunction({
url: 'client/userArticle/kh/action',
data: this.form
})
this.$message.success(this.form._id ? '修改成功' : '新增成功')
await this.getList()
this.isAdd = false
this.form = {
_id: null,
title: '',
content: '',
}
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/userArticle/kh/getList',
})
this.list = rows
},
del(_id) {
this.$confirm('确认删除该新闻动态吗?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(async () => {
await vk.callFunction({
url: 'client/userArticle/kh/delete',
data: {_id}
})
await this.getList()
})
},
edit(item) {
for (let key in this.form) this.form[key] = item[key]
this.isAdd = true
},
showAdd() {
this.isAdd = true
},
cancel(){
this.isAdd = !this.isAdd
this.form = {
_id: null,
title: '',
content: '',
}
}
},
mounted() {
this.getList()
}
}
</script>
+90 -23
View File
@@ -1,7 +1,12 @@
<template>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>您有<em style="color: #bf2b28;padding: 0 3px;font-weight: 500">{{ unreadNum }}</em>条未读消息</span>
<div slot="header" class="flex justify-between items-start">
<div class="flex flex-col justify-start items-start">
<span>您有<em style="color: #bf2b28;padding: 0 3px;font-weight: 500">{{
unreadNum
}}</em>条未读消息</span>
<span class="text-main pointer" @click="allRead">全部已读</span>
</div>
<el-button style="float: right; padding: 3px 0; color: #666" type="text" @click="onSetting"
v-if="parseInt(vk.getVuex('$user.userInfo.userLevel')) > 0"><i
class="el-icon-setting"></i> 消息推送设置
@@ -25,7 +30,7 @@
</div>
</div>
</div>
<div class="desc">
<div class="desc pointer" @click="toDetail(item, index)">
{{ item.content }}
</div>
</div>
@@ -35,7 +40,24 @@
</div>
</div>
<!-- 添加或编辑的弹窗结束 -->
<el-dialog title="提示" :visible.sync="dialogVisible" width="70%">
<el-descriptions title="报价详情" v-if="sheet && dialogVisible" border :column="1">
<el-descriptions-item label="公司">{{ sheet.user.company.companyName }}</el-descriptions-item>
<el-descriptions-item label="联系人">{{ sheet.user.manager.personName }}</el-descriptions-item>
<el-descriptions-item label="联系方式">{{ sheet.user.businessCard.companyMobile }}</el-descriptions-item>
<el-descriptions-item label="价格">{{ sheet.amount }}元</el-descriptions-item>
<el-descriptions-item label="附件">
<p v-for="(item, index) in sheet.files" :key="index">
<a :href="item" target="_blank">预览:文件{{ index + 1 }}</a>
</p>
</el-descriptions-item>
<el-descriptions-item label="备注">{{ sheet.remark }}</el-descriptions-item>
</el-descriptions>
<div slot="footer" class="dialog-footer">
<el-button @click="toContact" type="primary">去签合同</el-button>
<el-button @click="dialogVisible = false">关闭</el-button>
</div>
</el-dialog>
</el-card>
</template>
@@ -46,27 +68,33 @@ export default {
return {
unreadNum: 0,
noticeList: [],
pageSize: 20,
total: 0
pageSize: 10,
total: 0,
dialogVisible: false,
sheet: null,
}
},
created() {
this.getList()
this.getUnreadNum()
},
methods: {
async getList(pageIndex = 1) {
const {rows} = await vk.callFunction({
const {rows, total} = await vk.callFunction({
url: 'client/message/kh/getList',
data: {
pageIndex,
pageSize: this.pageSize,
}
})
this.unreadNum = 0
this.total = total
this.noticeList = rows
this.noticeList.forEach(item => {
if (!item.hasRead) this.unreadNum++
})
},
async getUnreadNum() {
const {data} = await vk.callFunction({
url: 'client/message/kh/getUnreadCount',
});
this.unreadNum = data
},
async setRead(index) {
this.noticeList[index].hasRead = true
@@ -77,29 +105,66 @@ export default {
}
})
},
async del(index) {
await vk.callFunction({
url: 'client/message/kh/delete',
data: {
id: this.noticeList[index]._id
}
del(index) {
this.$confirm('确认删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
await vk.callFunction({
url: 'client/message/kh/delete',
data: {
id: this.noticeList[index]._id
}
})
this.$message({
type: 'success',
message: '删除成功'
})
await this.getList()
await this.getUnreadNum()
})
this.$message({
type: 'success',
message: '删除成功'
})
await this.getList()
},
onSetting() {
this.$emit('done', 'setting')
},
toDetail(item, index) {
this.setRead(index)
if (!item.hasRead) this.setRead(index)
let url = null
if (item.type === 'old') url = `/pages/index/old/detail?id=${item.pk}`
else if (item.type === 'enquiry') url = `/pages/enquiry/detail?id=${item.pk}`
else if (item.type === 'process') url = `/pages/process/detail?id=${item.pk}`
else if (item.type === 'contract') url = `/pages/contract/index?tab=1`
else if (item.type === 'self-support') url = `/pages/index/self-support/quote?id=${item.pk}`
else if (item.type === 'self-product') url = `/pages/order/order`
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
}
});
},
toContact(){
this.dialogVisible = false
vk.navigateTo({url: '/pages/contract/index?tab=1'})
}
}
}
@@ -114,6 +179,8 @@ export default {
.item {
display: flex;
flex-direction: column;
padding: 10px 0;
border-bottom: 1px solid #ddd;
.title-box {
display: flex;
+4 -3
View File
@@ -68,7 +68,7 @@
</div>
<div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">请打开手机微信,扫一扫完成支付</div>
<div class="pay-desc">微信、支付宝、云闪付扫码完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div>
<el-button v-else type="danger" @click="onPay">立即支付</el-button>
@@ -142,7 +142,8 @@ export default {
tid: '88880001',
instMid: 'QRPAYDEFAULT',
totalAmount: 1,
notifyUrl: 'https://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/'
// notifyUrl: 'https://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/'
notifyUrl: 'https://tcb-n44byxi8bmrfrki-d4bn1c4a206d.service.tcloudbase.com/pay_notify'
}
}
/**
@@ -154,7 +155,7 @@ export default {
if (result.errCode === 'SUCCESS') {
this.showQrcode = true
this.billQRCode = result.billQRCode
// this.$alert('', '请打开手机微信,扫一扫完成支付', {
// this.$alert('', '微信、支付宝、云闪付扫码完成支付', {
// confirmButtonText: '确定',
// callback: action => {
// this.$message({
File diff suppressed because it is too large Load Diff
+431
View File
@@ -0,0 +1,431 @@
<template>
<view v-if="userInfo && userInfo.person">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="真实姓名" required>
<el-input v-model="form.person.personName" v-if="isEdit"/>
<text v-else>{{ userInfo.person.personName }}</text>
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="主营类目" required>-->
<!-- <el-input v-model="form.person.businessType" v-if="isEdit"/>-->
<!-- <text v-else>{{ userInfo.person.businessType }}</text>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<!-- <el-form-item label="主营商品" required>-->
<!-- <el-checkbox-group v-model="form.person.mainSpotCategoryIds" v-if="isEdit">-->
<!-- <el-checkbox v-for="(item, index) in goodsCate" :key="index" :label="item._id">-->
<!-- {{ item.name }}-->
<!-- </el-checkbox>-->
<!-- </el-checkbox-group>-->
<!-- <template v-else>-->
<!-- <text v-if="userInfo.person.mainSpotCategoryIds">-->
<!-- {{-->
<!-- userInfo.person.mainSpotCategoryIds.length ? userInfo.person.mainSpotCategoryIds.map(item => goodsCate.find(i => i._id === item) ? goodsCate.find(i => i._id === item).name : '').join('、') : ''-->
<!-- }}-->
<!-- </text>-->
<!-- </template>-->
<!-- </el-form-item>-->
<el-form-item label="行业分类">
<el-select v-model="form.person.businessType" placeholder="请选择行业分类" v-if="isEdit">
<el-option
v-for="(item, index) in industryList"
:key="index"
:label="item.name"
:value="item.name">
</el-option>
</el-select>
<!-- <el-input v-model="form.company.businessType" v-if="isEdit"/>-->
<text v-else>{{ userInfo.person.businessType }}</text>
</el-form-item>
<el-form-item label="现居住所在地" required>
<el-row :gutter="10" v-if="isEdit">
<el-col :span="8">
<el-select 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>
</el-col>
<el-col :span="7">
<el-select v-model="addressIndex[1]" placeholder="请选择市" class="w-100p"
:readonly="addressIndex.length === 0 || [0, 1].includes(userInfo.authStatus)">
<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>
</el-col>
<el-col :span="8">
<el-select v-model="addressIndex[2]" placeholder="请选择区" class="w-100p">
<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>
</el-col>
</el-row>
<view v-else-if="!isEdit && userInfo.person.addressRegion">
<text>{{
userInfo.person.addressRegion.province ? userInfo.person.addressRegion.province.name : ''
}}
</text>
<text>{{
userInfo.person.addressRegion.city ? userInfo.person.addressRegion.city.name : ''
}}
</text>
<text>{{
userInfo.person.addressRegion.area ? userInfo.person.addressRegion.area.name : ''
}}
</text>
<text>{{ userInfo.person.addressDetail ? userInfo.person.addressDetail : '' }}</text>
</view>
<el-input v-model="form.person.addressDetail" placeholder="请输入详细地址" v-if="isEdit"/>
</el-form-item>
<el-form-item label="有效通信地址">
<text>{{ form.person.address }}</text>
</el-form-item>
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="个人账号" required>
<el-input v-model="form.person.personAccount" v-if="isEdit"/>
<text v-else>{{ userInfo.person.personAccount }}</text>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="个人开户行" required>
<el-input v-model="form.person.personBankName" v-if="isEdit"/>
<text v-else>{{ userInfo.person.personBankName }}</text>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="个人账户名" required>
<el-input v-model="form.person.accountName" v-if="isEdit"/>
<text v-else>{{ userInfo.person.accountName }}</text>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-form-item label="联系方式" required>
<el-col :span="8">
<el-input v-model="form.person.mobile" v-if="isEdit" placeholder="请输入手机号码"/>
<text v-else>{{ userInfo.person.mobile }}</text>
</el-col>
<el-col :span="8">
<el-input v-model="form.person.qq" v-if="isEdit" placeholder="请输入QQ号码"/>
<text v-else>{{ userInfo.person.qq }}</text>
</el-col>
<el-col :span="8">
<el-input v-model="form.person.contactEmail" v-if="isEdit" placeholder="请输入邮箱地址"/>
<text v-else>{{ userInfo.person.contactEmail }}</text>
</el-col>
</el-form-item>
</el-row>
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="短信验证码" required>
<el-input v-model="form.smsCode" :disabled="!form.person.mobile" v-if="isEdit"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-button type="primary" :disabled="!form.person.mobile || codeDisabled" @click="sendSmsCode">
{{ smsTips }}
</el-button>
</el-col>
<el-col :span="6">
<text>(请勿告知他人相关信息)</text>
</el-col>
</el-row>
<!-- <el-form-item label="平台交易账号认证" required v-if="isEdit">-->
<!-- <div v-html="authBankInfo"></div>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="金久信平台幕布照" required>-->
<!-- <view class="flex justify-start items-center" v-if="isEdit">-->
<!-- <vk-data-upload :limit="1" v-model="form.person.photo"></vk-data-upload>-->
<!-- <text class="text-main ml-20 pointer" @click="openDownload">电子版文件下载</text>-->
<!-- </view>-->
<!-- <el-image :src="userInfo.person.photo" style="width: 100px;height: 100px" fit="cover"-->
<!-- v-else-if="!isEdit && userInfo.person.photo && userInfo.person.photo.includes('.')"/>-->
<!-- </el-form-item>-->
<view class="flex justify-start items-center">
<view class="flex justify-start items-center" v-if="[1, 2].includes(userInfo.authStatus)">
<view class="mr-15">
<el-button type="primary" plain @click.native="changeEdit">{{
isEdit ? '取消' : '编辑'
}}
</el-button>
</view>
<el-button v-if="userInfo.authStatus === 1" type="primary" @click.native="submit(0)"
:disabled="!isEdit">提交个人认证
</el-button>
</view>
<el-button type="primary" @click.native="submit()"
v-if="userInfo.authStatus === null || [-1, 2].includes(userInfo.authStatus)">提交个人认证
</el-button>
</view>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import key from "@icon-park/vue/lib/icons/Key";
let timer = null
let timeS = 60
export default {
name: "personalAuth",
data() {
return {
isEdit: false,
authBankInfo: '',
authPhotoBack: '',
provinceData: provinces,
cityData: citys,
areaData: areas,
addressIndex: [null, null, null],
form: {
person: {
personName: '',
address: '',
businessType: '',
addressRegion: {},
addressDetail: '',
mobile: '',
qq: '',
contactEmail: '',
personAccount: '',
personBankName: '',
accountName: '',
photo: '',
mainSpotCategoryIds: []
},
smsCode: '',
},
smsTips: '点击获取',
codeDisabled: false,
goodsCate: [],
industryList: [],
userInfo: {}
}
},
methods: {
async getIndustryList() {
const {rows} = await vk.callFunction({
url: 'client/industry/pub/getList'
})
this.industryList = rows
},
getGoodsCate() {
vk.callFunction({
url: 'client/spot/category/pub/getList',
data: {
whereJson: {
level: 2
}
},
success: (res) => {
this.goodsCate = res.data
}
});
},
getAuthBankInfo() {
vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '657d38a8337a9f0756cb3b22'
},
success: res => {
this.authBankInfo = res.content
}
});
},
getAuthPhoto() {
vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '657d3a178b0da41d31112468'
},
success: res => {
this.authPhotoBack = res.content
}
});
},
openDownload() {
window.open(this.authPhotoBack)
},
async submit(authStatus = 0) {
if (!this.form.person.personName) return this.$message({
type: 'error',
message: '请输入真实姓名'
})
// if (!this.form.person.businessType) return this.$message({
// type: 'error',
// message: '请选择行业分类'
// })
// if (this.form.person.mainSpotCategoryIds.length === 0) return this.$message({
// type: 'error',
// message: '请选择主营商品'
// })
if (!this.form.person.mobile) return this.$message({
type: 'error',
message: '请输入联系方式'
})
if (!this.form.person.personAccount) return this.$message({
type: 'error',
message: '请填写个人账号'
})
if (!this.form.person.personBankName) return this.$message({
type: 'error',
message: '请选择个人开户行'
})
if (!this.form.person.accountName) return this.$message({
type: 'error',
message: '请选择个人账户名'
})
// if (!this.form.person.photo) return this.$message({
// type: 'error',
// message: '请上传平台幕布照'
// })
if (!this.form.smsCode) return this.$message({
type: 'error',
message: '请输入短信验证码'
})
if (this.addressIndex[2] === null) return this.$message({
type: 'error',
message: '请完善居住所在地'
})
// this.form.person.addressRegion.province = this.provinceData[this.addressIndex[0]]
// this.form.person.addressRegion.city = this.cityData[this.addressIndex[0]][this.addressIndex[1]]
// this.form.person.addressRegion.area = this.areaData[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]]
const data = {...this.form, ...{authStatus}}
if (authStatus === 0) data.authType = 2
await vk.callFunction({
url: 'client/user/kh/addAuth',
title: '提交中...',
data
})
this.$message({
type: 'success',
message: '提交成功'
})
setTimeout(() => {
window.location.reload()
}, 1500)
},
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)
}
})
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
selectRegion() {
this.form.person.address = ''
if (this.addressIndex[0] !== null) {
this.form.person.address = this.provinceData[this.addressIndex[0]].name
this.form.person.addressRegion.province = this.provinceData[this.addressIndex[0]]
if (this.addressIndex[1] !== null) {
this.form.person.address += this.cityData[this.addressIndex[0]][this.addressIndex[1]].name
this.form.person.addressRegion.city = this.cityData[this.addressIndex[0]][this.addressIndex[1]]
if (this.addressIndex[2] !== null) {
this.form.person.address += this.areaData[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]].name
this.form.person.addressRegion.area = this.areaData[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]]
}
}
}
if (this.form.person.addressDetail) this.form.person.address += this.form.person.addressDetail
},
changeEdit() {
this.isEdit = !this.isEdit
this.codeDisabled = !this.isEdit
}
},
mounted() {
this.getGoodsCate()
this.getIndustryList()
vk.userCenter.getCurrentUserInfo({
success: (data) => {
this.userInfo = data.userInfo
this.isEdit = this.userInfo.authStatus === -1
this.codeDisabled = !this.isEdit
if (this.userInfo.person) for (let key in this.form.person) this.form.person[key] = this.userInfo.person[key]
if (JSON.stringify(this.userInfo.person.addressRegion) !== "{}" && this.userInfo.person.addressRegion && this.userInfo.person.addressRegion.province) {
this.addressIndex[0] = this.provinceData.findIndex(item => parseInt(item.code) === parseInt(this.userInfo.person.addressRegion.province.code))
if (this.addressIndex[0] !== -1) {
this.addressIndex[1] = this.cityData[this.addressIndex[0]].findIndex(item => parseInt(item.code) === parseInt(this.userInfo.person.addressRegion.city.code))
if (this.addressIndex[1] !== -1) {
this.addressIndex[2] = this.areaData[this.addressIndex[0]][this.addressIndex[1]].findIndex(item => parseInt(item.code) === parseInt(this.userInfo.person.addressRegion.area.code))
}
}
} else {
this.form.person.addressRegion = {
province: {
code: '',
name: ''
},
city: {
code: '',
name: ''
},
area: {
code: '',
name: ''
}
}
}
if (!this.userInfo.person.mainSpotCategoryIds) {
this.userInfo.person.mainSpotCategoryIds = []
this.form.person.mainSpotCategoryIds = []
}
if (!this.userInfo.person.personAccount && this.userInfo.person.bankCardNo)
this.form.person.personAccount = this.userInfo.person.bankCardNo
if (!this.userInfo.person.accountName && this.userInfo.person.personName)
this.form.person.accountName = this.userInfo.person.personName
// this.getAuthBankInfo()
// this.getAuthPhoto()
}
})
}
}
</script>
+79
View File
@@ -0,0 +1,79 @@
<template>
<el-card shadow="never">
<el-form ref="resetForm" :model="formData" label-width="100px" :rules="rules">
<el-form-item label="原密码" prop="oldPassword">
<el-input type="password" v-model="formData.oldPassword" clearable
placeholder="请输入原密码"/>
</el-form-item>
<el-form-item label="新密码" prop="newPassword">
<el-input type="password" v-model="formData.newPassword" clearable
placeholder="请输入新密码"/>
</el-form-item>
<el-form-item label="确认密码" prop="passwordConfirmation">
<el-input type="password" v-model="formData.passwordConfirmation" clearable
placeholder="请再次输入新密码"/>
</el-form-item>
</el-form>
<el-button type="primary" @click.native="submit">确定</el-button>
</el-card>
</template>
<script>
export default {
name: "pwd",
data() {
return {
formData: {
oldPassword: null,
newPassword: null,
passwordConfirmation: null,
},
rules: {
oldPassword: [
{required: true, message: '请输入原密码', trigger: 'blur'},
],
newPassword: [
{required: true, message: '请输入新密码', trigger: 'blur'},
{min: 6, max: 16, message: '密码长度在 6 到 16 个字符', trigger: 'blur'},
],
passwordConfirmation: [
{required: true, message: '请再次输入新密码', trigger: 'blur'},
{validator: this.checkPassword, trigger: 'blur'},
],
},
}
},
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({
type: 'success',
message: '修改成功'
})
this.$refs.resetForm.resetFields();
})
},
checkPassword(rule, value, callback) {
if (value !== this.formData.newPassword) {
callback(new Error('两次输入的密码不一致!'));
}
}
}
}
</script>
+1 -1
View File
@@ -64,7 +64,7 @@
type: "text",
},
{
key: "_add_time_srt",
key: "_add_time_str",
title: "添加时间",
type: "time",
width: 160
+359 -190
View File
@@ -1,220 +1,389 @@
<template>
<el-card class="box-card">
<div slot="header" class="clearfix" style="text-align: center">
<span style="font-size: 20px;line-height: 2em;">消息推送设置</span>
<div style="color: #999999">我们将针对您的选择,为您精准推送询价信息</div>
<el-card class="box-card">
<div slot="header" class="clearfix" style="text-align: center">
<span style="font-size: 20px;line-height: 2em;">消息推送设置</span>
<div style="color: #999999">我们将针对您的选择,为您精准推送询价信息</div>
</div>
<el-row class="setting-list" :gutter="50">
<el-col :span="12" v-for="(item,index) in settingList" :key="index">
<div class="item">
<div class="title">
<el-badge is-dot class="badge"></el-badge>
{{ item.title }}
</div>
<div class="btn">
<el-switch active-text="开启"
v-model="item.status">
</el-switch>
</div>
</div>
<el-row class="setting-list" :gutter="50">
<el-col :span="12" v-for="(item,index) in settingList" :key="index">
<div class="item">
<div class="title">
<el-badge is-dot class="badge"></el-badge>
{{ item.title }}
</div>
<div class="btn">
<el-switch
v-model="item.status">
</el-switch>
</div>
</div>
</el-col>
</el-row>
<el-divider></el-divider>
<div class="form">
<div class="form-title">
* 请选择产品:
</div>
<el-form ref="form" :model="form" label-position="left" label-width="120px">
<el-form-item :label="item.name" v-for="(item, index) in productList" :key="index">
<el-checkbox-group v-model="productList[index].idList" size="small">
<el-checkbox v-for="(productItem, productIndex) in item.children" :key="productIndex"
:label="productItem._id" border
:checked="productList[index].idList.includes(item._id)">
{{ item.name }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-divider></el-divider>
<div class="form">
<div class="form-title">
* 请选择产品:
</div>
<!-- <el-form ref="form" :model="form" label-position="left" label-width="120px">-->
<!-- <el-form-item :label="item.name" v-for="(item, index) in productList" :key="index">-->
<!-- <el-checkbox-group v-model="productList[index].idList" size="small" class="flex justify-start items-start flex-wrap">-->
<!-- <el-checkbox v-for="(productItem, productIndex) in item.children" :key="productIndex"-->
<!-- :label="productItem.name" border style="margin: 10px 10px 0 0"-->
<!-- :checked="productList[index].idList.includes(productItem.name)">-->
<!-- {{ productItem.name }}-->
<!-- </el-checkbox>-->
<!-- </el-checkbox-group>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<div class="flex justify-center items-start">
<div v-for="(item, index) in productList" class="flex-1 mx-15" :key="index">
<div class="flex justify-start items-center">
<image :src="item.icon" style="width: 15px; height: 15px"/>
<span class="ml-10">{{ item.name }}</span>
</div>
<div class="ml-25 flex flex-wrap justify-start items-start">
<span class="mr-25 mt-20 pointer" @click="changeCheck(productItem)"
:class="[allSelectedProductList.includes(productItem.name) ? 'text-main' : '']"
v-for="(productItem, productIndex) in item.children"
:key="productIndex"> {{ productItem.name }}</span>
</div>
</div>
<el-divider></el-divider>
<div class="form">
<div class="form-title">
* 请选择服务地区:
</div>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[1]" placeholder="请选择市"
:disabled="addressIndex.length === 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>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[2]" placeholder="请选择区"
:disabled="addressIndex.length === 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>
</el-col>
</el-row>
</div>
<div class="flex justify-start items-center flex-wrap mt-20">
<span style="margin: 10px 10px 0 0">已选:</span>
<div class="flex justify-start items-center pointer" @click="changeCheck(productItem)"
v-for="(productItem, productIndex) in allProductList.filter(all => allSelectedProductList.includes(all.name))"
:key="productIndex" style="margin: 10px 10px 0 0">
<image src="/static/images/check.png" style="width: 12px; height: 12px; margin-right: 5px"/>
<span style="line-height: 18px">{{ productItem.parentName }}-{{ productItem.name }}</span>
</div>
<el-divider></el-divider>
<el-button type="danger" round @click.native="save">保存设置</el-button>
</el-card>
</div>
</div>
<el-divider></el-divider>
<div class="form">
<div class="form-title">
* 请选择服务地区:
</div>
<el-row :gutter="10">
<el-col :span="4">
<el-select size="small" v-model="addressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select size="small" v-model="addressIndex[1]" placeholder="请选择市"
:disabled="addressIndex[0] === null">
<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>
</el-col>
<el-col :span="4">
<el-select size="small" v-model="addressIndex[2]" placeholder="请选择区"
:disabled="addressIndex[1] === null">
<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>
</el-col>
<el-col :span="4">
<div class="flex justify-start items-center">
<el-button type="primary" size="mini" @click="addAddress">添加</el-button>
</div>
</el-col>
</el-row>
</div>
<div class="flex justify-start items-start flex-wrap mt-20">
<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/images/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">
<div class="form-title">
* 请选择单笔交易额:
</div>
<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">
<div class="form-title">
* 请选择交易方式:
</div>
<el-row :gutter="10">
<el-col :span="4">
<div class="flex justify-start items-center pointer" @click="changeItemCheck('tradeSelf')"
style="margin: 10px 10px 0 0">
<image :src="tradeSelf ? '/static/images/check.png' : '/static/images/uncheck.png'"
style="width: 12px; height: 12px; margin-right: 5px"/>
<span style="line-height: 18px">自主交易</span>
</div>
</el-col>
<el-col :span="4">
<div class="flex justify-start items-center pointer" @click="changeItemCheck('tradePlatform')"
style="margin: 10px 10px 0 0">
<image :src="tradePlatform ? '/static/images/check.png' : '/static/images/uncheck.png'"
style="width: 12px; height: 12px; margin-right: 5px"/>
<span style="line-height: 18px">金久信公证</span>
</div>
</el-col>
</el-row>
</div>
<el-divider></el-divider>
<div class="form">
<div class="form-title">
* 请设置免打扰时间段:
</div>
<div class="flex justify-start items-center">
<!-- <el-time-picker v-model="doNotDisturbRange" range-separator="~" is-range style="width: 200px"/>-->
<el-cascader v-model="settingList.doNotDisturbStart" :options="timeList"/>
<span class="mx-15">至</span>
<el-cascader v-model="settingList.doNotDisturbEnd" :options="timeList"/>
</div>
</div>
<el-button type="danger" round @click.native="save">保存设置</el-button>
</el-card>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import {CheckCorrect} from '@icon-park/vue'
import dayjs from "dayjs";
export default {
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
addressIndex: [null, null, null],
settingList: {
article: {
title: '行情信息推送服务',
status: false
},
process: {
title: '找加工信息推送服务',
status: false
},
old: {
title: '旧货交易信息推送服务',
status: false
},
enquiry: {
title: '询价单和选项推送服务',
status: false
},
},
form: {},
group1: [],
productList: [],
addressRegion: {}
}
},
async created() {
await this.getCate()
await this.getConfig()
},
methods: {
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._id)) {
this.productList[index].idList.push(productItem._id)
}
})
})
if (res.addressRegion.province) {
this.addressIndex[0] = this.provinceData.findIndex(item => item.code === res.addressRegion.province.code)
if (this.addressIndex[0] !== -1) {
this.addressIndex[1] = this.cityData[this.addressIndex[0]].findIndex(item => item.code === res.addressRegion.city.code)
if (this.addressIndex[1] !== -1) {
this.addressIndex[2] = this.areaData[this.addressIndex[0]][this.addressIndex[1]].findIndex(item => item.code === res.addressRegion.area.code)
}
}
}
components: {CheckCorrect},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
addressIndex: [null, null, null],
addressList: [],
settingList: {
article: {
title: '现货推送服务',
status: false
},
async getCate() {
const {rows} = await vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
});
this.productList = rows.map(item => {
item.idList = []
return item
})
process: {
title: '找加工信息推送服务',
status: false
},
async save() {
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,
addressRegion: {
province: this.provinceData[this.addressIndex[0]],
city: this.cityData[this.addressIndex[0]][this.addressIndex[1]],
area: this.areaData[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]],
}
}
})
this.$message({
type: 'success',
message: '保存成功'
})
}
old: {
title: '旧货交易信息推送服务',
status: false
},
enquiry: {
title: '询价单和选项推送服务',
status: false
},
doNotDisturbStart: [],
doNotDisturbEnd: [],
},
form: {},
group1: [],
productList: [],
allProductList: [],
allSelectedProductList: [],
addressRegion: {},
tradeSelf: false,
tradePlatform: false,
doNotDisturbRange: [new Date(2024, 1, 1, 0, 0), new Date(2024, 1, 1, 0, 0)],
tradeAmount: [],
timeList: []
}
},
async created() {
await this.getCate()
await this.getConfig()
this.timeList = []
for (let i = 0; i < 24; i++) {
const minuteList = []
const secondList = []
for (let j = 0; j < 60; j++) {
secondList.push({
label: j.toString().padStart(2, '0') + '秒',
value: j
})
}
for (let j = 0; j < 60; j++) {
minuteList.push({
label: j.toString().padStart(2, '0') + '分',
value: j,
children: secondList
})
}
this.timeList.push({
label: i.toString().padStart(2, '0') + '时',
value: i,
children: minuteList
})
}
},
methods: {
async getConfig() {
const res = await vk.callFunction({
url: 'client/message/config/kh/getConfig'
})
this.allProductList = []
this.allSelectedProductList = []
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.allSelectedProductList.push(productItem.name)
}
this.allProductList.push({
...productItem,
parentName: item.name
})
})
})
this.tradeSelf = res.tradeSelf ?? false
this.tradePlatform = res.tradePlatform ?? false
if (res.addressList) this.addressList = res.addressList
else {
this.addressList = []
}
this.settingList.doNotDisturbStart = res.doNotDisturbStart ?? []
this.settingList.doNotDisturbEnd = res.doNotDisturbEnd ?? []
const today = dayjs().format('YYYY-MM-DD')
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 save() {
// let productList = []
// console.log(this.allSelectedProductList)
// 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: this.allSelectedProductList,
addressList: this.addressList,
tradeSelf: this.tradeSelf,
tradePlatform: this.tradePlatform,
doNotDisturbRange: this.doNotDisturbRange,
tradeAmount: this.tradeAmount,
doNotDisturbStart: this.settingList.doNotDisturbStart,
doNotDisturbEnd: this.settingList.doNotDisturbEnd,
}
})
this.$message({
type: 'success',
message: '保存成功'
})
},
changeCheck(product) {
const index = this.allSelectedProductList.findIndex(item => item === product.name)
if (index > -1) {
this.allSelectedProductList.splice(index, 1)
} else {
this.allSelectedProductList.push(product.name)
}
},
addAddress() {
if (!this.addressIndex[0]) return
this.addressList.push({
province: this.provinceData[this.addressIndex[0]],
city: this.addressIndex[1] != null ? this.cityData[this.addressIndex[0]][this.addressIndex[1]] : null,
area: this.addressIndex[2] != null ? 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]
}
}
}
</script>
<style lang="less">
.setting-list {
.item {
.item {
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 5px auto;
.title {
display: flex;
align-items: center;
.badge {
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 5px auto;
.title {
display: flex;
align-items: center;
.badge {
display: flex;
align-items: center;
padding: 0 5px;
}
}
align-items: center;
padding: 0 5px;
}
}
}
}
.form-title {
color: #bf2b28;
font-size: 16px;
font-weight: 500;
line-height: 2em;
margin-bottom: 10px;
color: #bf2b28;
font-size: 16px;
font-weight: 500;
line-height: 2em;
margin-bottom: 10px;
}
.form {
padding: 10px;
padding: 10px;
}
/deep/ .i-icon {
display: flex;
align-items: center;
justify-content: center;
}
/deep/ .el-input__suffix {
display: flex;
align-items: center;
justify-content: center;
}
</style>
+11 -5
View File
@@ -40,7 +40,7 @@
:before-close="handleClose">
<view class="p3">
<view v-for="(item, index) in userLevelList" :key="index">
<view class="item pointer"
<view class="item pointer p-20"
v-if="item.recommendUpgrade && parseInt(item.recommendUpgrade) > 0"
:class="index == current ? 'active' : ''" @click="onSelect(item, index)">
<view class="t">{{ item.name }}</view>
@@ -50,7 +50,7 @@
</view>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="exchangeUpgrade">确定兑换</el-button>
<el-button type="primary" @click="exchangeUpgrade" :disabled="current == null">确定兑换</el-button>
</span>
</el-dialog>
</view>
@@ -61,7 +61,7 @@ export default {
data() {
return {
progress: 0,
current: 0,
current: null,
dialogVisible: false,
user: this.vk.getVuex('$user.userInfo'),
userLevelList: [],
@@ -77,9 +77,14 @@ export default {
},
onSelect(item, index) {
if (parseInt(this.user.inviteNum) >= item.recommendUpgrade && item.level > parseInt(this.user.userLevel)) this.current = index
else this.$message({
type: 'error',
message: '您的邀请人数不足'
})
},
copy() {
const url = window.location.origin + `/#/pages/auth/register/register?code=${this.user.my_invite_code}`
// const url = window.location.origin + `/#/pages/auth/register/register?code=${this.user.my_invite_code}`
const url = this.user.my_invite_code
document.oncopy = function (e) {
e.clipboardData.setData('text', url);
e.preventDefault();
@@ -172,7 +177,7 @@ export default {
.item {
width: 250upx;
height: 180upx;
min-height: 240upx;
border-radius: 10upx;
box-shadow: 1px 1px 5px 1px #A92924;
display: flex;
@@ -181,6 +186,7 @@ export default {
justify-content: center;
font-size: 24upx;
color: #A92924;
padding: 10upx 20upx;
.t {
font-size: 30upx;
-169
View File
@@ -1,169 +0,0 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="flex justify-center items-start main-wrap">
<view class="flex-col flex-col justify-center items-center bg-white text-40 left-wrap pointer">
<view class="flex justify-center items-center" :class="[activeIndex === 0 ? 'active' : '' ]"
@click="changeActive(0)">
<text>询价管理</text>
</view>
<view class="flex justify-center items-center" :class="[activeIndex === 1 ? 'active' : '' ]"
@click="changeActive(1)">
<text>订单管理</text>
</view>
<view class="flex justify-center items-center" :class="[activeIndex === 2 ? 'active' : '' ]"
@click="changeActive(2)">
<text>合同管理</text>
</view>
</view>
<view class="w-1200 m-a bg-white p-40">
<el-table :data="tableData" style="width: 100%" border stripe>
<el-table-column prop="orderNo" label="订单号" width="200"/>
<el-table-column label="订单类型">
<template v-slot="{ row }">
<span>{{ row.type === 0 ? '普通订单' : '金久信自营订单' }}</span>
</template>
</el-table-column>
<el-table-column label="商品列表" width="250">
<template v-slot="{ row }">
<view class="flex flex-col justify-start items-start">
<view v-for="(item, index) in row.goods" :key="index"
class="flex justify-start items-start">
<image :src="item.goodsCover" class="goods-cover" v-if="row.type === 0"/>
<view class="ml-20 flex flex-col justify-start items-start">
<text class="text-main font-bold">{{ item.goodsName }}</text>
<text class="mt-20">¥{{ item.goodsPrice }}</text>
<text class="mt-20">x{{ item.num }}</text>
</view>
</view>
</view>
</template>
</el-table-column>
<el-table-column prop="amount" label="订单金额"/>
<el-table-column prop="payAmount" label="支付金额"/>
<el-table-column label="订单状态">
<template v-slot="{ row }">
<span v-if="row.orderStatus === 0">待支付</span>
<span v-if="row.orderStatus === 1">已支付</span>
<span v-if="row.orderStatus === 2">待收货</span>
<span v-if="row.orderStatus === 3">已完成</span>
</template>
</el-table-column>
<el-table-column prop="_add_time_str" label="下单时间"/>
<el-table-column label="操作">
<template v-slot="{ row }">
<text v-if="row.orderStatus === 0" class="text-main pointer" @click="repay(row)">去支付</text>
</template>
</el-table-column>
</el-table>
<view class="text-center mt-20">
<el-pagination
:page-size="pageSize"
@current-change="getOrderList"
background
layout="prev, pager, next"
:total="total">
</el-pagination>
</view>
</view>
</view>
<gap height="50"/>
<common-footer></common-footer>
<right-bar></right-bar>
</view>
</template>
<script>
import pay from "../index/shop/pay.vue";
export default {
name: "order",
computed: {
pay() {
return pay
}
},
data() {
return {
tableData: [],
activeIndex: 0,
pageSize: 20,
total: 0,
}
},
methods: {
changeActive(index) {
this.list = []
this.mode = 'list'
if (index !== 2) this.activeIndex = index
if (index === 0) {
} else if (index === 1) this.getOrderList()
else if (index === 2) {
vk.navigateTo({
url: '/pages/contract/index'
})
}
},
async getOrderList(pageIndex = 1) {
const {rows} = await vk.callFunction({
url: 'client/order/kh/getList',
data: {
pageIndex,
pageSize: this.pageSize,
}
})
this.tableData = rows
console.log(this.tableData)
},
async repay(row) {
await vk.callFunction({
url: 'client/order/kh/resetOrderNo',
data: {
id: row._id,
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${row._id}`
})
}
},
onLoad(options) {
if (options && options.tab) {
this.changeActive(parseInt(options.tab))
} else {
}
}
}
</script>
<style lang="scss" scoped>
.main-wrap {
width: 1200px;
margin: 20px auto;
position: relative;
.left-wrap {
position: absolute;
width: 220px;
left: -240px;
top: 0;
view {
padding: 20px;
}
.active {
background-color: #a92924;
color: white;
}
}
}
.goods-cover {
width: 80px;
height: 80px;
}
</style>
+156 -45
View File
@@ -1,8 +1,7 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<common-nav></common-nav>
<view class="w-1200 flex justify-start items-start my-25 m-a">
<view class="flex-col flex-col justify-center items-center bg-white text-40 left-wrap pointer">
<view class="flex justify-center items-center" :class="[activeIndex === 0 ? 'active' : '' ]"
@@ -12,12 +11,12 @@
</view>
<view class="flex justify-center items-center" :class="[activeIndex === 1 ? 'active' : '' ]"
@click="changeActive(1)">
<i class="el-icon-download"/>
<i class="el-icon-star-off"/>
<text class="ml-20">我的收藏</text>
</view>
<view class="flex justify-center items-center" :class="[activeIndex === 2 ? 'active' : '' ]"
@click="changeActive(2)">
<i class="el-icon-star-off"/>
<i class="el-icon-download"/>
<text class="ml-20">我的下载</text>
</view>
</view>
@@ -46,43 +45,81 @@
</view>
<el-button type="primary" @click="showAction">我要上传</el-button>
</view>
<view class="flex flex-col justify-start items-start pointer w-100p">
<view v-for="(item, index) in list" :key="index" class="content-item-wrap">
<file-word theme="outline" size="80" fill="#4a90e2" strokeLinecap="square"/>
<view class="flex flex-col justify-start items-start w-100p">
<view v-for="(item, index) in list" :key="index" class="content-item-wrap pointer"
@click="navTo(`/pages/article/detail?id=${item._id}`)">
<template v-if="item.files && item.files.length > 0">
<template v-if="['doc', 'docx'].includes(item.files[0].split('.').pop())">
<file-word theme="outline" class="pointer" size="80" fill="#4a90e2" strokeLinecap="square"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.files[0].split('.').pop())">
<file-excel theme="outline" class="pointer" size="80" fill="#417505" strokeLinecap="square"/>
</template>
<template v-else-if="['pdf'].includes(item.files[0].split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="80" fill="#f5a623" strokeLinecap="square"/>
</template>
<template v-else>
<el-image :src="item.files[0]" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item.files]"/>
</template>
</template>
<view class="content">
<text class="title">{{ item.name }}</text>
<view class="desc">
<text class="item">{{ item._add_time_str }}</text>
<text class="item">{{ item.viewNum }}人浏览</text>
<text class="item">{{ item.downloadNum }}次下载</text>
<text class="item">{{
item.amount === 0 ? '免费下载' : `${item.amount}元下载`
}}
</text>
<!-- <text class="item">{{ item._add_time_str }}</text>-->
</view>
</view>
</view>
</view>
</template>
<template v-else>
<view class="flex justify-start items-center">
<text class="text-50">上传文档</text>
<vk-data-upload v-model="form1.data.files" accept="image/*,application/pdf,application/msword,application/vnd.ms-excel,application/vnd.ms-powerpoint">
<template>
<el-button type="primary">点击上传</el-button>
</template>
</vk-data-upload>
<!-- <u-upload :custom-btn="true" :show-upload-list="false" :action="">-->
<!-- <template v-slot:addBtn>-->
<!-- <el-button type="primary">点击上传</el-button>-->
<!-- </template>-->
<!-- </u-upload>-->
</view>
<!-- <view class="flex justify-start items-center">-->
<!-- <text class="text-50">上传文档</text>-->
<!-- <vk-data-upload v-model="form1.data.files" accept="image/*,application/pdf,application/msword,application/vnd.ms-excel,application/vnd.ms-powerpoint">-->
<!-- <template>-->
<!-- <el-button type="primary">点击上传</el-button>-->
<!-- </template>-->
<!-- </vk-data-upload>-->
<!-- <u-upload :custom-btn="true" :show-upload-list="false" :action="">-->
<!-- <template v-slot:addBtn>-->
<!-- <el-button type="primary">点击上传</el-button>-->
<!-- </template>-->
<!-- </u-upload>-->
<!-- </view>-->
<vk-data-form v-model="form1.data" :rules="form1.props.rules" :action="form1.props.action"
:form-type="form1.props.formType" :columns='form1.props.columns' label-width="120px"
@success="addSuccess"></vk-data-form>
@success="addSuccess" :show-cancel="false">
<!-- <template v-slot:content="{ form, keyName }">-->
<!-- <div style="border: 1px solid #ccc;">-->
<!-- <Toolbar-->
<!-- style="border-bottom: 1px solid #ccc"-->
<!-- :editor="editor"-->
<!-- :defaultConfig="toolbarConfig"-->
<!-- mode="simple"-->
<!-- />-->
<!-- <Editor-->
<!-- style="height: 500px; overflow-y: hidden;"-->
<!-- v-model="form1.data.content"-->
<!-- :defaultConfig="editorConfig"-->
<!-- mode="simple"-->
<!-- @onCreated="onCreated"-->
<!-- />-->
<!-- </div>-->
<!-- </template>-->
</vk-data-form>
</template>
<div class="text-center">
<el-pagination
background
layout="prev, pager, next"
:total="total"
:page-size="pageSize"
@click="changePage"
>
</el-pagination>
</div>
</view>
</view>
<common-footer></common-footer>
@@ -90,22 +127,29 @@
</template>
<script>
import {FileWord} from "@icon-park/vue";
import {FileExcel, FilePdfOne, FileWord} from "@icon-park/vue";
import {Editor, Toolbar} from '@wangeditor/editor-for-vue'
export default {
name: "school",
components: {FileWord},
components: {FilePdfOne, FileExcel, FileWord, Editor, Toolbar},
data() {
return {
total: 0,
pageSize: 5,
activeIndex: 0,
mode: 'list',
list: [],
cateList: [],
uploadFile: null,
editor: null,
toolbarConfig: {},
editorConfig: {placeholder: '请输入内容...'},
form1: {
// 表单请求数据,此处可以设置默认值
data: {
amount: 0,
content: ''
},
// 表单属性
props: {
@@ -119,6 +163,12 @@ export default {
type: "text",
placeholder: "请输入标题"
},
{
key: "files",
title: "附件",
type: "file",
accept: '.xls,.xlsx,.doc,.docx,.ppt,.pptx,.pdf,.png,.jpg,.jpeg'
},
{
key: "parentId",
title: "分类",
@@ -132,24 +182,30 @@ export default {
label: "name",
},
},
{
key: "content",
title: "内容",
type: "editor",
placeholder: "请输入内容"
},
{
key: "amount",
title: "金额",
type: "text",
placeholder: "请输入内容",
},
{key: "content", title: "内容", type: "editor"},
// {
// key: "content",
// title: "内容",
// type: "html",
// },
// {
// key: "amount",
// title: "金额",
// type: "text",
// placeholder: "请输入内容",
// },
],
// 表单验证规则
rules: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'},
],
parentId: [
{required: true, message: '请选择分类', trigger: 'blur'},
],
content: [
{required: true, message: '请输入内容', trigger: 'blur'},
],
},
// add 代表添加 update 代表修改
formType: "",
@@ -160,17 +216,55 @@ export default {
}
},
methods: {
async getList() {
onCreated(editor) {
this.editor = Object.seal(editor)
},
async getList(pageIndex = 1) {
const {rows} = await vk.callFunction({
url: 'client/article/list/kh/getUserList'
url: 'client/article/list/kh/getUserList',
pageIndex,
pageSize: this.pageSize
})
this.list = rows
},
async getCollectList() {
async getCollectList(pageIndex = 1) {
const {rows} = await vk.callFunction({
url: 'client/article/collect/kh/getList'
url: 'client/article/collect/kh/getList',
pageIndex,
pageSize: this.pageSize
})
this.list = rows
this.list = rows.map(item => {
if (item.article) {
item._id = item.article._id
item.name = item.article.name
item._add_time_str = item.article._add_time_str
item.viewNum = item.article.viewNum
item.downloadNum = item.article.downloadNum
}
return item
})
},
async getDownloadList(pageIndex = 1) {
const {rows} = await vk.callFunction({
url: 'client/article/list/kh/getDownloadList',
pageIndex,
pageSize: this.pageSize
})
this.list = rows.map(item => {
if (item.article) {
item._id = item.article._id
item.name = item.article.name
item._add_time_str = item.article._add_time_str
item.viewNum = item.article.viewNum
item.downloadNum = item.article.downloadNum
}
return item
})
},
changePage(page) {
if (this.activeIndex === 0) this.getList(page)
else if (this.activeIndex === 1) this.getCollectList(page)
else if (this.activeIndex === 2) this.getDownloadList(page)
},
changeActive(index) {
this.list = []
@@ -178,6 +272,7 @@ export default {
this.activeIndex = index
if (index === 0) this.getList()
else if (index === 1) this.getCollectList()
else if (index === 2) this.getDownloadList()
},
showAction() {
this.mode = 'action'
@@ -187,6 +282,9 @@ export default {
this.mode = 'list'
this.activeIndex = 0
this.getList()
},
navTo(url) {
vk.navigateTo({url})
}
// beforeUpload(file) {
// this.uploadFile = file
@@ -203,10 +301,23 @@ export default {
// }
},
onLoad() {
if (!vk.getVuex('$user.userInfo.mobile')) {
this.$confirm('请先绑定手机号', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.redirectTo(`/pages/auth/login/wechat?state=jjx_` + vk.getVuex('$user.userInfo.accountType'))
}).catch(() => {
vk.redirectTo(`/pages/auth/login/wechat?state=jjx_` + vk.getVuex('$user.userInfo.accountType'))
})
return
}
this.getList()
}
}
</script>
<style src="@wangeditor/editor/dist/css/style.css"></style>
<style lang="scss" scoped>
.left-wrap {
+158 -106
View File
@@ -1,117 +1,169 @@
<template>
<view>
<top-bar></top-bar>
<common-nav></common-nav>
<view>
<top-bar></top-bar>
<common-nav></common-nav>
<view class="w-1200">
<el-row :gutter="20">
<el-col :span="6">
<el-menu @select="menuSelect" :default-active="currMenu" 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-item index="seal">
<i class="el-icon-s-check"></i>
<span slot="title">我的印章</span>
</el-menu-item> -->
<el-menu-item index="notice">
<i class="el-icon-bell"></i>
<span slot="title">我的消息</span>
</el-menu-item>
<el-menu-item index="equity">
<i class="el-icon-wallet"></i>
<span slot="title">平台权益</span>
</el-menu-item>
<el-menu-item index="yaoqing">
<i class="el-icon-user"></i>
<span slot="title">我的邀请</span>
</el-menu-item>
<!-- <el-menu-item index="grade">-->
<!-- <i class="el-icon-user"></i>-->
<!-- <span slot="title">会员等级(临时)</span>-->
<!-- </el-menu-item>-->
<!-- <el-menu-item index="added">-->
<!-- <i class="el-icon-medal"></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>
<seal v-else-if="currMenu === 'seal'"></seal>
<notice v-else-if="currMenu === 'notice'" @done="onDone"></notice>
<setting v-else-if="currMenu === 'setting'" @done="onDone"></setting>
<equity v-else-if="currMenu === 'equity'" @done="onDone"></equity>
<payment v-else-if="currMenu === 'payment'" @done="onDone"></payment>
<grade v-else-if="currMenu === 'grade'" @done="onDone"></grade>
<Added v-else-if="currMenu === 'added'" @done="onDone"></Added>
<Yaoqing v-else-if="currMenu === 'yaoqing'" @done="onDone"></Yaoqing>
</el-col>
</el-row>
<view class="w-1200">
<el-row :gutter="20">
<el-col :span="4">
<el-menu @select="menuSelect" :default-active="currMenu" 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-item index="business-contact">-->
<!-- <i class="el-icon-phone"></i>-->
<!-- <span slot="title">业务联系人</span>-->
<!-- </el-menu-item>-->
<!-- <el-menu-item index="notice">-->
<!-- <i class="el-icon-bell"></i>-->
<!-- <span slot="title">我的消息</span>-->
<!-- </el-menu-item>-->
<!-- <el-menu-item index="equity">-->
<!-- <i class="el-icon-s-cooperation"></i>-->
<!-- <span slot="title">平台权益</span>-->
<!-- </el-menu-item>-->
<!-- <el-menu-item index="yaoqing">-->
<!-- <i class="el-icon-user"></i>-->
<!-- <span slot="title">我的邀请</span>-->
<!-- </el-menu-item>-->
<!-- <el-menu-item index="factory">-->
<!-- <i class="el-icon-office-building"></i>-->
<!-- <span slot="title">我的加工厂</span>-->
<!-- </el-menu-item>-->
<!-- <el-menu-item index="account">-->
<!-- <i class="el-icon-wallet"></i>-->
<!-- <span slot="title">收款账户</span>-->
<!-- </el-menu-item>-->
<!-- <el-menu-item index="news" v-if="userInfo.userLevel > 1">-->
<!-- <i class="el-icon-s-order"></i>-->
<!-- <span slot="title">新闻动态</span>-->
<!-- </el-menu-item>-->
<el-menu-item index="pwd">
<i class="el-icon-lock"></i>
<span slot="title">修改密码</span>
</el-menu-item>
<!-- <el-menu-item index="grade">-->
<!-- <i class="el-icon-user"></i>-->
<!-- <span slot="title">会员等级(临时)</span>-->
<!-- </el-menu-item>-->
<!-- <el-menu-item index="added">-->
<!-- <i class="el-icon-medal"></i>-->
<!-- <span slot="title">购买增值服务(临时)</span>-->
<!-- </el-menu-item>-->
</el-menu>
</el-col>
<el-col :span="20">
<personal v-if="currMenu === 'fadada'" @done="onDone"></personal>
<business-card v-else-if="currMenu === 'business-card'"></business-card>
<business-contact v-else-if="currMenu === 'business-contact'"></business-contact>
<seal v-else-if="currMenu === 'seal'"></seal>
<notice v-else-if="currMenu === 'notice'" @done="onDone"></notice>
<setting v-else-if="currMenu === 'setting'" @done="onDone"></setting>
<equity v-else-if="currMenu === 'equity'" @done="onDone"></equity>
<payment v-else-if="currMenu === 'payment'" @done="onDone"></payment>
<grade v-else-if="currMenu === 'grade'" @done="onDone"></grade>
<Added v-else-if="currMenu === 'added'" @done="onDone"></Added>
<Yaoqing v-else-if="currMenu === 'yaoqing'" @done="onDone"></Yaoqing>
<factory v-else-if="currMenu === 'factory'" @done="onDone"></factory>
<pwd v-else-if="currMenu === 'pwd'" @done="onDone"></pwd>
<account v-else-if="currMenu === 'account'" @done="onDone"></account>
<news v-else-if="currMenu === 'news'" @done="onDone"></news>
</el-col>
</el-row>
</view>
<!-- 现货市场 end -->
<gap height="100" />
<common-footer></common-footer>
<right-bar></right-bar>
</view>
</view>
<!-- 现货市场 end -->
<gap height="100"/>
<common-footer></common-footer>
<!-- <right-bar></right-bar>-->
</view>
</template>
<script>
import Personal from './components/personal'
import BusinessCard from './components/business-card'
import Seal from './components/seal'
import Notice from './components/notice'
import Setting from './components/setting'
import Equity from './components/equity'
import Grade from './components/grade'
import Added from './components/added'
import Payment from './components/payment'
import Yaoqing from './components/yaoqing'
import Personal from './components/personal'
import BusinessCard from './components/business-card'
import Seal from './components/seal'
import Notice from './components/notice'
import Setting from './components/setting'
import Equity from './components/equity'
import Grade from './components/grade'
import Added from './components/added'
import Payment from './components/payment'
import Yaoqing from './components/yaoqing'
import Factory from "./components/factory.vue";
import Pwd from "./components/pwd.vue";
import BusinessContact from "./components/business-contact.vue";
import Account from "./components/account.vue";
import News from "./components/news.vue";
export default {
components: {
Personal,
BusinessCard,
Seal,
Notice,
Equity,
Setting,
Grade,
Added,
Payment,
Yaoqing
},
data() {
return {
currMenu: 'fadada',
};
},
onLoad(options) {
if (options && options.menu) {
this.currMenu = options.menu
}
},
methods: {
menuSelect(e) {
this.currMenu = e
},
onDone(index) {
this.currMenu = index
}
}
}
export default {
components: {
Account,
BusinessContact,
Pwd,
Factory,
Personal,
BusinessCard,
Seal,
Notice,
Equity,
Setting,
Grade,
Added,
Payment,
Yaoqing,
News,
},
data() {
return {
currMenu: 'fadada',
userInfo: null
};
},
onLoad(options) {
if (options && options.menu) {
this.currMenu = options.menu
}
this.getUserInfo()
},
methods: {
menuSelect(e) {
this.currMenu = e
},
onDone(index) {
this.currMenu = index
},
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
this.userInfo = data.userInfo
if (!this.userInfo.mobile) {
this.$confirm('请先绑定手机号', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.redirectTo(`/pages/auth/login/wechat?state=jjx_` + vk.getVuex('$user.userInfo.accountType'))
}).catch(() => {
vk.redirectTo(`/pages/auth/login/wechat?state=jjx_` + vk.getVuex('$user.userInfo.accountType'))
})
return
}
}
});
},
}
}
</script>
<style lang="scss" scoped>
.w-1200 {
width: 1200px;
margin: 20px auto;
}
.w-1200 {
width: 1200px;
margin: 20px auto;
}
</style>
+49
View File
@@ -0,0 +1,49 @@
<template>
<view>
<view class="bg-gray-light flex justify-center items-center table-header p-30">
<view class="text-gray font-bold text-30 flex-1">品名/材质</view>
<view class="text-gray font-bold text-30 flex-1">采购量</view>
<view class="text-gray font-bold text-30 flex-2">采购企业</view>
<view class="text-gray font-bold text-30 flex-1">报价情况</view>
<view class="text-gray font-bold text-30 flex-1">发布时间</view>
<view class="text-gray font-bold text-30 flex-1 flex justify-end">操作</view>
</view>
<view class="flex justify-center items-center w-100p p-30"
v-for="(item, index) in info.enquiryList.filter((_, i) => i < limit)" :key="`enquiryList_${index}`">
<template
v-if="item.productList && item.productList.length > 0 && JSON.stringify(item.productList[0]) !== '{}'">
<view class="text-main flex-1 font-bold">{{ item.productList[0].goodsName }}</view>
<view class="flex-1">{{ item.productList[0].procureNumber }}{{
item.productList[0].procureUnit
}}
</view>
<view class="flex-2">{{ info.company.companyName }}</view>
<view class="flex-1">{{ item.answerNumber }}家已报价</view>
<view class="flex-1">{{ item._add_time_str }}</view>
<view class="flex-1 flex justify-end">
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="vk.navigateTo('/pages/enquiry/detail?id=' + item._id);">
查看详情
</el-button>
</view>
</template>
</view>
</view>
</template>
<script>
export default {
name: "enquiry",
props: {
info: Object,
limit: {
type: Number,
default: 999999
},
},
data() {
return {}
},
methods: {}
}
</script>
+71
View File
@@ -0,0 +1,71 @@
<template>
<view>
<view class="bg-gray-light flex justify-center items-center table-header p-30">
<view class="text-gray font-bold text-30 flex-1">品名/材质</view>
<view class="text-gray font-bold text-30 flex-1">加工量</view>
<!-- <view class="text-gray flex-1">收购地</view>-->
<view class="text-gray font-bold text-30 flex-2">采购企业</view>
<view class="text-gray font-bold text-30 flex-1">报价情况</view>
<view class="text-gray font-bold text-30 flex-1">发布时间</view>
<view class="text-gray font-bold text-30 flex-1 flex justify-end">操作</view>
</view>
<view class="flex justify-center items-center w-100p p-30"
v-for="(item, index) in info.processList" :key="`processList_${index}`">
<view class="text-main flex-1 font-bold">{{ item.title }}</view>
<!-- <view class="flex-1">{{ item.address }}</view>-->
<view class="flex-1">{{ item.num }}</view>
<view class="flex-2">{{ info.company.companyName }}</view>
<view class="flex-1">{{ item.answerNumber }}家已报价</view>
<view class="flex-1">{{ item._add_time_str }}</view>
<view class="flex-1 flex justify-end">
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="toProcessDetail(item._id)">查看详情
</el-button>
</view>
</view>
</view>
</template>
<script>
export default {
name: "process",
props: {
info: Object,
limit: {
type: Number,
default: 999999
},
},
data() {
return {}
},
methods: {
async toProcessDetail(id) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
vk.navigateTo({
url: `/pages/process/detail?id=${id}`
})
}
},
}
}
</script>
+149
View File
@@ -0,0 +1,149 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<gap/>
<view class="m-a w-1200 bg-white p-20 rounded">
<el-divider>
<span class="text-50 text-main font-bold">工厂信息</span>
</el-divider>
<el-descriptions border :column="2">
<el-descriptions-item label="成立年限">
<p>{{ info.year }}年</p>
</el-descriptions-item>
<el-descriptions-item label="年产值">
<p>{{ info.yearsIncome }}万元</p>
</el-descriptions-item>
<el-descriptions-item label="员工人数">
<p>{{ info.employeeNum }}人</p>
</el-descriptions-item>
<el-descriptions-item label="流水线数量">
<p>{{ info.flowNum }}条</p>
</el-descriptions-item>
<el-descriptions-item label="厂房归属">
<p>{{ info.blongTo }}</p>
</el-descriptions-item>
<el-descriptions-item label="厂房面积">
<p>{{ info.size }}平方米</p>
</el-descriptions-item>
<el-descriptions-item label="所在地">
<p>{{ info.addressRegion.province.name }}{{ info.addressRegion.city.name }}</p>
</el-descriptions-item>
<el-descriptions-item label="主营工艺和业务范围">
<p>{{ info.mainProcess }}</p>
</el-descriptions-item>
<el-descriptions-item label="主营类别" v-if="info.mainSpotCategory">
<p>{{ info.mainSpotCategory.join() }}</p>
</el-descriptions-item>
<el-descriptions-item label="服务信息">
<p>{{ info.serviceInfo }}</p>
</el-descriptions-item>
</el-descriptions>
<template v-if="info.video">
<el-divider>
<span class="text-50 text-main font-bold">视频</span>
</el-divider>
<video :src="info.video" style="width: 100%" controls></video>
</template>
<el-divider>
<span class="text-50 text-main font-bold">设备信息</span>
</el-divider>
<el-row :gutter="10" class="p-20 bg-gray-light">
<el-col :span="3">
<p class="text-center">设备名称</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备数量</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备来源</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备类型</p>
</el-col>
<el-col :span="3">
<p class="text-center">品牌</p>
</el-col>
<el-col :span="3">
<p class="text-center">型号</p>
</el-col>
<el-col :span="3">
<p class="text-center">投产年限</p>
</el-col>
<el-col :span="3">
<p class="text-center">特点描述</p>
</el-col>
</el-row>
<el-row :gutter="10" class="p-20" v-for="(item, index) in info.deviceList" :key="index">
<el-col :span="3">
<p class="text-center">{{ item.name }}</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.num }}台</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.source }}</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.type }}</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.brand }}</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.model }}</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.year }}年</p>
</el-col>
<el-col :span="3">
<p class="text-center">{{ item.desc }}</p>
</el-col>
</el-row>
<el-divider>
<span class="text-50 text-main font-bold">工厂实景</span>
</el-divider>
<div class="flex justify-start items-start">
<el-image v-for="(item, index) in info.album" :key="index" :src="item" class="mr-25 mb-25"
style="width: 200px; height: 200px;" fit="cover" :preview-src-list="info.album"/>
</div>
</view>
<gap/>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "factory",
data() {
return {
info: null
}
},
methods: {
async getInfo(userId) {
const {data} = await vk.callFunction({
url: 'client/factory/pub/getInfo',
data: {
userId
}
})
if (!data) {
this.$message.error('获取工厂信息失败')
setTimeout(() => {
vk.navigationBack()
}, 1000)
} else {
this.info = data
}
}
},
onLoad(options) {
if (options && options.userId) {
this.getInfo(options.userId)
}
}
}
</script>
+381 -259
View File
@@ -1,169 +1,232 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<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/yellowPage/list">金久信黄页</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item class="text-main">{{ info.company.companyName }}</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="mt-40 bg-white company">
<view class="p-50 flex justify-between items-center pb-30 border-bottom">
<view class="flex justify-start items-center">
<image class="logo" :src="info.businessCard.logo" v-if="info.businessCard"/>
<view class="ml-35 flex flex-col justify-start items-start">
<text class="text-40 font-bold">{{ info.company.companyName }}</text>
<text class="text-gray text-28 mt-40" v-if="info.businessCard">主营业务:
{{ info.businessCard.mainBusiness }}
</text>
</view>
</view>
<view class="flex justify-end items-center">
<view class="flex flex-col justify-center items-center">
<view class="flex justify-center items-center">
<protect theme="filled" size="24" fill="#d0021b" strokeLinecap="square"/>
<view class="text-gray">平台累计交易</view>
</view>
<text class="text-main font-bold text-50">{{ info.transactionAmount }}</text>
</view>
<view class="flex flex-col justify-center items-center ml-35">
<view class="flex justify-center items-center">
<exchange-three theme="filled" size="24" fill="#d0021b" strokeLinecap="square"/>
<view class="text-gray">已缴纳交易保证金</view>
</view>
<text class="text-main font-bold text-50">{{ info.paidEnsure }}</text>
</view>
<view class="w-1200 m-a">
<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/yellowPage/list">金久信黄页</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item class="text-main">{{ info.company.companyName }}</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="mt-40 bg-white company">
<view class="p-50 flex justify-between items-center pb-30 border-bottom">
<view class="flex justify-start items-center">
<image class="logo" :src="info.businessCard.logo" v-if="info.businessCard"/>
<view class="ml-35 flex flex-col justify-start items-start ">
<view class="flex justify-between items-center w-100p">
<text class="text-40 font-bold">{{ info.company.companyName }}</text>
<view class="flex justify-end items-start">
<view class="flex justify-center items-center">
<protect theme="filled" size="24" fill="#d0021b" strokeLinecap="square"/>
<view class="text-gray mx-15">平台累计交易</view>
</view>
<text class="text-main font-bold text-50">{{ info.transactionAmount.toFixed(2) }}</text>
<view class="flex justify-end items-start " v-if="info.paidEnsure && info.paidEnsure > 0" style="margin-left: 60rpx">
<view class="flex justify-center items-center">
<exchange-three theme="filled" size="24" fill="#d0021b" strokeLinecap="square"/>
<view class="text-gray mx-15">已缴纳交易保证金</view>
</view>
<text class="text-main font-bold text-50">{{ info.paidEnsure.toFixed(2) }}</text>
</view>
</view>
<view class="mt-30 p-40">
<view class="flex justify-between items-center mb-20">
<view class="title">企业简介</view>
<view class="mt-20" v-html="info.companyIntroduction"></view>
</view>
<view class="flex flex-col justify-start items-start mb-20">
<view class="title">联系我们</view>
<view class="mt-20 flex justify-start items-start flex-wrap w-100p text-30">
<view class="flex justify-start items-center w-33p mb-20">
<i class="el-icon-map-location mr-15"/>
<text v-if="info.manager">地址:{{ info.manager.address }}</text>
</view>
<view class="flex justify-start items-center w-33p mb-20">
<i class="el-icon-phone mr-15"/>
<text v-if="info.businessCard">电话:{{ info.businessCard.phone }}</text>
</view>
<view class="flex justify-start items-center w-33p mb-20">
<i class="el-icon-mobile mr-15"/>
<text v-if="info.businessCard">手机:{{ info.businessCard.mobile }}</text>
</view>
<view class="flex justify-start items-center w-33p">
<i class="el-icon-message mr-15"/>
<text v-if="info.businessCard">邮箱:{{ info.businessCard.email }}</text>
</view>
<view class="flex justify-start items-center w-33p">
<i class="el-icon-data-board mr-15"/>
<text v-if="info.businessCard">网址:{{ info.businessCard.website }}</text>
</view>
</view>
</view>
<view class="flex flex-col justify-start items-start mb-20">
<view class="title">发布的现货</view>
<view class="mt-20 bg-gray w-100p p-40" v-for="(item, index) in info.spotList" :key="index">
<view class="w-100p flex justify-between items-center">
<text class="font-bold text-40">{{ item.name }}</text>
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id)">查看详情
</el-button>
</view>
<view class="w-60p flex justify-between items-center text-main my-20">
<text>库存:{{ item.stock }}吨</text>
<text>供货地:{{ item.address.province.name }}-{{
item.address.city.name
}}-{{ item.address.area.name }}
</text>
</view>
<view class="w-60p flex justify-between items-center text-gray">
<view class="flex justify-start items-center">
<i class="el-icon-user"/>
<text>{{ info.company.companyName }}</text>
</view>
<text class="">{{ item._add_time_str }}发布</text>
</view>
</view>
<text class="text-gray text-28 mt-40" v-if="info.company.mainSpotCategory">
主营业务:{{ info.company.mainSpotCategory.join() }}
</text>
</view>
</view>
</view>
</view>
<view class="flex justify-between items-start mb-20">
<view class="title">发布的询价单</view>
<view class="text-main pointer" @click="vk.navigateTo('/pages/spot/goods/goods')">查看更多>
</view>
</view>
<view class="bg-gray-light flex justify-center items-center table-header p-20">
<view class="text-gray flex-1">品名/材质</view>
<view class="text-gray flex-1">采购量</view>
<view class="text-gray flex-1">收购地</view>
<view class="text-gray flex-1">采购企业</view>
<view class="text-gray flex-1">报价情况</view>
<view class="text-gray flex-1">发布时间</view>
<view class="text-gray flex-1">操作</view>
</view>
<view class="flex justify-center items-center mt-20 w-100p p-20"
v-for="(item, index) in info.enquiryList" :key="index">
<template v-if="item.productList && item.productList.length > 0 && JSON.stringify(item.productList[0]) !== '{}'">
<view class="text-main flex-1">{{ item.productList[0].goodsName }}</view>
<view class="flex-1">{{ item.productList[0].procureNumber }}{{
item.productList[0].procureUnit
}}
</view>
<view class="flex-1">{{ item.address }}</view>
<view class="flex-1">{{ info.company.companyName }}</view>
<view class="flex-1">{{ item.answerNumber }}家已报价</view>
<view class="flex-1">{{ item._add_time_str }}</view>
<view class="flex-1">
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="vk.navigateTo('/pages/enquiry/detail?id=' + item._id);">查看
</el-button>
</view>
</template>
</view>
<view class="flex justify-between items-start mb-20">
<view class="title">发布的加工单</view>
<view class="text-main" @click="vk.navigateTo('/pages/process/list')">查看更多></view>
</view>
<view class="bg-gray-light flex justify-center items-center table-header p-20">
<view class="text-gray flex-1">品名/材质</view>
<view class="text-gray flex-1">加工量</view>
<!-- <view class="text-gray flex-1">收购地</view>-->
<view class="text-gray flex-1">采购企业</view>
<view class="text-gray flex-1">报价情况</view>
<view class="text-gray flex-1">发布时间</view>
<view class="text-gray flex-1">操作</view>
</view>
<view class="flex justify-center items-center mt-20 w-100p p-20"
v-for="(item, index) in info.processList" :key="index">
<view class="text-main flex-1">{{ item.title }}</view>
<!-- <view class="flex-1">{{ item.address }}</view>-->
<view class="flex-1">{{ item.num }}</view>
<view class="flex-1">{{ info.company.companyName }}</view>
<view class="flex-1">{{ item.answerNumber }}家已报价</view>
<view class="flex-1">{{ item._add_time_str }}</view>
<view class="flex-1">
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="toProcessDetail(row._id)">查看
</el-button>
</view>
</view>
</view>
</view>
</view>
<gap/>
<common-footer></common-footer>
<view class="mt-30 p-40" v-if="info">
<el-carousel height="300px`" :style="{width: '100%'}" class="m-a"
v-if="info.businessCard && info.businessCard.album">
<template v-if="Array.isArray(info.businessCard.album)">
<el-carousel-item v-for="(item, index) in info.businessCard.album" :key="index"
:style="{width: '100%'}">
<el-image :src="item" fit="cover" :style="{width: '100%'}"/>
</el-carousel-item>
</template>
<el-carousel-item v-else :style="{width: '100%'}">
<el-image :src="info.businessCard.album" fit="cover" :style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
<view class="flex flex-col justify-start items-start mb-20">
<view class="title">企业简介</view>
<view class="mt-20" v-if="info.businessCard && info.businessCard.companyIntroduction"
v-html="info.businessCard.companyIntroduction"></view>
<text v-else>商家暂未填写</text>
</view>
<view class="flex flex-col justify-start items-start mb-20"
v-if="info.businessCard && info.businessCard.video">
<view class="title">企业视频</view>
<video :src="info.businessCard.video" autoplay controls style="width: 100%"/>
</view>
<view class="flex flex-col justify-start items-start mb-20"
v-if="info.businessCard && info.businessCard.productImageList">
<view class="title">产品展示</view>
<view class="flex justify-start items-start flex-wrap">
<el-image :preview-src-list="info.businessCard.productImageList" :src="item"
v-for="(item, index) in info.businessCard.productImageList"
:key="index" fit="cover"
:style="{margin: (index !== 0 && (index + 1) % 5 === 0) ? '0 0 21px 0' : '0 21px 21px 0'}"
style="width: 215px; height: 215px;"/>
</view>
</view>
<view class="flex flex-col justify-start items-start mb-20"
v-if="info.businessCard && info.businessCard.exampleImageList">
<view class="title">案例展示</view>
<view class="flex justify-start items-start flex-wrap">
<el-image :preview-src-list="info.businessCard.exampleImageList" :src="item"
v-for="(item, index) in info.businessCard.exampleImageList"
:style="{margin: (index !== 0 && (index + 1) % 5 === 0) ? '0 0 21px 0' : '0 21px 21px 0'}"
:key="index" fit="cover"
style="width: 215px; height: 215px;"/>
</view>
</view>
<view class="flex flex-col justify-start items-start mb-20"
v-if="info.businessCard && info.businessCard.longitude">
<view class="title">地图定位</view>
<view class="mapDiv">
<tdt-map :center="[info.businessCard.longitude, info.businessCard.latitude]" :zoom="12">
<tdt-marker :position="[info.businessCard.longitude, info.businessCard.latitude]"
:draggable="false"/>
</tdt-map>
</view>
</view>
<view class="flex flex-col justify-start items-start mb-20"
v-if="userArticle.length > 0">
<view class="title">新闻动态</view>
<view class="flex justify-start items-start flex-col w-100p">
<view class="flex justify-between items-center pointer w-100p mb-25"
@click="showArticle(index)"
v-for="(item, index) in userArticle" :key="index">
<text>{{ item.title }}</text>
<text class="text-gray">{{ item._add_time_str }}</text>
</view>
</view>
</view>
<view class="flex flex-col justify-start items-start mb-20">
<view class="title">联系我们</view>
<view class="mt-20 flex justify-start items-start flex-wrap w-100p text-30">
<view class="flex justify-start items-center w-50p mb-20">
<i class="el-icon-map-location mr-15"/>
<text class="content" v-if="info.company.addressRegion">地址:{{
info.company.addressRegion.province.name
}}{{ info.company.addressRegion.city.name }}{{
info.company.addressRegion.area.name
}}{{ info.company.addressDetail }}
</text>
</view>
<view class="flex justify-start items-center w-25p mb-20">
<i class="el-icon-phone mr-15"/>
<text class="content" v-if="info.businessCard">电话:{{
info.businessCard.companyMobile ? info.businessCard.companyMobile : '商家暂未填写'
}}
</text>
</view>
<view class="flex justify-start items-center w-25p mb-20">
<i class="el-icon-mobile mr-15"/>
<text class="content" v-if="info.manager">手机:{{
info.manager.mobile ? info.manager.mobile : '商家暂未填写'
}}
</text>
</view>
<view class="flex justify-start items-center w-33p">
<i class="el-icon-message mr-15"/>
<text class="content" v-if="info.businessCard">邮箱:{{
info.businessCard.email ? info.businessCard.email : '商家暂未填写'
}}
</text>
</view>
<view class="flex justify-start items-center w-33p" v-if="info.userLevel > 1">
<i class="el-icon-data-board mr-15"/>
<text class="content" v-if="info.businessCard">网址:{{
info.businessCard.website ? info.businessCard.website : '商家暂未填写'
}}
</text>
</view>
</view>
</view>
<template v-if="parseInt(info.userLevel) > 0">
<view class="flex flex-col justify-start items-start mb-20">
<view class="title">发布的现货</view>
<view class="mt-20 spot-bg w-100p p-40" v-if="info.spotList">
<view class="w-100p flex justify-between items-center">
<text class="font-bold text-40">{{ info.spotList.name }}</text>
<el-button type="primary" plain class="empty-bg-plain-btn"
@click.native="vk.navigateTo('/pages/spot/goods/detail?id=' + info.spotList._id)">
查看详情
</el-button>
</view>
<view class="w-60p flex justify-between items-center text-main my-20">
<text>库存:{{ info.spotList.stock }}吨</text>
<text
v-if="info.spotList.address && info.spotList.address.province && info.spotList.address.area && info.spotList.address.area ">
供货地:{{ info.spotList.address.province.name }}-{{
info.spotList.address.city.name
}}-{{ info.spotList.address.area.name }}
</text>
</view>
<view class="w-60p flex justify-between items-center text-gray">
<view class="flex justify-start items-center">
<i class="el-icon-user"/>
<text>{{ info.company.companyName }}</text>
</view>
<text class="">{{ info.spotList._add_time_str }}发布</text>
</view>
</view>
</view>
<view class="flex justify-between items-center mb-20">
<view class="title">发布的询价单</view>
<!-- <view class="text-main pointer" @click="vk.navigateTo('/pages/spot/goods/goods')">查看更多>-->
<view class="text-main pointer" v-if="info.enquiryList.length > 5" @click="showAllEnquiry = true">查看更多>
</view>
</view>
<enquiry :info="info" :limit="5"/>
<view class="flex justify-between items-center mb-20">
<view class="title">发布的加工单</view>
<!-- <view class="text-main pointer" @click="vk.navigateTo('/pages/process/list')">查看更多>-->
<view class="text-main pointer" v-if="info.processList.length > 5" @click="showAllProcess = true">查看更多>
</view>
</view>
<process :info="info" :limit="5"/>
</template>
</view>
</view>
</view>
<gap/>
<common-footer></common-footer>
<el-dialog v-if="articleIndex > -1 && dialogVisible"
title="新闻动态"
:visible.sync="dialogVisible"
width="70%">
<p class="text-35 font-bold pb-20">{{ userArticle[articleIndex].title }}</p>
<p class="text-gray text-28 pb-20 border-bottom">{{ userArticle[articleIndex]._add_time_str }}</p>
<div v-html="userArticle[articleIndex].content" class="pt-20"></div>
<div slot="footer">
<el-button @click="dialogVisible = false">关 闭</el-button>
</div>
</el-dialog>
<el-dialog v-if="showAllEnquiry"
title="全部询价单"
:visible.sync="showAllEnquiry"
width="70%">
<enquiry :info="info"/>
</el-dialog>
<el-dialog v-if="showAllProcess"
title="全部加工单"
:visible.sync="showAllProcess"
width="70%">
<process :info="info"/>
</el-dialog>
</view>
</template>
<script>
@@ -172,117 +235,176 @@ import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import Gap from "../../components/gap/gap.vue";
import Enquiry from "@/pages/yellowPage/components/enquiry.vue";
import Process from "@/pages/yellowPage/components/process.vue";
export default {
name: "info",
components: {Gap, Protect, ExchangeThree},
data() {
return {
id: null,
provinceData: provinces,
cityData: citys,
areaData: areas,
info: {
transactionAmount: 0,
paidEnsure: 0,
spotList: [],
enquiryList: [],
processList: [],
},
}
},
methods: {
getInfo() {
vk.callFunction({
url: "client/user/pub/getDetail",
data: {
_id: this.id
},
success: (res) => {
this.info = res.data
this.info.enquiryList.map(val => {
let str = ''
if (val.productList.length > 0 && val.productList[0].addressRegion.length > 0) {
let provinceIndex = 0, cityIndex = 0, areaIndex = 0
this.provinceData.forEach((item, index) => {
if (parseInt(val.productList[0].addressRegion[0]) === parseInt(item.code)) {
provinceIndex = index
str = item.name
}
})
this.cityData[provinceIndex].forEach((item, index) => {
if (parseInt(val.productList[0].addressRegion[1]) === parseInt(item.code)) {
cityIndex = index
str += item.name
}
})
this.areaData[provinceIndex][cityIndex].forEach((item, index) => {
if (parseInt(val.productList[0].addressRegion[2]) === parseInt(item.code)) {
areaIndex = index
str += item.name
}
})
str += val.productList[0].addressDetail
}
val.address = str
return val
})
}
});
},
async toProcessDetail(id) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
vk.navigateTo({
url: `/pages/process/detail?id=${id}`
})
}
},
},
onLoad(option) {
if (option.id) {
this.id = option.id
this.getInfo()
name: "info",
components: {Process, Enquiry, Gap, Protect, ExchangeThree},
data() {
return {
id: null,
provinceData: provinces,
cityData: citys,
areaData: areas,
info: {
transactionAmount: 0,
paidEnsure: 0,
spotList: [],
enquiryList: [],
processList: [],
company: {
companyName: ''
}
},
allChildCate: [],
userArticle: [],
articleIndex: -1,
dialogVisible: false,
showAllEnquiry: false,
showAllProcess: false,
}
},
methods: {
getCategoryTreeData() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.allChildCate = []
data.rows.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
this.getInfo()
}
});
},
getUserArticle() {
vk.callFunction({
url: 'client/userArticle/pub/getList',
title: '请求中...',
data: {
userId: this.id
},
success: (data) => {
this.userArticle = data.rows
}
});
},
getInfo() {
vk.callFunction({
url: "client/user/pub/getDetail",
data: {
_id: this.id
},
success: (res) => {
this.info = res.data
this.info.company.mainSpotCategory = []
if (this.info.company && this.info.company.mainSpotCategoryIds) {
this.allChildCate.forEach(child => {
if (this.info.company.mainSpotCategoryIds.includes(child._id)) {
this.info.company.mainSpotCategory.push(child.name)
}
})
}
this.info.enquiryList.map(val => {
let str = ''
if (val.addressRegion && val.addressRegion.area) {
str = val.addressRegion.province.name + val.addressRegion.city.name + val.addressRegion.area.name
}
if (val.addressDetail) str += val.addressDetail
val.address = str
return val
})
}
});
},
async toProcessDetail(id) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
vk.navigateTo({
url: `/pages/process/detail?id=${id}`
})
}
},
showArticle(index) {
this.articleIndex = index
this.dialogVisible = true
this.$nextTick(() => {
// 获取所有的img元素
var imgElements = document.getElementsByTagName('img');
// 遍历img元素数组
for (var i = 0; i < imgElements.length; i++) {
// 添加style属性,并设置width为100%
imgElements[i].style.width = '100%';
}
})
}
},
onLoad(option) {
if (option.id) {
this.id = option.id
this.getCategoryTreeData()
this.getUserArticle()
}
}
}
</script>
<style lang="scss" scoped>
.company {
.logo {
width: 100px;
height: 100px;
}
.logo {
width: 100px;
height: 100px;
}
.title {
font-size: 16px;
padding-left: 5px;
border-left: 3px solid #d0021b;
color: #d0021b;
}
.title {
font-weight: bold;
font-size: 16px;
padding-left: 5px;
border-left: 3px solid #d0021b;
color: #d0021b;
margin: 20px 0;
}
.table-header {
border-top: 8px solid #F4F4F4;
}
.table-header {
border-top: 8px solid #F4F4F4;
}
.content {
color: #555;
}
}
.spot-bg {
background-color: #F9F9F9;
}
.mapDiv {
width: 100%;
height: 300px;
}
</style>
+569 -290
View File
@@ -1,171 +1,253 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
</view>
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="getCompany()" clearable placeholder="输入关键字搜索"
v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-getCompany"></i>
<el-button @click="getCompany()" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="行业类型:" class="border-bottom pb-30">
</el-form-item>
<el-form-item label="分类:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
{{ item.name }}
</text>
</view>
</view>
<view class="child-cate flex justify-start items-center flex-wrap" v-if="clickedCateIndex !== null">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
</text>
</template>
</view>
</el-form-item>
<el-form-item label="城市" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
</text>
<view v-for="(item, index) in provinceData" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectProvince(item.code)"
:class="[checkProvinceList.includes(item.code)? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllProvince">
{{ item.name }}
</text>
</view>
<text @click="showAllProvince = !showAllProvince" class="pointer mr-25">查看更多
</text>
</view>
</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="w-1200 flex justify-start items-start flex-wrap m-a">
<view v-for="(item, index) in companyList" :key="index" class="w-50p company-item">
<view class="p-40">
<view class="rounded shadow p-50 bg-white flex flex-col justify-start items-start">
<view class="flex justify-end w-100p">
<image class="authed" src="/static/images/authed.png" mode="aspectFit"
v-if="item.authStatus === 1"/>
<gap height="40" v-else/>
</view>
<view class="flex justify-start items-center">
<image :src="item.businessCard.logo" class="logo" v-if="item.businessCard"
mode="aspectFill"/>
<image v-else src="/static/images/no-logo.jpg" class="logo" mode="aspectFill"/>
<view class="ml-35 flex flex-col justify-start items-start">
<text>{{ item.name }}</text>
<i class="el-icon-star-off text-main my-20"/>
<view class="flex justify-start items-center">
<i class="el-icon-user"/>
<text class="ml-10" v-if="item.manager">{{ item.manager.personName }}</text>
<text class="ml-20 text-28" v-if="item.businessCard">{{
item.businessCard.position
}}
</text>
</view>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-map-location mr-15"/>
<view class="flex-col justify-start items-center">
<text>地址:</text>
<text
v-if="item.company && item.company.addressRegion && item.company.addressRegion.province && item.company.addressRegion.city && item.company.addressRegion.area">
{{
item.company.addressRegion.province.name
}}{{ item.company.addressRegion.city.name }}{{
item.company.addressRegion.area.name
}}{{
item.company.addressDetail
}}
</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-phone mr-15"/>
<view class="flex-col justify-start items-center">
<text>电话:</text>
<text v-if="item.businessCard">{{ item.company.companyMobile }}</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-mobile mr-15"/>
<view class="flex-col justify-start items-center">
<text>手机:</text>
<text v-if="item.businessCard">{{ item.businessCard.managerMobile }}</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-message mr-15"/>
<view class="flex-col justify-start items-center">
<text>邮箱:</text>
<text v-if="item.businessCard">{{ item.businessCard.email }}</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-data-board mr-15"/>
<view class="flex-col justify-start items-center">
<text>网址:</text>
<text v-if="item.businessCard">{{ item.businessCard.website }}</text>
</view>
</view>
<view class="flex justify-between items-center w-100p">
<view class="flex justify-start items-center mt-20">
<text class="text-main">主营业务:</text>
<text v-if="item.businessCard">{{ item.businessCard.mainBusiness }}</text>
</view>
<el-button type="primary" @click="showInfo(item._id)">查看详情</el-button>
</view>
</view>
</view>
</view>
</view>
<right-bar></right-bar>
<common-footer></common-footer>
<view class="carousel">
<el-carousel height="500px">
<common-swiper page="yellowPage"/>
</el-carousel>
</view>
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="search()" clearable placeholder="输入关键字搜索"
v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-getCompany"></i>
<el-button @click="search()" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<!-- <el-form-item label="行业类型:" class="border-bottom pb-30">-->
<!-- </el-form-item>-->
<el-form-item label="主营类目:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
{{ item.name }}
</text>
</view>
</view>
<view class="child-cate flex justify-start items-center flex-wrap" v-if="clickedCateIndex !== null">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
</text>
</template>
</view>
</el-form-item>
<el-form-item label="行业分类" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectIndustry(-1)" class="pointer mr-25 flex-grow-0"
:class="[selectedIndustryList.length === 0 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in industryList" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectIndustry(item.name)"
:class="[selectedIndustryList.includes(item.name)? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllIndustry">
{{ item.name }}
</text>
</view>
<!-- <text @click="showAllIndustry = !showAllIndustry" class="pointer mr-25">查看更多-->
<!-- </text>-->
</view>
</el-form-item>
<el-form-item label="城市" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
</text>
<view v-for="(item, index) in provinceData" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectProvince(item.code)"
:class="[checkProvinceList.includes(item.code)? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllProvince">
{{ item.name }}
</text>
</view>
<!-- <text @click="showAllProvince = !showAllProvince" class="pointer mr-25">查看更多-->
<!-- </text>-->
</view>
</el-form-item>
<!-- <el-form-item label="其他" class="border-bottom pb-30">-->
<!-- <el-checkbox v-model="factoryFilter" @change="factoryFilterChange">筛选加工商</el-checkbox>-->
<!-- </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="w-1200 flex justify-start items-start flex-wrap m-a">
<view v-for="(item, index) in companyList.filter((_, i) => hasAuth ? true : i < 6)" :key="index"
class="w-50p company-item">
<view class="p-40">
<view class="rounded shadow p-50 bg-white flex flex-col justify-start items-start"
style="height: 900rpx">
<view class="flex justify-end w-100p">
<image class="authed" src="/static/images/authed.png" mode="aspectFit"
v-if="item.authStatus === 1"/>
<gap height="40" v-else/>
</view>
<view class="flex justify-start items-center">
<image :src="item.businessCard.logo" class="logo" v-if="item.businessCard"
mode="aspectFill"/>
<image v-else src="/static/images/no-logo.jpg" class="logo" mode="aspectFill"/>
<view class="ml-35 flex flex-col justify-start items-start">
<div class="flex justify-start items-center font-bold">
<text>{{ item.name }}</text>
<!-- <text v-if="item.factoryStatus === 1" class="text-main">[加工商]</text>-->
<i class="el-icon-star-off text-main ml-20"/>
</div>
<view class="flex justify-start items-center">
<i class="el-icon-user"/>
<text class="ml-10" v-if="item.manager">{{ item.manager.personName }}</text>
<text class="ml-20 text-28" v-if="item.businessCard">{{
item.businessCard.position
}}
</text>
</view>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-map-location mr-15"/>
<view class="flex-col justify-start items-center">
<text>地址:</text>
<text
v-if="item.company && item.company.addressRegion && item.company.addressRegion.province && item.company.addressRegion.city && item.company.addressRegion.area">
{{
item.company.addressRegion.province.name
}}{{ item.company.addressRegion.city.name }}{{
item.company.addressRegion.area.name
}}{{
item.company.addressDetail
}}
</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<view class="flex justify-start items-center ">
<i class="el-icon-mobile mr-15"/>
<view class="flex-col justify-start items-center">
<text>手机:</text>
<text v-if="item.manager">{{
item.manager.mobile ? item.manager.mobile : '商家暂未填写'
}}
</text>
</view>
</view>
<view class="flex justify-start items-center ml-25">
<i class="el-icon-phone mr-15"/>
<view class="flex-col justify-start items-center">
<text>电话:</text>
<text v-if="item.businessCard">{{
item.businessCard.companyMobile ? item.businessCard.companyMobile : '商家暂未填写'
}}
</text>
</view>
</view>
</view>
<view class="mt-20 flex justify-between items-center w-100p">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center ">
<i class="el-icon-message mr-15"/>
<view class="flex-col justify-start items-center">
<text>邮箱:</text>
<text v-if="item.businessCard">
{{ item.businessCard.email ? item.businessCard.email : '商家暂未填写' }}
</text>
</view>
</view>
<view class="flex justify-start items-center mt-20" v-if="item.userLevel > 1">
<i class="el-icon-data-board mr-15"/>
<view class="flex-col justify-start items-center">
<text>网址:</text>
<text v-if="item.businessCard">
{{ item.businessCard.website ? item.businessCard.website : '商家暂未填写' }}
</text>
</view>
</view>
</view>
<el-image v-if="item.businessCard && item.businessCard.companyWechat"
:src="item.businessCard.companyWechat" class="wechat" fix="cover"/>
</view>
<view class="flex justify-between items-center w-100p">
<view class="flex justify-start items-center mt-20">
<text class="text-main" style="width: 140rpx">主营业务:</text>
<text class="ml-20 flex-1">{{ item.mainSpotCategory.join() }}</text>
</view>
</view>
<view class="flex justify-end items-center w-100p">
<!-- <el-button type="primary" plain @click="showFactoryInfo(item._id)"-->
<!-- v-if="item.factoryStatus === 1">查看加工商详情-->
<!-- </el-button>-->
<el-button type="primary" @click="showInfo(item._id)">查看详情</el-button>
</view>
</view>
</view>
</view>
</view>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad23.length">
<el-carousel :height="`100px`" :style="{width: ad24.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad23" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad24.length">
<el-carousel :height="`100px`" :style="{width: ad23.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad24" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad25.length">
<el-carousel :height="`100px`" :style="{width: ad26.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad25" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad26.length">
<el-carousel :height="`100px`" :style="{width: ad25.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad26" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<right-bar></right-bar>
<common-footer></common-footer>
</view>
</template>
<script>
@@ -173,170 +255,367 @@ import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import Gap from "../../components/gap/gap.vue";
export default {
name: "list",
components: {Gap},
data() {
return {
categoryTreeData: [],
allChildCate: [],
clickedCateIndex: null,
checkCategoryList: [],
keyword: '',
provinceData: provinces,
checkProvinceList: [],
showAllProvince: false,
companyList: []
}
},
methods: {
getCategoryTreeData() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
}
});
},
selectCate(id) {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList.push(id)
else this.checkCategoryList.splice(index, 1)
this.getCompany()
},
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
else {
const index = this.checkProvinceList.indexOf(code)
if (index === -1) this.checkProvinceList.push(code)
else this.checkProvinceList.splice(index, 1)
}
this.getCompany()
},
getCompany() {
vk.callFunction({
url: 'client/user/pub/getCompany',
title: '请求中...',
data: {
province: this.checkProvinceList,
keyword: this.keyword,
mainSpotCategoryIds: this.checkCategoryList,
},
success: (data) => {
this.companyList = data.rows.map(item => {
item.name = item.company.companyName
return item
})
}
});
},
showInfo(id) {
vk.navigateTo({
url: `/pages/yellowPage/info?id=${id}`
})
}
},
onShow() {
this.getCategoryTreeData()
this.getCompany()
},
computed: {
checkCategoryArr() {
const arr = []
this.allChildCate.forEach(item => {
if (this.checkCategoryList.includes(item._id)) arr.push(item)
})
this.provinceData.forEach(item => {
if (this.checkProvinceList.includes(item.code)) {
arr.push(item)
}
})
return arr
}
name: "list",
components: {Gap},
data() {
return {
categoryTreeData: [],
allChildCate: [],
clickedCateIndex: -1,
checkCategoryList: [],
keyword: '',
provinceData: provinces,
checkProvinceList: [],
showAllProvince: true,
companyList: [],
factoryFilter: false,
industryList: [],
selectedIndustryList: [],
showAllIndustry: true,
ad23: [],
ad24: [],
ad25: [],
ad26: [],
hasAuth: true
}
},
methods: {
getCategoryTreeData() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
this.getCompany()
}
});
},
selectCate(id) {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList = [id]
else this.checkCategoryList = []
this.getCompany()
},
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
else {
// const index = this.checkProvinceList.indexOf(code)
// if (index === -1) this.checkProvinceList.push(code)
// else this.checkProvinceList.splice(index, 1)
this.checkProvinceList = [code]
}
this.getCompany()
},
selectIndustry(name) {
if (name === -1) this.selectedIndustryList = []
else {
const index = this.selectedIndustryList.indexOf(name)
if (index === -1) this.selectedIndustryList = [name]
else this.selectedIndustryList = []
}
this.getCompany()
},
search() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm') || [-1, 2].includes(vk.getVuex('$user.userInfo.authStatus'))) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else {
this.getCompany()
}
},
getCompany() {
vk.callFunction({
url: 'client/user/pub/getCompany',
title: '请求中...',
data: {
province: this.checkProvinceList,
keyword: this.keyword,
mainSpotCategoryIds: this.checkCategoryList,
showInYellow: 1,
// factoryFilter: this.factoryFilter,
industryList: this.selectedIndustryList
},
success: (data) => {
this.companyList = data.rows.map(item => {
item.name = item.company.companyName
item.mainSpotCategory = []
if (item.company && item.company.mainSpotCategoryIds) {
this.allChildCate.forEach(child => {
if (item.company.mainSpotCategoryIds.includes(child._id)) {
item.mainSpotCategory.push(child.name)
}
})
}
return item
})
this.getAd23()
this.getAd24()
this.getAd25()
this.getAd26()
}
});
},
showInfo(id) {
vk.navigateTo({
url: `/pages/yellowPage/info?id=${id}`
})
},
showFactoryInfo(id) {
vk.navigateTo({
url: `/pages/yellowPage/factory?userId=${id}`
})
},
factoryFilterChange(val) {
this.factoryFilter = val
this.getCompany()
},
async getIndustryList() {
const {rows} = await vk.callFunction({
url: 'client/industry/pub/getList'
})
this.industryList = rows
},
async getAd23() {
this.ad23 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 23,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad23 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 1,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad23.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd24() {
this.ad24 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 24,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad24 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 2,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad24.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd25() {
this.ad25 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 25,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad25 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 3,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad25.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd26() {
this.ad26 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 26,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad26 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 4,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad26.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
},
onShow() {
this.getCategoryTreeData()
this.getIndustryList()
this.hasAuth = (vk.getVuex('$user.userInfo.fadadaConfirm') && vk.getVuex('$user.userInfo.authStatus') === 1)
},
computed: {
checkCategoryArr() {
const arr = []
this.allChildCate.forEach(item => {
if (this.checkCategoryList.includes(item._id)) arr.push(item)
})
this.provinceData.forEach(item => {
if (this.checkProvinceList.includes(item.code)) {
arr.push(item)
}
})
this.selectedIndustryList.forEach(item => {
arr.push({name: item})
})
return arr
}
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
display: flex;
.el-tag {
margin-right: 10px;
}
.el-tag {
margin-right: 10px;
}
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
.post-btn {
background: none;
background: none;
}
.post-btn:hover {
background: #f6eae9;
color: #A92924;
background: #f6eae9;
color: #A92924;
}
.selected-cate {
border-bottom: 2px solid #BD3124;
line-height: 40rpx;
border-bottom: 2px solid #BD3124;
line-height: 40rpx;
}
.child-cate {
background-color: #DB8382;
color: white;
margin-top: 10rpx;
border-radius: 15rpx;
padding: 0 20rpx;
background-color: #DB8382;
color: white;
margin-top: 10rpx;
border-radius: 15rpx;
padding: 0 20rpx;
}
.company-item {
font-size: 16px;
font-size: 16px;
.authed {
height: 40px;
width: 60px;
}
.authed {
height: 40px;
width: 60px;
}
.logo {
width: 100px;
height: 100px;
}
.logo {
width: 100px;
height: 100px;
}
}
.wechat {
width: 60px;
height: 60px;
}
</style>